/* ==========================================================================
   Energomodernization — Instrument Deck
   One stylesheet: tokens, 5 themes, layout, components, motion, print.
   ========================================================================== */

/* ---------- fonts ---------- */
@import url("../fonts/fonts.css");

/* ---------- tokens ---------- */
:root {
  --font-display: "Unbounded", "Manrope", system-ui, sans-serif;
  --font-body: "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;

  --step--1: clamp(.78rem, .74rem + .16vw, .86rem);
  --step-0: clamp(.95rem, .9rem + .22vw, 1.05rem);
  --step-1: clamp(1.1rem, 1rem + .45vw, 1.32rem);
  --step-2: clamp(1.32rem, 1.1rem + .9vw, 1.8rem);
  --step-3: clamp(1.7rem, 1.3rem + 1.7vw, 2.6rem);
  --step-4: clamp(2rem, 1.4rem + 2.2vw, 3.3rem);
  --step-5: clamp(2.4rem, 1.6rem + 3.6vw, 4.6rem);

  --r-1: 8px; --r-2: 12px; --r-3: 18px; --r-4: 26px; --r-pill: 999px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;
  --wrap: 1280px;
  --ease: cubic-bezier(.22,.8,.24,1);
  --header-h: 74px;
}

/* Neon Deep Blue — default */
html[data-theme="neon"] {
  color-scheme: dark;
  --bg: #04060D;
  --bg-2: #070B16;
  --surface: #0A1020;
  --surface-2: #0D1628;
  --surface-3: #111D33;
  --line: rgba(126, 176, 255, .14);
  --line-2: rgba(126, 196, 255, .34);
  --text: #EAF3FF;
  --text-2: #A4BCD9;
  --text-3: #7087A6;
  --accent: #2FE8FF;
  --accent-2: #2E6BFF;
  --accent-3: #FF3EA5;
  --ok: #3AF5B0;
  --warn: #FFC24B;
  --bad: #FF6377;
  --accent-ink: #031018;
  --shadow: 0 30px 80px rgba(0, 0, 0, .5);
  --glow: 0 0 0 1px rgba(47, 232, 255, .26), 0 0 42px rgba(47, 232, 255, .12);
  --hero-aura: radial-gradient(52% 60% at 76% 18%, rgba(46, 107, 255, .26), transparent 70%),
               radial-gradient(40% 46% at 18% 12%, rgba(47, 232, 255, .16), transparent 72%),
               radial-gradient(46% 50% at 58% 96%, rgba(255, 62, 165, .12), transparent 74%);
  --grain-opacity: .05;
  --glass: rgba(8, 14, 28, .62);
}

/* Blueprint */
html[data-theme="blueprint"] {
  color-scheme: dark;
  --bg: #06182B;
  --bg-2: #071D33;
  --surface: #0A2340;
  --surface-2: #0D2A4B;
  --surface-3: #123458;
  --line: rgba(140, 200, 255, .18);
  --line-2: rgba(140, 210, 255, .4);
  --text: #E2F1FF;
  --text-2: #A9C8E4;
  --text-3: #7C9CBD;
  --accent: #5CC8FF;
  --accent-2: #A78BFA;
  --accent-3: #FFB86B;
  --ok: #5CF0C0;
  --warn: #FFD166;
  --bad: #FF7A8A;
  --accent-ink: #04121F;
  --shadow: 0 30px 80px rgba(0, 12, 24, .5);
  --glow: 0 0 0 1px rgba(92, 200, 255, .3), 0 0 42px rgba(92, 200, 255, .12);
  --hero-aura: radial-gradient(55% 60% at 80% 20%, rgba(167, 139, 250, .22), transparent 70%),
               radial-gradient(45% 50% at 15% 10%, rgba(92, 200, 255, .18), transparent 72%);
  --grain-opacity: .045;
  --glass: rgba(7, 27, 47, .66);
}

/* Solar */
html[data-theme="solar"] {
  color-scheme: light;
  --bg: #FAF5EC;
  --bg-2: #F6EFE2;
  --surface: #FFFFFF;
  --surface-2: #F4EDE1;
  --surface-3: #EDE3D2;
  --line: rgba(80, 62, 42, .14);
  --line-2: rgba(80, 62, 42, .3);
  --text: #1B1712;
  --text-2: #55493A;
  --text-3: #857662;
  --accent: #C2410C;
  --accent-2: #0E7490;
  --accent-3: #6D28D9;
  --ok: #15803D;
  --warn: #B45309;
  --bad: #B91C1C;
  --accent-ink: #FFFFFF;
  --shadow: 0 24px 60px rgba(70, 50, 25, .12);
  --glow: 0 0 0 1px rgba(194, 65, 12, .25), 0 14px 40px rgba(194, 65, 12, .1);
  --hero-aura: radial-gradient(55% 55% at 82% 18%, rgba(194, 65, 12, .1), transparent 70%),
               radial-gradient(45% 45% at 12% 8%, rgba(14, 116, 144, .09), transparent 72%);
  --grain-opacity: .03;
  --glass: rgba(250, 245, 236, .78);
}

/* Biosphere */
html[data-theme="biosphere"] {
  color-scheme: light;
  --bg: #F1F7F4;
  --bg-2: #E8F2ED;
  --surface: #FFFFFF;
  --surface-2: #EAF3EF;
  --surface-3: #DDEBE5;
  --line: rgba(20, 60, 48, .14);
  --line-2: rgba(20, 60, 48, .3);
  --text: #0F231E;
  --text-2: #3E5B52;
  --text-3: #6C877E;
  --accent: #0F766E;
  --accent-2: #4D7C0F;
  --accent-3: #0E7490;
  --ok: #15803D;
  --warn: #A16207;
  --bad: #B91C1C;
  --accent-ink: #FFFFFF;
  --shadow: 0 24px 60px rgba(10, 40, 30, .12);
  --glow: 0 0 0 1px rgba(15, 118, 110, .24), 0 14px 40px rgba(15, 118, 110, .1);
  --hero-aura: radial-gradient(55% 55% at 82% 18%, rgba(15, 118, 110, .12), transparent 70%),
               radial-gradient(45% 45% at 12% 8%, rgba(77, 124, 15, .1), transparent 72%);
  --grain-opacity: .03;
  --glass: rgba(241, 247, 244, .78);
}

/* Paper */
html[data-theme="paper"] {
  color-scheme: light;
  --bg: #FBF7EE;
  --bg-2: #F5EFE2;
  --surface: #FFFFFF;
  --surface-2: #F3ECDD;
  --surface-3: #E9DFCC;
  --line: rgba(50, 40, 30, .15);
  --line-2: rgba(50, 40, 30, .32);
  --text: #241F31;
  --text-2: #514A61;
  --text-3: #7E768F;
  --accent: #6D28D9;
  --accent-2: #0E7490;
  --accent-3: #B45309;
  --ok: #15803D;
  --warn: #B45309;
  --bad: #B91C1C;
  --accent-ink: #FFFFFF;
  --shadow: 0 24px 60px rgba(40, 30, 15, .12);
  --glow: 0 0 0 1px rgba(109, 40, 217, .25), 0 14px 40px rgba(109, 40, 217, .1);
  --hero-aura: radial-gradient(55% 55% at 82% 18%, rgba(109, 40, 217, .1), transparent 70%),
               radial-gradient(45% 45% at 12% 8%, rgba(180, 83, 9, .08), transparent 72%);
  --grain-opacity: .035;
  --glass: rgba(251, 247, 238, .8);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
[id] { scroll-margin-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: var(--hero-aura);
  opacity: .9;
  transition: opacity .4s var(--ease);
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='.6'/></svg>");
}
main, header, footer { position: relative; z-index: 2; }
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---------- utilities ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(18px, 4vw, 40px); }
.wrap--narrow { max-width: 880px; }
.mono { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; }
.mut { color: var(--text-2); }
.hide { display: none !important; }
.skip {
  position: fixed; left: 16px; top: -80px; z-index: 200;
  background: var(--accent); color: var(--accent-ink);
  padding: 12px 18px; border-radius: var(--r-2); font-weight: 700;
  transition: top .2s var(--ease);
}
.skip:focus { top: 12px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.grad {
  background: linear-gradient(104deg, var(--accent) 0%, var(--accent-2) 78%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
html[data-theme="solar"] .grad,
html[data-theme="biosphere"] .grad,
html[data-theme="paper"] .grad {
  background: none; color: var(--accent); -webkit-text-fill-color: var(--accent);
}

/* ---------- header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 100;
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.hdr__in { display: flex; align-items: center; gap: 18px; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 12px; flex: none; }
.brand__mark {
  width: 34px; height: 34px; color: var(--accent);
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 45%, transparent));
}
.brand__txt b { display: block; font-size: 12.5px; letter-spacing: .18em; font-weight: 800; white-space: nowrap; }
.brand__txt span { display: block; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .22em; color: var(--text-3); text-transform: uppercase; margin-top: 2px; }
.nav { display: flex; align-items: center; gap: 4px; margin-inline-start: 14px; }
.nav a { white-space: nowrap;
  position: relative; padding: 10px 12px; border-radius: var(--r-1);
  font-size: 13.5px; color: var(--text-2); transition: color .2s;
}
.nav a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.hdr__tools { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.themes { display: flex; gap: 7px; padding: 5px 8px; border: 1px solid var(--line); border-radius: var(--r-pill); }
.themes button {
  width: 12px; height: 12px; padding: 0; border-radius: 50%; border: 1px solid var(--line-2);
  transition: transform .2s var(--ease), box-shadow .2s;
}
.themes button:hover { transform: scale(1.2); }
.themes button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.lang { position: relative; }
.lang__btn {
  display: flex; align-items: center; gap: 6px; padding: 8px 12px;
  background: transparent; border: 1px solid var(--line); border-radius: var(--r-pill);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em;
}
.lang__btn svg { width: 10px; height: 10px; transition: transform .2s; }
.lang__btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.lang__list {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px; z-index: 120;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-2);
  box-shadow: var(--shadow); padding: 6px; display: none;
}
.lang__list.open { display: block; }
.lang__list a { display: flex; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: var(--r-1); font-size: 13px; }
.lang__list a:hover { background: var(--surface-2); }
.lang__list a span { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); letter-spacing: .1em; }
.hdr .btn { padding: 10px 16px; font-size: 13px; }
.burger { display: none; }

/* ---------- buttons ---------- */
.btn {
  --btn-bg: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 22px; border-radius: var(--r-pill); border: 1px solid var(--line-2);
  background: var(--btn-bg); font-weight: 700; font-size: 14px; letter-spacing: .01em;
  transition: transform .2s var(--ease), box-shadow .3s, border-color .2s, background .2s;
  white-space: nowrap;
}
.btn .ar { transition: transform .25s var(--ease); font-weight: 500; }
.btn:hover .ar { transform: translateX(4px); }
.btn--primary {
  border: 0; color: var(--accent-ink);
  background: linear-gradient(100deg, var(--accent), var(--accent-2) 92%);
  box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 26%, transparent), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn--primary:hover { transform: translateY(-1px); box-shadow: 0 16px 40px color-mix(in srgb, var(--accent) 34%, transparent); }
.btn--ghost { background: color-mix(in srgb, var(--surface) 55%, transparent); }
.btn--ghost:hover { border-color: var(--accent); box-shadow: var(--glow); }
.btn--link { border: 0; padding: 0; color: var(--accent); background: none; }
.btn--sm { padding: 10px 16px; font-size: 13px; }

/* ---------- hero ---------- */
.hero { position: relative; padding-block: clamp(40px, 6vw, 84px) clamp(32px, 5vw, 64px); overflow: clip; }
.hero__grid { display: grid; grid-template-columns: 1.3fr .95fr; gap: clamp(28px, 4vw, 64px); align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; color: var(--text-3);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 34px; height: 1px; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
h1, .h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--step-4); line-height: 1.04; letter-spacing: -.035em;
  margin-top: 18px; text-wrap: balance;
}
.hero .lead { margin-top: 20px; max-width: 54ch; font-size: var(--step-1); color: var(--text-2); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.metrics { display: flex; flex-wrap: wrap; gap: 12px 34px; margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line); }
.metrics div { display: flex; align-items: baseline; gap: 9px; }
.metrics b { font-family: var(--font-mono); font-size: 15px; color: var(--text); font-weight: 500; }
.metrics span { font-size: 11.5px; letter-spacing: .08em; color: var(--text-3); text-transform: uppercase; }

/* instrument panel */
.panel {
  position: relative; border: 1px solid var(--line-2); border-radius: var(--r-4);
  background:
    radial-gradient(80% 70% at 50% 0%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%),
    linear-gradient(160deg, var(--surface), var(--bg-2));
  box-shadow: var(--shadow); min-height: 470px; overflow: hidden;
}
.panel::before, .panel::after {
  content: ""; position: absolute; width: 18px; height: 18px; border: 1px solid var(--accent); opacity: .7;
}
.panel::before { left: 12px; top: 12px; border-right: 0; border-bottom: 0; border-radius: 8px 0 0 0; }
.panel::after { right: 12px; bottom: 12px; border-left: 0; border-top: 0; border-radius: 0 0 8px 0; }
.panel canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.panel__hud { position: absolute; left: 22px; right: 22px; display: flex; justify-content: space-between; gap: 10px; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }
.panel__hud--top { top: 22px; }
.panel__hud--bottom { bottom: 22px; }
.panel__hud b { color: var(--accent); font-weight: 500; }
.panel__cap { position: absolute; left: 22px; bottom: 52px; max-width: 76%; font-size: 11.5px; color: var(--text-2); line-height: 1.5; }
.chip {
  position: absolute; display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(8px);
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-2);
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.chip--a { top: 84px; right: 18px; }
.chip--b { bottom: 118px; left: 16px; }

/* ---------- marquee ---------- */
.marquee { border-block: 1px solid var(--line); padding-block: 14px; overflow: hidden; background: color-mix(in srgb, var(--surface) 40%, transparent); }
.marquee__track { display: flex; gap: 38px; width: max-content; animation: marquee 42s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee span { display: inline-flex; align-items: center; gap: 38px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; }
.marquee span::after { content: "◆"; color: var(--accent); font-size: 7px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
section { position: relative; }
.sec { padding-block: clamp(44px, 6vw, 88px); }
.sec--tight { padding-block: clamp(30px, 4vw, 56px); }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: clamp(28px, 4vw, 48px); }
.sec-head__l { max-width: 760px; }
.sec-head .mono { color: var(--text-3); display: block; margin-bottom: 12px; }
h2, .h2 { font-family: var(--font-display); font-weight: 500; font-size: var(--step-3); line-height: 1.1; letter-spacing: -.03em; text-wrap: balance; }
.sec-head p { margin-top: 12px; color: var(--text-2); max-width: 62ch; }
.sec-head .mono--right { flex: none; color: var(--text-3); white-space: nowrap; }

/* ---------- cards ---------- */
.grid { display: grid; gap: clamp(14px, 1.8vw, 22px); }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.card {
  position: relative; padding: clamp(20px, 2.4vw, 30px);
  background: linear-gradient(170deg, color-mix(in srgb, var(--surface) 94%, transparent), color-mix(in srgb, var(--bg-2) 88%, transparent));
  border: 1px solid var(--line); border-radius: var(--r-3);
  transition: transform .3s var(--ease), border-color .2s, box-shadow .3s;
  overflow: hidden;
}
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(60% 50% at 100% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%);
  opacity: 0; transition: opacity .35s;
}
.card:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow); }
.card:hover::after { opacity: 1; }
.card__num { font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; color: var(--accent); }
.card h3 { margin-top: 14px; font-size: var(--step-1); font-weight: 700; letter-spacing: -.01em; }
.grid.g-3 .card h3 { min-height: 2.6em; }
.grid.g-2 .card h3 { min-height: 1.3em; }
.card p { margin-top: 10px; color: var(--text-2); font-size: .94rem; }
.card__foot { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 9px; border: 1px solid var(--line); border-radius: var(--r-pill); color: var(--text-2);
}
.tag--ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.tag--warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.card__link { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; color: var(--accent); font-size: 13px; font-weight: 600; }
.card__link .ar { transition: transform .2s; }
.card:hover .card__link .ar { transform: translateX(4px); }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; }
.stat { background: var(--bg-2); padding: clamp(18px, 2vw, 28px); }
.stat b { display: block; font-family: var(--font-display); font-size: clamp(1.7rem, 2.6vw, 2.5rem); font-weight: 500; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat b i { font-style: normal; color: var(--accent); font-size: .55em; margin-left: 3px; }
.stat span { display: block; margin-top: 6px; font-size: 12px; color: var(--text-3); }
.stat small { display: block; margin-top: 10px; font-size: 10.5px; color: var(--text-3); opacity: .85; }

/* ---------- steps / gate ---------- */
.gate { counter-reset: gate; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; }
.gate__step { background: var(--bg-2); padding: 20px; position: relative; }
.gate__step::before {
  counter-increment: gate; content: "0" counter(gate);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; color: var(--accent);
}
.gate__step b { display: block; margin-top: 8px; font-size: 14px; }
.gate__step span { display: block; margin-top: 6px; font-size: 12px; color: var(--text-2); }
.gate__step:hover { background: var(--surface); }

/* ---------- split ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 64px); align-items: center; }
.split--wide { grid-template-columns: 1.15fr .85fr; }
.split h2 { font-size: var(--step-3); }
.split p { margin-top: 14px; color: var(--text-2); }
.ticks { margin-top: 22px; display: grid; gap: 10px; }
.ticks li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-2); }
.ticks li::before { content: "▸"; color: var(--accent); flex: none; }

/* figure / diagram */
.figure {
  position: relative; border: 1px solid var(--line); border-radius: var(--r-3);
  background: linear-gradient(160deg, var(--surface), var(--bg-2)); padding: 18px;
  box-shadow: var(--shadow); overflow: hidden;
}
.figure svg { width: 100%; height: auto; }
.figure figcaption { margin-top: 10px; font-size: 11px; color: var(--text-3); font-family: var(--font-mono); letter-spacing: .06em; }

/* ---------- table ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-3); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 620px; }
th, td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); }
th { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); font-weight: 500; background: var(--surface-2); }
td { color: var(--text-2); }
td b { color: var(--text); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }

/* ---------- quote ---------- */
.quote { border-left: 2px solid var(--accent); padding: 6px 0 6px clamp(18px, 3vw, 34px); }
.quote p { font-family: var(--font-display); font-weight: 400; font-size: var(--step-2); line-height: 1.35; letter-spacing: -.02em; }
.quote cite { display: block; margin-top: 14px; font-style: normal; font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }

/* ---------- accordion ---------- */
details {
  border: 1px solid var(--line); border-radius: var(--r-2); background: color-mix(in srgb, var(--surface) 60%, transparent);
  margin-bottom: 10px; overflow: hidden;
}
summary {
  list-style: none; cursor: pointer; padding: 16px 20px; font-weight: 600; font-size: 14.5px;
  display: flex; justify-content: space-between; gap: 16px; align-items: center;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-family: var(--font-mono); color: var(--accent); font-size: 16px; transition: transform .25s; }
details[open] summary::after { transform: rotate(45deg); }
details > div { padding: 0 20px 18px; color: var(--text-2); font-size: 14px; }
details[open] { border-color: var(--line-2); }

/* ---------- CTA band ---------- */
.cta-band {
  position: relative; overflow: hidden; border: 1px solid var(--line-2); border-radius: var(--r-4);
  background:
    radial-gradient(70% 120% at 90% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%),
    linear-gradient(120deg, var(--surface), var(--bg-2));
  padding: clamp(28px, 5vw, 64px);
  display: grid; grid-template-columns: 1.35fr .65fr; gap: 28px; align-items: center;
  box-shadow: var(--shadow);
}
.cta-band h2 { font-size: var(--step-3); }
.cta-band p { margin-top: 12px; color: var(--text-2); max-width: 52ch; }
.cta-band__actions { display: grid; gap: 10px; }

/* ---------- atlas teaser ---------- */
.atlas-teaser { display: grid; grid-template-columns: 1.2fr .8fr; border-radius: var(--r-4); overflow: hidden; border: 1px solid var(--line-2); box-shadow: var(--shadow); background: var(--surface); }
.atlas-teaser__fig { margin: 0; background: #04070e; border-right: 1px solid var(--line); }
.atlas-teaser__fig img { display: block; width: 100%; height: 100%; min-height: 300px; object-fit: cover; }


.atlas-teaser__body { padding: clamp(22px, 2.8vw, 40px); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.atlas-teaser__body h3 { font-family: var(--font-display); font-size: var(--step-2); font-weight: 500; letter-spacing: -.02em; }
.atlas-teaser__body p { margin-top: 8px; max-width: 58ch; color: #B6CCE6; font-size: 13.5px; }
.badge-demo {
  display: inline-flex; gap: 8px; align-items: center; margin-bottom: 12px;
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .14em; color: #FFD48A;
  border: 1px solid rgba(255, 212, 138, .4); background: rgba(255, 212, 138, .08);
  padding: 6px 10px; border-radius: var(--r-pill);
}

/* ---------- calculator ---------- */
.calc { display: grid; grid-template-columns: .95fr 1.05fr; gap: clamp(20px, 3vw, 40px); align-items: start; }
.calc__panel { border: 1px solid var(--line); border-radius: var(--r-3); padding: clamp(20px, 2.4vw, 30px); background: var(--surface); }
.field { display: grid; gap: 8px; margin-bottom: 20px; }
.field label { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; letter-spacing: .05em; color: var(--text-2); }
.field label output { font-family: var(--font-mono); font-size: 12px; color: var(--text); }
input[type="range"] { width: 100%; accent-color: var(--accent); height: 26px; }
input[type="text"], input[type="email"], select, textarea {
  width: 100%; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-2); font-size: 14px; transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
textarea { min-height: 110px; resize: vertical; }
.calc__out { border: 1px solid var(--line-2); border-radius: var(--r-3); padding: clamp(20px, 2.4vw, 30px); background: linear-gradient(160deg, var(--surface), var(--bg-2)); }
.calc__big { font-family: var(--font-display); font-size: clamp(2rem, 3.4vw, 3rem); letter-spacing: -.03em; font-weight: 500; }
.calc__big i { font-style: normal; color: var(--accent); }
.bar { margin-top: 16px; }
.bar__row { display: grid; grid-template-columns: 120px 1fr 78px; gap: 10px; align-items: center; font-size: 11.5px; color: var(--text-2); margin-bottom: 8px; }
.bar__track { height: 8px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.bar__fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .5s var(--ease); }
.bar__fill--muted { background: var(--text-3); }
.note { border-left: 2px solid var(--warn); background: color-mix(in srgb, var(--warn) 7%, transparent); padding: 12px 14px; border-radius: 0 var(--r-1) var(--r-1) 0; font-size: 11.5px; color: var(--text-2); }

/* ---------- forms ---------- */
.form { display: grid; gap: 16px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form .field { margin: 0; }
.form small { color: var(--text-3); font-size: 11px; }
.form .err { color: var(--bad); font-size: 11.5px; min-height: 14px; }
.form .ok { color: var(--ok); font-size: 13px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 12px; color: var(--text-2); }
.check input { margin-top: 3px; accent-color: var(--accent); }

/* ---------- footer ---------- */
.ftr { border-top: 1px solid var(--line); margin-top: clamp(28px, 4vw, 56px); padding-block: 48px 26px; background: color-mix(in srgb, var(--bg-2) 70%, transparent); }
.ftr__top { display: grid; grid-template-columns: 1.6fr .85fr .85fr .85fr 1.25fr; gap: 24px; }
.ftr h4 { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); margin-bottom: 14px; }
.ftr a { display: block; font-size: 13px; color: var(--text-2); padding-block: 4px; overflow-wrap: anywhere; }
.ftr a:hover { color: var(--accent); }
.ftr__brand p { font-size: 13px; color: var(--text-3); max-width: 34ch; margin-top: 12px; }
.ftr__bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 11px; color: var(--text-3); }
.ftr__bottom a { display: inline; }

/* ---------- reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js .reveal.on { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .nav { display: none; }
  .burger { display: grid; }
}
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; }
  .ftr__top { grid-template-columns: 1fr 1fr 1fr; }
  .panel { min-height: 400px; }
  .g-4 { grid-template-columns: repeat(2, 1fr); }
  .g-3 { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .gate { grid-template-columns: repeat(2, 1fr); }
  .split, .calc, .cta-band, .split--wide { grid-template-columns: 1fr; }
  .ftr__top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .g-3, .g-4, .form__row { grid-template-columns: 1fr; }
  .stats, .gate { grid-template-columns: 1fr; }
  .hdr .btn { display: none; }
  .brand__txt span { display: none; }
  .themes { display: none; }
  .sec-head { flex-direction: column; align-items: flex-start; }
  .ftr__top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
  .brand__txt b { font-size: 11px; letter-spacing: .12em; }
}

/* mobile drawer */
.drawer {
  position: fixed; inset: var(--header-h) 0 0 0; z-index: 99;
  background: var(--bg); border-top: 1px solid var(--line);
  padding: 28px clamp(18px, 4vw, 40px); display: none; overflow-y: auto;
}
.drawer.open { display: block; }
.drawer a { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); font-family: var(--font-display); font-size: 20px; }
.drawer .drawer__foot { margin-top: 24px; display: grid; gap: 10px; }

/* ---------- motion / contrast ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
@media (prefers-contrast: more) {
  :root { --line: currentColor; }
  .card, .panel, .figure, .calc__panel, .calc__out { box-shadow: none; }
  .grad { background: none; -webkit-text-fill-color: var(--text); color: var(--text); }
  body::before, body::after { display: none; }
}

/* ---------- print ---------- */
@media print {
  .hdr, .ftr, .skip, .burger, .drawer { display: none !important; }
  body { background: #fff; color: #000; }
  body::before, body::after { display: none; }
  .card, .figure, .panel { break-inside: avoid; border-color: #ccc; box-shadow: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9px; }
}

/* ---------- page-specific ---------- */
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  background: transparent; border: 1px solid var(--line); border-radius: 50%; color: var(--text);
}
.icon-btn svg { width: 18px; height: 18px; }

.hero--page { padding-block: clamp(44px, 6vw, 92px) clamp(30px, 4vw, 48px); }
.hero__grid--page { grid-template-columns: 1.25fr .75fr; align-items: end; }
.hero--page h1 { font-size: var(--step-4); max-width: 20ch; }
.hero__facts { display: grid; gap: 14px; padding-left: clamp(0px, 2vw, 26px); border-left: 1px solid var(--line); }
.fact { display: grid; gap: 2px; }
.fact b { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--accent); letter-spacing: .04em; }
.fact span { font-size: 11.5px; color: var(--text-3); }

.form-card { border: 1px solid var(--line); border-radius: var(--r-3); padding: clamp(20px, 2.6vw, 32px); background: var(--surface); box-shadow: var(--shadow); }
.form-legend { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); margin-bottom: 18px; }

.calc__label { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.calc__label output { font-family: var(--font-mono); color: var(--text); font-size: 12px; }
.out-row { display: flex; justify-content: space-between; gap: 12px; padding-block: 10px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-2); }
.out-row b { font-family: var(--font-mono); color: var(--text); font-weight: 500; }
.calc__unit { font-size: .5em; letter-spacing: 0; color: var(--text-3); margin-left: 6px; font-family: var(--font-body); }

/* atlas viewer */
body.viewer .hdr { position: sticky; }
.viewer-shell { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: calc(100svh - var(--header-h)); background: var(--bg); }
.viewer-bar { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; padding: 8px clamp(14px, 3vw, 28px); border-bottom: 1px solid var(--line); background: var(--surface); }
.viewer-bar label { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.viewer-bar .mono { color: var(--text-3); }
.viewer-bar .spacer { flex: 1; }
.viewer-bar .ctl { display: inline-flex; align-items: center; gap: 8px; }
.viewer-bar select { width: auto; min-width: 118px; padding: 7px 30px 7px 12px; font-size: 12px; border-radius: var(--r-pill); }
.viewer-bar .btn { padding: 7px 14px; font-size: 12px; }
.viewer-frame { position: relative; background: #03060c; }
.viewer-frame { overflow: hidden; }
.viewer-frame iframe { position: absolute; top: 0; left: 0; width: 1920px; height: 1080px; border: 0; display: block; transform-origin: 0 0; }
.viewer-legend { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px clamp(14px, 3vw, 28px); border-top: 1px solid var(--line); background: var(--surface); font-size: 11px; color: var(--text-3); }
.viewer-legend b { color: var(--text-2); font-weight: 600; }

/* page hero stacking (later rules win over .hero__grid--page) */
@media (max-width: 960px) {
  .hero__grid--page { grid-template-columns: 1fr; align-items: start; }
  .hero__facts { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 16px 0 0; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 680px) {
  .hero__facts { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .atlas-teaser { grid-template-columns: 1fr; }
  .atlas-teaser__fig { border-right: 0; border-bottom: 1px solid var(--line); }
  .atlas-teaser__fig img { min-height: 220px; }
}

.viewer-fallback { display: none; }
@media (max-width: 820px) {
  .viewer-frame { display: none; }
  .viewer-shell { grid-template-rows: auto auto 1fr auto; }
  .viewer-fallback { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: clamp(22px, 6vw, 36px); }
  .viewer-fallback p { color: var(--text-2); max-width: 48ch; }
}
