/* APEX site · base: tokens, type, chrome (loader, cursor, nav, menu), hero, marquee */
:root {
  --ink: #0b1312;
  --ink-2: #101b19;
  --ink-3: #16231f;
  --line: rgba(236, 229, 214, .12);
  --line-2: rgba(236, 229, 214, .24);
  --cream: #ece5d6;
  --cream-2: #cfc8b8;
  --dim: #9a968a;
  --gold: #e9ad4f;
  --mint: #72d1ae;
  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --pad: clamp(22px, 5.5vw, 88px);
  --ease: cubic-bezier(.2, .75, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ink); -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0; color: var(--cream); background: var(--ink);
  font-family: var(--display); font-size: clamp(15px, .95vw, 17px); line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: clip; font-optical-sizing: auto; /* clip, not hidden: hidden makes body a scroll container and breaks position:sticky */
}
body.is-loading, body.menu-open { overflow: hidden; }
body::after { /* film grain */
  content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--gold); color: var(--ink); }
.ic { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--gold); letter-spacing: -.01em; }
strong { font-weight: 600; color: var(--cream); }
.eyebrow { font-family: var(--mono); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--mint); margin: 0; }
.eyebrow--dim { color: var(--dim); }
.big {
  font-size: clamp(2rem, 4.6vw, 4.4rem); line-height: 1.02; letter-spacing: -.035em; font-weight: 700;
  margin: .3em 0 .9em; max-width: 17ch; text-wrap: balance;
}
.big em { padding-right: .06em; }

.section { position: relative; padding: clamp(110px, 17vh, 210px) var(--pad); }
.shead { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.shead__num { font-family: var(--mono); font-size: .68rem; color: var(--dim); border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 10px; }
.shead--row { display: grid; grid-template-columns: minmax(170px, auto) 1fr auto; align-items: end; gap: 34px; margin-bottom: 0; }
.shead--row > div { display: flex; gap: 14px; align-items: center; align-self: start; padding-top: 1em; }
.shead--row .big { margin: 0; font-size: clamp(1.7rem, 3.3vw, 3.3rem); max-width: 26ch; }

/* loader */
.loader { position: fixed; inset: 0; z-index: 200; background: var(--ink); display: grid; place-items: center; }
.loader__word { display: flex; overflow: hidden; font-size: clamp(4rem, 17vw, 13rem); font-weight: 800; letter-spacing: -.06em; line-height: .9; }
.loader__word span { display: inline-block; }
.loader__word span:nth-child(2) { color: var(--gold); }
.loader__count { position: absolute; right: var(--pad); bottom: 32px; font-family: var(--mono); font-size: .78rem; color: var(--dim); }

/* cursor (fine pointers only) */
.cursor { position: fixed; left: 0; top: 0; z-index: 150; pointer-events: none; opacity: 0; transition: opacity .3s; }
.cursor.is-on { opacity: 1; }
.cursor__dot { position: absolute; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--gold); }
.cursor__ring {
  position: absolute; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%; border: 1px solid var(--line-2);
  display: grid; place-items: center; transition: width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease), background .35s, border-color .35s;
}
.cursor.is-hover .cursor__ring { width: 60px; height: 60px; margin: -30px 0 0 -30px; border-color: var(--gold); }
.cursor.has-label .cursor__ring { width: 84px; height: 84px; margin: -42px 0 0 -42px; background: var(--gold); border-color: var(--gold); }
.cursor__label { font-family: var(--mono); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); opacity: 0; transition: opacity .2s; }
.cursor.has-label .cursor__label { opacity: 1; }
.cursor.has-label .cursor__dot { opacity: 0; }
@media (pointer: coarse) { .cursor { display: none; } }

/* nav */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 100; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 16px var(--pad); mix-blend-mode: difference;
}
/* The brand goes with the hero. The nav blends with `difference`, so past the hero
   the lion and the wordmark invert over whatever is behind them — a different
   picture in every section — and they read as debris sitting on the view rather
   than as branding. The chapter readout beside it already says where you are.
   Faded, not removed: the nav is a `1fr auto 1fr` grid, so leaving the column in
   place keeps the chapter centred on the page and the menu button where it was. */
.nav__brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: .08em; justify-self: start; font-size: .95rem; transition: opacity .55s var(--ease), visibility .55s var(--ease); }
body.past-hero .nav__brand { opacity: 0; visibility: hidden; pointer-events: none; }
.nav__brand img { width: 28px; height: 28px; border-radius: 50%; }
.nav__chapter { font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; display: flex; gap: 12px; }
.nav__num { color: var(--gold); }
.nav__menu {
  justify-self: end; display: inline-flex; align-items: center; gap: 12px; background: none; cursor: pointer;
  border: 1px solid var(--line-2); border-radius: 999px; padding: 8px 15px; font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
}
.nav__burger { display: grid; gap: 5px; width: 17px; }
.nav__burger i { display: block; height: 1.5px; background: currentColor; transition: transform .45s var(--ease); }
body.menu-open .nav__burger i:first-child { transform: translateY(3.25px) rotate(45deg); }
body.menu-open .nav__burger i:last-child { transform: translateY(-3.25px) rotate(-45deg); }

/* full-screen menu */
.menu {
  position: fixed; inset: 0; z-index: 95; background: var(--ink-2); display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px;
  padding: 110px var(--pad) 48px; clip-path: inset(0 0 100% 0); transition: clip-path .9s var(--ease); visibility: hidden;
}
body.menu-open .menu { clip-path: inset(0); visibility: visible; }
.menu__list { columns: 2; column-gap: 40px; align-self: center; }
.menu__list a {
  display: flex; align-items: baseline; gap: 16px; break-inside: avoid; text-decoration: none; color: var(--dim);
  font-size: clamp(1.25rem, 2.4vw, 2.3rem); font-weight: 600; letter-spacing: -.03em; line-height: 1.4; transition: color .3s, transform .45s var(--ease);
}
.menu__list a span { font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; color: var(--gold); }
.menu__list a:hover, .menu__list a:focus-visible { color: var(--cream); transform: translateX(10px); outline: none; }
.menu__side { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 24px; }
.menu__preview { width: min(62%, 320px); aspect-ratio: 1; border-radius: 50%; object-fit: cover; }
.menu__side p { font-family: var(--mono); font-size: .72rem; color: var(--dim); text-align: center; line-height: 1.9; margin: 0; }
.menu__side .menu__keys { font-size: .64rem; line-height: 1.7; max-width: 30ch; }
kbd { display: inline-block; min-width: 1.9em; padding: 1px 6px; border: 1px solid var(--line-2); border-radius: 5px; font-family: var(--mono); font-size: .9em; color: var(--cream-2); }

/* presenter mode's counter (js/motion.js): only shows for a moment after a key */
.present {
  position: fixed; right: var(--pad); bottom: 26px; z-index: 120; padding: 7px 13px; border: 1px solid var(--line-2); border-radius: 999px;
  background: rgba(11, 19, 18, .72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-family: var(--mono); font-size: .66rem; letter-spacing: .1em; color: var(--dim);
  opacity: 0; transform: translateY(8px); transition: opacity .35s var(--ease), transform .45s var(--ease); pointer-events: none;
}
.present.is-on { opacity: 1; transform: none; }
.present b { color: var(--gold); font-weight: 600; }

/* hero */
.hero {
  position: relative; min-height: 100svh; display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: clamp(30px, 5vw, 70px);
  padding: 130px var(--pad) 100px; overflow: hidden;
}
/* No gold pool behind the lion: it sat at 74% 54%, right under him, and read as
   an odd elliptical light rather than atmosphere. The light on him now comes from
   the stage (js/herofx.js), where the floor's pool sits under a beam you can see.
   Only the faint mint wash on the copy side is left here. */
.hero__glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(30% 36% at 12% 88%, rgba(114, 209, 174, .07), transparent 70%);
}
.hero__copy { position: relative; }
.hero__eyebrow { display: flex; align-items: center; }
.hero__eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); margin-right: 12px; animation: pulse 2.2s infinite; }
/* the live dot IS the Telegram mark: says "live" and "on Telegram" in one glyph */
.hero__eyebrow .dot--tg { width: 16px; height: 16px; background: none; flex: none; animation: pulse-tg 2.4s infinite; }
@keyframes pulse-tg {
  0% { box-shadow: 0 0 0 0 rgba(42, 171, 238, .5); }
  70% { box-shadow: 0 0 0 11px rgba(42, 171, 238, 0); }
  100% { box-shadow: 0 0 0 0 rgba(42, 171, 238, 0); }
}
.hero__title { font-size: clamp(2.8rem, 8vw, 8.4rem); line-height: .92; letter-spacing: -.05em; font-weight: 800; margin: .32em 0 .4em; }
.hero__title em { letter-spacing: -.03em; padding-right: .1em; }
/* no glow here: .line clips overflow, so a text-shadow shows up as a hard-edged box */
.hero__name { color: var(--gold); }
.line { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.line > span { display: inline-block; }
.hero__lede { max-width: 38ch; font-size: clamp(1rem, 1.2vw, 1.2rem); color: var(--cream-2); margin: 0; }
.hero__lede b { color: var(--gold); font-weight: 600; }
.hero__stats { display: flex; gap: clamp(24px, 4vw, 64px); margin: 42px 0 34px; }
.stat b { display: block; font-size: clamp(2rem, 3.4vw, 3.2rem); font-weight: 700; line-height: 1; letter-spacing: -.05em; }
.stat span { font-family: var(--mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.hero__credit { font-family: var(--mono); font-size: .72rem; color: var(--dim); margin: 0; }
.hero__credit span { color: var(--gold); margin: 0 6px; }
.hero__credit .tag {
  display: inline-block; margin-left: 9px; padding: 3px 10px; font-weight: 400; font-size: .67rem;
  color: var(--gold); border: 1px solid rgba(233, 173, 79, .32); border-radius: 999px;
}
/* the stage: the bubble sits up and left, APEX stands below it */
.hero__visual { position: relative; height: clamp(400px, 60vh, 600px); aspect-ratio: 44/58; width: auto; justify-self: center; }
/* no agent ring in the hero any more - see the note in js/render.js */
.hero__scroll {
  position: absolute; left: var(--pad); bottom: 30px; display: flex; align-items: center; gap: 14px; text-decoration: none;
  font-family: var(--mono); font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; color: var(--dim);
}
.hero__scroll i { position: relative; width: 52px; height: 1px; background: var(--line-2); overflow: hidden; }
.hero__scroll i::after { content: ""; position: absolute; inset: 0; background: var(--gold); animation: scan 2.2s var(--ease) infinite; }

/* marquee */
.marquee { border-block: 1px solid var(--line); padding: 18px 0; overflow: hidden; }
.marquee__track { display: flex; width: max-content; will-change: transform; }
.marquee__track > div { display: flex; align-items: center; gap: 34px; padding-right: 34px; }
.marquee__track span { display: inline-block; font-size: clamp(1.7rem, 3.8vw, 3.4rem); font-weight: 800; letter-spacing: -.04em; line-height: 1; color: transparent; -webkit-text-stroke: 1px var(--cream-2); }
.marquee__track span:nth-of-type(3n+1) { color: var(--cream); -webkit-text-stroke: 0; }
.marquee__track .ic { width: .9em; height: .9em; color: var(--gold); font-size: clamp(1rem, 1.8vw, 1.6rem); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(114, 209, 174, .55); } 70% { box-shadow: 0 0 0 12px rgba(114, 209, 174, 0); } 100% { box-shadow: 0 0 0 0 rgba(114, 209, 174, 0); } }
@keyframes scan { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

@media (max-width: 900px) {
  .nav__chapter { display: none; }
  .nav { grid-template-columns: 1fr 1fr; }
  .menu { grid-template-columns: 1fr; padding-top: 96px; }
  .menu__list { columns: 1; }
  .menu__side { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 104px; gap: 34px; }
  .hero__visual { width: min(100%, 360px); height: auto; aspect-ratio: 44/58; order: -1; margin-top: 4px; }
  .hero__credit .tag { margin: 8px 0 0; display: block; width: fit-content; }
  .hero__scroll { display: none; }
  .shead--row { grid-template-columns: 1fr; gap: 10px; }
  .shead--row > div { padding-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .loader, .cursor { display: none; }
}
