/* Hallmark · macrostructure: Marquee Hero · H1 hero knobs: tally-led + oscilloscope, alignment=center
 * theme: custom · vibe: "late-night tally-light broadcast console" · paper: oklch(14% 0.008 50) · accent: oklch(65% 0.22 55)
 * display: Space Grotesk · body: Inter · mono: JetBrains Mono · axes: dark / geometric-sans / warm (on-air red ~55°)
 * nav: N5 floating pill · footer: Ft5 statement · studied: no · context: inferred (brand-aligned to the Android app)
 * genre: atmospheric · contrast: pass (40–41) · tokens: pass (48) · mobile: pass (34, 49, 50–57)
 * pre-emit critique: P5 H5 E5 S5 R5 V5 · v1.0.0
 *
 * Every colour below references a token. Translucent variants derive via color-mix() on a token — no raw oklch/hex.
 * Mono is the deliberate "instrument readout" register (brand + genre voice), used on labels/log/numerals only.
 */

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }                /* gate 34: clip, never hidden */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-copy);
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Two fixed warm blooms (atmospheric allowance, ≤ ~20% each, no animation). */
  background-image:
    radial-gradient(60% 50% at 18% -8%, var(--color-accent-soft), transparent 70%),
    radial-gradient(55% 45% at 95% 8%, color-mix(in oklch, var(--color-accent) 8%, transparent), transparent 72%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: var(--leading-tight); letter-spacing: var(--tracking-tight); margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ---- Focus is first-class: instant, visible, never animated ---- */
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ---- Layout ---- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: clamp(56px, 9vw, 116px); }
.measure { max-width: var(--measure); }

/* ---- Mono readout helpers ---- */
.mono {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--color-readout);
  font-weight: 500;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--space-xs);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--color-muted);
}
.eyebrow .pip { color: var(--color-accent-2); }

/* ===========================================================
   NAV · N5 floating pill (blur backdrop over the bloom)
   =========================================================== */
.nav {
  position: sticky;
  top: var(--space-sm);
  z-index: 50;
  margin-block: var(--space-sm) 0;
  padding-inline: var(--gutter);
}
.nav-pill {
  max-width: var(--maxw);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-xs) var(--space-xs) var(--space-xs) var(--space-lg);
  background: color-mix(in oklch, var(--color-paper-2) 72%, transparent);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border: var(--rule-hairline) solid var(--color-rule);
  border-radius: var(--radius-pill);
  box-shadow: 0 10px 30px -18px oklch(0% 0 0 / 0.7);
  min-width: 0;
}
.brand {
  display: inline-flex; align-items: center; gap: var(--space-sm);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  font-size: var(--text-lg);
  white-space: nowrap;
}
.brand .dot {
  width: 10px; height: 10px; border-radius: var(--radius-pill);
  background: var(--color-accent);
  box-shadow: 0 0 10px 1px var(--color-accent-soft);
  flex: none;
}
.nav-links {
  display: flex; align-items: center; gap: var(--space-xs);
}
.nav-links a {
  display: inline-flex; align-items: center;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-pill);
  color: var(--color-ink-2);
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;                         /* gate 49: never wrap */
  transition: color var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out);
}
.nav-links a:hover { color: var(--color-ink); background: var(--color-paper-3); }
.nav-links a:active { color: var(--color-accent-2); }
.nav-links .source {
  color: var(--color-accent-2);
  border: var(--rule-hairline) solid color-mix(in oklch, var(--color-accent) 45%, transparent);
}
.nav-links .source:hover { background: color-mix(in oklch, var(--color-accent) 14%, transparent); color: var(--color-accent-2); }

/* ---- Language switcher · flag icons (default: Bahasa Indonesia) ---- */
.lang {
  display: inline-flex; align-items: center; gap: var(--space-3xs);
  margin-left: var(--space-2xs);
  padding: var(--space-3xs);
  border-radius: var(--radius-pill);
  border: var(--rule-hairline) solid var(--color-rule-2);
}
.lang button {
  display: inline-flex; align-items: center; justify-content: center;
  padding: var(--space-2xs);
  border-radius: var(--radius-sm);
  line-height: 0;
  opacity: 0.5;
  transition: opacity var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.lang button:hover { opacity: 0.9; }
.lang button:active { opacity: 1; }
.lang button[aria-pressed="true"] { opacity: 1; box-shadow: 0 0 0 1.5px var(--color-accent); }
.lang button svg {
  width: 24px; height: 16px; display: block;
  border-radius: var(--space-3xs);
  box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--color-ink) 22%, transparent);
}

/* ===========================================================
   HERO · Marquee, centered (atmospheric loosens gate 6)
   =========================================================== */
.hero {
  text-align: center;
  /* gate 44a: bottom padding ≥ 1.3× top so the hero sits into the page */
  padding-block: clamp(40px, 7vw, 80px) clamp(64px, 12vw, 128px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}
.tally {
  display: inline-flex; align-items: center; gap: var(--space-sm);
  padding: var(--space-2xs) var(--space-md) var(--space-2xs) var(--space-sm);
  border-radius: var(--radius-pill);
  border: var(--rule-hairline) solid color-mix(in oklch, var(--color-accent) 40%, transparent);
  background: color-mix(in oklch, var(--color-accent) 8%, transparent);
}
.tally .led {
  width: 11px; height: 11px; border-radius: var(--radius-pill);
  background: var(--color-accent);
  box-shadow: 0 0 10px 2px var(--color-accent), 0 0 22px 4px var(--color-accent-soft);
  animation: tally-pulse 2.4s var(--ease-in-out) infinite;
}
.tally .label {
  font-family: var(--font-mono); font-size: var(--text-xs);
  letter-spacing: var(--tracking-mono); text-transform: uppercase;
  color: var(--color-accent-2); font-weight: 600;
}
@keyframes tally-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.hero h1 {
  font-size: var(--text-display);
  letter-spacing: var(--tracking-tighter);
  max-width: 12ch;
  overflow-wrap: anywhere;        /* gate 51 */
  min-width: 0;
}
.hero .lede {
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
  color: var(--color-ink-2);
  max-width: 52ch;
}
.hero .lede strong { color: var(--color-ink); font-weight: 600; }

/* oscilloscope — frozen broadcast trace, phosphor glow. Pure SVG, no fake chrome. */
.scope {
  width: 100%;
  max-width: 680px;
  margin-inline: auto;
  border-radius: var(--radius-lg);
  border: var(--rule-hairline) solid var(--color-rule);
  background: linear-gradient(180deg,
    color-mix(in oklch, var(--color-paper-2) 65%, transparent),
    color-mix(in oklch, var(--color-paper) 65%, transparent));
  padding: var(--space-md);
  overflow: hidden;
}
.scope svg { width: 100%; height: auto; }
.scope .trace {
  stroke: var(--color-accent); stroke-width: 2; fill: none;
  filter: drop-shadow(0 0 5px var(--color-accent)) drop-shadow(0 0 12px var(--color-accent-soft));
  animation: trace-breathe 3.6s var(--ease-in-out) infinite;
}
.scope .axis { stroke: var(--color-rule); stroke-width: 1; stroke-dasharray: 3 5; }
.scope .grid { stroke: color-mix(in oklch, var(--color-rule) 50%, transparent); stroke-width: 1; }
@keyframes trace-breathe {
  0%, 100% { opacity: 0.95; }
  50% { opacity: 0.6; }
}

/* quiet scroll cue (informational — no download CTA) */
.cue {
  display: inline-flex; align-items: center; gap: var(--space-xs);
  font-family: var(--font-mono); font-size: var(--text-xs);
  letter-spacing: var(--tracking-mono); text-transform: uppercase;
  color: var(--color-muted);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-pill);
  white-space: nowrap;
  transition: color var(--dur-base) var(--ease-out);
}
.cue:hover { color: var(--color-ink); }
.cue:active { color: var(--color-accent-2); }
.cue .arr { display: inline-block; transition: transform var(--dur-base) var(--ease-out); }
.cue:hover .arr { transform: translateY(3px); }

/* ===========================================================
   SECTION HEAD (mono label stacked above heading — gate 54)
   =========================================================== */
.section-head {
  display: flex; flex-direction: column; gap: var(--space-sm);
  margin-bottom: var(--space-2xl);
}
.section-head h2 {
  font-size: var(--text-2xl);
  letter-spacing: var(--tracking-tight);
  overflow-wrap: anywhere; min-width: 0;
}
.section-head .desc { color: var(--color-muted); max-width: 56ch; }

/* ===========================================================
   WHAT IT IS · narrow statement
   =========================================================== */
.statement {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.25rem, 2.4vw + 0.4rem, 1.9rem);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  color: var(--color-ink);
  max-width: 20ch;
  overflow-wrap: anywhere;        /* gate 51 */
  min-width: 0;
}
.statement em { font-style: normal; color: var(--color-accent-2); }   /* gate 38a: roman, not italic */
.statement-wrap { display: grid; gap: var(--space-lg); }
.statement-wrap p.body { color: var(--color-muted); max-width: 52ch; }

/* ===========================================================
   FEATURES · console-panel grid (elevated cards, no hairlines-on-paper)
   =========================================================== */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));   /* gate 50 */
  gap: var(--space-md);
}
.feature {
  background: var(--color-paper-2);
  border: var(--rule-card) solid var(--color-rule-2);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex; flex-direction: column; gap: var(--space-sm);
  min-width: 0;
  transition: transform var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}
.feature:hover {
  transform: translateY(-2px);                 /* one coherent "raise" — gate 13 */
  border-color: var(--color-rule);
  box-shadow: 0 16px 40px -24px color-mix(in oklch, var(--color-accent) 55%, transparent);
}
.feature:active { transform: translateY(0); }
.feature .ch {
  display: inline-flex; align-items: center; gap: var(--space-xs);
  font-family: var(--font-mono); font-size: var(--text-xs);
  letter-spacing: var(--tracking-mono); text-transform: uppercase;
  color: var(--color-readout);
}
.feature .ch i {
  width: 6px; height: 6px; border-radius: var(--radius-pill);
  background: var(--color-accent); opacity: 0.9; font-style: normal; flex: none;
}
.feature h3 {
  font-size: var(--text-lg);
  letter-spacing: var(--tracking-tight);
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--color-ink);
}
.feature p { color: var(--color-ink-2); font-size: var(--text-sm); line-height: var(--leading-snug); }

/* ===========================================================
   HOW IT WORKS · pipeline (4 steps)
   =========================================================== */
.pipeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-md);
}
.step {
  background: var(--color-paper-2);
  border: var(--rule-card) solid var(--color-rule-2);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex; flex-direction: column; gap: var(--space-sm);
  min-width: 0;
}
.step .num {
  font-family: var(--font-mono); font-size: var(--text-xs);
  letter-spacing: var(--tracking-mono); color: var(--color-accent-2);
  font-weight: 600;
}
.step h3 {
  font-size: var(--text-base);
  font-family: var(--font-body); font-weight: 600;
  letter-spacing: 0;
  color: var(--color-ink);
}
.step p { color: var(--color-ink-2); font-size: var(--text-sm); line-height: var(--leading-snug); }

/* ===========================================================
   CHANGELOG · transmission log (mono, paper-2 panel)
   =========================================================== */
.log {
  background: var(--color-paper-2);
  border: var(--rule-card) solid var(--color-rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.log-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-bottom: var(--rule-hairline) solid var(--color-rule);
  background: color-mix(in oklch, var(--color-paper) 55%, transparent);
}
.log-bar .title {
  font-family: var(--font-mono); font-size: var(--text-xs);
  letter-spacing: var(--tracking-mono); text-transform: uppercase;
  color: var(--color-readout); font-weight: 600;
  display: inline-flex; align-items: center; gap: var(--space-sm);
}
.log-bar .title i {
  width: 8px; height: 8px; border-radius: var(--radius-pill);
  background: var(--color-accent); box-shadow: 0 0 8px 1px var(--color-accent-soft);
  font-style: normal; flex: none;
}
.log-bar .meta {
  font-family: var(--font-mono); font-size: var(--text-xs);
  letter-spacing: var(--tracking-mono); color: var(--color-readout);
}
.log-body { padding: var(--space-lg); display: grid; gap: var(--space-2xl); }
.log-release { display: grid; gap: var(--space-md); }
.log-release .ver {
  display: inline-flex; align-items: baseline; gap: var(--space-sm); flex-wrap: wrap;
  font-family: var(--font-mono);
}
.log-release .ver b { color: var(--color-accent-2); font-size: var(--text-lg); font-weight: 700; }
.log-release .ver span { color: var(--color-readout); font-size: var(--text-xs); letter-spacing: var(--tracking-mono); }
.log-release ul { display: grid; gap: var(--space-xs); }
.log-release li {
  position: relative;
  padding-left: var(--space-lg);
  color: var(--color-ink-2);
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
}
.log-release li::before {
  content: ">";
  position: absolute; left: 0; top: 0;
  font-family: var(--font-mono); color: var(--color-accent); font-weight: 700;
}
.log-release li b { color: var(--color-ink); font-weight: 600; }
.log-release .note {
  color: var(--color-muted); font-size: var(--text-xs);
  font-family: var(--font-mono); letter-spacing: 0.02em;
  margin-top: var(--space-xs);
}

/* ===========================================================
   FOOTER · Ft5 statement
   =========================================================== */
.footer {
  border-top: var(--rule-hairline) solid var(--color-rule);
  margin-top: clamp(40px, 8vw, 96px);
  padding-block: clamp(48px, 8vw, 88px) var(--space-2xl);
}
.footer .closing {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3.6vw + 0.5rem, 2.6rem);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  max-width: 18ch;
  overflow-wrap: anywhere; min-width: 0;
}
.footer .closing em { font-style: normal; color: var(--color-accent-2); }   /* gate 38a */
.footer-meta {
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: var(--rule-hairline) solid var(--color-rule-2);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--space-md);
  font-family: var(--font-mono); font-size: var(--text-xs);
  letter-spacing: var(--tracking-mono); text-transform: uppercase;
  color: var(--color-readout);
}
.footer-meta .brand-mark { display: inline-flex; align-items: center; gap: var(--space-xs); white-space: nowrap; }
.footer-meta .brand-mark i {
  width: 8px; height: 8px; border-radius: var(--radius-pill);
  background: var(--color-accent); box-shadow: 0 0 8px 1px var(--color-accent-soft);
  font-style: normal; flex: none;
}
.footer-meta .signoff { display: inline-flex; align-items: center; gap: var(--space-xs); }
.footer-meta .signoff i {
  width: 7px; height: 7px; border-radius: var(--radius-pill);
  background: var(--color-faint); font-style: normal; flex: none;
}

/* ===========================================================
   Entrance · fade-in only (atmospheric). Reduced-motion: instant.
   =========================================================== */
.reveal { opacity: 0; transform: translateY(8px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
.reveal.is-in { opacity: 1; transform: none; }

/* ===========================================================
   Responsive · verified at 320 / 375 / 414 / 768
   =========================================================== */
@media (max-width: 860px) {
  .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .nav-links .anchor { display: none; }     /* keep wordmark + Source only on small phones */
  .pipeline { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { max-width: 10ch; }
  .footer-meta { justify-content: flex-start; }
}

/* ===========================================================
   Reduced motion · collapse to instant (≤150ms crossfade)
   =========================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .tally .led, .scope .trace { animation: none; }
}

/* ===========================================================
   Touch / coarse pointer · drop hover-only transforms
   =========================================================== */
@media (hover: none) {
  .feature:hover { transform: none; box-shadow: none; }
  .cue:hover .arr { transform: none; }
}
