/* ==========================================================================
   XTO | Frontier AI Lab · main stylesheet
   ========================================================================== */

/* Dark is the default theme. The terminal stays dark in light mode too. */
:root,
[data-theme="light"] .terminal {
  --bg: #02040a;
  --bg-2: #050a13;
  --bg-3: #08111d;
  --bg-rgb: 2, 4, 10;
  --bg-2-rgb: 5, 10, 19;
  --bg-deep: #010207;
  --panel: rgba(10, 22, 34, 0.55);
  --panel-solid: #0a1522;
  --card: rgba(8, 17, 29, 0.5);
  --card-grad: linear-gradient(180deg, rgba(12, 26, 40, 0.8), rgba(4, 9, 16, 0.9));
  --card-grad-soft: linear-gradient(180deg, rgba(10, 22, 34, 0.6), rgba(4, 9, 16, 0.4));
  --form-grad: linear-gradient(180deg, rgba(10, 22, 34, 0.75), rgba(3, 8, 14, 0.85));
  --line: rgba(120, 255, 220, 0.12);
  --line-strong: rgba(120, 255, 220, 0.28);
  --grid-line: rgba(120, 255, 220, 0.045);
  --text: #e8f4f2;
  --text-strong: #fff;
  --text-dim: #b8cccc;
  --muted: #7f9799;
  --ghost-text: rgba(232, 244, 242, 0.14);
  --placeholder: #4d6264;
  --accent: #19f0a6;
  --accent-2: #36d6ff;
  --accent-3: #6b7bff;
  --warn: #ffb547;
  --err: #ff6b8a;
  --err-rgb: 255, 107, 138;
  --err-text: #ff8aa2;
  --err-status: #ffd0da;
  --sel-bg: rgba(25, 240, 166, 0.35);
  --grad: linear-gradient(90deg, #19f0a6 0%, #36d6ff 55%, #6b7bff 100%);
  --grad-text: var(--grad);
  --grad-soft: linear-gradient(135deg, rgba(25, 240, 166, 0.16), rgba(54, 214, 255, 0.08) 50%, rgba(107, 123, 255, 0.14));
  --glow: 0 0 24px rgba(25, 240, 166, 0.35), 0 0 60px rgba(54, 214, 255, 0.15);
  --noise-opacity: 0.05;
  --logo-filter: none;

  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f4f7f6;
  --bg-2: #eaf1ef;
  --bg-3: #e1ebe8;
  --bg-rgb: 244, 247, 246;
  --bg-2-rgb: 234, 241, 239;
  --bg-deep: #e4ece9;
  --panel: rgba(255, 255, 255, 0.6);
  --panel-solid: #ffffff;
  --card: rgba(255, 255, 255, 0.62);
  --card-grad: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(242, 247, 245, 0.88));
  --card-grad-soft: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.45));
  --form-grad: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 250, 249, 0.9));
  --line: rgba(6, 64, 54, 0.12);
  --line-strong: rgba(6, 64, 54, 0.24);
  --grid-line: rgba(6, 64, 54, 0.06);
  --text: #0a1a1c;
  --text-strong: #02080a;
  --text-dim: #34494c;
  --muted: #5a6f72;
  --ghost-text: rgba(10, 26, 28, 0.13);
  --placeholder: #8a9b9d;
  --accent: #047857;
  --accent-2: #0369a1;
  --accent-3: #4f46e5;
  --warn: #b45309;
  --err: #d9365b;
  --err-rgb: 217, 54, 91;
  --err-text: #c02648;
  --err-status: #8f1330;
  --sel-bg: rgba(4, 120, 87, 0.2);
  --grad-text: linear-gradient(90deg, #04966a 0%, #0284c7 55%, #4f46e5 100%);
  --grad-soft: linear-gradient(135deg, rgba(25, 240, 166, 0.14), rgba(54, 214, 255, 0.08) 50%, rgba(107, 123, 255, 0.12));
  --glow: 0 0 18px rgba(4, 150, 106, 0.22), 0 0 44px rgba(3, 105, 161, 0.1);
  --noise-opacity: 0.035;
  --logo-filter: invert(1) hue-rotate(180deg);

  color-scheme: light;
}

:root {
  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --container: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 14px;
  --radius-lg: 22px;
  --nav-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.08; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--sel-bg); color: var(--text-strong); }

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

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 1000;
  padding: 10px 16px;
  background: var(--accent);
  color: #001a10;
  font-weight: 600;
  border-radius: 8px;
  transform: translateY(-150%);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: none; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.grad {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mono { font-family: var(--font-mono); }

/* ---------- Global atmosphere ---------- */

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  opacity: var(--noise-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.cursor-glow {
  pointer-events: none;
  position: fixed;
  top: 0; left: 0;
  z-index: 1;
  width: 520px; height: 520px;
  margin: -260px 0 0 -260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(25, 240, 166, 0.07), rgba(54, 214, 255, 0.03) 40%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s;
  will-change: transform;
}
.has-pointer .cursor-glow { opacity: 1; }

/* ---------- Boot sequence ---------- */

.boot {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  place-items: center;
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  transition: opacity 0.6s var(--ease), visibility 0.6s;
}
.js .boot { display: grid; }
.boot.is-done { opacity: 0; visibility: hidden; }
.boot__inner { width: min(320px, 80vw); }
.boot__logo { width: 120px; margin: 0 auto 28px; opacity: 0.95; }
.boot__bar { height: 2px; background: rgba(25, 240, 166, 0.12); overflow: hidden; margin: 14px 0 10px; }
.boot__bar span { display: block; height: 100%; width: 0; background: var(--grad); box-shadow: var(--glow); transition: width 0.25s linear; }
.boot__row { display: flex; justify-content: space-between; color: var(--muted); }
.boot__row b { color: var(--accent); font-weight: 500; }

/* ---------- Navigation ---------- */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition: background 0.35s, border-color 0.35s, backdrop-filter 0.35s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled,
.nav.is-open {
  background: rgba(var(--bg-rgb), 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nav__logo img { width: 104px; height: auto; }
.nav__links { display: flex; align-items: center; gap: 4px; }
.nav__links a {
  position: relative;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text-dim);
  border-radius: 8px;
  transition: color 0.2s;
}
.nav__links a:hover,
.nav__links a.is-active { color: var(--text-strong); }
.nav__links a.is-active:not(.nav__cta)::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 2px;
  height: 1px;
  background: var(--grad);
  box-shadow: var(--glow);
}
.nav__cta { margin-left: 12px; }
.nav__links a.nav__cta,
.nav__links a.nav__cta:hover { color: #fff; }
.nav__toggle {
  display: none;
  width: 44px; height: 44px;
  cursor: pointer;
  position: relative;
}
.nav__toggle span,
.nav__toggle span::before,
.nav__toggle span::after {
  position: absolute;
  left: 50%;
  width: 18px; height: 1.5px;
  margin-left: -9px;
  background: var(--text);
  transition: transform 0.3s var(--ease), opacity 0.2s;
}
.nav__toggle span { top: 50%; }
.nav__toggle span::before,
.nav__toggle span::after { content: ""; left: 0; margin: 0; }
.nav__toggle span::before { transform: translateY(-6px); }
.nav__toggle span::after { transform: translateY(6px); }
.nav.is-open .nav__toggle span { background: transparent; }
.nav.is-open .nav__toggle span::before { transform: rotate(45deg); }
.nav.is-open .nav__toggle span::after { transform: rotate(-45deg); }

/* Theme toggle: sun morphs into a crescent moon */
.nav__links { margin-left: auto; }
.theme-toggle {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  margin-left: 6px;
  padding: 0;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.3s, filter 0.4s var(--ease);
}
.theme-toggle:hover { color: var(--accent); }

/* icon buttons: chamfered plates with a gradient edge that charge up on hover */
.theme-toggle,
.nav__toggle {
  --cut: 9px;
  isolation: isolate;
  border: 0;
  border-radius: 0;
  background: none;
}
.theme-toggle::before,
.theme-toggle::after,
.nav__toggle::before,
.nav__toggle::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  pointer-events: none;
}
.theme-toggle::before,
.nav__toggle::before { background: var(--grad); opacity: 0.4; transition: opacity 0.35s; }
.theme-toggle::after,
.nav__toggle::after {
  inset: 1px;
  --cut: 8.6px;
  background:
    linear-gradient(135deg, rgba(25, 240, 166, 0.2), rgba(54, 214, 255, 0.1) 60%, rgba(107, 123, 255, 0.16)) no-repeat 0 0 / 0% 100%,
    rgba(var(--bg-rgb), 0.65);
  transition: background-size 0.5s var(--ease);
}
.theme-toggle:hover,
.nav__toggle:hover { filter: drop-shadow(0 0 12px rgba(25, 240, 166, 0.35)); }
.theme-toggle:hover::before,
.nav__toggle:hover::before,
.nav.is-open .nav__toggle::before { opacity: 1; }
.theme-toggle:hover::after,
.nav__toggle:hover::after,
.nav.is-open .nav__toggle::after { background-size: 100% 100%, auto; }
[data-theme="light"] .theme-toggle::before,
[data-theme="light"] .nav__toggle::before { opacity: 0.65; }
.theme-toggle svg { width: 20px; height: 20px; overflow: visible; }
.theme-toggle__core,
.theme-toggle__cut,
.theme-toggle__rays {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.6s var(--ease), opacity 0.4s var(--ease);
}
/* dark: moon */
.theme-toggle__core { transform: scale(1.45); }
.theme-toggle__cut { transform: none; }
.theme-toggle__rays { transform: rotate(-60deg) scale(0.4); opacity: 0; }
/* light: sun */
[data-theme="light"] .theme-toggle__core { transform: none; }
[data-theme="light"] .theme-toggle__cut { transform: translate(9px, -9px); }
[data-theme="light"] .theme-toggle__rays { transform: none; opacity: 1; transition-delay: 0.08s; }
.no-js .theme-toggle { display: none; }

@media (max-width: 1080px) {
  .nav__toggle { display: block; order: 1; }
  .theme-toggle { width: 44px; height: 44px; margin-left: auto; margin-right: -12px; }
  .nav__links {
    position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px var(--gutter) 28px;
    background: rgba(var(--bg-rgb), 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
  }
  .nav.is-open .nav__links { opacity: 1; transform: none; visibility: visible; }
  .nav__links a { padding: 14px 4px; font-size: 17px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav__links a.is-active:not(.nav__cta)::after { display: none; }
  .nav__cta { margin: 18px 0 0; text-align: center; }
  .nav__links a.nav__cta { border-bottom: 0; }
}

/* ---------- Buttons ----------
   HUD-style: chamfered plates (top-left / bottom-right cut, echoing .brackets),
   a flowing energy fill, a light sweep and target-lock corner brackets on hover.
   Layers: ::before = plate / frame, ::after = sweep or inner glass, .btn__fx = brackets (added by main.js). */

.btn {
  --bx: 0px; --by: 0px;
  --cut: 12px;
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 52px;
  padding: 14px 28px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 0;
  border-radius: 0;
  background: none;
  cursor: pointer;
  transform: translate(var(--bx), var(--by));
  transition: transform 0.25s var(--ease), filter 0.4s var(--ease), color 0.3s;
  white-space: nowrap;
}
.btn::before,
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  pointer-events: none;
}
.btn:active { transform: translate(var(--bx), var(--by)) scale(0.97); }
.btn svg { width: 16px; height: 16px; flex: none; transition: transform 0.35s var(--ease); }
.btn:hover svg { transform: translateX(4px); }
.btn__label { display: inline-block; transition: text-shadow 0.4s var(--ease); }
.btn:hover .btn__label,
.btn:focus-visible .btn__label {
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.55), 0 0 14px rgba(25, 240, 166, 0.55), 0 0 26px rgba(54, 214, 255, 0.35);
}

/* target-lock brackets */
.btn__fx {
  position: absolute;
  inset: -6px;
  pointer-events: none;
  opacity: 0;
  transform: scale(1.12, 1.35);
  transition: opacity 0.3s, transform 0.45s var(--ease);
}
.btn__fx::before,
.btn__fx::after {
  content: "";
  position: absolute;
  width: 12px; height: 12px;
  border: 1.5px solid var(--accent);
  filter: drop-shadow(0 0 4px var(--accent));
}
.btn__fx::before { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.btn__fx::after { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.btn:hover .btn__fx,
.btn:focus-visible .btn__fx { opacity: 1; transform: none; }

/* primary: reactor core.
   ::before = energy running around the frame, ::after = dark plasma core with circuit grid,
   .btn__core = flash sweep + cursor hot spot + holo scan line (added by main.js). */
@property --btn-ang { syntax: "<angle>"; initial-value: 0deg; inherits: false; }

.btn--primary {
  --cut-in: calc(var(--cut) - 0.8px);
  --px: 50%; --py: 50%;
  color: #fff;
  filter: drop-shadow(0 0 12px rgba(25, 240, 166, 0.35)) drop-shadow(0 8px 24px rgba(54, 214, 255, 0.25));
}
.btn--primary::before {
  z-index: -3;
  background: conic-gradient(from var(--btn-ang),
    #19f0a6, #36d6ff 18%, #fff 24%, #36d6ff 30%, #6b7bff 48%,
    rgba(107, 123, 255, 0.5) 62%, #19f0a6 78%, #fff 84%, #19f0a6 90%, #19f0a6);
  animation: btn-spin 4.5s linear infinite;
  transition: filter 0.4s var(--ease);
}
.btn--primary::after {
  --cut: var(--cut-in);
  inset: 2px;
  z-index: -2;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 3px),
    linear-gradient(90deg, rgba(54, 214, 255, 0.09) 1px, transparent 1px) 0 0 / 14px 100%,
    radial-gradient(90% 160% at 0% 110%, rgba(25, 240, 166, 0.42), transparent 60%),
    radial-gradient(90% 160% at 100% -10%, rgba(107, 123, 255, 0.5), transparent 60%),
    linear-gradient(135deg, #031522, #06203a 50%, #0c1238);
  box-shadow: inset 0 0 16px rgba(54, 214, 255, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  animation: btn-core 5s ease-in-out infinite alternate;
}
.btn__core {
  position: absolute;
  inset: 2px;
  z-index: -1;
  overflow: hidden;
  clip-path: polygon(var(--cut-in) 0, 100% 0, 100% calc(100% - var(--cut-in)), calc(100% - var(--cut-in)) 100%, 0 100%, 0 var(--cut-in));
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.4) 50%, transparent 62%) no-repeat;
  background-size: 250% 100%;
  background-position: 160% 0;
  animation: btn-sweep 6s var(--ease) 1.5s infinite;
  pointer-events: none;
}
/* cursor-tracked plasma hot spot */
.btn__core::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(160px circle at var(--px) var(--py), rgba(54, 214, 255, 0.5), rgba(25, 240, 166, 0.18) 40%, transparent 70%),
    linear-gradient(90deg, rgba(25, 240, 166, 0.22), rgba(54, 214, 255, 0.12) 55%, rgba(107, 123, 255, 0.24));
  opacity: 0;
  transition: opacity 0.45s var(--ease);
}
/* holographic scan line */
.btn__core::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 45%;
  background: linear-gradient(180deg, transparent, rgba(54, 214, 255, 0.16) 85%, rgba(200, 255, 245, 0.75) 97%, transparent);
  transform: translateY(-110%);
  opacity: 0.45;
  animation: btn-scan 3.2s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
.btn--primary:hover {
  filter: drop-shadow(0 0 20px rgba(25, 240, 166, 0.6)) drop-shadow(0 12px 36px rgba(54, 214, 255, 0.45));
}
.btn--primary:hover::before { filter: brightness(1.35) saturate(1.2); }
.btn--primary:hover .btn__core { animation: btn-sweep-once 1s var(--ease); }
.btn--primary:hover .btn__core::before,
.btn--primary:focus-visible .btn__core::before { opacity: 1; }
.btn--primary:hover .btn__core::after { opacity: 1; }
.btn--primary .btn__label {
  text-shadow: 0 0 6px rgba(54, 214, 255, 0.65), 0 0 16px rgba(25, 240, 166, 0.35);
}
.btn--primary:hover .btn__label,
.btn--primary:focus-visible .btn__label {
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.9), 0 0 18px rgba(255, 255, 255, 0.55), 0 0 32px rgba(54, 214, 255, 0.8);
}
.btn--primary svg {
  width: 29px;
  padding-left: 12px;
  border-left: 1px solid rgba(54, 214, 255, 0.4);
  filter: drop-shadow(0 0 4px rgba(54, 214, 255, 0.8));
}

/* ghost: gradient-edged glass plate that charges up on hover */
.btn--ghost { color: var(--text); }
.btn--ghost::before {
  background: var(--grad);
  opacity: 0.45;
  transition: opacity 0.35s;
}
.btn--ghost::after {
  inset: 1px;
  --cut: 11.6px;
  background:
    linear-gradient(90deg, rgba(25, 240, 166, 0.16), rgba(54, 214, 255, 0.1) 60%, rgba(107, 123, 255, 0.14)) no-repeat 0 0 / 0% 100%,
    rgba(var(--bg-rgb), 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background-size 0.55s var(--ease);
}
.btn--ghost:hover { color: var(--text-strong); filter: drop-shadow(0 0 16px rgba(25, 240, 166, 0.25)); }
.btn--ghost:hover::before { opacity: 1; }
.btn--ghost:hover::after { background-size: 100% 100%, auto; }

.btn--sm { --cut: 9px; min-height: 40px; padding: 10px 20px; font-size: 12px; gap: 10px; }
.btn--sm.btn--ghost::after { --cut: 8.6px; }
.btn--sm .btn__fx { inset: -5px; }
.btn--sm .btn__fx::before,
.btn--sm .btn__fx::after { width: 9px; height: 9px; }

@keyframes btn-spin { to { --btn-ang: 360deg; } }
@keyframes btn-core { to { filter: brightness(1.2) saturate(1.15); } }
@keyframes btn-scan {
  0% { transform: translateY(-110%); }
  55%, 100% { transform: translateY(240%); }
}
@keyframes btn-sweep {
  0% { background-position: 160% 0; }
  22.5%, 100% { background-position: -60% 0; }
}
@keyframes btn-sweep-once {
  from { background-position: 160% 0; }
  to { background-position: -60% 0; }
}

[data-theme="light"] .btn--primary { filter: drop-shadow(0 6px 14px rgba(4, 150, 106, 0.3)); }
[data-theme="light"] .btn--primary:hover { filter: drop-shadow(0 0 14px rgba(25, 240, 166, 0.45)) drop-shadow(0 10px 22px rgba(3, 105, 161, 0.3)); }
[data-theme="light"] .btn--ghost::before { opacity: 0.7; }
[data-theme="light"] .btn--ghost:hover { filter: drop-shadow(0 6px 16px rgba(4, 150, 106, 0.2)); }

/* ---------- Scenes (WebGL holders) ---------- */

.scene { position: absolute; inset: 0; overflow: hidden; }
.scene canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene.no-webgl {
  background:
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(25, 240, 166, 0.18), transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(107, 123, 255, 0.15), transparent 70%);
}

/* ---------- HUD primitives ---------- */

.eyebrow,
.sec-tag,
.hud,
.chip {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(var(--bg-rgb), 0.5);
  color: var(--accent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(25, 240, 166, 0.6);
  animation: pulse 2s infinite;
  flex: none;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(25, 240, 166, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(25, 240, 166, 0); }
  100% { box-shadow: 0 0 0 0 rgba(25, 240, 166, 0); }
}

.brackets { position: relative; }
.brackets::before,
.brackets::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border: 1px solid var(--accent);
  opacity: 0.7;
  pointer-events: none;
}
.brackets::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.brackets::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-h) + 40px) 0 120px;
  overflow: hidden;
  isolation: isolate;
}
.hero .scene { z-index: -2; }
.hero__vignette {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 60% at 30% 35%, rgba(var(--bg-rgb), 0.75), transparent 70%),
    linear-gradient(180deg, rgba(var(--bg-rgb), 0.6) 0%, transparent 25%, transparent 88%, var(--bg) 100%);
}
.hero__grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 20%, transparent 75%);
}
.hero__inner { position: relative; }
.hero__title {
  margin: 28px 0 26px;
  font-size: clamp(42px, 7.6vw, 108px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.045em;
}
.hero__title .line { display: block; overflow: hidden; padding-bottom: 0.14em; margin-bottom: -0.1em; }
.hero__title .line > span { display: inline-block; }
.js .hero__title .line > span { transform: translateY(105%); transition: transform 1.1s var(--ease); }
.js .is-booted .hero__title .line > span,
.js.is-booted .hero__title .line > span { transform: none; }
.hero__title .line:nth-child(2) > span { transition-delay: 0.08s; }
.hero__title .line:nth-child(3) > span { transition-delay: 0.16s; }

.hero__lede {
  max-width: 620px;
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--text-dim);
}
.hero__words {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.rotator {
  position: relative;
  display: inline-block;
  height: 1.6em;
  overflow: hidden;
  color: var(--accent);
  min-width: 12ch;
}
.rotator span {
  position: absolute;
  left: 0; top: 0;
  line-height: 1.6em;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.6s var(--ease), opacity 0.6s;
}
.rotator span.is-active { transform: none; opacity: 1; }
.rotator span.is-leaving { transform: translateY(-100%); opacity: 0; }
.no-js .rotator span:first-child { transform: none; opacity: 1; }

.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 38px; }

.hero__hud {
  position: absolute;
  left: 0; right: 0; bottom: 28px;
  z-index: 1;
}
.hero__hud .container {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}
.hud { color: var(--muted); font-size: 11px; line-height: 1.9; }
.hud b { color: var(--text-dim); font-weight: 500; }
.hud .ok { color: var(--accent); }
.scroll-cue {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}
.scroll-cue i {
  width: 1px; height: 46px;
  background: linear-gradient(var(--accent), transparent);
  position: relative;
  overflow: hidden;
}
.scroll-cue i::after {
  content: "";
  position: absolute;
  left: 0; top: -40%;
  width: 1px; height: 40%;
  background: var(--text-strong);
  animation: drip 2.2s var(--ease) infinite;
}
@keyframes drip { to { top: 110%; } }

@media (max-width: 720px) {
  .hero__hud .hud--right { display: none; }
  .hero__hud .scroll-cue { display: none; }
}

/* ---------- Marquee ---------- */

.marquee {
  position: relative;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(var(--bg-2-rgb), 0.7);
  overflow: hidden;
  padding: 18px 0;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee__track {
  display: flex;
  width: max-content;
  gap: 0;
  animation: marquee 48s linear infinite;
}
.marquee--reverse .marquee__track { animation-direction: reverse; animation-duration: 60s; }
.marquee__item {
  display: flex;
  align-items: center;
  gap: 28px;
  padding-right: 28px;
  font-family: var(--font-display);
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-dim);
  white-space: nowrap;
}
.marquee__item::after {
  content: "";
  width: 8px; height: 8px;
  transform: rotate(45deg);
  border: 1px solid var(--accent);
  box-shadow: 0 0 10px rgba(25, 240, 166, 0.6);
}
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */

.section {
  position: relative;
  padding: clamp(96px, 13vw, 170px) 0;
  isolation: isolate;
}
.section--tight { padding: clamp(72px, 9vw, 120px) 0; }
.section--alt { background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 20%, var(--bg-2) 80%, var(--bg) 100%); }

.sec-head { max-width: 860px; margin-bottom: clamp(48px, 6vw, 80px); }
.sec-head--center { margin-left: auto; margin-right: auto; text-align: center; }
.sec-head--split {
  max-width: none;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: end;
}
.sec-tag {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--accent);
  margin-bottom: 22px;
}
.sec-tag span {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--text);
  font-size: 11px;
  letter-spacing: 0.08em;
}
.sec-tag::after {
  content: "";
  width: 56px; height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.sec-head--center .sec-tag::before {
  content: "";
  width: 56px; height: 1px;
  background: linear-gradient(270deg, var(--accent), transparent);
}
.sec-title {
  font-size: clamp(36px, 5.6vw, 76px);
  letter-spacing: -0.035em;
}
.sec-lede {
  margin-top: 24px;
  font-size: clamp(16px, 1.4vw, 19px);
  color: var(--text-dim);
  max-width: 640px;
}
.sec-head--center .sec-lede { margin-left: auto; margin-right: auto; }
.sec-head--split .sec-lede { margin-top: 0; }
.sec-title--col { font-size: clamp(36px, 4.6vw, 64px); }

@media (max-width: 860px) {
  .sec-head--split { grid-template-columns: 1fr; gap: 20px; }
}

/* Reveal */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  transition-delay: var(--d, 0s);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- Mission / manifesto ---------- */

.manifesto {
  font-family: var(--font-display);
  font-size: clamp(28px, 4.2vw, 58px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 500;
  max-width: 1120px;
}
.manifesto em { font-style: normal; color: var(--accent); }
.manifesto .w { transition: color 0.4s, text-shadow 0.4s; color: var(--ghost-text); }
.manifesto .w.is-lit { color: var(--text); }
.manifesto .w.hl.is-lit { color: var(--accent); text-shadow: 0 0 30px rgba(25, 240, 166, 0.35); }
.no-js .manifesto .w,
.reduced .manifesto .w { color: var(--text); }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: clamp(64px, 8vw, 110px);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.stat {
  position: relative;
  padding: 34px 28px 30px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.stat::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--grad-soft);
  opacity: 0;
  transition: opacity 0.4s;
}
.stat:hover::before { opacity: 1; }
.stat__num {
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(44px, 5vw, 68px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
}
.stat__label {
  position: relative;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.stat__desc { position: relative; margin-top: 8px; font-size: 14px; color: var(--muted); }

@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stats { grid-template-columns: 1fr; } }

.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}
.pillar {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}
.pillar h3 { font-size: 20px; margin-bottom: 10px; display: flex; align-items: center; gap: 12px; }
.pillar h3 svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.pillar p { color: var(--muted); font-size: 15px; }
@media (max-width: 860px) { .pillars { grid-template-columns: 1fr; } }

/* ---------- Labs ---------- */

.labs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.lab {
  --mx: 50%; --my: 50%;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 560px;
  padding: 34px 30px 30px;
  border-radius: var(--radius-lg);
  background: var(--card-grad);
  border: 1px solid var(--line);
  overflow: hidden;
  transform-style: preserve-3d;
  transition: border-color 0.4s, transform 0.5s var(--ease);
}
.lab::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(25, 240, 166, 0.14), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.lab::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(300px circle at var(--mx) var(--my), rgba(54, 214, 255, 0.8), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.lab:hover::before,
.lab:hover::after { opacity: 1; }
.lab__top { display: flex; justify-content: space-between; align-items: flex-start; }
.lab__idx { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.16em; color: var(--muted); }
.lab__status { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); display: flex; gap: 8px; align-items: center; }
.lab__glyph {
  position: relative;
  width: 150px; height: 150px;
  margin: 30px auto 34px;
}
.lab__glyph svg { width: 100%; height: 100%; overflow: visible; }
.lab__glyph .spin { transform-origin: 75px 75px; animation: spin 18s linear infinite; }
.lab__glyph .spin-rev { transform-origin: 75px 75px; animation: spin 26s linear infinite reverse; }
.lab__glyph .float { animation: floaty 5s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes floaty { 50% { transform: translateY(-5px); } }
.lab__kicker { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 10px; }
.lab h3 { font-size: 30px; margin-bottom: 14px; }
.lab p { color: var(--text-dim); font-size: 15px; }
.lab__list { margin: 22px 0 26px; display: grid; gap: 10px; }
.lab__list li { display: flex; gap: 12px; font-size: 14px; color: var(--text-dim); }
.lab__list li::before {
  content: "";
  flex: none;
  width: 6px; height: 6px;
  margin-top: 8px;
  background: var(--accent);
  transform: rotate(45deg);
  box-shadow: 0 0 8px var(--accent);
}
.lab__tags { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.02);
}

@media (max-width: 1020px) {
  .labs { grid-template-columns: 1fr; }
  .lab { min-height: 0; }
  .lab__glyph { width: 120px; height: 120px; margin: 18px 0 24px; }
}

/* ---------- Capabilities ---------- */

.caps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.cap {
  --mx: 50%; --my: 50%;
  position: relative;
  padding: 32px 28px 34px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  transition: background 0.4s;
}
.cap::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(260px circle at var(--mx) var(--my), rgba(25, 240, 166, 0.1), transparent 70%);
  opacity: 0;
  transition: opacity 0.35s;
}
.cap:hover::before { opacity: 1; }
.cap__icon {
  position: relative;
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--accent);
  background: rgba(25, 240, 166, 0.04);
  margin-bottom: 26px;
  transition: box-shadow 0.4s, border-color 0.4s;
}
.cap:hover .cap__icon { box-shadow: var(--glow); border-color: var(--accent); }
.cap__icon svg { width: 22px; height: 22px; }
.cap__num { position: absolute; top: 28px; right: 26px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: 0.1em; }
.cap h3 { position: relative; font-size: 19px; margin-bottom: 10px; letter-spacing: -0.01em; }
.cap p { position: relative; font-size: 14.5px; color: var(--muted); line-height: 1.6; }

@media (max-width: 1080px) { .caps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .caps { grid-template-columns: 1fr; } }

/* ---------- Frontier / globe ---------- */

.frontier { overflow: hidden; }
.frontier__grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: clamp(30px, 5vw, 70px);
  align-items: center;
}
.globe {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  max-width: 640px;
  justify-self: center;
}
.globe::before {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(25, 240, 166, 0.14), rgba(54, 214, 255, 0.05) 50%, transparent 70%);
  filter: blur(20px);
}
.globe__ring {
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  border: 1px dashed rgba(120, 255, 220, 0.14);
  animation: spin 80s linear infinite;
}
.globe__ring--2 { inset: -2%; border-style: solid; border-color: rgba(120, 255, 220, 0.06); animation-duration: 120s; animation-direction: reverse; }
.globe__ring--2::before {
  content: "";
  position: absolute;
  top: 50%; left: -4px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 12px var(--accent-2);
}
.globe .scene { border-radius: 50%; overflow: visible; }
.globe__legend {
  position: absolute;
  left: 0; bottom: 4%;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 2;
}
.globe__legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: 0; }
.globe__legend .o { background: var(--text-strong); box-shadow: 0 0 10px var(--accent); }
.globe__legend .l { background: var(--accent-2); }

.vectors { display: grid; gap: 2px; margin-top: 36px; counter-reset: v; }
.vector {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.vector:first-child { border-top: 1px solid var(--line); }
.vector::before {
  counter-increment: v;
  content: "V." counter(v, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--accent);
  padding-top: 4px;
}
.vector h3 { font-size: 18px; margin-bottom: 4px; letter-spacing: -0.01em; }
.vector p { font-size: 14.5px; color: var(--muted); }

@media (min-width: 961px) {
  .frontier__grid { align-items: start; }
  .globe { position: sticky; top: calc(var(--nav-h) + 40px); }
}
@media (max-width: 960px) {
  .frontier__grid { grid-template-columns: 1fr; }
  .globe { max-width: 520px; order: -1; }
}

/* ---------- Platform / terminal ---------- */

.platform__grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(30px, 5vw, 70px);
  align-items: center;
}
.feature-list { display: grid; gap: 22px; margin-top: 36px; }
.feature { display: grid; grid-template-columns: 40px 1fr; gap: 16px; }
.feature__icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--accent);
  border: 1px solid var(--line-strong);
  background: rgba(25, 240, 166, 0.04);
}
.feature__icon svg { width: 19px; height: 19px; }
.feature h3 { font-size: 17px; margin-bottom: 4px; letter-spacing: -0.01em; }
.feature p { font-size: 14.5px; color: var(--muted); }

.terminal {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(8, 18, 28, 0.95), rgba(3, 7, 12, 0.98));
  box-shadow: 0 40px 120px -40px rgba(25, 240, 166, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  overflow: hidden;
}
.terminal::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px);
}
.terminal__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.terminal__bar i { width: 10px; height: 10px; border-radius: 50%; background: #1d2b36; }
.terminal__bar i:nth-child(1) { background: #ff5f57; opacity: 0.8; }
.terminal__bar i:nth-child(2) { background: #febc2e; opacity: 0.8; }
.terminal__bar i:nth-child(3) { background: #28c840; opacity: 0.8; }
.terminal__bar span { margin-left: auto; }
.terminal__body {
  margin: 0;
  padding: 22px 22px 26px;
  min-height: 420px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.85;
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-word;
}
.terminal__body .p { color: var(--accent); }
.terminal__body .c { color: var(--accent-2); }
.terminal__body .m { color: var(--muted); }
.terminal__body .g { color: var(--accent); }
.terminal__body .v { color: #c4b5ff; }
.terminal__body .caret {
  display: inline-block;
  width: 8px; height: 1.1em;
  vertical-align: -0.2em;
  background: var(--accent);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.terminal__note { margin-top: 12px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); text-align: right; }

@media (max-width: 960px) {
  .platform__grid { grid-template-columns: 1fr; }
  .terminal__body { min-height: 0; font-size: 12px; }
}

/* ---------- Process ---------- */

.process {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
}
.process__line {
  position: absolute;
  top: 27px; left: 28px; right: calc((100% - 72px) / 5 - 28px);
  height: 1px;
  background: var(--line);
  overflow: hidden;
}
.process__line span {
  position: absolute;
  inset: 0;
  background: var(--grad);
  box-shadow: var(--glow);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 2.2s var(--ease);
}
.process.is-in .process__line span { transform: scaleX(1); }
.step { position: relative; }
.step__node {
  position: relative;
  width: 56px; height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 28px;
  transition: box-shadow 0.5s, border-color 0.5s;
  transition-delay: var(--d, 0s);
}
.process.is-in .step__node { border-color: var(--accent); box-shadow: 0 0 0 6px rgba(25, 240, 166, 0.06), var(--glow); }
.step__phase { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.step h3 { font-size: 22px; margin-bottom: 10px; }
.step p { font-size: 14.5px; color: var(--muted); }

@media (max-width: 960px) {
  .process { grid-template-columns: 1fr; gap: 0; }
  .process__line { top: 28px; bottom: 28px; left: 27px; right: auto; width: 1px; height: auto; }
  .process__line span { transform: scaleY(0); transform-origin: top; }
  .process.is-in .process__line span { transform: scaleY(1); }
  .step { display: grid; grid-template-columns: 56px 1fr; gap: 22px; padding-bottom: 34px; }
  .step__node { margin: 0; }
}

/* ---------- Industries ---------- */

.industries { margin-top: clamp(60px, 7vw, 90px); }
.industries__label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); text-align: center; margin-bottom: 18px; }

/* ---------- Principles ---------- */

.principles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.principle {
  position: relative;
  padding: 26px 24px 28px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card-grad-soft);
  transition: border-color 0.35s, transform 0.35s var(--ease);
}
.principle:hover { border-color: var(--line-strong); transform: translateY(-4px); }
.principle__k { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; color: var(--accent); margin-bottom: 18px; display: flex; justify-content: space-between; }
.principle__k i { font-style: normal; color: var(--muted); }
.principle h3 { font-size: 18px; margin-bottom: 8px; letter-spacing: -0.01em; }
.principle p { font-size: 14px; color: var(--muted); line-height: 1.6; }
.principles__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 36px;
  padding: 24px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--grad-soft);
}
.principles__foot p { color: var(--text-dim); max-width: 720px; font-size: 15px; }

@media (max-width: 1080px) { .principles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .principles { grid-template-columns: 1fr; } }

/* ---------- Corridor CTA / careers ---------- */

.horizon {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
  text-align: center;
}
.horizon .scene { z-index: -2; }
.horizon::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(var(--bg-rgb), 0.75), transparent 75%),
    linear-gradient(180deg, var(--bg) 0%, transparent 18%, transparent 82%, var(--bg) 100%);
  pointer-events: none;
}
.horizon__title {
  font-size: clamp(40px, 7.5vw, 104px);
  letter-spacing: -0.045em;
  line-height: 1;
}
.horizon__lede { max-width: 640px; margin: 26px auto 0; color: var(--text-dim); font-size: clamp(16px, 1.5vw, 19px); }
.roles { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 34px auto 0; max-width: 760px; }
.roles .chip { font-size: 11px; padding: 8px 12px; background: rgba(var(--bg-rgb), 0.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.horizon .hero__cta { justify-content: center; }

/* ---------- Contact ---------- */

.contact__grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(30px, 5vw, 80px);
  align-items: start;
}
.channels { display: grid; gap: 14px; margin-top: 36px; }
.channel {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  transition: border-color 0.3s, background 0.3s;
}
.channel:hover { border-color: var(--accent); background: rgba(25, 240, 166, 0.05); }
.channel__icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line-strong); color: var(--accent); }
.channel__icon svg { width: 19px; height: 19px; }
.channel small { display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.channel strong { font-weight: 500; font-size: 16px; word-break: break-all; }
.channel > svg { width: 16px; height: 16px; color: var(--muted); transition: transform 0.3s var(--ease), color 0.3s; }
.channel:hover > svg { transform: translate(3px, -3px); color: var(--accent); }
.contact__meta { margin-top: 30px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.1em; line-height: 2; color: var(--muted); text-transform: uppercase; }
.contact__meta b { color: var(--text-dim); font-weight: 500; }

.form {
  position: relative;
  padding: clamp(24px, 3.4vw, 40px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
  background: var(--form-grad);
  box-shadow: 0 40px 120px -50px rgba(54, 214, 255, 0.35);
}
.form__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.form__head span:first-child { color: var(--accent); }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 8px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); }
.field label em { color: var(--accent); font-style: normal; }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 14px 16px;
  font-size: 15px;
  background: rgba(var(--bg-rgb), 0.7);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  transition: border-color 0.25s, box-shadow 0.25s;
  -webkit-appearance: none;
  appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2319f0a6' stroke-width='1.5'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}
.field select option { background: var(--panel-solid); }
.field textarea { min-height: 150px; resize: vertical; }
.field input::placeholder,
.field textarea::placeholder { color: var(--placeholder); }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(25, 240, 166, 0.12);
}
.field.is-invalid input,
.field.is-invalid textarea,
.field.is-invalid select { border-color: var(--err); }
.field__err { display: none; margin-top: 6px; font-size: 13px; color: var(--err-text); }
.field.is-invalid .field__err { display: block; }
.consent { display: flex; gap: 12px; align-items: flex-start; margin: 6px 0 22px; font-size: 13.5px; color: var(--muted); }
.consent input { flex: none; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.consent a { color: var(--text-dim); text-decoration: underline; text-underline-offset: 3px; }
.form__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.form__note { font-size: 12.5px; color: var(--muted); max-width: 320px; }
.form__status { margin-top: 18px; padding: 14px 16px; border-radius: 10px; font-size: 14px; display: none; }
.form__status.is-ok { display: block; border: 1px solid var(--line-strong); background: rgba(25, 240, 166, 0.08); color: var(--text); }
.form__status.is-err { display: block; border: 1px solid rgba(var(--err-rgb), 0.4); background: rgba(var(--err-rgb), 0.08); color: var(--err-status); }

@media (max-width: 960px) { .contact__grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .form__row { grid-template-columns: 1fr; gap: 0; } }

/* ---------- Footer ---------- */

.footer {
  position: relative;
  padding: 80px 0 34px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  overflow: hidden;
}
.footer__grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer__brand img { width: 120px; margin-bottom: 22px; }
.footer__brand p { color: var(--muted); font-size: 14.5px; max-width: 340px; }
.footer h4 { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }
.footer ul { display: grid; gap: 10px; }
.footer ul a { color: var(--text-dim); font-size: 14.5px; transition: color 0.2s; }
.footer ul a:hover { color: var(--text-strong); }
.footer__bottom {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.footer__bottom nav { display: flex; flex-wrap: wrap; gap: 20px; }
.footer__bottom a:hover { color: var(--text-strong); }
.to-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}

/* ---------- Side HUD (section index) ---------- */

.side-hud {
  position: fixed;
  right: 22px;
  top: 50%;
  z-index: 50;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}
.side-hud.is-visible { opacity: 1; pointer-events: auto; }
.side-hud a {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: transparent;
  transition: color 0.3s;
}
.side-hud a::after {
  content: "";
  width: 14px; height: 1px;
  background: var(--muted);
  transition: width 0.3s var(--ease), background 0.3s;
}
.side-hud a:hover { color: var(--text-dim); }
.side-hud a.is-active { color: var(--accent); }
.side-hud a.is-active::after { width: 30px; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.side-hud__count { margin-top: 8px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: 0.1em; }
.side-hud__count b { color: var(--text); font-weight: 500; }
@media (max-width: 1540px) { .side-hud { display: none; } }

/* ---------- Legal pages ---------- */

.page-hero {
  position: relative;
  padding: calc(var(--nav-h) + 90px) 0 80px;
  overflow: hidden;
  isolation: isolate;
  border-bottom: 1px solid var(--line);
}
.page-hero .scene { z-index: -2; opacity: 0.9; }
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(var(--bg-rgb), 0.55), rgba(var(--bg-rgb), 0.2) 50%, var(--bg));
}
.page-hero h1 { font-size: clamp(40px, 6.5vw, 84px); letter-spacing: -0.04em; margin-top: 22px; }
.page-hero p { margin-top: 18px; color: var(--text-dim); max-width: 640px; }
.page-hero .meta { margin-top: 26px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px 24px; }
.page-hero .meta b { color: var(--accent); font-weight: 500; }

.legal {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: clamp(30px, 5vw, 80px);
  padding: 70px 0 120px;
}
.toc { position: sticky; top: calc(var(--nav-h) + 30px); align-self: start; }
.toc h2 { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); margin-bottom: 16px; }
.toc ol { margin: 0; padding: 0; list-style: none; counter-reset: t; display: grid; gap: 2px; border-left: 1px solid var(--line); }
.toc li { counter-increment: t; }
.toc a {
  display: block;
  padding: 6px 0 6px 16px;
  margin-left: -1px;
  border-left: 1px solid transparent;
  font-size: 13.5px;
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s;
}
.toc a::before { content: counter(t, decimal-leading-zero) "  "; font-family: var(--font-mono); font-size: 11px; color: var(--placeholder); }
.toc a:hover,
.toc a.is-active { color: var(--text); border-left-color: var(--accent); }

.prose { max-width: 780px; color: var(--text-dim); font-size: 16px; line-height: 1.8; }
.prose > section { padding-top: 10px; margin-bottom: 44px; }
.prose h2 {
  font-size: clamp(22px, 2.4vw, 28px);
  color: var(--text);
  margin-bottom: 18px;
  letter-spacing: -0.02em;
  display: flex;
  gap: 14px;
  align-items: baseline;
}
.prose h2 .n { font-family: var(--font-mono); font-size: 12px; color: var(--accent); letter-spacing: 0.08em; font-weight: 500; }
.prose h3 { font-size: 18px; color: var(--text); margin: 26px 0 10px; letter-spacing: -0.01em; }
.prose p { margin-bottom: 16px; }
.prose ul,
.prose ol { margin: 0 0 18px; padding-left: 0; list-style: none; display: grid; gap: 10px; }
.prose ol { counter-reset: li; }
.prose ul li,
.prose ol li { position: relative; padding-left: 26px; }
.prose ul li::before {
  content: "";
  position: absolute;
  left: 4px; top: 11px;
  width: 6px; height: 6px;
  background: var(--accent);
  transform: rotate(45deg);
}
.prose ol li { counter-increment: li; }
.prose ol li::before { content: "(" counter(li, lower-alpha) ")"; position: absolute; left: 0; font-family: var(--font-mono); font-size: 13px; color: var(--accent); }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-color: rgba(25, 240, 166, 0.4); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--accent); }
.prose strong { color: var(--text); font-weight: 600; }
.callout {
  margin: 0 0 30px;
  padding: 20px 22px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: rgba(25, 240, 166, 0.05);
  color: var(--text-dim);
  font-size: 15px;
}
.table-wrap { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--line); border-radius: 10px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.prose th,
.prose td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); font-weight: 500; background: rgba(25, 240, 166, 0.04); }
.prose tr:last-child td { border-bottom: 0; }
.address {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  font-style: normal;
}

@media (max-width: 900px) {
  .legal { grid-template-columns: 1fr; padding-top: 40px; }
  .toc { position: static; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); }
}

/* ---------- 404 ---------- */

.lost {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
  padding: 120px 0;
}
.lost .scene { z-index: -2; }
.lost::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse 60% 50% at 50% 45%, rgba(var(--bg-rgb), 0.8), transparent 75%);
}
.lost__code {
  font-family: var(--font-display);
  font-size: clamp(120px, 26vw, 300px);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.06em;
}
.lost h1 { font-size: clamp(24px, 3vw, 36px); margin: 16px 0 14px; }
.lost p { color: var(--text-dim); max-width: 480px; margin: 0 auto 30px; }

/* ---------- Light theme details ---------- */

.nav__logo img,
.footer__brand img,
.boot__logo { filter: var(--logo-filter); }

[data-theme="light"] .hero__vignette {
  background:
    radial-gradient(ellipse 70% 60% at 30% 35%, rgba(var(--bg-rgb), 0.85), transparent 70%),
    linear-gradient(180deg, rgba(var(--bg-rgb), 0.6) 0%, transparent 25%, transparent 88%, var(--bg) 100%);
}
[data-theme="light"] .manifesto .w.hl.is-lit { text-shadow: 0 0 30px rgba(4, 150, 106, 0.18); }
[data-theme="light"] .lab__glyph svg { filter: brightness(0.8) saturate(1.4); }
[data-theme="light"] .lab__glyph [fill="#fff"] { fill: var(--text); }
[data-theme="light"] .globe__ring { border-color: rgba(6, 64, 54, 0.18); }
[data-theme="light"] .globe__ring--2 { border-color: rgba(6, 64, 54, 0.08); }
[data-theme="light"] .terminal {
  background: linear-gradient(180deg, #08121c, #03070c);
  box-shadow: 0 40px 100px -40px rgba(3, 60, 50, 0.45);
}
[data-theme="light"] .form { box-shadow: 0 40px 100px -50px rgba(3, 60, 50, 0.3); }
[data-theme="light"] .field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23047857' stroke-width='1.5'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
}

/* ---------- Theme switching ---------- */

/* applied for a single frame so nothing animates twice under the view transition */
.theme-switching,
.theme-switching *,
.theme-switching *::before,
.theme-switching *::after { transition: none !important; }
.theme-switching .theme-toggle__core,
.theme-switching .theme-toggle__cut,
.theme-switching .theme-toggle__rays { transition: transform 0.6s var(--ease), opacity 0.4s var(--ease) !important; }

/* fallback cross-fade for browsers without view transitions */
.theme-fade,
.theme-fade *,
.theme-fade *::before,
.theme-fade *::after {
  transition:
    background-color 0.5s var(--ease), color 0.5s var(--ease), border-color 0.5s var(--ease),
    fill 0.5s var(--ease), stroke 0.5s var(--ease), box-shadow 0.5s var(--ease),
    filter 0.5s var(--ease), transform 0.6s var(--ease), opacity 0.4s var(--ease) !important;
}
.theme-fade .scene canvas { animation: scene-in 0.6s var(--ease); }
@keyframes scene-in { from { opacity: 0; } }

/* circular reveal from the toggle; the clip-path is animated from main.js */
::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .marquee__track { animation: none; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .js .hero__title .line > span { transform: none; }
}

@media print {
  .nav, .noise, .cursor-glow, .scene, .boot, .side-hud { display: none !important; }
  body { background: #fff; color: #000; }
  .prose, .prose h2, .prose h3, .prose strong { color: #000; }
}
