/* ==========================================================================
   Halaman Portofolio (/portofolio/)
   Berdiri sendiri. Prefix pf-. Variabel warna dari global.css.
   ========================================================================== */
.pf {
  --pf-grad: linear-gradient(90deg, var(--blue), var(--teal) 55%, var(--green));
  --pf-grad-45: linear-gradient(
    45deg,
    var(--blue),
    var(--teal) 55%,
    var(--green)
  );
  --pf-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  max-width: 1360px;
  min-width: 0;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 64px) 0 clamp(80px, 11vw, 160px);
  overflow-x: clip;
  animation: pf-in 0.8s var(--pf-ease) both;
}
@keyframes pf-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes pf-up {
  from {
    transform: translateY(112%);
  }
  to {
    transform: none;
  }
}
.pf h1,
.pf h2,
.pf p,
.pf li {
  min-width: 0;
  overflow-wrap: break-word;
}

/* ---------- hero ---------- */
.pf-title {
  margin: 0;
  font-size: clamp(44px, 11.5vw, 180px);
  font-weight: 500;
  line-height: 0.88;
  letter-spacing: -0.08em;
}
.pf-ln {
  display: block;
  overflow: hidden;
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
}
.pf-ln > span {
  display: block;
  animation: pf-up 1s var(--pf-ease) both;
  animation-delay: var(--d, 0.1s);
}
.pf-title em {
  background: var(--pf-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-style: normal;
}
.pf-lede {
  max-width: 28em;
  margin: clamp(20px, 3vw, 40px) 0 0;
  color: var(--muted);
  font-size: clamp(17px, 1.7vw, 22px);
  line-height: 1.45;
}

/* ---------- bidang ---------- */
.pf-ch {
  margin-top: clamp(90px, 12vw, 190px);
  scroll-margin-top: 110px;
}
.pf-head {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 28px 24px;
  align-items: end;
  margin-bottom: clamp(32px, 4vw, 56px);
}
.pf-name {
  grid-column: 1 / span 7;
  margin: 0;
  font-size: clamp(44px, 8vw, 128px);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.08em;
}
.pf-aside {
  grid-column: 9 / -1;
  display: grid;
  gap: 18px;
  justify-items: start;
}
.pf-aside p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.5;
}
.pf-link {
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--fg);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition:
    color 0.3s,
    border-color 0.3s;
}
.pf-link i {
  display: inline-block;
  font-style: normal;
  transition: transform 0.4s var(--pf-ease);
}
.pf-link:hover {
  border-color: var(--teal);
  color: var(--teal);
}
.pf-link:hover i {
  transform: translateX(6px);
}

/* ---------- daftar karya (kartu browser) ---------- */
.pf-cards {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(48px, 6vw, 88px) 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pf-cards > li {
  grid-column: 1 / -1;
  min-width: 0;
}
.pf-cards > li:nth-child(4n + 1) {
  grid-column: 1 / span 7;
}
.pf-cards > li:nth-child(4n + 2) {
  grid-column: 8 / -1;
  margin-top: clamp(0px, 9vw, 140px);
}
.pf-cards > li:nth-child(4n + 3) {
  grid-column: 1 / span 5;
}
.pf-cards > li:nth-child(4n + 4) {
  grid-column: 6 / -1;
}
.pf-cards > li.pf-more {
  grid-column: 1 / -1;
  margin-top: 0;
}
.pf-card {
  display: block;
  color: var(--fg);
  text-decoration: none;
}
.pf-frame {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--bg);
  transition:
    transform 0.6s var(--pf-ease),
    box-shadow 0.6s var(--pf-ease);
}
.pf-bar {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-strong);
}
.pf-bar span {
  display: block;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--line);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pf-screen {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--pf-grad-45);
  color: var(--on-brand);
}
.pf-screen[data-tone="a"] {
  background: linear-gradient(135deg, var(--blue), var(--teal));
}
.pf-screen[data-tone="b"] {
  background: linear-gradient(135deg, var(--teal), var(--green));
}
.pf-screen[data-tone="c"] {
  background: linear-gradient(135deg, var(--green), var(--teal));
}
.pf-screen[data-tone="d"] {
  background: linear-gradient(135deg, var(--teal), var(--blue));
}
.pf-screen::before {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image:
    linear-gradient(currentColor 1px, transparent 1px),
    linear-gradient(90deg, currentColor 1px, transparent 1px);
  background-size: 44px 44px;
  content: "";
}
.pf-screen b {
  position: absolute;
  left: clamp(18px, 3vw, 36px);
  bottom: clamp(14px, 2.4vw, 28px);
  right: 16px;
  overflow: hidden;
  font-size: clamp(44px, 7vw, 112px);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.08em;
  text-overflow: ellipsis;
  transition: transform 0.8s var(--pf-ease);
}
.pf-screen img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.pf-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  margin-top: 20px;
}
.pf-body {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.pf-site {
  overflow-wrap: anywhere;
  font-size: clamp(24px, 2.8vw, 40px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.05em;
  transition: color 0.3s;
}
.pf-body small {
  max-width: 36em;
  color: var(--muted);
  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.45;
}
.pf-go {
  width: clamp(26px, 2.8vw, 36px);
  height: clamp(26px, 2.8vw, 36px);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--muted);
  transition:
    transform 0.45s var(--pf-ease),
    color 0.3s;
}
.pf-card:hover .pf-frame,
.pf-card:focus-visible .pf-frame {
  transform: translateY(-6px);
  box-shadow: 0 28px 48px -28px rgba(7, 16, 20, 0.45);
}
.pf-card:hover .pf-screen b {
  transform: translateX(6px);
}
.pf-card:hover .pf-site,
.pf-card:focus-visible .pf-site {
  color: var(--teal);
}
.pf-card:hover .pf-go,
.pf-card:focus-visible .pf-go {
  color: var(--teal);
  transform: translate(4px, -4px);
}
.pf-more p {
  max-width: 18em;
  margin: 0;
  padding-top: clamp(20px, 2.6vw, 32px);
  border-top: 1px solid var(--line-strong);
  font-size: clamp(26px, 3.6vw, 52px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.055em;
  text-wrap: balance;
}
.pf-more p span {
  color: var(--muted);
}

/* bidang yang belum punya karya: bingkai kosong bergaris putus */
.pf-empty {
  display: grid;
  place-items: center start;
  min-height: clamp(160px, 22vw, 280px);
  padding: clamp(24px, 4vw, 56px);
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
}
.pf-empty p {
  max-width: 16em;
  margin: 0;
  color: var(--muted);
  font-size: clamp(24px, 3.2vw, 46px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.05em;
  text-wrap: balance;
}

/* ---------- penutup ---------- */
.pf-close {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px 48px;
  margin-top: clamp(96px, 13vw, 200px);
  padding-top: clamp(32px, 4vw, 56px);
  border-top: 1px solid var(--line-strong);
}
.pf-close p {
  max-width: 15em;
  margin: 0;
  font-size: clamp(30px, 4.6vw, 68px);
  font-weight: 500;
  line-height: 0.99;
  letter-spacing: -0.06em;
  text-wrap: balance;
}
.pf-close p span {
  color: var(--muted);
}
.pf-btn {
  display: inline-flex;
  align-items: stretch;
  overflow: hidden;
  border-radius: 6px;
  background: var(--fg);
  color: var(--bg);
  font-size: 14px;
  font-stretch: 80%;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-decoration: none;
  text-transform: uppercase;
}
.pf-btn .t {
  padding: 18px 24px;
}
.pf-btn .a {
  display: grid;
  place-items: center;
  width: 58px;
  background: var(--pf-grad-45);
  color: var(--on-brand);
  transition: width 0.5s var(--pf-ease);
}
.pf-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.5s var(--pf-ease);
}
.pf-btn:hover .a {
  width: 90px;
}
.pf-btn:hover svg {
  transform: translateX(8px);
}

/* ---------- animasi masuk (hanya jika JS aktif) ---------- */
.pf-js .pf-rv {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.9s var(--pf-ease),
    transform 1s var(--pf-ease);
}
.pf-js .pf-rv.in {
  opacity: 1;
  transform: none;
}

@media (max-width: 900px) {
  .pf-name,
  .pf-aside {
    grid-column: 1 / -1;
  }
  .pf-cards > li:nth-child(n) {
    grid-column: 1 / -1;
    margin-top: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pf,
  .pf-ln > span {
    animation: none;
  }
  .pf-js .pf-rv {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .pf-frame,
  .pf-screen b,
  .pf-go,
  .pf-link i,
  .pf-btn .a,
  .pf-btn svg {
    transition: none;
  }
}

.pf .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
