/*
 * Arival Studio — halaman Portfolio (/portfolio) dan Detail Portfolio (/portfolio/:slug).
 * Melengkapi site.css: semua warna memakai token sehingga mode gelap (html.dark) ikut otomatis.
 * Prefix kelas: .pfp-
 */

/* ---------- Umum ---------- */
.pfp-main { overflow: clip; }
.pfp-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pfp-actions .s-btn { flex: 0 0 auto; }
@media (max-width: 479px) {
  .pfp-actions { display: grid; grid-template-columns: 1fr; }
  .pfp-actions .s-btn { justify-content: space-between; height: 44px; font-size: 14px; }
  .pfp-actions .s-btn--ghost { justify-content: center; }
}

/* ---------- Hero daftar ---------- */
.pfp-hero { padding: 36px 0 28px; }
@media (min-width: 1024px) { .pfp-hero { padding: 96px 0 48px; } }
.pfp-hero .s-eyebrow { margin-bottom: 14px; }
@media (min-width: 1024px) { .pfp-hero .s-eyebrow { margin-bottom: 20px; } }
.pfp-hero .s-h1 { max-width: 15ch; font-size: clamp(28px, 7.2vw, 84px); }
.pfp-hero__row { display: flex; flex-direction: column; gap: 20px; margin-top: 16px; }
@media (min-width: 1024px) {
  .pfp-hero__row { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 48px; margin-top: 36px; }
}
.pfp-hero__row .s-lead { max-width: 560px; font-size: clamp(13.5px, 1.15vw, 18px); }
.pfp-stats { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 22px; }
@media (min-width: 1024px) { .pfp-stats { margin-top: 28px; } }
.pfp-stat { display: flex; align-items: baseline; gap: 8px; color: var(--muted); font-size: 13px; }
@media (min-width: 640px) { .pfp-stat { font-size: 15px; } }
.pfp-stat strong { color: var(--ink); font-weight: 600; letter-spacing: -.03em; font-size: clamp(22px, 2.2vw, 32px); font-variant-numeric: tabular-nums; }

/* ---------- Filter kategori ---------- */
.pfp-filter { display: flex; flex-direction: column; gap: 12px; padding: 0 0 28px; }
@media (min-width: 640px) { .pfp-filter { flex-direction: row; align-items: center; justify-content: space-between; gap: 24px; } }
@media (min-width: 1024px) { .pfp-filter { padding-bottom: 48px; } }
.pfp-chips {
  display: flex; gap: 8px; min-width: 0; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  margin: 0 -16px; padding: 2px 16px; scroll-padding: 0 16px;
}
.pfp-chips::-webkit-scrollbar { display: none; }
@media (min-width: 640px) { .pfp-chips { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; } }
.pfp-chip {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; height: 38px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font-size: 13.5px; font-weight: 500; white-space: nowrap;
  transition: background-color .25s var(--ease), color .25s, border-color .25s;
}
@media (min-width: 640px) { .pfp-chip { height: 42px; padding: 0 18px; font-size: 15px; } }
.pfp-chip:hover { border-color: var(--ink); color: var(--ink); }
.pfp-chip small { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pfp-chip.is-active { background: var(--invert); border-color: var(--invert); color: var(--invert-ink); }
.pfp-chip.is-active small { color: inherit; opacity: .6; }
.pfp-count { flex-shrink: 0; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
@media (min-width: 640px) { .pfp-count { font-size: 14px; } }

/* ---------- Kartu proyek (pola "Karya" beranda) ---------- */
.pfp-works { display: grid; gap: 36px 24px; }
@media (min-width: 768px) { .pfp-works { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px 32px; } }
.pfp-works--3 { gap: 32px 20px; }
@media (min-width: 640px) { .pfp-works--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .pfp-works--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 24px; } }
.pfp-work { display: block; min-width: 0; }
.pfp-work__media { position: relative; overflow: hidden; aspect-ratio: 5 / 3; border-radius: 16px; background: var(--surface-2); }
.pfp-works--3 .pfp-work__media { aspect-ratio: 4 / 3; }
.pfp-work__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 1s var(--ease); }
.pfp-work:hover .pfp-work__media img { transform: scale(1.04); }
.pfp-work__empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.pfp-work__empty svg { width: 44px; height: 44px; opacity: .5; }
.pfp-work__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 16px; color: var(--muted); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
@media (min-width: 1024px) { .pfp-work__tags { margin-top: 18px; font-size: 13px; } }
.pfp-work__tags span + span::before { content: ""; display: inline-block; width: 4px; height: 4px; margin: 0 8px 2px 0; border-radius: 99px; background: var(--brand); vertical-align: middle; }
.pfp-work__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.pfp-work__row svg { width: 20px; height: 20px; flex-shrink: 0; transition: transform .4s var(--ease), color .3s; }
.pfp-work:hover .pfp-work__row svg { transform: translate(3px, -3px); color: var(--brand); }
.pfp-work__title { font-weight: 600; letter-spacing: -.02em; line-height: 1.25; font-size: clamp(17px, 1.6vw, 24px); transition: color .3s; }
.pfp-works--3 .pfp-work__title { font-size: clamp(17px, 1.4vw, 21px); }
.pfp-work:hover .pfp-work__title { color: var(--brand); }
.pfp-work__desc {
  margin-top: 6px; color: var(--muted); font-size: clamp(13.5px, 1.1vw, 17px); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pfp-works--3 .pfp-work__desc { font-size: clamp(13.5px, 1vw, 15px); }
.pfp-work:focus-visible { outline: 2px solid var(--brand); outline-offset: 6px; border-radius: 16px; }

/* ---------- Pagination ---------- */
.pfp-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 48px 0 0; }
@media (min-width: 1024px) { .pfp-pager { padding-top: 72px; } }
.pfp-pager a, .pfp-pager span {
  display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 6px; border-radius: 999px; font-size: 15px; font-weight: 500;
  border: 1px solid var(--line-strong); color: var(--ink-2); background: var(--surface); transition: border-color .25s, background-color .25s, color .25s;
}
.pfp-pager a:hover { border-color: var(--ink); color: var(--ink); }
.pfp-pager .is-active { background: var(--invert); border-color: var(--invert); color: var(--invert-ink); }
.pfp-pager .is-gap { border-color: transparent; background: transparent; min-width: 20px; color: var(--muted); }
.pfp-pager svg { width: 16px; height: 16px; }

/* ---------- Kosong ---------- */
.pfp-empty {
  display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 56px 20px; border-radius: var(--radius);
  border: 1px dashed var(--line-strong); background: var(--surface);
}
.pfp-empty .s-body { max-width: 440px; }
.pfp-empty .pfp-actions { justify-content: center; margin-top: 4px; }

/* ---------- Panel CTA ---------- */
.pfp-cta {
  position: relative; overflow: hidden; display: grid; gap: 24px; padding: 32px 22px; border-radius: 28px; background: var(--brand); color: #fff;
}
@media (min-width: 768px) { .pfp-cta { padding: 56px 48px; } }
@media (min-width: 1024px) { .pfp-cta { grid-template-columns: minmax(0, 1.3fr) auto; align-items: end; gap: 48px; padding: 80px 72px; border-radius: 36px; } }
.pfp-cta::after {
  content: ''; position: absolute; right: -12%; top: -40%; width: 60%; aspect-ratio: 1; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .16); box-shadow: 0 0 0 60px rgba(255, 255, 255, .03), 0 0 0 120px rgba(255, 255, 255, .025); pointer-events: none;
}
.pfp-cta .s-h2 { max-width: 16ch; font-size: clamp(26px, 4vw, 56px); }
.pfp-cta p { margin-top: 14px; max-width: 520px; color: rgba(255, 255, 255, .78); font-size: clamp(13.5px, 1.15vw, 18px); line-height: 1.65; }
.pfp-cta .pfp-actions { position: relative; z-index: 1; }
.pfp-cta .s-btn--light { background: #fff; color: #121212; }
.pfp-cta .s-btn--light .s-btn__ic { background: var(--brand); color: #fff; }
.pfp-btn-line { border: 1px solid rgba(255, 255, 255, .4); background: transparent; color: #fff; height: 46px; padding: 0 20px; }
@media (min-width: 640px) { .pfp-btn-line { height: 52px; padding: 0 24px; } }
@media (max-width: 479px) { .pfp-actions .pfp-btn-line { justify-content: center; } }
.pfp-btn-line:hover { border-color: #fff; background: rgba(255, 255, 255, .08); }

/* ---------- Detail: header ---------- */
.pfp-back { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 10px; margin-left: -10px; border-radius: 999px; color: var(--muted); font-size: 14px; transition: color .2s, background-color .2s; }
.pfp-back svg { width: 16px; height: 16px; transform: rotate(-135deg); transition: transform .35s var(--ease); }
.pfp-back:hover { color: var(--ink); background: var(--surface-2); }
.pfp-back:hover svg { transform: translateX(-3px) rotate(-135deg); }
.pfp-dhero { padding: 20px 0 28px; }
@media (min-width: 1024px) { .pfp-dhero { padding: 40px 0 48px; } }
.pfp-dhero__grid { display: grid; gap: 18px; margin-top: 18px; }
@media (min-width: 1024px) { .pfp-dhero__grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: end; gap: 64px; margin-top: 32px; } }
.pfp-dhero .s-eyebrow { display: inline-block; margin-bottom: 12px; transition: color .2s; }
@media (min-width: 1024px) { .pfp-dhero .s-eyebrow { margin-bottom: 18px; } }
a.s-eyebrow:hover { color: var(--brand); }
.pfp-dhero .s-h1 { font-size: clamp(28px, 6vw, 80px); max-width: 16ch; overflow-wrap: anywhere; }
.pfp-dhero__side { display: flex; flex-direction: column; gap: 18px; }
.pfp-dhero__side .s-lead { font-size: clamp(13.5px, 1.15vw, 18px); }

/* Baris meta */
.pfp-meta { display: grid; gap: 0; margin-top: 28px; border-top: 1px solid var(--line); }
@media (min-width: 768px) { .pfp-meta { grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); margin-top: 48px; } }
.pfp-meta > div { display: flex; flex-direction: column; gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--line); min-width: 0; }
@media (max-width: 767px) { .pfp-meta > div { flex-direction: row; align-items: baseline; justify-content: space-between; gap: 16px; } }
@media (min-width: 768px) { .pfp-meta > div { padding: 20px 24px 20px 0; border-bottom: 0; } .pfp-meta > div + div { padding-left: 24px; border-left: 1px solid var(--line); } }
.pfp-meta dt { color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; flex-shrink: 0; }
@media (min-width: 640px) { .pfp-meta dt { font-size: 13px; } }
.pfp-meta dd { margin: 0; color: var(--ink); font-size: 14px; font-weight: 500; min-width: 0; }
@media (min-width: 640px) { .pfp-meta dd { font-size: 16px; } }
@media (max-width: 767px) { .pfp-meta dd { text-align: right; } .pfp-meta .pfp-pills { justify-content: flex-end; } }
.pfp-meta dd a:hover { color: var(--brand); }
.pfp-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pfp-pill {
  display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--line-strong); color: var(--ink-2); background: var(--surface); white-space: nowrap;
}
@media (min-width: 640px) { .pfp-pill { height: 30px; font-size: 13px; } }

/* Sampul */
.pfp-cover { position: relative; overflow: hidden; margin: 0; border-radius: 16px; aspect-ratio: 4 / 3; background: var(--surface-2); border: 1px solid var(--line); }
@media (min-width: 768px) { .pfp-cover { aspect-ratio: 16 / 9; border-radius: 20px; } }
@media (min-width: 1024px) { .pfp-cover { aspect-ratio: 2 / 1; border-radius: 24px; } }
.pfp-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; transform: scale(1.04); transition: transform 1.6s var(--ease); }
.pfp-cover.in img { transform: none; }

/* ---------- Detail: isi + kartu samping ---------- */
.pfp-body { display: grid; gap: 32px; padding: 48px 0 0; }
@media (min-width: 1024px) {
  .pfp-body { grid-template-columns: minmax(0, 720px) minmax(300px, 380px); justify-content: space-between; align-items: start; gap: 64px; padding-top: 96px; }
}
.pfp-body__head { margin-bottom: 18px; }
.pfp-body .s-eyebrow { margin-bottom: 12px; }
.pfp-prose { color: var(--ink-2); font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; }
@media (min-width: 640px) { .pfp-prose { font-size: 17px; } }
.pfp-prose > * + * { margin-top: 1em; }
.pfp-prose p { margin: 0; }
.pfp-prose p + p { margin-top: 1em; }
.pfp-prose h1, .pfp-prose h2, .pfp-prose h3, .pfp-prose h4 { color: var(--ink); font-weight: 600; letter-spacing: -.02em; line-height: 1.25; margin: 1.8em 0 .6em; }
.pfp-prose h1, .pfp-prose h2 { font-size: 1.45em; }
.pfp-prose h3 { font-size: 1.2em; }
.pfp-prose h4 { font-size: 1.05em; }
.pfp-prose > :first-child { margin-top: 0; }
.pfp-prose ul, .pfp-prose ol { padding-left: 1.3em; margin: 1em 0; }
.pfp-prose li + li { margin-top: .4em; }
.pfp-prose li::marker { color: var(--brand); }
.pfp-prose a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.pfp-prose strong, .pfp-prose b { color: var(--ink); font-weight: 600; }
.pfp-prose img { max-width: 100%; height: auto; border-radius: 16px; margin: 1.4em 0; }
.pfp-prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 18px; border-left: 2px solid var(--brand); color: var(--ink); }
.pfp-prose table { width: 100%; border-collapse: collapse; font-size: .92em; display: block; overflow-x: auto; }
.pfp-prose th, .pfp-prose td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.pfp-prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

.pfp-aside { display: grid; gap: 12px; }
@media (min-width: 1024px) { .pfp-aside { position: sticky; top: 100px; } }
.pfp-side { display: flex; flex-direction: column; gap: 16px; padding: 22px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
@media (min-width: 1024px) { .pfp-side { padding: 28px; } }
.pfp-side .s-h3 { font-size: clamp(18px, 1.6vw, 24px); }
.pfp-side .s-btn { justify-content: space-between; width: 100%; }
.pfp-side .s-btn--ghost { justify-content: center; }
.pfp-facts { list-style: none; margin: 0; padding: 0; display: grid; }
.pfp-facts li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14px; }
.pfp-facts li > span:first-child { color: var(--muted); flex-shrink: 0; }
.pfp-facts li > span:last-child { color: var(--ink); font-weight: 500; text-align: right; min-width: 0; }
.pfp-facts li.pfp-facts__stack { flex-direction: column; align-items: stretch; gap: 10px; }
.pfp-facts li.pfp-facts__stack > span:last-child { text-align: left; }
.pfp-status { display: inline-flex; align-items: center; gap: 6px; }
.pfp-status::before { content: ''; width: 7px; height: 7px; border-radius: 99px; background: #22C55E; }
.pfp-wa { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 46px; border-radius: 999px; font-size: 14px; font-weight: 500; border: 1px solid #25D366; color: var(--ink); transition: background-color .25s, color .25s; }
@media (min-width: 640px) { .pfp-wa { height: 52px; font-size: 15px; } }
.pfp-wa svg { width: 18px; height: 18px; color: #25D366; transition: color .25s; }
.pfp-wa:hover { background: #25D366; color: #fff; }
.pfp-wa:hover svg { color: #fff; }

/* ---------- Detail: galeri ---------- */
.pfp-gallery { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .pfp-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
.pfp-gallery--1 { grid-template-columns: 1fr; }
.pfp-gallery--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pfp-shot {
  position: relative; display: block; width: 100%; overflow: hidden; border-radius: 16px; aspect-ratio: 4 / 3; background: var(--surface-2);
  border: 1px solid var(--line); cursor: zoom-in;
}
@media (min-width: 768px) { .pfp-shot { border-radius: 20px; } }
.pfp-gallery--1 .pfp-shot { aspect-ratio: 16 / 9; }
@media (min-width: 768px) { .pfp-gallery:not(.pfp-gallery--1):not(.pfp-gallery--2) .pfp-shot:first-child { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; } }
@media (max-width: 767px) { .pfp-gallery:not(.pfp-gallery--1):not(.pfp-gallery--2) .pfp-shot:first-child { grid-column: span 2; aspect-ratio: 16 / 10; } }
.pfp-shot img, .pfp-shot video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 1s var(--ease); }
.pfp-shot:hover img, .pfp-shot:hover video { transform: scale(1.05); }
.pfp-shot__ic {
  position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--ink); transition: transform .35s var(--ease), opacity .3s;
}
.pfp-shot__ic svg { width: 20px; height: 20px; }
.pfp-shot--img .pfp-shot__ic { opacity: 0; transform: scale(.85); }
.pfp-shot:hover .pfp-shot__ic { opacity: 1; transform: scale(1); }
@media (hover: none) { .pfp-shot--img .pfp-shot__ic { opacity: 0; } }
.pfp-shot:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

/* Lightbox */
.pfp-lb {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 56px 12px; background: rgba(10, 10, 12, .92);
  opacity: 0; visibility: hidden; transition: opacity .3s var(--ease), visibility .3s;
}
.pfp-lb.is-open { opacity: 1; visibility: visible; }
.pfp-lb__stage { display: grid; place-items: center; width: 100%; height: 100%; transform: scale(.97); transition: transform .4s var(--ease); }
.pfp-lb.is-open .pfp-lb__stage { transform: none; }
.pfp-lb__stage img, .pfp-lb__stage video { max-width: min(1200px, 100%); max-height: 100%; width: auto; height: auto; border-radius: 16px; object-fit: contain; }
.pfp-lb__btn {
  position: absolute; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; background: rgba(255, 255, 255, .1);
  color: #fff !important; transition: background-color .2s;
}
.pfp-lb__btn:hover { background: rgba(255, 255, 255, .22); }
.pfp-lb__btn svg { width: 20px; height: 20px; }
.pfp-lb__close { top: 12px; right: 12px; }
.pfp-lb__prev, .pfp-lb__next { top: 50%; margin-top: -22px; }
.pfp-lb__prev { left: 12px; }
.pfp-lb__next { right: 12px; }
@media (min-width: 768px) { .pfp-lb__prev { left: 24px; } .pfp-lb__next { right: 24px; } .pfp-lb__close { top: 20px; right: 24px; } }
.pfp-lb__count { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); color: rgba(255, 255, 255, .7); font-size: 13px; font-variant-numeric: tabular-nums; }

/* ---------- 404 ---------- */
.pfp-404 { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; padding: 56px 0 24px; }
@media (min-width: 1024px) { .pfp-404 { padding: 120px 0 40px; } }
.pfp-404__num {
  font-weight: 600; letter-spacing: -.06em; line-height: .8; font-size: clamp(96px, 22vw, 260px); color: transparent;
  -webkit-text-stroke: 1.5px var(--line-strong); user-select: none;
}
.pfp-404 .s-h1 { font-size: clamp(26px, 5vw, 64px); }
.pfp-404 .s-lead { max-width: 520px; }
.pfp-404 .pfp-actions { justify-content: center; margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
  .pfp-work__media img, .pfp-shot img, .pfp-shot video, .pfp-cover img, .pfp-lb, .pfp-lb__stage { transition: none !important; }
  .pfp-cover img, .pfp-work:hover .pfp-work__media img, .pfp-shot:hover img { transform: none !important; }
}
