/* ============================================================
   ZeroLix — cinematic scroll film (Royal Pop architecture)
   Film mode is opt-in via html.cine (JS + motion + ≥768px).
   Default CSS = static stacked page: readable with no JS,
   reduced motion, or small viewports.
   ============================================================ */

:root {
  /* Obsidian + metallic palette (2026-06 luxury re-theme).
     Legacy names kept as aliases so any straggler rule still resolves. */
  --bg: #050505;
  --bg-2: #0b0b0b;
  --panel: rgba(11, 11, 11, 0.66);
  --ink: #ffffff;
  --muted: #a0a0a0;
  --muted-2: #8d8d8d;
  --silver: #c0c0c0;
  --titanium: #8d8d8d;
  --gold: #d4af37;
  --gold-bright: #e3c45c;
  --copper: #b87333;
  --blue: var(--gold);
  --cyan: var(--silver);
  --green: var(--gold);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

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

html { scroll-behavior: smooth; }
html.cine { scroll-behavior: auto; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Sora', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* film grain */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  background: url('textures/noise.png');
  opacity: 0.5;
}

::selection { background: rgba(212, 175, 55, 0.35); }

.mono { font-family: 'JetBrains Mono', monospace; }

a { color: var(--cyan); }

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

.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 200;
  background: var(--gold); color: #050505; padding: 0.6rem 1.2rem;
  border-radius: 0; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* ---------------- loader ---------------- */
#loader {
  position: fixed; inset: 0; z-index: 150;
  background: var(--bg);
  display: none;
  flex-direction: column;
  align-items: center; justify-content: center; gap: 1.2rem;
  transition: opacity 600ms var(--ease), visibility 600ms;
}
html.cine #loader { display: flex; }
#loader.hidden { opacity: 0; visibility: hidden; }
.loader-brand { font-weight: 700; letter-spacing: 0.35em; font-size: 0.95rem; }
.loader-brand b { color: var(--gold); font-weight: 700; }
#loader-bar {
  width: 180px; height: 1px; background: var(--border-strong);
  overflow: hidden; position: relative;
}
#loader-bar span {
  position: absolute; inset: 0; transform-origin: left;
  background: linear-gradient(90deg, var(--titanium), var(--gold));
  animation: loadsweep 900ms var(--ease) forwards;
}
@keyframes loadsweep { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.loader-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem; letter-spacing: 0.3em; color: var(--muted-2);
  text-transform: uppercase;
}

/* ---------------- header ---------------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.05rem clamp(1.25rem, 4vw, 3rem);
  background: linear-gradient(180deg, rgba(5, 5, 5, 0.85), rgba(5, 5, 5, 0));
}

.brand {
  font-weight: 700; font-size: 1.12rem; letter-spacing: -0.02em;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.brand span { color: var(--gold); }

.header-actions { display: flex; align-items: center; gap: 0.7rem; }

.lang-switch {
  display: inline-flex; gap: 0.1rem; padding: 0.18rem;
  border: 1px solid var(--border); border-radius: 0;
  background: rgba(255, 255, 255, 0.03);
}
.lang-btn {
  border: 0; border-radius: 0; background: transparent;
  color: var(--muted); cursor: pointer;
  font-family: 'JetBrains Mono', monospace; font-size: 0.7rem;
  padding: 0.32rem 0.6rem;
  transition: background-color 180ms var(--ease), color 180ms var(--ease);
}
.lang-btn.active { background: rgba(192, 192, 192, 0.14); color: var(--silver); }

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.55rem; border-radius: 0;
  font-size: 0.9rem; font-weight: 600; letter-spacing: 0.02em; text-decoration: none;
  border: 1px solid transparent; white-space: nowrap; cursor: pointer;
  transition: background-color 180ms var(--ease), border-color 180ms var(--ease),
              color 180ms var(--ease), transform 160ms var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--gold); border-color: var(--gold); color: #050505; }
.btn-primary:hover { background: var(--gold-bright); border-color: var(--gold-bright); }
.btn-ghost { border-color: var(--border-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--silver); }
.btn-sm { padding: 0.5rem 1.05rem; font-size: 0.8rem; }

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover, .btn-ghost:hover { transform: translateY(-1px); }
}

/* ---------------- hero (standalone 100vh) ---------------- */
.hero {
  min-height: 100dvh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 6.5rem 1.5rem 7rem;
  position: relative;
}

.hero-kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--cyan); margin-bottom: 1.6rem;
}

.hero h1 {
  font-size: clamp(2.7rem, 7.5vw, 5.6rem);
  font-weight: 700; letter-spacing: -0.035em; line-height: 1.04;
  margin-bottom: 1.4rem; text-wrap: balance;
}
.hero h1 .w2 { color: var(--silver); }
.hero h1 .w3 { color: var(--gold); }

.hero-tagline {
  color: var(--muted); font-weight: 300;
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  max-width: 46ch; margin: 0 auto 2.4rem;
}

.hero-ctas { display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; }

.scroll-cue {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  display: none; flex-direction: column; align-items: center; gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace; font-size: 0.62rem;
  letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted-2);
  pointer-events: none;
}
html.cine .scroll-cue { display: flex; }
.scroll-cue::after {
  content: ''; width: 1px; height: 34px;
  background: linear-gradient(180deg, var(--cyan), transparent);
  animation: cuedrip 2.2s var(--ease) infinite;
}
@keyframes cuedrip {
  0% { transform: scaleY(0); transform-origin: top; }
  55% { transform: scaleY(1); transform-origin: top; }
  56% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* hero load choreography (film mode only) */
html.cine .hero-kicker, html.cine .hero h1, html.cine .hero-tagline, html.cine .hero-ctas {
  opacity: 0; transform: translateY(20px);
  animation: rise 800ms var(--ease) forwards;
}
html.cine .hero h1 { animation-delay: 120ms; }
html.cine .hero-tagline { animation-delay: 240ms; }
html.cine .hero-ctas { animation-delay: 360ms; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------------- canvas (the film) ---------------- */
.canvas-wrap {
  position: fixed; inset: 0; z-index: 10;
  display: none; pointer-events: none;
  clip-path: circle(0% at 50% 50%);
  will-change: clip-path;
  background: var(--bg);
}
html.cine .canvas-wrap { display: block; }
#film-canvas { width: 100vw; height: 100vh; display: block; }

#dark-overlay {
  position: fixed; inset: 0; z-index: 20;
  background: rgba(2, 2, 2, 0.92);
  opacity: 0; pointer-events: none;
  display: none;
}
html.cine #dark-overlay { display: block; }

/* ---------------- film container + chapters ---------------- */
html.cine #film { position: relative; height: 1150vh; z-index: 30; }

.ch {
  /* static default: normal flow */
  position: relative;
  padding: clamp(4rem, 9vw, 7rem) clamp(1.25rem, 5vw, 3rem);
  display: flex; align-items: center;
  max-width: 1180px; margin: 0 auto;
}

html.cine .ch {
  position: fixed; inset: 0; max-width: none; margin: 0;
  padding: 0 clamp(1.5rem, 6vw, 5rem);
  opacity: 0; pointer-events: none;
  z-index: 35;
  will-change: opacity;
}
html.cine .ch a, html.cine .ch button { pointer-events: auto; }

.ch-inner { max-width: 540px; }
.ch.align-right { justify-content: flex-end; }
.ch.align-center { justify-content: center; text-align: center; }
.ch.align-center .ch-inner { max-width: 720px; }

/* directional vignettes for legibility over the film */
html.cine .ch.align-left::before,
html.cine .ch.align-right::before {
  content: ''; position: absolute; top: 0; bottom: 0; width: 58vw;
  pointer-events: none; z-index: -1;
}
html.cine .ch.align-left::before {
  left: 0;
  background: linear-gradient(to right, rgba(3,3,3,0.82), rgba(3,3,3,0.55) 40%, transparent);
}
html.cine .ch.align-right::before {
  right: 0;
  background: linear-gradient(to left, rgba(3,3,3,0.82), rgba(3,3,3,0.55) 40%, transparent);
}
html.cine .ch.align-center::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 62% 56% at 50% 50%, rgba(3,3,3,0.74), transparent);
  pointer-events: none; z-index: -1;
}

.ch-label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem; letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--cyan); margin-bottom: 1.1rem;
}

.ch-heading {
  font-size: clamp(1.8rem, 3.8vw, 3rem);
  font-weight: 700; letter-spacing: -0.03em; line-height: 1.12;
  margin-bottom: 1.1rem; text-wrap: balance;
}
.ch-heading em { font-style: normal; color: var(--gold); }
.hl { color: var(--gold); font-weight: 700; }

.ch-body {
  color: var(--muted); font-weight: 300;
  font-size: clamp(0.95rem, 1.3vw, 1.05rem);
  margin-bottom: 0.9rem; max-width: 56ch; text-wrap: pretty;
}
.ch-body strong { color: var(--ink); font-weight: 600; }

.ch-list { list-style: none; margin: 1.1rem 0 0.6rem; }
.ch-list li {
  display: flex; gap: 0.65rem; align-items: baseline;
  padding: 0.32rem 0; font-size: 0.92rem; font-weight: 300;
}
.ch-list li::before { content: '▸'; color: var(--gold); font-size: 0.78rem; }

.ch-ctas { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.4rem; }

.product-mark {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem; letter-spacing: 0.2em; color: var(--muted-2);
  display: block; margin-bottom: 0.4rem;
}

/* stats chapter */
.ch-stats .stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: clamp(1.2rem, 4vw, 3.5rem);
  width: 100%; max-width: 1050px; margin: 0 auto;
  text-align: center;
}
.stat-number {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(2.2rem, 5.2vw, 4rem); font-weight: 500;
  letter-spacing: -0.02em; line-height: 1;
  color: var(--ink);
}
.stat-number .unit { color: var(--gold); font-size: 0.5em; }
.stat-label {
  display: block; margin-top: 0.65rem;
  color: var(--muted); font-size: 0.85rem; font-weight: 300;
}

/* CTA chapter */
.ch-cta .ch-inner { max-width: 760px; }
.ch-cta .ch-heading { font-size: clamp(2.2rem, 5vw, 3.8rem); }
.mantra {
  margin-top: 2.6rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.78rem, 1.5vw, 0.95rem);
  letter-spacing: 0.22em; color: var(--muted);
}
.mantra b { color: var(--gold); font-weight: 500; }

/* ---------------- post-film dossier ---------------- */
.dossier {
  position: relative; z-index: 50;
  background: #050505;
  border-top: 1px solid var(--border);
}

.dossier-inner {
  max-width: 1200px; margin: 0 auto;
  padding: clamp(4.5rem, 9vw, 7.5rem) clamp(1.25rem, 4vw, 2.5rem);
}

.dossier h2 {
  font-size: clamp(1.95rem, 3.8vw, 3rem);
  font-weight: 700; letter-spacing: -0.03em; line-height: 1.07;
  margin-bottom: 1rem; text-wrap: balance;
}
.dossier h2 em, .dossier h2 .accent { font-style: normal; color: var(--gold); }

.dossier .lede {
  color: var(--muted); font-weight: 300; font-size: 1.05rem; line-height: 1.65; max-width: 58ch;
}

.dossier-head { margin-bottom: 2.8rem; max-width: 64ch; }

.dossier-section + .dossier-section { margin-top: clamp(5rem, 9vw, 7.5rem); }

/* acceleration matrix — ruled cards (matches audit "whole process" grid) */
.accel-panel {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--border); border: 0; border-radius: 0;
}
.accel-tier {
  background: #050505; padding: 1.85rem; position: relative;
  transition: background-color 220ms var(--ease);
}
.accel-tier::after {
  content: ''; position: absolute; left: 0; top: 0; height: 2px; width: 0;
  background: var(--gold); transition: width 260ms var(--ease);
}
@media (hover: hover) {
  .accel-tier:hover { background: rgba(212,175,55,0.05); }
  .accel-tier:hover::after { width: 100%; }
}
.tier-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase;
  display: block; margin-bottom: 0.7rem; color: var(--gold);
}
.accel-tier h3 { font-size: 1.02rem; font-weight: 600; margin-bottom: 1.1rem; line-height: 1.3; letter-spacing: -0.01em; }
.ac-list { list-style: none; }
.ac-list li {
  display: flex; gap: 0.6rem; align-items: baseline;
  padding: 0.36rem 0; font-size: 0.875rem; font-weight: 300; color: var(--muted);
}
.accel-tier:nth-child(1) .ac-list li::before { content: '◆'; color: var(--gold); font-size: 0.6rem; }
.accel-tier:nth-child(2) .ac-list li::before { content: '◇'; color: var(--muted-2); font-size: 0.6rem; }
.accel-tier:nth-child(3) .ac-list li::before { content: '◆'; color: var(--silver); font-size: 0.6rem; }

/* capabilities clusters */
.cap-clusters {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(2rem, 4vw, 3rem);
}
.cap-cluster > h3 {
  font-size: 1.02rem; padding-bottom: 0.85rem; margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-strong);
}
.cap-cluster > h3 span { color: var(--muted-2); font-weight: 400; font-size: 0.82rem; margin-left: 0.5rem; }
.cap-rows { list-style: none; }
.cap-row { display: flex; gap: 0.9rem; padding: 0.65rem 0; align-items: flex-start; }
.cap-row .ph { color: var(--cyan); font-size: 1.1rem; transform: translateY(3px); flex: 0 0 auto; }
.cap-row h4 { font-size: 0.92rem; font-weight: 600; }
.cap-row p { color: var(--muted); font-size: 0.8rem; font-weight: 300; line-height: 1.5; }

/* journey tabs */
.journey-tabs { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 2rem; }
.journey-tab {
  font-family: 'JetBrains Mono', monospace; font-size: 0.76rem;
  padding: 0.5rem 1.1rem; border-radius: 0;
  border: 1px solid var(--border-strong);
  background: transparent; color: var(--muted); cursor: pointer;
  transition: color 180ms var(--ease), background-color 180ms var(--ease),
              border-color 180ms var(--ease), transform 140ms var(--ease);
}
.journey-tab:active { transform: scale(0.96); }
.journey-tab.active { background: var(--gold); border-color: var(--gold); color: #050505; }
@media (hover: hover) { .journey-tab:hover { color: var(--ink); border-color: var(--silver); } }

/* journey flow — ruled cards (matches audit "whole process" grid) */
.journey-flow {
  display: none; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--border); border: 0;
}
.journey-flow.active { display: grid; animation: rise 400ms var(--ease) both; }
.j-step {
  position: relative; background: #050505; border: 0; border-radius: 0;
  padding: 1.85rem; display: flex; flex-direction: column; gap: 0.55rem;
  transition: background-color 220ms var(--ease);
}
.j-step::after {
  content: ''; position: absolute; left: 0; top: 0; height: 2px; width: 0;
  background: var(--gold); transition: width 260ms var(--ease);
}
@media (hover: hover) {
  .j-step:hover { background: rgba(212,175,55,0.05); }
  .j-step:hover::after { width: 100%; }
}
.j-label {
  font-family: 'JetBrains Mono', monospace; font-size: 0.66rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold);
}
.j-text { font-size: 0.9rem; font-weight: 500; line-height: 1.5; color: var(--ink); }

/* about strip */
.about-cols {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(2rem, 5vw, 3.5rem);
}
.about-col h3 {
  font-family: 'JetBrains Mono', monospace; font-size: 0.68rem;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--cyan);
  margin-bottom: 0.8rem;
}
.about-col p { color: var(--muted); font-weight: 300; font-size: 0.95rem; margin-bottom: 0.8rem; }
.about-col p strong { color: var(--ink); font-weight: 600; }

/* footer */
footer {
  position: relative; z-index: 50;
  border-top: 1px solid var(--border);
  background: #050505;
  padding: 3rem 0 2.4rem;
}
.footer-inner {
  max-width: 1180px; margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
  display: flex; justify-content: space-between; align-items: center;
  gap: 1.2rem; flex-wrap: wrap;
}
.footer-links { display: flex; gap: 1.6rem; flex-wrap: wrap; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 0.85rem; transition: color 180ms var(--ease); }
.footer-links a:hover { color: var(--gold); }
.footer-meta { font-size: 0.78rem; color: var(--muted-2); }
.footer-mantra { font-family: 'JetBrains Mono', monospace; font-size: 0.68rem; letter-spacing: 0.18em; color: var(--muted-2); }
.footer-mantra b { color: var(--gold); font-weight: 500; }

/* ---------------- responsive / static-mode niceties ---------------- */
@media (max-width: 1020px) {
  .accel-panel { grid-template-columns: 1fr; }
  .accel-tier + .accel-tier { border-left: none; border-top: 1px solid var(--border); }
  .journey-flow, .journey-flow.active { grid-template-columns: 1fr; }
  .j-step:first-child { border-radius: 0; }
  .j-step:last-child { border-radius: 0 0 14px 14px; }
  .j-step + .j-step { border-left: 1px solid var(--border); border-top: none; }
}

@media (max-width: 640px) {
  .header-actions .btn-ghost { display: none; }
  .ch-stats .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scroll-cue::after { animation: none; }
  .journey-flow.active { animation: none; }
  .btn:active, .journey-tab:active { transform: none; }
}
