/* ============================================================
   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 {
  --bg: #05080f;
  --bg-2: #0a0e1a;
  --panel: rgba(13, 19, 34, 0.66);
  --ink: #e8eaf0;
  --muted: #9aa3b8;
  --muted-2: #828ca3;
  --blue: #1a6cf5;
  --cyan: #00d4ff;
  --green: #34ffa1;
  --border: rgba(255, 255, 255, 0.09);
  --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(26, 108, 245, 0.45); }

.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(--blue); color: #fff; padding: 0.6rem 1.2rem;
  border-radius: 8px; 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(--cyan); 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(--blue), var(--cyan));
  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.1rem clamp(1.25rem, 4vw, 3rem);
  background: linear-gradient(180deg, rgba(5, 8, 15, 0.85), rgba(5, 8, 15, 0));
}

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

.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: 100px;
  background: rgba(255, 255, 255, 0.03);
}
.lang-btn {
  border: 0; border-radius: 100px; 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(0, 212, 255, 0.13); color: var(--cyan); }

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.55rem; border-radius: 8px;
  font-size: 0.9rem; font-weight: 600; 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(--blue); color: #fff; }
.btn-primary:hover { background: #1558d4; }
.btn-ghost { border-color: var(--border-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--cyan); }
.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 4rem;
  position: relative;
  background:
    radial-gradient(ellipse 50% 42% at 50% 18%, rgba(26, 108, 245, 0.16), transparent),
    radial-gradient(ellipse 30% 26% at 78% 70%, rgba(0, 212, 255, 0.07), transparent);
}

.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: #7aa9ff; }
.hero h1 .w3 { color: var(--cyan); }

.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);
}
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;
  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(3, 5, 10, 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,5,10,0.82), rgba(3,5,10,0.55) 40%, transparent);
}
html.cine .ch.align-right::before {
  right: 0;
  background: linear-gradient(to left, rgba(3,5,10,0.82), rgba(3,5,10,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,5,10,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(--cyan); }

.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(--cyan); 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(--cyan); 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(--cyan); font-weight: 500; }

/* ---------------- post-film dossier ---------------- */
.dossier {
  position: relative; z-index: 50;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 14%);
  border-top: 1px solid var(--border);
}
html.cine .dossier { box-shadow: 0 -40px 80px rgba(3, 5, 10, 0.9); }

.dossier-inner {
  max-width: 1180px; margin: 0 auto;
  padding: clamp(4rem, 8vw, 7rem) clamp(1.25rem, 4vw, 2.5rem);
}

.dossier h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  font-weight: 700; letter-spacing: -0.025em; line-height: 1.15;
  margin-bottom: 0.9rem; text-wrap: balance;
}

.dossier .lede {
  color: var(--muted); font-weight: 300; font-size: 1.02rem; max-width: 60ch;
}

.dossier-head { margin-bottom: 2.6rem; }

.dossier-section + .dossier-section { margin-top: clamp(4rem, 8vw, 6.5rem); }

/* acceleration matrix */
.accel-panel {
  display: grid; grid-template-columns: 1.25fr 1fr 1fr;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-strong);
  border-radius: 14px; overflow: hidden;
}
.accel-tier { padding: 1.8rem 1.6rem; }
.accel-tier + .accel-tier { border-left: 1px solid var(--border); }
.tier-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.64rem; letter-spacing: 0.16em; text-transform: uppercase;
  display: block; margin-bottom: 0.5rem; color: var(--muted-2);
}
.accel-tier:first-child .tier-label { color: var(--green); }
.accel-tier h3 { font-size: 1rem; margin-bottom: 1.1rem; line-height: 1.35; }
.ac-list { list-style: none; }
.ac-list li {
  display: flex; gap: 0.6rem; align-items: baseline;
  padding: 0.34rem 0; font-size: 0.89rem; font-weight: 300;
}
.accel-tier:nth-child(1) .ac-list li::before { content: '◆'; color: var(--green); font-size: 0.62rem; }
.accel-tier:nth-child(2) .ac-list li::before { content: '◇'; color: var(--muted-2); font-size: 0.62rem; }
.accel-tier:nth-child(3) .ac-list li::before { content: '◆'; color: #7aa9ff; font-size: 0.62rem; }

/* 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: 100px;
  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(--blue); border-color: var(--blue); color: #fff; }
@media (hover: hover) { .journey-tab:hover { color: var(--ink); border-color: #7aa9ff; } }

.journey-flow { display: none; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.journey-flow.active { display: grid; animation: rise 400ms var(--ease) both; }
.j-step {
  position: relative; background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border); padding: 1.3rem 1.1rem;
  display: flex; flex-direction: column; gap: 0.4rem;
}
.j-step:first-child { border-radius: 14px 0 0 14px; }
.j-step:last-child { border-radius: 0 14px 14px 0; background: linear-gradient(165deg, rgba(52,255,161,0.07), rgba(255,255,255,0.025) 60%); }
.j-step + .j-step { border-left: none; }
.j-label {
  font-family: 'JetBrains Mono', monospace; font-size: 0.6rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-2);
}
.j-step:first-child .j-label { color: #7aa9ff; }
.j-step:last-child .j-label { color: var(--green); }
.j-text { font-size: 0.84rem; font-weight: 500; line-height: 1.45; }

/* 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: #04060c;
  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(--cyan); }
.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(--cyan); 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: 14px 14px 0 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; }
}
