/* ==========================================================================
   ARR OFFICIAL — style.css
   Gaya: Brutalism editorial (dark) — mengikuti design-system/arr-official/MASTER.md
   Aturan performa: animasi hanya memakai transform & opacity.
   Urutan file:
     1. Token desain (variabel CSS)
     2. Reset & dasar
     3. Utilitas (container, ikon, tombol, tag, link)
     4. Elemen global (loader, cursor, grid, nav)
     5. Section: hero → about → skills (+ etalase 3D ESP32) → projects → lab → journey → contact → footer
     6. Responsif & reduced motion
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKEN DESAIN
   Palet MASTER ("Monochrome + blue accent") diadaptasi ke dark mode.
   Semua pasangan teks sudah dicek kontrasnya (lihat PLAN.md).
   -------------------------------------------------------------------------- */
:root {
  /* Warna */
  --color-background: #09090B;      /* latar utama */
  --color-foreground: #FAFAFA;      /* teks utama (19.6:1) */
  --color-card: #18181B;            /* permukaan kartu */
  --color-card-foreground: #FAFAFA;
  --color-secondary: #3F3F46;       /* border & garis */
  --color-muted: #27272A;
  --color-muted-foreground: #A1A1AA;/* teks sekunder (7.7:1) */
  --color-accent: #2563EB;          /* fill tombol (teks putih 5.2:1) */
  --color-on-accent: #FFFFFF;
  --color-accent-text: #6B9BFF;     /* aksen untuk teks di latar gelap (7.4:1) */
  --color-ring: #6B9BFF;            /* focus ring */
  --color-deco: #52525B;            /* garis dekoratif (bukan teks penting) */

  /* Font */
  --font-heading: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Skala tipografi fluid (min, ideal berbasis lebar layar, max) */
  --fs-giant: clamp(4rem, 18.5vw, 21rem);
  --fs-h2: clamp(2.5rem, 7.5vw, 7.5rem);
  --fs-lead: clamp(1.5rem, 3.3vw, 3.25rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.875rem;

  /* Spasi — density 3/10 (spacious) dari MASTER */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --section-y: clamp(6rem, 12vw, 12rem);
  --nav-h: 72px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);   /* expo.out */
  --ease-in-out: cubic-bezier(0.87, 0, 0.13, 1);/* expo.inOut */
  --dur-fast: 150ms;
  --dur: 250ms;
  --dur-slow: 450ms;
}

/* --------------------------------------------------------------------------
   2. RESET & DASAR
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Scroll halus bawaan browser hanya bila Lenis tidak aktif & motion diizinkan */
@media (prefers-reduced-motion: no-preference) {
  html:not(.lenis) { scroll-behavior: smooth; }
}

/* CSS wajib dari Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  background: var(--color-background);
  color: var(--color-foreground);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;               /* cegah scroll horizontal di mobile */
  text-rendering: optimizeLegibility;
}

img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
h1, h2, h3 { font-weight: inherit; }

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

/* Focus state yang jelas untuk navigasi keyboard */
:focus-visible {
  outline: 3px solid var(--color-ring);
  outline-offset: 3px;
}

/* Semua elemen klik wajib cursor pointer (aturan MASTER) */
a, button, [role="button"] { cursor: pointer; }

/* Jam analog WIB — sudut tajam ala brutalism, jarum bergeser halus lewat JS */
.analog-clock { display: inline-block; width: 52px; height: 52px; flex: none; vertical-align: middle; }
.analog-clock--lg { width: 64px; height: 64px; }
.analog-clock__svg { display: block; width: 100%; height: 100%; overflow: visible; }
.ac-face { fill: var(--color-background); stroke: var(--color-foreground); stroke-width: 3; }
.ac-tick { stroke: var(--color-deco); stroke-width: 1; }
.ac-tick--major { stroke: var(--color-foreground); stroke-width: 2.4; }
.ac-hand { stroke-linecap: butt; }
.ac-hand--hour { stroke: var(--color-foreground); stroke-width: 5; }
.ac-hand--min { stroke: var(--color-foreground); stroke-width: 3.2; }
.ac-hand--sec { stroke: var(--color-accent-text); stroke-width: 1.6; }
.ac-pin { fill: var(--color-accent-text); }
.footer__clock { display: inline-flex; align-items: center; gap: 0.75rem; }
/* Jam besar di hero — menempati area kanan atas, di bawah baris meta */
.hero__clock {
  position: absolute;
  z-index: 2;
  right: var(--gutter);
  top: calc(var(--nav-h) + 4.25rem);
}
.analog-clock--hero { width: clamp(150px, 38vw, 190px); height: clamp(150px, 38vw, 190px); }
.ac-num {
  fill: var(--color-foreground);
  font-family: var(--font-heading);
  font-size: 9px;
  font-weight: 700;
  font-variation-settings: "wdth" 100, "wght" 700;
}

/* --------------------------------------------------------------------------
   3. UTILITAS
   -------------------------------------------------------------------------- */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.container {
  width: 100%;
  max-width: 1680px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.accent { color: var(--color-accent-text); }

/* Ikon SVG (gaya Lucide): ukuran mengikuti font, warna mengikuti teks */
.icon {
  width: 1.25em;
  height: 1.25em;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Skip link */
.skip-link {
  position: fixed;
  top: 1rem; left: 1rem;
  z-index: 300;
  padding: 0.75rem 1.25rem;
  background: var(--color-foreground);
  color: var(--color-background);
  font-weight: 700;
  transform: translateY(-200%);
  transition: transform var(--dur) var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }

/* Tombol — sudut tajam (brutalism), transisi 150–300ms */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  min-height: 48px;
  padding: 0.85rem 1.5rem;
  border: 2px solid transparent;
  border-radius: 0;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background-color var(--dur) ease, color var(--dur) ease, border-color var(--dur) ease;
}
.btn--primary {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-on-accent);
}
.btn--primary:hover {
  background: var(--color-foreground);
  border-color: var(--color-foreground);
  color: var(--color-background);
}
.btn--sm { min-height: 44px; padding: 0.6rem 1.1rem; font-size: 0.8125rem; }

/* Tombol ikon (min 44×44 px) */
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  border: 1px solid var(--color-secondary);
  transition: border-color var(--dur) ease, color var(--dur) ease;
}
.icon-btn:hover { border-color: var(--color-accent-text); color: var(--color-accent-text); }
.icon-btn .icon { width: 18px; height: 18px; }

/* Toggle ikon pause/play */
[data-motion-toggle] .icon-play { display: none; }
[data-motion-toggle][aria-pressed="true"] .icon-play { display: block; }
[data-motion-toggle][aria-pressed="true"] .icon-pause { display: none; }

/* Tag / chip */
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tags li {
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--color-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  transition: border-color var(--dur) ease, color var(--dur) ease;
}

/* Link dengan panah + garis bawah yang "tumbuh" saat hover */
.link-arrow {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  min-height: 44px;
  font-weight: 600;
  color: var(--color-foreground);
}
.link-arrow::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 6px;
  height: 2px;
  background: var(--color-accent-text);
  transform: scaleX(0.3);
  transform-origin: left;
  transition: transform var(--dur-slow) var(--ease-out);
}
.link-arrow:hover::after { transform: scaleX(1); }
.link-arrow .icon { transition: transform var(--dur) var(--ease-out); }
.link-arrow:hover .icon { transform: translate(2px, -2px); }

/* Split text: span hasil pemecahan teks oleh JS */
.word, .char { display: inline-block; }
.word { white-space: nowrap; }
/* Untuk reveal per huruf, tiap kata menjadi "mask" */
[data-reveal="chars"] .word,
.contact__line .word { overflow: hidden; vertical-align: top; padding-block: 0.06em; margin-block: -0.06em; }

/* Label & judul section */
.section { padding-block: var(--section-y); position: relative; }
.section-head { margin-bottom: clamp(3rem, 6vw, 6rem); }
.section-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  font-size: var(--fs-small);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-muted-foreground);
}
.section-label span { color: var(--color-accent-text); font-weight: 700; }
.section-label::after {
  content: "";
  flex: 0 0 clamp(2rem, 8vw, 6rem);
  height: 1px;
  background: var(--color-secondary);
}
.section-title {
  font-family: var(--font-heading);
  font-size: var(--fs-h2);
  font-weight: 800;
  font-variation-settings: "wdth" 105;
  line-height: 0.9;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   4. ELEMEN GLOBAL
   -------------------------------------------------------------------------- */

/* ---------- Loader (tampil hanya saat JS aktif) ---------- */
.loader { display: none; }
.js .loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--gutter);
  background: var(--color-accent);
  color: var(--color-on-accent);
}
.js .loader.is-done { display: none; }
/* Pengaman: bila script/CDN gagal dimuat, loader tetap hilang setelah 6 detik */
.js .loader { animation: loaderFailsafe 0.01s linear 6s forwards; }
@keyframes loaderFailsafe { to { visibility: hidden; } }
.loader__label {
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.loader__count {
  display: flex;
  align-items: flex-start;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: clamp(6rem, 26vw, 26rem);
  line-height: 0.8;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}
.loader__pct { font-size: 0.3em; margin-left: 0.1em; letter-spacing: 0; }
.loader__bar {
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 8px;
  background: var(--color-on-accent);
  transform: scaleX(0);
  transform-origin: left;
}

/* ---------- Custom cursor (hanya pointer halus + motion diizinkan) ---------- */
.cursor, .cursor-dot { display: none; }
/* Kursor bawaan disembunyikan karena digantikan ring + titik (hanya mouse) */
.has-cursor, .has-cursor * { cursor: none !important; }
.has-cursor .cursor,
.has-cursor .cursor-dot {
  position: fixed;
  top: 0; left: 0;
  z-index: 150;
  pointer-events: none;
  display: grid;
  place-items: center;
}
/* Ukuran dasar besar (88px) lalu di-scale kecil oleh GSAP → label tetap tajam saat membesar */
.has-cursor .cursor {
  width: 88px; height: 88px;
  margin: -44px 0 0 -44px;
  border: 3px solid #FFFFFF;
  border-radius: 50%;
  mix-blend-mode: difference;
  transform: scale(0.35);
}
.cursor.is-label {
  mix-blend-mode: normal;
  background: var(--color-accent);
  border-color: var(--color-accent);
}
.cursor__label {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-on-accent);
  opacity: 0;
  transition: opacity var(--dur-fast) ease;
}
.cursor.is-label .cursor__label { opacity: 1; }
.has-cursor .cursor-dot {
  width: 6px; height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: #FFFFFF;
  mix-blend-mode: difference;
}

/* ---------- Garis grid latar (ciri brutalism "visible grid") ---------- */
.grid-lines {
  position: fixed;
  inset: 0;
  z-index: -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 1680px;
  margin-inline: auto;
  padding-inline: var(--gutter);
  pointer-events: none;
}
.grid-lines span { border-left: 1px solid rgba(255, 255, 255, 0.05); }
.grid-lines span:nth-child(3) { border-right: 1px solid rgba(255, 255, 255, 0.05); }
.grid-lines span:nth-child(n + 4) { display: none; }

/* ---------- Navigasi ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: var(--nav-h);
  transition: transform var(--dur-slow) var(--ease-out);
}
/* Latar nav diletakkan di pseudo-element agar backdrop-filter tidak
   mengganggu posisi fixed menu mobile */
.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(9, 9, 11, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-muted);
}
.nav.is-hidden { transform: translateY(-100%); }
.nav:focus-within { transform: none; } /* jangan sembunyikan nav saat ada fokus keyboard */

.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.nav__logo, .nav__actions { position: relative; z-index: 2; }
.nav__logo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: -0.04em;
}
.nav__actions { display: flex; align-items: center; gap: 0.5rem; }

.nav__menu { position: relative; z-index: 1; }
.nav__menu ul { display: flex; gap: clamp(1rem, 2vw, 2.25rem); }
.nav__menu a {
  position: relative;
  display: inline-flex;
  align-items: flex-start;
  gap: 0.3rem;
  min-height: 44px;
  padding-top: 0.7rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-muted-foreground);
  transition: color var(--dur) ease;
}
.nav__menu a:hover,
.nav__menu a[aria-current="true"] { color: var(--color-foreground); }
.nav__menu a[aria-current="true"] .nav__num { color: var(--color-accent-text); }
.nav__num { font-size: 0.6875rem; font-weight: 700; color: var(--color-muted-foreground); }
.nav__toggle { display: none; }

.nav__progress {
  position: absolute;
  left: 0; bottom: -1px;
  z-index: 3;
  width: 100%; height: 2px;
  background: var(--color-accent-text);
  transform: scaleX(0);
  transform-origin: left;
}

/* --------------------------------------------------------------------------
   5a. HERO
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding-top: calc(var(--nav-h) + 1.5rem);
  padding-bottom: clamp(1.5rem, 3vw, 2.5rem);
  overflow: hidden;
}
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem 1rem;
  font-size: var(--fs-small);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted-foreground);
}

.hero__title {
  position: relative;
  align-self: center;
  padding-inline: calc(var(--gutter) * 0.6);
  font-family: var(--font-heading);
  font-size: var(--fs-giant);
  font-weight: 850;
  font-variation-settings: "wdth" 100, "wght" 850;
  line-height: 0.8;
  letter-spacing: -0.05em;
  text-transform: uppercase;
}
.hero__line {
  display: flex;
  align-items: center;
  overflow: hidden;              /* mask untuk huruf yang naik dari bawah */
  padding-block: 0.06em 0.02em;
}
.hero__line--2 { justify-content: flex-end; }
.hero__word { display: inline-block; white-space: nowrap; }
.hero__dot { color: var(--color-accent-text); display: inline-block; }

/* Huruf hero: efek variable font saat disentuh kursor (dipicu JS) */
.hero__title .char {
  font-variation-settings: "wdth" 100, "wght" 850;
  transition: font-variation-settings 600ms var(--ease-out);
}
.hero__title .char.is-flex { font-variation-settings: "wdth" 62, "wght" 200; }

.hero__note {
  margin-left: clamp(1rem, 4vw, 4rem);
  font-family: var(--font-body);
  font-size: clamp(0.75rem, 1vw, 0.9375rem);
  font-weight: 500;
  font-variation-settings: normal;
  line-height: 1.35;
  letter-spacing: 0.1em;
  color: var(--color-muted-foreground);
}

/* Bar aksen ala shape layer mograph — state akhir: tersembunyi */
.hero__bar {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: 0.16em;
  margin-top: -0.08em;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  z-index: 2;
  pointer-events: none;
}

.hero__bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
}
.hero__tagline {
  max-width: 34ch;
  font-size: clamp(1.05rem, 1.6vw, 1.375rem);
  line-height: 1.45;
}
.hero__tagline strong { color: var(--color-accent-text); font-weight: 700; }

.hero__badge {
  position: relative;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: clamp(96px, 10vw, 140px);
  aspect-ratio: 1;
}
.hero__badge-ring {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  animation: spin 16s linear infinite;
  animation-play-state: var(--play-global, running);
}
.hero__badge-ring text {
  fill: var(--color-foreground);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 3px;
}
.hero__badge-icon {
  width: 28px; height: 28px;
  color: var(--color-accent-text);
  transition: transform var(--dur) var(--ease-out);
}
.hero__badge:hover .hero__badge-icon { transform: translateY(4px); }

@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   5b. ABOUT
   -------------------------------------------------------------------------- */
.about__text {
  max-width: 24em;
  font-family: var(--font-heading);
  font-size: var(--fs-lead);
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -0.015em;
  text-wrap: pretty;
}
.about__text .kw {
  position: relative;
  color: var(--color-accent-text);
  font-weight: 700;
}
/* Garis bawah kata kunci: panjangnya dikendalikan variabel --u (0–1) oleh GSAP */
.about__text .kw::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0.02em;
  height: 0.08em;
  background: currentColor;
  transform: scaleX(var(--u, 1));
  transform-origin: left;
}

.about__facts {
  display: grid;
  gap: 0;
  margin-top: clamp(3rem, 8vw, 7rem);
  border-top: 1px solid var(--color-secondary);
}
.fact {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--color-secondary);
}
.fact dt {
  margin-bottom: 0.4rem;
  font-size: var(--fs-small);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-muted-foreground);
}
.fact dd {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   5c. SKILLS — marquee, kartu, & Etalase 3D ESP32
   -------------------------------------------------------------------------- */
.skills { overflow: hidden; }

.marquee {
  position: relative;
  overflow: hidden;
  padding-block: clamp(1rem, 2vw, 1.75rem);
  border-block: 1px solid var(--color-secondary);
  user-select: none;
}
.marquee__track { display: flex; width: max-content; }
.marquee__group {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 3rem);
  padding-right: clamp(1.25rem, 3vw, 3rem);
}
.marquee__group span {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 7vw, 6.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.marquee__group .is-outline {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--color-foreground);
}
.marquee__group .icon {
  width: clamp(1.5rem, 3.5vw, 3rem);
  height: clamp(1.5rem, 3.5vw, 3rem);
  color: var(--color-accent-text);
}

/* Baris kedua: pita aksen yang sedikit miring */
.marquee--alt {
  width: 110%;
  margin-left: -5%;
  margin-top: 1.5rem;
  margin-bottom: clamp(4rem, 8vw, 7rem);
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-on-accent);
  transform: rotate(-2deg);
}
.marquee--alt .marquee__group .is-outline { -webkit-text-stroke-color: var(--color-on-accent); }
.marquee--alt .marquee__group .icon { color: var(--color-on-accent); }

.skill-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--color-secondary);   /* gap 1px jadi garis grid */
  border: 1px solid var(--color-secondary);
}
.skill-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 300px;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  background: var(--color-background);
}
/* Fill aksen yang naik dari bawah saat hover (transform saja) */
.skill-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--color-accent);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform var(--dur-slow) var(--ease-out);
}
.skill-card__num {
  position: absolute;
  top: clamp(1.5rem, 3vw, 2.5rem);
  right: clamp(1.5rem, 3vw, 2.5rem);
  font-family: var(--font-heading);
  font-size: var(--fs-small);
  font-weight: 700;
  color: var(--color-muted-foreground);
  transition: color var(--dur) ease;
}
.skill-card__icon {
  width: 44px; height: 44px;
  stroke-width: 1.5;
  color: var(--color-accent-text);
  margin-bottom: auto;
  transition: transform var(--dur-slow) var(--ease-out), color var(--dur) ease;
}
.skill-card__title {
  margin-top: 2.5rem;
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 3vw, 2.75rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.skill-card__desc {
  max-width: 42ch;
  color: var(--color-muted-foreground);
  transition: color var(--dur) ease;
}
@media (hover: hover) {
  .skill-card:hover::before { transform: scaleY(1); }
  .skill-card:hover .skill-card__icon { color: var(--color-on-accent); transform: rotate(-12deg) scale(1.1); }
  .skill-card:hover .skill-card__desc,
  .skill-card:hover .skill-card__num { color: var(--color-on-accent); }
  .skill-card:hover .tags li { border-color: rgba(255, 255, 255, 0.7); }
}

/* ---------- Etalase Hardware 3D: ESP32-WROOM-32 ---------- */
.esp-showcase {
  display: grid;
  grid-template-columns: 1fr;
  margin-top: clamp(3rem, 6vw, 5.5rem);
  background: var(--color-card);
  border: 1px solid var(--color-secondary);
}
.esp-showcase__info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.15rem;
  padding: clamp(1.5rem, 3vw, 3rem);
  border-bottom: 1px solid var(--color-secondary);
}
.esp-showcase__info .section-label { margin-bottom: 0; }
.esp-showcase__title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3.75rem);
  font-weight: 800;
  line-height: 0.94;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}
.esp-showcase__desc {
  max-width: 44ch;
  color: var(--color-muted-foreground);
}
.esp-showcase__hint {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.5rem;
  font-size: var(--fs-small);
  color: var(--color-muted-foreground);
}
.esp-showcase__hint .icon { color: var(--color-accent-text); width: 1.35rem; height: 1.35rem; }

.esp-showcase__stage {
  --esp-ry: -28deg;
  --esp-rx: 24deg;
  position: relative;
  min-height: clamp(340px, 50vh, 520px);
  overflow: hidden;
  user-select: none;
  touch-action: pan-y;
  cursor: grab;
  background-color: #0B0B0E;
  background-image:
    radial-gradient(circle at 50% 54%, rgba(37, 99, 235, 0.18), transparent 62%),
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 100% 100%, 36px 36px, 36px 36px;
}
.esp-showcase__stage.is-dragging { cursor: grabbing; }

.esp-showcase__corner {
  position: absolute;
  z-index: 3;
  width: 16px; height: 16px;
  border-color: var(--color-accent-text);
  border-style: solid;
  border-width: 0;
  pointer-events: none;
}
.esp-showcase__corner--tl { top: 14px; left: 14px; border-top-width: 2px; border-left-width: 2px; }
.esp-showcase__corner--tr { top: 14px; right: 14px; border-top-width: 2px; border-right-width: 2px; }
.esp-showcase__corner--bl { bottom: 14px; left: 14px; border-bottom-width: 2px; border-left-width: 2px; }
.esp-showcase__corner--br { bottom: 14px; right: 14px; border-bottom-width: 2px; border-right-width: 2px; }

.esp-showcase__hud {
  position: absolute;
  left: 1.5rem; right: 1.5rem;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted-foreground);
  pointer-events: none;
}
.esp-showcase__hud--top { top: 1.25rem; }
.esp-showcase__hud--bottom { bottom: 1.25rem; }
.esp-showcase__angle {
  padding: 0.15rem 0.5rem;
  background: rgba(37, 99, 235, 0.18);
  border: 1px solid var(--color-accent);
  color: var(--color-accent-text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.esp-showcase__canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}
.esp-showcase__canvas canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
}
.esp-showcase__stage.is-webgl .esp-fallback {
  opacity: 0;
  pointer-events: none;
}

/* CSS 3D fallback ESP32 (tampil otomatis bila offline / sebelum WebGL siap) */
.esp-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding-bottom: 1.5rem;
  perspective: 900px;
  transition: opacity var(--dur) ease;
}
.esp-fallback__turntable {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 210px; height: 210px;
  margin-left: -105px;
  margin-top: 10px;
  border-radius: 50%;
  border: 2px dashed rgba(107, 155, 255, 0.45);
  box-shadow: inset 0 0 28px rgba(37, 99, 235, 0.22);
  transform: rotateX(72deg) rotateZ(var(--esp-ry));
}
.esp-fallback__board {
  position: relative;
  width: 118px; height: 212px;
  margin-top: -22px;
  transform-style: preserve-3d;
  transform: rotateX(var(--esp-rx)) rotateY(var(--esp-ry));
}
.esp-fallback__face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border: 2px solid #52525B;
  background: #12141A;
}
.esp-fallback__face--top {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 14px;
  box-shadow:
    inset 6px 0 0 #D4AF37,
    inset -6px 0 0 #D4AF37;
}
.esp-fallback__face--bottom {
  display: grid;
  place-items: center;
  transform: rotateY(180deg);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--color-accent-text);
  box-shadow:
    inset 6px 0 0 #D4AF37,
    inset -6px 0 0 #D4AF37;
}
.esp-fallback__ant {
  width: 78px; height: 24px;
  background:
    repeating-linear-gradient(90deg, #D4AF37 0 4px, transparent 4px 9px);
  border: 1px solid #3F3F46;
}
.esp-fallback__shield {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 82px; height: 78px;
  margin-top: 6px;
  background: linear-gradient(135deg, #D4D4D8, #71717A);
  border: 1px solid #F4F4F5;
  color: #09090B;
  font-family: var(--font-mono);
  line-height: 1.1;
}
.esp-fallback__shield b { font-size: 0.8rem; }
.esp-fallback__shield small { font-size: 0.55rem; font-weight: 700; }
.esp-fallback__chip {
  width: 28px; height: 28px;
  margin-top: 18px;
  background: #27272A;
  border: 1px solid #71717A;
}
.esp-fallback__led {
  position: absolute;
  bottom: 34px;
  width: 7px; height: 5px;
}
.esp-fallback__led--pwr { left: 24px; background: #EF4444; box-shadow: 0 0 8px #EF4444; }
.esp-fallback__led--io { right: 24px; background: #3B82F6; box-shadow: 0 0 10px #3B82F6; }
.esp-fallback__usb {
  width: 42px; height: 20px;
  margin-top: auto;
  margin-bottom: -14px;
  background: #D4D4D8;
  border: 1px solid #71717A;
}

/* --------------------------------------------------------------------------
   5d. PROJECTS
   Default (mobile / reduced motion): sticky stacking cards vertikal.
   Desktop + motion: JS menambah .is-horizontal → scroll horizontal ter-pin.
   -------------------------------------------------------------------------- */
.projects { position: relative; padding-block: var(--section-y); }
.projects__track {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 1680px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.projects__intro { margin-bottom: 1.5rem; }
.projects__title {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 9vw, 9rem);
  font-weight: 800;
  line-height: 0.88;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}
.projects__hint {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.5rem;
  color: var(--color-muted-foreground);
}
.projects__hint .icon { color: var(--color-accent-text); }

.project {
  position: sticky;                        /* sticky stacking cards */
  top: calc(var(--nav-h) + 1rem);
  display: grid;
  grid-template-columns: 1fr;
  background: var(--color-card);
  border: 1px solid var(--color-secondary);
  overflow: hidden;
}
.project__preview {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 1.5rem;
  overflow: hidden;
  background-color: #0F0F12;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  border-bottom: 1px solid var(--color-secondary);
  font-size: clamp(0.75rem, 1vw, 1rem);
}
.project__info {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 1rem;
  padding: clamp(1.5rem, 3vw, 3rem);
}
.project__meta {
  font-size: var(--fs-small);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted-foreground);
}
.project__meta span { color: var(--color-accent-text); font-weight: 700; margin-right: 0.5rem; }
.project__title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4.2vw, 4.25rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}
.project__desc { max-width: 40ch; color: var(--color-muted-foreground); }
.project .link-arrow { align-self: flex-start; }

/* ---- Kartu khusus video 16:9 (tanpa deskripsi) ---- */
.project.project--video {
  grid-template-columns: 1fr;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #050507;
}

.projects__outro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2rem;
  padding-block: 3rem 0;
}
.projects__outro-text {
  font-family: var(--font-heading);
  font-size: clamp(2.25rem, 5.5vw, 5.5rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

/* ---- Mode horizontal (desktop) ---- */
.projects.is-horizontal { padding-block: 0; }
.projects.is-horizontal .projects__pin {
  height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.projects.is-horizontal .projects__track {
  flex-direction: row;
  align-items: center;
  gap: clamp(1.5rem, 3vw, 3rem);
  width: max-content;
  max-width: none;
  margin: 0;
  padding-top: var(--nav-h);
}
.projects.is-horizontal .projects__intro { width: min(38vw, 620px); margin: 0; flex-shrink: 0; }
.projects.is-horizontal .project {
  position: relative;
  top: auto;
  flex-shrink: 0;
  width: min(74vw, 1180px);
  height: min(68vh, 640px);
  grid-template-columns: 1.15fr 1fr;
}
.projects.is-horizontal .project__preview { border-bottom: 0; border-right: 1px solid var(--color-secondary); }
.projects.is-horizontal .project.project--video {
  grid-template-columns: 1fr;
  height: min(68vh, 640px, 48vw);
  width: auto;
  aspect-ratio: 16 / 9;
}
.projects.is-horizontal .projects__outro { width: min(46vw, 720px); flex-shrink: 0; padding: 0 var(--gutter) 0 0; }

/* ---- Preview: foto portrait 9:16 (Project Halo & Reg Nightmare) ---- */
.pv-photo {
  position: relative;
  width: min(64%, 230px);
  aspect-ratio: 9 / 16;
  background: var(--color-background);
  border: 2px solid var(--color-foreground);
  box-shadow: 12px 12px 0 var(--color-accent);
  overflow: hidden;
}
.projects.is-horizontal .pv-photo {
  width: auto;
  height: min(86%, 480px);
  max-width: 82%;
}
.pv-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

/* ---- Preview: kode API CDN Upload ---- */
.pv-code {
  width: 94%;
  max-width: 530px;
  padding: 1.15em 1.25em;
  background: #0B0B0E;
  border: 1px solid var(--color-secondary);
  box-shadow: 10px 10px 0 rgba(37, 99, 235, 0.35);
  font-family: var(--font-mono);
  font-size: clamp(0.68rem, 0.85vw, 0.85rem);
  line-height: 1.55;
  color: #D4D4D8;
  overflow-x: auto;
}
.pv-code__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45em;
  padding-bottom: 0.65em;
  border-bottom: 1px solid var(--color-muted);
  font-size: 0.92em;
  color: var(--color-muted-foreground);
}
.pv-code pre {
  margin-top: 0.75em;
  font-family: inherit;
  white-space: pre;
}
.t-method { padding: 0.12em 0.45em; background: var(--color-accent); color: var(--color-on-accent); font-weight: 700; }
.t-kw { color: var(--color-accent-text); font-weight: 600; }
.t-key { color: #93C5FD; }
.t-str { color: #FAFAFA; }
.t-num { color: var(--color-accent-text); }

/* ---- Preview: pemutar video 16:9 (Play & Stop, Anti-Download) ---- */
.pv-video {
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  background: #050507;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.pv-video__media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}
.pv-video__shield {
  position: absolute;
  inset: 0;
  z-index: 2;
  cursor: pointer;
}
.pv-video__center {
  position: absolute;
  top: 50%; left: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: clamp(56px, 7vw, 76px);
  height: clamp(56px, 7vw, 76px);
  background: var(--color-accent);
  border: 2px solid var(--color-on-accent);
  color: var(--color-on-accent);
  transform: translate(-50%, -50%);
  transition: transform var(--dur) var(--ease-out), opacity var(--dur) ease, background-color var(--dur) ease, color var(--dur) ease;
}
.pv-video__center .icon { width: 1.75rem; height: 1.75rem; margin-left: 3px; }
.pv-video__center:hover {
  background: var(--color-foreground);
  color: var(--color-background);
  transform: translate(-50%, -50%) scale(1.06);
}
.project--video.is-playing .pv-video__center {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.82);
}

.pv-video__controls {
  position: absolute;
  left: clamp(0.75rem, 2vw, 1.25rem);
  right: clamp(0.75rem, 2vw, 1.25rem);
  bottom: clamp(0.75rem, 2vw, 1.25rem);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
}
.pv-video__btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.5rem 0.95rem;
  background: rgba(9, 9, 11, 0.88);
  border: 1px solid var(--color-secondary);
  color: var(--color-foreground);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background-color var(--dur) ease, border-color var(--dur) ease, color var(--dur) ease, opacity var(--dur) ease;
}
.pv-video__btn .icon { width: 1rem; height: 1rem; }
.pv-video__btn:hover:not(:disabled) {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-on-accent);
}
.pv-video__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.pv-video__btn .icon-v-pause { display: none; }
.project--video.is-playing .pv-video__btn .icon-v-play { display: none; }
.project--video.is-playing .pv-video__btn .icon-v-pause { display: block; }

.pv-video__badge {
  margin-left: auto;
  padding: 0.35rem 0.65rem;
  background: rgba(9, 9, 11, 0.82);
  border: 1px solid var(--color-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-muted-foreground);
}
.pv-video__progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 4;
  height: 3px;
  background: rgba(255, 255, 255, 0.14);
  pointer-events: none;
}
.pv-video__progress span {
  display: block;
  width: 100%; height: 100%;
  background: var(--color-accent-text);
  transform: scaleX(0);
  transform-origin: left;
}

/* --------------------------------------------------------------------------
   5e. MOTION LAB
   -------------------------------------------------------------------------- */
.lab { overflow: hidden; }

/* Judul outline → fill */
.fill-reveal {
  position: relative;
  display: block;
  width: max-content;
  max-width: 100%;
  font-family: var(--font-heading);
  font-size: clamp(2.75rem, 11.5vw, 13rem);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.04em;
  white-space: nowrap;
}
.fill-reveal__outline {
  display: block;
  color: transparent;
  -webkit-text-stroke: clamp(1px, 0.15vw, 2px) var(--color-foreground);
}
.fill-reveal__mask {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.fill-reveal__fill { display: block; color: var(--color-foreground); }
.lab__intro {
  max-width: 46ch;
  margin-top: 2rem;
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  color: var(--color-muted-foreground);
}

.lab-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--color-secondary);
  border: 1px solid var(--color-secondary);
}
/* --play mengendalikan semua loop di tile (running/paused) */
.lab-tile {
  --play: paused;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: clamp(1.25rem, 2vw, 1.75rem);
  background: var(--color-background);
}
.lab-tile.is-running,
.no-js .lab-tile { --play: running; }
.is-paused .lab-tile { --play: paused; }

.lab-tile__stage {
  display: grid;
  place-items: center;
  height: clamp(170px, 18vw, 240px);
  margin-bottom: 1rem;
  overflow: hidden;
  background: var(--color-card);
  border: 1px solid var(--color-muted);
}
.lab-tile__name { font-weight: 600; }
.lab-tile__name span { margin-right: 0.5rem; color: var(--color-accent-text); font-weight: 700; }
.lab-tile__param { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--color-muted-foreground); }

.fx {
  position: relative;
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4.4vw, 3.75rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.fx .char,
.fx-roll__list,
.fx-slice__a,
.fx-slice__b,
.fx-outline__fill { animation-play-state: var(--play) !important; }

/* P-01 Wave */
.fx-wave .char { animation: fxWave 1.6s ease-in-out infinite; animation-delay: calc(var(--i) * -0.08s); }
@keyframes fxWave {
  0%, 100% { transform: translateY(18%) rotate(0deg); }
  50% { transform: translateY(-18%) rotate(-6deg); }
}

/* P-02 Word roller */
.fx-roll__mask { display: block; height: 1em; overflow: hidden; }
.fx-roll__list { display: flex; flex-direction: column; animation: fxRoll 4.8s var(--ease-in-out) infinite; }
.fx-roll__list span { display: block; height: 1em; }
.fx-roll__list span:nth-child(2) { color: var(--color-accent-text); }
@keyframes fxRoll {
  0%, 22% { transform: translateY(0); }
  33%, 55% { transform: translateY(-25%); }
  66%, 88% { transform: translateY(-50%); }
  100% { transform: translateY(-75%); }
}

/* P-03 Squash & stretch */
.fx-stretch .char { transform-origin: 50% 100%; animation: fxStretch 2s var(--ease-out) infinite; animation-delay: calc(var(--i) * 0.07s); }
@keyframes fxStretch {
  0%, 100% { transform: scaleY(1); }
  25% { transform: scaleY(0.15); }
  45% { transform: scaleY(1.3); }
  60% { transform: scaleY(0.92); }
}

/* P-04 Slice glitch (dua salinan bergeser + kedip) */
.fx-slice__base { display: block; }
.fx-slice__a, .fx-slice__b { position: absolute; inset: 0; opacity: 0; }
.fx-slice__a { color: var(--color-accent-text); animation: fxGlitchA 2.2s steps(1) infinite; }
.fx-slice__b { color: var(--color-muted-foreground); animation: fxGlitchB 2.2s steps(1) infinite; }
@keyframes fxGlitchA {
  0%, 100% { opacity: 0; transform: none; }
  12% { opacity: 0.9; transform: translate(-6px, -2px); }
  14% { opacity: 0; }
  56% { opacity: 0.9; transform: translate(5px, 1px); }
  58% { opacity: 0.9; transform: translate(-3px, 0); }
  60% { opacity: 0; }
}
@keyframes fxGlitchB {
  0%, 100% { opacity: 0; transform: none; }
  13% { opacity: 0.8; transform: translate(6px, 2px); }
  15% { opacity: 0; }
  57% { opacity: 0.8; transform: translate(-5px, -1px); }
  59% { opacity: 0; }
}

/* P-05 Outline pulse */
.fx-outline__stroke { display: block; color: transparent; -webkit-text-stroke: 1.5px var(--color-foreground); }
.fx-outline__fill { position: absolute; inset: 0; color: var(--color-foreground); opacity: 0; animation: fxOutline 2.4s var(--ease-in-out) infinite; }
@keyframes fxOutline {
  0%, 25% { opacity: 0; }
  45%, 75% { opacity: 1; }
  95%, 100% { opacity: 0; }
}

/* P-06 Spin in */
.fx-spin .char { transform-origin: 50% 100%; animation: fxSpin 3s var(--ease-out) infinite; animation-delay: calc(var(--i) * 0.07s); }
@keyframes fxSpin {
  0% { opacity: 0; transform: rotate(-90deg) translateY(40%); }
  18%, 68% { opacity: 1; transform: none; }
  86%, 100% { opacity: 0; transform: rotate(90deg) translateY(-40%); }
}

/* Pita kinetik */
.lab-ribbon { margin-top: clamp(4rem, 8vw, 8rem); overflow: hidden; }
.lab-ribbon__text {
  font-family: var(--font-heading);
  font-size: clamp(4rem, 14vw, 16rem);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.04em;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px var(--color-deco);
}

/* --------------------------------------------------------------------------
   5f. JOURNEY — timeline
   -------------------------------------------------------------------------- */
.timeline { position: relative; padding-left: 2rem; }
.timeline__line {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 2px;
  background: var(--color-secondary);
}
.timeline__progress {
  position: absolute;
  inset: 0;
  background: var(--color-accent-text);
  transform-origin: top;
}
.timeline__item {
  position: relative;
  display: grid;
  gap: 0.5rem;
  padding-block: clamp(1.75rem, 3.5vw, 3rem);
  border-top: 1px solid var(--color-muted);
}
/* Penanda (kotak) di garis timeline */
.timeline__item::before {
  content: "";
  position: absolute;
  top: clamp(2.25rem, 4.5vw, 4.25rem);
  left: calc(-2rem - 6px);
  width: 14px; height: 14px;
  background: var(--color-accent-text);
  border: 3px solid var(--color-background);
  transition: transform var(--dur-slow) var(--ease-out);
}
.timeline__year {
  position: relative;
  font-family: var(--font-heading);
  font-size: clamp(3rem, 8vw, 8rem);
  font-weight: 900;
  line-height: 0.85;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--color-muted-foreground);
}
/* Lapisan isi tahun — muncul (opacity) saat item aktif */
.timeline__year::after {
  content: attr(data-year);
  position: absolute;
  inset: 0;
  color: var(--color-foreground);
  -webkit-text-stroke: 0;
  transition: opacity var(--dur-slow) ease;
}
.timeline__body h3 {
  margin-bottom: 0.5rem;
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 2.6vw, 2.25rem);
  font-weight: 700;
  line-height: 1.1;
}
.timeline__body p { max-width: 48ch; color: var(--color-muted-foreground); }

/* Saat JS aktif, item yang belum "aktif" tampil redup sampai di-scroll */
.js .timeline__item:not(.is-active)::before { transform: scale(0.45); }
.js .timeline__item:not(.is-active) .timeline__year::after { opacity: 0; }

/* --------------------------------------------------------------------------
   5g. CONTACT
   -------------------------------------------------------------------------- */
.contact { padding-bottom: clamp(5rem, 10vw, 9rem); }
.contact__title {
  margin-bottom: clamp(2.5rem, 6vw, 5rem);
  font-family: var(--font-heading);
  font-size: clamp(3.25rem, 13.5vw, 15.5rem);
  font-weight: 900;
  line-height: 0.86;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}
.contact__line { display: block; white-space: nowrap; }
.contact__line--outline { color: transparent; -webkit-text-stroke: clamp(1.5px, 0.2vw, 3px) var(--color-foreground); }
.contact__line--outline .char:last-child { color: var(--color-accent-text); -webkit-text-stroke: 0; }

.contact__grid {
  display: grid;
  gap: 2rem;
  align-items: end;
}
.contact__lead { max-width: 36ch; font-size: clamp(1.15rem, 1.8vw, 1.5rem); line-height: 1.45; }

.contact__wa {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 80px;
  padding: clamp(1.25rem, 3vw, 2.25rem);
  background: var(--color-accent);
  border: 2px solid var(--color-accent);
  color: var(--color-on-accent);
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 2.6vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  transition: background-color var(--dur) ease, color var(--dur) ease, border-color var(--dur) ease;
}
.contact__wa span { margin-right: auto; }
.contact__wa:hover { background: var(--color-foreground); border-color: var(--color-foreground); color: var(--color-background); }

.contact__mail {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  max-width: 100%;
  margin-top: clamp(3rem, 7vw, 6rem);
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 4.4vw, 4.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}
.contact__mail .icon { width: 0.8em; height: 0.8em; color: var(--color-accent-text); }
.contact__mail::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -0.05em;
  height: 0.06em;
  background: var(--color-accent-text);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--dur-slow) var(--ease-out);
}
.contact__mail:hover::after { transform: scaleX(1); transform-origin: left; }

.socials { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.5rem; }
.socials a {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 48px;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--color-secondary);
  font-weight: 600;
  transition: border-color var(--dur) ease, color var(--dur) ease, background-color var(--dur) ease;
}
.socials a:hover { border-color: var(--color-accent-text); color: var(--color-accent-text); }

/* --------------------------------------------------------------------------
   5h. FOOTER
   -------------------------------------------------------------------------- */
.footer { padding-block: 3rem 2rem; border-top: 1px solid var(--color-secondary); overflow: hidden; }
.footer__word {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 14.5vw, 17rem);
  font-weight: 900;
  line-height: 0.85;
  letter-spacing: -0.05em;
  text-align: center;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px var(--color-deco);
}
.footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-top: 2rem;
  font-size: var(--fs-small);
  color: var(--color-muted-foreground);
}
.footer__row .link-arrow { color: var(--color-foreground); }

/* --------------------------------------------------------------------------
   6. RESPONSIF
   Breakpoint: 375 (dasar) → 768 → 1024 → 1440
   -------------------------------------------------------------------------- */

/* ---- < 1024px: menu menjadi overlay layar penuh ---- */
@media (max-width: 1023.98px) {
  .nav__toggle { display: inline-grid; }
  .nav__toggle .icon-close { display: none; }
  .nav__toggle[aria-expanded="true"] .icon-open { display: none; }
  .nav__toggle[aria-expanded="true"] .icon-close { display: block; }

  .nav__menu {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding: calc(var(--nav-h) + 2rem) var(--gutter) 3rem;
    background: var(--color-background);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-1.5rem);
    transition: opacity var(--dur) ease, transform var(--dur-slow) var(--ease-out), visibility 0s linear var(--dur-slow);
  }
  .nav__menu.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity var(--dur) ease, transform var(--dur-slow) var(--ease-out), visibility 0s;
  }
  .nav__menu ul { flex-direction: column; gap: 0.25rem; width: 100%; }
  .nav__menu a {
    gap: 0.75rem;
    padding-top: 0;
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 11vw, 4.5rem);
    font-weight: 800;
    line-height: 1.05;
    text-transform: uppercase;
    color: var(--color-foreground);
  }
  .nav__num { font-family: var(--font-body); font-size: 0.875rem; padding-top: 0.6em; color: var(--color-accent-text); }
}

/* ---- Kartu proyek lebih tinggi dari layar? matikan sticky agar link di bawah kartu
        tidak tertutup kartu berikutnya (ponsel portrait & layar landscape pendek) ---- */
@media (max-width: 767.98px), (max-height: 700px) {
  .project { position: relative; top: auto; }
}

/* ---- Ponsel kecil (≤ 480px) ---- */
@media (max-width: 480px) {
  .nav .btn--sm { display: none; }        /* CTA tetap ada di menu & section kontak */
  .hero__meta { font-size: 0.75rem; }
  .hero__note { display: none; }
  .hero__bottom { align-items: flex-end; }
  .hero__badge { width: 88px; }
  .contact__wa { font-size: 1.15rem; }
  .pv-video__badge { display: none; }
}

/* ---- ≥ 768px (tablet) ---- */
@media (min-width: 768px) {
  .grid-lines { grid-template-columns: repeat(4, 1fr); }
  .grid-lines span:nth-child(3) { border-right: 0; }
  .grid-lines span:nth-child(4) { display: block; border-right: 1px solid rgba(255, 255, 255, 0.05); }

  .about__facts { grid-template-columns: repeat(2, 1fr); }
  .fact { padding: 1.75rem 1.5rem 1.75rem 0; border-bottom: 0; }
  .fact + .fact { padding-left: 1.5rem; border-left: 1px solid var(--color-secondary); }

  .skill-grid { grid-template-columns: repeat(2, 1fr); }
  .skill-card:nth-child(1) { grid-column: span 2; }

  .project { grid-template-columns: 1fr 1fr; }
  .project.project--video { grid-template-columns: 1fr; }
  .project__preview { min-height: 360px; border-bottom: 0; border-right: 1px solid var(--color-secondary); }
  .pv-photo { width: min(70%, 250px); }

  .lab-grid { grid-template-columns: repeat(2, 1fr); }

  .timeline__item { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 2rem; align-items: start; }
}

/* ---- ≥ 1024px (laptop) ---- */
@media (min-width: 1024px) {
  :root { --nav-h: 80px; }
  .grid-lines { grid-template-columns: repeat(5, 1fr); }
  .grid-lines span:nth-child(4) { border-right: 0; }
  .grid-lines span:nth-child(5) { display: block; border-right: 1px solid rgba(255, 255, 255, 0.05); }

  .skill-grid { grid-template-columns: repeat(4, 1fr); }
  .skill-card:nth-child(1) { grid-column: span 2; }
  .skill-card:nth-child(5) { grid-column: span 3; }

  .esp-showcase { grid-template-columns: 0.92fr 1.18fr; }
  .esp-showcase__info { border-bottom: 0; border-right: 1px solid var(--color-secondary); }

  .lab-grid { grid-template-columns: repeat(3, 1fr); }

  .contact__grid { grid-template-columns: 1fr 1fr; gap: 4rem; }
  .timeline { padding-left: 3rem; }
  .timeline__item::before { left: calc(-3rem - 6px); }
}

/* ---- ≥ 1440px (desktop lebar) ---- */
@media (min-width: 1440px) {
  :root { --fs-body: 1.125rem; }
  .hero__title { padding-inline: var(--gutter); }
}

/* --------------------------------------------------------------------------
   7. REDUCED MOTION
   Semua animasi dimatikan & konten tampil di state akhirnya.
   -------------------------------------------------------------------------- */
@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;
  }
  .js .loader, .cursor, .cursor-dot { display: none !important; }
  .fx .char, .fx-roll__list, .fx-slice__a, .fx-slice__b, .fx-outline__fill,
  .hero__badge-ring { animation: none !important; }
  .fx-outline__fill { opacity: 1; }      /* tampilkan versi terisi (lebih terbaca) */
  .project { position: relative; top: auto; }
}

/* Saat user menekan tombol "jeda animasi" */
.is-paused { --play-global: paused; }


/* ==========================================================================
   JAM RETAK (#waktu) — jam besar muncul, diam saat di-pin, retak jadi dua
   ========================================================================== */
.timeclock {
  position: relative;
  display: grid;
  place-items: center;
  justify-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
  padding-block: var(--space-3xl);
  overflow: hidden;
}
.tc__stage { position: relative; width: min(82vw, 62svh, 540px); aspect-ratio: 1; }
.tc__halves { position: absolute; inset: 0; will-change: transform; }
.analog-clock--stage { width: 100%; height: 100%; }
.tc__half { position: absolute; inset: 0; will-change: transform; }
/* Dua potongan memakai tepi bergerigi yang sama → pas seperti jam yang pecah */
.tc__half--l { clip-path: polygon(0 0, 50% 0, 53% 12%, 47% 25%, 54% 38%, 46% 52%, 53% 66%, 47% 80%, 52% 92%, 50% 100%, 0 100%); }
.tc__half--r { clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%, 52% 92%, 47% 80%, 53% 66%, 46% 52%, 54% 38%, 47% 25%, 53% 12%); }
.tc__crack {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; overflow: visible;
}
.tc__crack path {
  fill: none; stroke: var(--color-accent-text); stroke-width: 2.5;
  stroke-linejoin: miter; vector-effect: non-scaling-stroke;
}
.tc__msg {
  position: relative; z-index: 2; text-align: center;
  font-family: var(--font-heading);
  font-size: clamp(2.25rem, 9vw, 6.5rem);
  font-weight: 850; font-variation-settings: "wdth" 100, "wght" 850;
  line-height: 0.92; letter-spacing: -0.04em; text-transform: uppercase;
}
.tc__msg span { color: var(--color-accent-text); }

/* Mode animasi (diaktifkan JS): layar penuh, teks tersembunyi di balik jam */
.timeclock.is-anim { min-height: 100svh; padding-block: 0; }
.timeclock.is-anim .tc__stage,
.timeclock.is-anim .tc__msg { grid-area: 1 / 1; }
.timeclock.is-anim .tc__stage { z-index: 1; }
.timeclock.is-anim .tc__msg { opacity: 0; padding-inline: var(--gutter); }
