/* ============================================================
   MALAM — portfolio gelap, editorial, satu aksen
   Toko: Carbon preset + aksen merah P5R (bukan mint default)
   ============================================================ */

@font-face {
  font-family: 'PersonifiedUX';
  src: url('../PersonifiedUX.woff2') format('woff2');
  font-display: swap;
}

:root {
  /* ---- permukaan (Carbon, hue 260, gelap sebagai root) ---- */
  --s0:   oklch(13.5% 0.014 262);   /* halaman */
  --s1:   oklch(17.5% 0.014 262);   /* kartu */
  --s2:   oklch(21.5% 0.014 262);   /* terangkat */
  --s3:   oklch(25.5% 0.014 262);   /* tertinggi */
  --line: oklch(29% 0.014 262);
  --line-2: oklch(35% 0.014 262);

  /* ---- teks ---- */
  --t1: oklch(93% 0.006 262);
  --t2: oklch(72% 0.010 262);
  --t3: oklch(54% 0.012 262);

  /* ---- aksen: merah P5R, bukan mint ---- */
  --accent:        oklch(62% 0.21 25);
  --accent-hover:  oklch(68% 0.21 25);
  --accent-tint:   oklch(62% 0.21 25 / 0.12);
  --on-accent:     oklch(97% 0.005 262);

  /* ---- tipografi: satu tangga, 5 langkah ---- */
  --f-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'PersonifiedUX', 'JetBrains Mono', ui-monospace, monospace;
  --text-xs:   0.75rem;    /* 12 — label mono */
  --text-sm:   0.875rem;   /* 14 — sekunder */
  --text-base: 1rem;       /* 16 — body */
  --text-lg:   1.375rem;   /* 22 — lead */
  --text-xl:   2rem;       /* 32 — kepala bagian */
  --text-3xl:  5.5rem;     /* 88 — display */

  /* ---- bentuk: radius ketat, tanpa shadow lembut ---- */
  --r-input: 0.25rem;
  --r-card:  0.375rem;
  --r-pill:  999em;

  /* ---- gerak ---- */
  --m-fast: 120ms;
  --m-base: 200ms;
  --m-slow: 320ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --pad-x: clamp(24px, 6vw, 120px);
  --maxw: 1180px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  /* `scroll-behavior: smooth` sengaja TIDAK dipakai. Di mesin headless /
     beberapa WebView ia membuat scroll programatik (window.scrollTo,
     scrollIntoView) tidak berpindah sama sekali — anchor pun ikut mati.
     Navigasi anchor tetap bekerja; yang hilang hanya animasi gulir. */
  scroll-behavior: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--s0);
  color: var(--t1);
  font-family: var(--f-body);
  font-size: var(--text-base);
  line-height: 1.6;
  font-synthesis: none;
}

/* cegah geser horizontal: batasi lebar elemen, jangan ubah overflow
   (overflow hidden/clip pada html mematikan scroll di beberapa mesin) */
html, body { max-width: 100%; }

::selection { background: var(--accent-tint); color: var(--accent-hover); }

a { color: inherit; }

/* ============================================================
   LATAR — bintang kanvas (satu frame statis, tanpa rAF liar)
   ============================================================ */
.sky {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  display: block;
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
  padding: 0 var(--pad-x);
  background: color-mix(in oklab, var(--s0) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--m-base) var(--ease-out),
              background var(--m-base) var(--ease-out);
}

.nav[data-stuck="true"] {
  border-bottom-color: var(--line);
  background: color-mix(in oklab, var(--s0) 94%, transparent);
}

.nav-mark {
  font-family: var(--f-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.34em;
  color: var(--t1);
  text-decoration: none;
  display: flex; align-items: center; gap: 10px;
}

.nav-mark i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  display: block;
}

.nav-links { display: flex; gap: clamp(18px, 3vw, 40px); list-style: none; }

.nav-links a {
  font-size: var(--text-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--t3);
  text-decoration: none;
  padding: 6px 2px;
  position: relative;
  transition: color var(--m-fast) var(--ease-out);
}

.nav-links a::after {
  content: '';
  position: absolute; left: 0; bottom: 0;
  width: 0; height: 1px; background: var(--accent);
  transition: width var(--m-base) var(--ease-out);
}

.nav-links a:hover { color: var(--t1); }
.nav-links a:hover::after { width: 100%; }

/* ============================================================
   KERANGKA
   ============================================================ */
.shell { position: relative; z-index: 1; }

section {
  padding: clamp(88px, 13vh, 152px) var(--pad-x);
  position: relative;
}

.inner { max-width: var(--maxw); margin: 0 auto; }

/* kepala bagian — label mono kecil, bukan eyebrow setiap bagian */
.s-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-bottom: clamp(48px, 7vh, 88px);
  max-width: 62ch;
}

.s-label {
  font-family: var(--f-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

h2 {
  font-family: var(--f-body);
  font-weight: 500;
  font-size: var(--text-xl);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: var(--t1);
}

.s-head p {
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--t2);
  max-width: 56ch;
}

/* ============================================================
   HERO — kelas "type-only": tipografi saja, tanpa gambar
   ============================================================ */
#hero {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-start;
  padding-top: clamp(120px, 17vh, 190px);
  padding-bottom: clamp(80px, 12vh, 120px);
}

.hero-badge {
  font-family: var(--f-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--t3);
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: 40px;
}

.hero-badge i {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
  display: block;
}

h1 {
  font-family: var(--f-body);
  font-weight: 500;
  font-size: var(--text-3xl);
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-wrap: balance;
  color: var(--t1);
  max-width: 15ch;
  overflow-wrap: break-word;
}

h1 em {
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
}

.hero-sub {
  margin-top: 36px;
  font-size: var(--text-lg);
  line-height: 1.5;
  color: var(--t2);
  max-width: 46ch;
}

.hero-cta {
  margin-top: 48px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
}

.hero-trust {
  margin-top: 26px;
  font-family: var(--f-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  color: var(--t3);
}

/* ---- tombol: tiga tingkat, tidak setara ---- */
.btn {
  font-family: var(--f-body);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px;
  border-radius: var(--r-input);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--m-fast) var(--ease-out),
              background var(--m-fast) var(--ease-out),
              border-color var(--m-fast) var(--ease-out),
              box-shadow var(--m-fast) var(--ease-out);
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 0 0 0 var(--accent-tint);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 18px 0 var(--accent-tint);
}

.btn-ghost {
  background: transparent;
  color: var(--t1);
  border-color: var(--line-2);
}

.btn-ghost:hover {
  border-color: var(--t3);
  background: color-mix(in oklab, var(--t1) 6%, transparent);
}

.btn:active { transform: scale(0.985); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ============================================================
   KARYA — baris editorial, bukan kartu seragam
   ============================================================ */
.works { display: flex; flex-direction: column; }

.work {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: clamp(20px, 4vw, 56px);
  align-items: start;
  padding: clamp(32px, 5vh, 56px) 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  position: relative;
  transition: padding-left var(--m-base) var(--ease-out);
}

.work:last-child { border-bottom: 1px solid var(--line); }

.work:hover { padding-left: 14px; }

.work-idx {
  font-family: var(--f-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  color: var(--t3);
  padding-top: 8px;
  transition: color var(--m-fast) var(--ease-out);
}

.work:hover .work-idx { color: var(--accent); }

.work-body { min-width: 0; }

.work h3 {
  font-family: var(--f-body);
  font-weight: 500;
  font-size: clamp(1.5rem, 3.4vw, 2.25rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--t1);
  margin-bottom: 12px;
  overflow-wrap: break-word;
  transition: color var(--m-fast) var(--ease-out);
}

.work:hover h3 { color: var(--accent); }

.work p {
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--t2);
  max-width: 54ch;
}

.work-tags {
  margin-top: 16px;
  display: flex; flex-wrap: wrap; gap: 8px;
  list-style: none;
}

.work-tags li {
  font-family: var(--f-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  color: var(--t3);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 4px 11px;
}

.work-go {
  font-family: var(--f-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--t3);
  white-space: nowrap;
  padding-top: 10px;
  transition: color var(--m-fast) var(--ease-out),
              transform var(--m-base) var(--ease-out);
}

.work:hover .work-go { color: var(--t1); transform: translateX(6px); }

/* proyek unggulan — satu kartu, bukan grid seragam */
.feature {
  margin-top: clamp(56px, 8vh, 96px);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--s1);
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}

.feature-shot {
  position: relative;
  background: #05060a;
  min-height: 320px;
  overflow: hidden;
}

.feature-shot img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 38%;
  display: block;
  opacity: 0.94;
}

/* potong di tepi bawah — bukan melayang di ruang kosong */
.feature-shot::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, var(--s1));
}

.feature-body {
  padding: clamp(28px, 4vw, 48px);
  display: flex; flex-direction: column; justify-content: center;
  gap: 18px;
}

.feature-body .s-label { color: var(--accent); }

.feature-body h3 {
  font-family: var(--f-body);
  font-weight: 500;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--t1);
}

.feature-body p {
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--t2);
}

.feature-stats {
  display: flex; flex-wrap: wrap; gap: 32px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
}

.stat { display: flex; flex-direction: column; gap: 4px; }

.stat b {
  font-family: var(--f-mono);
  font-size: var(--text-lg);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--t1);
  font-variant-numeric: tabular-nums;
}

.stat span {
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--t3);
}

/* scrollbar ikut gelap — jangan putih menyilaukan di tengah malam */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--s0); }
::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: var(--r-pill);
  border: 2px solid var(--s0);
}
::-webkit-scrollbar-thumb:hover { background: var(--t3); }

/* ============================================================
   KEAHLIAN — daftar bernomor, bukan grid ikon
   ============================================================ */
.craft { display: flex; flex-direction: column; }

.craft-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(20px, 4vw, 56px);
  align-items: baseline;
  padding: clamp(28px, 4vh, 44px) 0;
  border-top: 1px solid var(--line);
}

.craft-row:last-child { border-bottom: 1px solid var(--line); }

.craft-n {
  font-family: var(--f-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  color: var(--accent);
}

.craft-row h4 {
  font-family: var(--f-body);
  font-weight: 500;
  font-size: var(--text-lg);
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--t1);
}

.craft-row p {
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--t2);
}

/* ============================================================
   KUTIPAN — blok lebar penuh, beda dari baris karya
   ============================================================ */
#quiet {
  padding: clamp(96px, 16vh, 176px) var(--pad-x);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--s1);
}

.quote {
  max-width: var(--maxw);
  margin: 0 auto;
  font-family: var(--f-body);
  font-weight: 500;
  font-size: clamp(1.75rem, 4.4vw, 3.25rem);
  line-height: 1.14;
  letter-spacing: -0.03em;
  color: var(--t1);
  text-wrap: balance;
  max-width: 30ch;
}

.quote em { font-style: italic; color: var(--accent); }

.quote-src {
  margin-top: 28px;
  font-family: var(--f-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--t3);
}

/* ============================================================
   KONTAK
   ============================================================ */
.mail {
  font-family: var(--f-body);
  font-weight: 500;
  font-size: clamp(1.5rem, 5vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--t1);
  text-decoration: none;
  display: inline-block;
  position: relative;
  word-break: break-all;
  transition: color var(--m-fast) var(--ease-out);
}

.mail::after {
  content: '';
  position: absolute; left: 0; bottom: -6px;
  width: 100%; height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--m-slow) var(--ease-out);
}

.mail:hover { color: var(--accent); }
.mail:hover::after { transform: scaleX(1); }

.links {
  margin-top: clamp(48px, 8vh, 80px);
  display: flex; flex-wrap: wrap; gap: clamp(20px, 4vw, 48px);
  list-style: none;
}

.links a {
  font-family: var(--f-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--t3);
  text-decoration: none;
  transition: color var(--m-fast) var(--ease-out);
}

.links a:hover { color: var(--t1); }

/* ============================================================
   FOOTER — membosankan dengan sengaja
   ============================================================ */
footer {
  padding: 36px var(--pad-x);
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  font-family: var(--f-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  color: var(--t3);
}

/* ============================================================
   REVEAL — satu per bagian, sekali jalan
   ============================================================ */
.rv {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--m-slow) var(--ease-out),
              transform var(--m-slow) var(--ease-out);
}

.rv.in { opacity: 1; transform: none; }

/* ============================================================
   RESPONSIF
   ============================================================ */
@media (max-width: 900px) {
  .feature { grid-template-columns: 1fr; }
  .feature-shot { min-height: 240px; }
  .craft-row { grid-template-columns: 56px minmax(0, 1fr); }
  .craft-row p { grid-column: 2; }
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .work { grid-template-columns: 44px minmax(0, 1fr); }
  .work-go { display: none; }
  .quote { max-width: 100%; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .rv { opacity: 1; transform: none; }
}
