/* azrim.my.id
   Theme: dark, locked. Warm charcoal base, single amber accent.
   Radius system: surfaces 16px, interactive controls pill.
   Z-index scale: canvas 0, content 1, header 40, grain 80, curtain 90, skip-link 100. */

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/space-grotesk-var.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("fonts/jetbrains-mono-var.woff2") format("woff2");
}

:root {
  --bg: #100f16;
  --raise: #18161f;
  --raise-2: #1f1c2a;
  --text: #eae7f2;
  --muted: #a19aae;
  --line: rgba(234, 231, 242, 0.10);
  --line-strong: rgba(234, 231, 242, 0.20);
  --accent: #a58bff;
  --accent-soft: rgba(165, 139, 255, 0.12);
  --accent-ink: #191036;
  --radius: 16px;
  --max: 1120px;
  --font: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(900px 480px at 12% -8%, rgba(165, 139, 255, 0.10), transparent 60%),
    var(--bg);
  overflow-x: clip;
}

/* Grain overlay: fixed, non-scrolling, no pointer events */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.container {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.skip-link {
  position: absolute;
  top: -3rem;
  left: 1rem;
  z-index: 100;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.skip-link:focus-visible { top: 1rem; }

/* Intro curtain: hidden unless JS drives it (script.js reveals then lifts it) */
.curtain {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: #0b0a11;
  display: none;
}

#dots {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

main, .site-footer { position: relative; z-index: 1; }

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  height: 68px;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
  background: rgba(16, 15, 22, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: transform 0.35s var(--ease), border-color 0.25s var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header.hidden { transform: translateY(-100%); }
/* Never trap keyboard focus in the auto-hidden header */
.site-header.hidden:focus-within { transform: none; }

.wordmark {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}
.wordmark-dot { color: var(--accent); }

.nav {
  display: none;
  gap: 1.4rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.nav a { transition: color 0.18s var(--ease); }
.nav a:hover { color: var(--text); }

.header-cta { margin-left: auto; }

/* ---------- Buttons & text links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: 999px;
  padding: 0.8rem 1.7rem;
  font-weight: 600;
  font-size: 1rem;
  white-space: nowrap;
  transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease),
    color 0.18s var(--ease);
}
.btn:active { transform: scale(0.98); }

.btn-solid {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-solid:hover { background: #b9a3ff; }

.btn-line {
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: transparent;
}
.btn-line:hover { border-color: var(--accent); color: var(--accent); }

.btn-sm { padding: 0.42rem 1rem; font-size: 0.9rem; min-height: 44px; }

.text-link {
  color: var(--accent);
  font-weight: 600;
}
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Sections ---------- */

.section { padding-top: 7rem; scroll-margin-top: 40px; }

.section-head { margin-bottom: 2.5rem; }
.section-head h2 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.section-head p { margin: 0; color: var(--muted); }

/* ---------- Hero ---------- */

.hero {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: calc(68px + 1.5rem) 0 1.75rem;
}

.hero-inner {
  position: relative;
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.hero-eyebrow {
  margin: 0 0 1.2rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-title {
  margin: 0 0 1.4rem;
  /* Sized against width and height so the hero always fits one viewport */
  font-size: min(clamp(3rem, 12.5vw, 8rem), 16vh);
  line-height: 0.98;
  letter-spacing: -0.03em;
  font-weight: 700;
  text-transform: uppercase;
}
.hero-mask {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
}
.hero-line {
  display: block;
}

/* Intro pre-hide, stamped on <html> before first paint by the inline head
   script and overridden by GSAP's inline styles once the timeline runs. */
html.intro .hero-line { transform: translateY(115%); }
html.intro .hero-eyebrow,
html.intro .hero-sub,
html.intro .hero-actions,
html.intro .hero-card { opacity: 0; }
html.intro .curtain { display: block; }
.hero-title em {
  font-style: normal;
  color: transparent;
  -webkit-text-stroke: 2px var(--accent);
}

.hero-row {
  display: grid;
  gap: 2.5rem;
  align-items: end;
}

.hero-sub {
  margin: 0 0 1.8rem;
  max-width: 32rem;
  color: var(--muted);
  font-size: 1.1rem;
}

.hero-actions { display: flex; gap: 0.8rem; }

.hero-card {
  justify-self: start;
  width: min(60%, 230px);
}
.hero-card-tilt {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--raise-2), var(--raise));
  overflow: hidden;
}
/* Only promote a layer where the tilt interaction actually runs */
@media (hover: hover) and (pointer: fine) {
  .hero-card-tilt { will-change: transform; }
}
.hero-avatar {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}
.hero-card-body { padding: 0.9rem 1.1rem 1rem; }
.hero-handle {
  margin: 0 0 0.2rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--accent);
}
.hero-orgs { margin: 0; color: var(--muted); font-size: 0.85rem; }

.hero-card-stats {
  margin: 0.7rem 0 0;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---------- Marquee ---------- */

.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1.1rem 0;
  overflow: hidden;
}
.marquee-track {
  display: flex;
  align-items: baseline;
  gap: 3.2rem;
  width: max-content;
  padding-right: 3.2rem;
}
.marquee-track span {
  font-size: clamp(1.3rem, 2.6vw, 2rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.marquee-track .hollow {
  color: transparent;
  -webkit-text-stroke: 1px var(--muted);
}

@media (prefers-reduced-motion: no-preference) {
  .marquee-track { animation: marquee 30s linear infinite; }
  .marquee:hover .marquee-track { animation-play-state: paused; }
  @keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
  }
}

/* ---------- Work: vertical stack by default, horizontal pan when enabled ---------- */

.work { padding-top: 7rem; scroll-margin-top: 40px; }

.work-track {
  display: grid;
  gap: 1rem;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.panel {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--raise);
  padding: clamp(1.5rem, 3vw, 2.5rem);
}

.panel-featured {
  background:
    radial-gradient(520px 300px at 88% -20%, rgba(165, 139, 255, 0.16), transparent 65%),
    var(--raise);
}

.panel-meta {
  margin: 0 0 auto;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  padding-bottom: 1.6rem;
}
.panel-stars { color: var(--accent); padding-left: 0.7rem; }

.panel-title {
  margin: 0 0 0.6rem;
  font-size: clamp(1.7rem, 3.4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.panel-desc {
  margin: 0 0 1.4rem;
  color: var(--muted);
  font-size: 1rem;
  max-width: 34rem;
}

.panel-links { display: flex; gap: 1.6rem; margin-top: auto; }
.panel-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent);
  font-weight: 600;
  padding: 0.6rem 0;
}
.panel-link span { display: inline-block; transition: transform 0.2s var(--ease); }
.panel-link:hover span { transform: translateX(4px); }

.panel-more {
  background: var(--accent-soft);
  border-color: rgba(165, 139, 255, 0.3);
  justify-content: center;
}
.panel-title-big {
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  text-transform: uppercase;
}
.panel-title-big a { color: transparent; -webkit-text-stroke: 2px var(--accent); }
.panel-title-big a:hover { color: var(--accent); -webkit-text-stroke: 0; }
.panel-more .panel-desc { margin: 1rem 0 0; }

/* Horizontal pan mode (set by script.js on wide, motion-friendly viewports) */
body.pan-enabled .work-pin {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding-top: 68px;
}
body.pan-enabled .work-pin .section-head { width: 100%; }
body.pan-enabled .work-track {
  display: flex;
  align-items: stretch;
  gap: 2.5vw;
  max-width: none;
  width: max-content;
  padding-inline: clamp(1.25rem, 6vw, 5rem);
  /* will-change is toggled by ScrollTrigger only while the pin is active */
}
body.pan-enabled .panel {
  width: min(640px, 66vw);
  flex: none;
  min-height: min(58vh, 540px);
}
body.pan-enabled .panel-more { width: min(520px, 50vw); }

/* ---------- History timeline ---------- */

.timeline { position: relative; }

.tl-rail { display: none; }

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.history-row {
  display: grid;
  gap: 0.35rem;
  padding: 1.6rem 0;
}
.history-row + .history-row { border-top: 1px solid var(--line); }

.history-era {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
}

.history-row h3 {
  margin: 0 0 0.3rem;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.history-row p { margin: 0; color: var(--muted); max-width: 40rem; }

/* ---------- Links: big-type rows ---------- */

.links-section { padding-bottom: 3rem; }

.link-rows {
  margin-top: 0.5rem;
  border-top: 1px solid var(--line);
}

.link-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 1.25rem;
  max-width: var(--max);
  margin-inline: auto;
  padding: 1.4rem 1.25rem;
  border-bottom: 1px solid var(--line);
  transition: background-color 0.25s var(--ease);
}
.link-row:hover { background: var(--raise); }

.link-name {
  font-size: clamp(1.5rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  transition: color 0.25s var(--ease);
}
.link-row:hover .link-name { color: var(--accent); }

.link-handle {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
}

.link-arrow {
  font-size: 1.6rem;
  color: var(--accent);
  transition: transform 0.25s var(--ease);
}
.link-row:hover .link-arrow { transform: translateX(6px); }

/* ---------- Footer ---------- */

.site-footer {
  padding-top: 1.6rem;
  padding-bottom: 2.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: baseline;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer p { margin: 0; }
.site-footer .text-link { font-size: 0.9rem; }

/* Hollow type falls back to solid color where text-stroke is unsupported */
@supports not (-webkit-text-stroke: 1px black) {
  .hero-title em { color: var(--accent); -webkit-text-stroke: 0; }
  .panel-title-big a { color: var(--accent); }
  .marquee-track .hollow { color: var(--muted); }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .site-header, .btn, .panel-link span, .link-row, .link-name, .link-arrow {
    transition: none;
  }
}

/* ---------- Breakpoints ---------- */

@media (min-width: 640px) {
  .history-row { grid-template-columns: 170px 1fr; gap: 1.5rem; }
  .history-era { padding-top: 0.2rem; }

  .timeline { padding-left: 0; }
  .tl-rail {
    display: block;
    position: absolute;
    left: 190px;
    top: 12px;
    bottom: 12px;
    width: 2px;
  }
  .tl-line {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, var(--accent), rgba(165, 139, 255, 0.12));
    transform-origin: top;
  }
  .history-row { grid-template-columns: 170px 1fr; padding-left: 0; }
  .history-row > div { padding-left: 56px; }
}

@media (min-width: 768px) {
  .nav { display: flex; }
}

@media (min-width: 980px) {
  .hero-row { display: block; }
  .hero-card {
    position: absolute;
    top: 0.25rem;
    right: 1.25rem;
    width: min(250px, 21vw);
  }
}
