/* ---------------------------------------------------------------------------
 * Base styles. Landing-page-only rules live below under `body.landing`.
 * ------------------------------------------------------------------------- */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/fonts/PlusJakartaSans-VariableFont_wght.ttf") format("truetype-variations");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/fonts/PlusJakartaSans-Italic-VariableFont_wght.ttf") format("truetype-variations");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}

/* Fathom Zero wordmark. The closest open-licensed match to the logo's
   lettering; swap for the designer's vector wordmark once there is one. */
@font-face {
  font-family: "Figtree";
  src: url("/fonts/Figtree-VariableFont_wght.ttf") format("truetype-variations");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0a0a0f;
  --bg-elev: #13131a;
  --fg: #ececf1;
  --fg-muted: #a0a0b0;
  --accent-1: #8b5cf6;
  --accent-2: #22d3ee;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 0.75rem;
  --container: 1100px;

  color-scheme: dark;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

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

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-2);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font: inherit;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
}

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

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

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--bg-elev);
  color: var(--fg);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  z-index: 100;
}

.skip-link:focus {
  top: 1rem;
}

/* ---------------------------------------------------------------------------
 * Login page (body.login-page) — frosted card over the water scene
 * ------------------------------------------------------------------------- */

body.login-page {
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
}

/* Full-bleed water scene pinned behind everything. */
body.login-page .water--backdrop {
  position: fixed;
  z-index: 0;
}

/* Share the landing's nav placement for visual continuity. */
body.login-page .nav--login {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: transparent;
  pointer-events: none;
}

body.login-page .nav--login .nav__wordmark {
  pointer-events: auto;
  font-size: 1.75rem;
}

body.login-page .nav--login .nav__wordmark:hover {
  text-decoration: none;
}

body.login-page .login {
  position: relative;
  z-index: 5;
  display: grid;
  gap: 1.5rem;
  width: 100%;
  max-width: 22rem;
  justify-items: center;
}

body.login-page .login__card {
  width: 100%;
  background: rgba(0, 14, 40, 0.55);
  border: 1px solid rgba(132, 189, 219, 0.14);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  display: grid;
  gap: 1.25rem;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

body.login-page .login__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--fg);
}

body.login-page .login__subtitle {
  margin: -0.5rem 0 0 0;
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

body.login-page .login__providers {
  display: grid;
  gap: 0.75rem;
}

body.login-page .login__provider {
  display: inline-grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--fg);
  font-weight: 600;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

body.login-page .login__provider:hover {
  text-decoration: none;
  border-color: var(--accent-2);
  background: rgba(34, 211, 238, 0.08);
  transform: translateY(-1px);
}

body.login-page .login__provider:active {
  transform: translateY(0);
}

body.login-page .login__provider[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* Reset the default <button> appearance so .login__provider styling wins. */
body.login-page button.login__provider {
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

body.login-page .login__provider-icon {
  width: 18px;
  height: 18px;
}

body.login-page .login__provider-label {
  text-align: left;
}

body.login-page .login__divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  color: var(--fg-muted);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body.login-page .login__divider::before,
body.login-page .login__divider::after {
  content: "";
  height: 1px;
  background: var(--border);
}

body.login-page .login__error {
  padding: 0.65rem 0.9rem;
  border: 1px solid rgba(255, 99, 99, 0.35);
  background: rgba(255, 99, 99, 0.12);
  color: #ffbcbc;
  border-radius: var(--radius);
  font-size: 0.85rem;
}


/* ---------------------------------------------------------------------------
 * AI News page (body.news-page) — dated notes on the deep-water background.
 * Content lives in public/ai-news/index.html; nothing here changes per day.
 * ------------------------------------------------------------------------- */

body.news-page {
  isolation: isolate;
  background: #000617;
}

body.news-page .water--backdrop {
  position: fixed;
  z-index: -1;
  pointer-events: none;
}

body.news-page .news-nav {
  padding: 0.75rem 1.5rem;
}

body.news-page .news-nav__wordmark {
  font-size: 1.75rem;
}

body.news-page .news-nav__wordmark:hover {
  text-decoration: none;
}

body.news-page .news,
body.docs-page .docs {
  max-width: 60.48rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 6vh, 4rem) 1.25rem 4rem;
}

body.news-page .news__title {
  margin: 0 0 2rem 0;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

body.news-page .news__day {
  margin: 0 0 2.5rem 0;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(132, 189, 219, 0.16);
}

body.news-page .news__date {
  margin: 0 0 1.25rem 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #84bddb;
}

body.news-page .news__item {
  margin: 0 0 1.5rem 0;
}

body.news-page .news__headline {
  margin: 0 0 0.4rem 0;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
  text-wrap: balance;
}

body.news-page .news__item p {
  margin: 0;
  color: var(--fg-muted);
}


/* ---------------------------------------------------------------------------
 * Landing page (body.landing) — tokens and base
 * ------------------------------------------------------------------------- */

body.landing {
  --page-gutter: clamp(1.25rem, 4vw, 3rem);
  display: block;
}

body.landing main {
  max-width: none;
  padding: 0;
  position: relative;
}

body.landing .hero-overlay {
  position: relative;
  align-self: end;
  padding-inline-start: max(0px, calc((100% - var(--container)) / 2));
  pointer-events: none;
  z-index: 5;
}

body.landing .hero-copy {
  max-width: 38ch;
}

body.landing .hero-overlay__title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 0.75rem 0;
  color: var(--fg);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.85);
}

body.landing .hero-overlay__body {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--fg-muted);
  margin: 0 0 1.25rem 0;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.85);
}

body.landing .hero-overlay__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  margin: 0;
  color: var(--fg);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.85);
}

body.landing .hero-overlay__cta a {
  pointer-events: auto;
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 0.25em;
  padding: 0.15rem 0;
}

body.landing .hero-overlay__cta a:hover {
  color: var(--accent-2);
}

/* ---------------------------------------------------------------------------
 * Landing nav
 * ------------------------------------------------------------------------- */

body.landing .nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: transparent;
}

@media (max-width: 720px), (pointer: coarse) and (max-height: 32rem) {
  body.landing .nav::before {
    content: "";
    position: absolute;
    inset: 0 0 -1.25rem;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(to bottom, #000617 calc(100% - 1.75rem), transparent);
  }
}

body.landing .nav__wordmark {
  justify-self: start;
  font-size: 1.75rem;
}

body.landing .nav__wordmark:hover {
  text-decoration: none;
}

/* The small wordmark and its mobile backdrop fade together as the hero passes. */
body.landing .nav::before,
body.landing .nav__wordmark {
  transition: opacity 0.4s ease, visibility 0s linear 0s;
}

body.landing .nav--brand-hidden::before,
body.landing .nav--brand-hidden .nav__wordmark {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0s linear 0.4s;
}

body.landing .nav__user {
  position: relative;
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  justify-self: end;
  border-radius: 50%;
}

body.landing .nav__user:hover {
  text-decoration: none;
}

body.landing .nav__user-canvas {
  position: absolute;
  width: 80px;
  height: 80px;
  left: -18px;
  top: -18px;
  pointer-events: none;
  display: block;
}


/* ---------------------------------------------------------------------------
 * Fathom Zero wordmark — "fathom" over a smaller, tracked-out "ZERO" that
 * right-aligns under the m. Sized by the container's font-size.
 * ------------------------------------------------------------------------- */

.wordmark {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: "Figtree", "Plus Jakarta Sans", system-ui, sans-serif;
  line-height: 0.9;
}

.wordmark__fathom {
  font-weight: 300;
  letter-spacing: 0.01em;
  color: #84bddb;
}

.wordmark__zero {
  font-size: 0.36em;
  font-weight: 400;
  letter-spacing: 0.32em;
  /* Trailing tracking would push ZERO off the m's edge. */
  margin-right: -0.32em;
  margin-top: 0.1em;
  text-transform: uppercase;
  color: #0162b1;
}

body.landing .hero-mark {
  position: relative;
  place-self: center;
  font-size: clamp(4.5rem, 14vw, 10.5rem);
  pointer-events: none;
  z-index: 4;
}

/* ---------------------------------------------------------------------------
 * Water scene — just below the surface, sunlight filtering down. Fills the
 * landing hero; `.water--backdrop` pins it full-bleed behind the login card.
 *
 * Deliberately faint: a drifting glow from above plus a few soft light shafts
 * that sway and breathe on staggered, non-matching periods so the pattern
 * never visibly repeats. Only transform and opacity animate, so the whole
 * thing stays on the compositor. water.ts pauses it when it isn't visible.
 * ------------------------------------------------------------------------- */

.water {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #00102e 0%, #000a24 30%, #00071b 65%, #000617 100%);
}

.water__glow {
  position: absolute;
  left: -25%;
  right: -25%;
  top: -35%;
  height: 100%;
  background: radial-gradient(
    ellipse 36% 55% at 50% 30%,
    rgba(8, 48, 130, 0.32) 0%,
    rgba(4, 30, 90, 0.14) 45%,
    transparent 75%
  );
  animation: water-glow 34s ease-in-out infinite alternate;
  will-change: transform, opacity;
}

.water__glow--drift {
  background: radial-gradient(
    ellipse 18% 32% at 50% 24%,
    rgba(40, 110, 200, 0.12) 0%,
    transparent 70%
  );
  animation-duration: 47s;
  animation-direction: alternate-reverse;
}

.water__rays {
  position: absolute;
  inset: 0;
}

.water__ray {
  position: absolute;
  top: -10%;
  left: var(--x);
  width: var(--w);
  height: 88%;
  transform-origin: 50% 0;
  transform: translateX(-50%) rotate(var(--tilt));
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(110, 170, 235, 0.085) 50%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.45) 45%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.45) 45%, transparent 100%);
  opacity: calc(var(--peak) * 0.5);
  animation: water-ray var(--dur) ease-in-out var(--delay) infinite alternate;
  will-change: transform, opacity;
}

.water--sunlit .water__ray:nth-child(1) {
  --x: 30%;
  --w: 9vw;
  --tilt: 14deg;
  --peak: 0.55;
  --dur: 19s;
  --delay: -4s;
}
.water--sunlit .water__ray:nth-child(2) {
  --x: 41%;
  --w: 5vw;
  --tilt: 7deg;
  --peak: 0.8;
  --dur: 13s;
  --delay: -9s;
}
.water--sunlit .water__ray:nth-child(3) {
  --x: 50%;
  --w: 12vw;
  --tilt: 1deg;
  --peak: 0.65;
  --dur: 23s;
  --delay: -2s;
}
.water--sunlit .water__ray:nth-child(4) {
  --x: 58%;
  --w: 4vw;
  --tilt: -6deg;
  --peak: 0.9;
  --dur: 11s;
  --delay: -6s;
}
.water--sunlit .water__ray:nth-child(5) {
  --x: 67%;
  --w: 8vw;
  --tilt: -12deg;
  --peak: 0.5;
  --dur: 17s;
  --delay: -12s;
}

.water.is-paused .water__glow,
.water.is-paused .water__ray {
  animation-play-state: paused;
}

@media (min-width: 721px) {
  .water--sunlit .water__ray {
    /* Feather the shaft and its shimmer together before either reaches the sides. */
    width: calc(var(--w) * 1.35);
    --ray-mask: radial-gradient(
      ellipse 50% 100% at 50% 0%,
      #000 0%, rgb(0 0 0 / 70%) 35%, rgb(0 0 0 / 18%) 70%, transparent 100%
    );
    -webkit-mask-image: var(--ray-mask);
    mask-image: var(--ray-mask);
  }
}

/* Three of the shafts carry a brighter core that swells and
   fades on its own slow clock (not the sway's), so the light visibly moves
   in the dark water above the wordmark. The core sits in each shaft's upper
   half and inherits its sway, mask and breathing; only its opacity animates,
   on periods and offsets that never line up, so there is no shared flash.
   Reduced motion drops it entirely (static scene unchanged). */
.water--sunlit .water__ray:nth-child(2)::before,
.water--sunlit .water__ray:nth-child(3)::before,
.water--sunlit .water__ray:nth-child(4)::before {
  content: "";
  position: absolute;
  inset: 0 -30%; /* a soft halo a little wider than the shaft */
  background: linear-gradient(
    90deg,
    transparent 10%,
    rgba(130, 190, 245, 0.2) 35%,
    rgba(150, 205, 250, 0.42) 50%,
    rgba(130, 190, 245, 0.2) 65%,
    transparent 90%
  );
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.6) 30%, transparent 58%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.6) 30%, transparent 58%);
  opacity: 0;
  animation: water-ray-shimmer 9.5s ease-in-out -3s infinite alternate;
  will-change: opacity;
}
.water--sunlit .water__ray:nth-child(3)::before {
  animation-duration: 14s;
  animation-delay: -11s;
}
.water--sunlit .water__ray:nth-child(4)::before {
  animation-duration: 7.5s;
  animation-delay: -5.5s;
}

.water--sunlit.is-paused .water__ray::before {
  animation-play-state: paused; /* outranks the cores' animation shorthand */
}

@keyframes water-ray-shimmer {
  0% {
    opacity: 0.05;
  }
  55% {
    opacity: 1;
  }
  100% {
    opacity: 0.3;
  }
}

@media (prefers-reduced-motion: reduce) {
  .water--sunlit .water__ray::before {
    display: none;
  }
}

@keyframes water-glow {
  0% {
    transform: translate3d(-5%, 0, 0) scale(1);
    opacity: 0.8;
  }
  50% {
    transform: translate3d(1.5%, 1.5%, 0) scale(1.06);
    opacity: 1;
  }
  100% {
    transform: translate3d(6%, -1%, 0) scale(0.97);
    opacity: 0.85;
  }
}

@keyframes water-ray {
  0% {
    opacity: calc(var(--peak) * 0.2);
    transform: translateX(-50%) rotate(var(--tilt));
  }
  50% {
    opacity: var(--peak);
    transform: translateX(calc(-50% + 1.5vw)) rotate(calc(var(--tilt) + 2deg));
  }
  100% {
    opacity: calc(var(--peak) * 0.35);
    transform: translateX(calc(-50% - 1vw)) rotate(calc(var(--tilt) - 1.5deg));
  }
}

/* ---------------------------------------------------------------------------
 * Reduced-motion catch-all — kill transitions and animations
 * ------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------------------------------------------------------------------
 * Game launcher (desktop only)
 * ------------------------------------------------------------------------- */

body.landing .game-launcher {
  position: fixed;
  bottom: 6.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  background: transparent;
  color: var(--fg);
  border: none;
  border-radius: 50%;
  z-index: 20;
  padding: 0;
  overflow: visible;
  cursor: pointer;
  transition: transform 0.15s ease;
}

body.landing .game-launcher:hover {
  transform: translateY(-1px);
}

body.landing .game-launcher__canvas {
  position: absolute;
  width: 80px;
  height: 80px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  display: block;
}

@media (max-width: 1023px) {
  body.landing .game-launcher {
    display: none;
  }
}

/* ---------------------------------------------------------------------------
 * Games modal
 * ------------------------------------------------------------------------- */

body.landing .games-modal[open] {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  padding: 1.5rem;
  background: transparent;
  color: inherit;
  display: grid;
  place-items: center;
}

body.landing .games-modal::backdrop {
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

body.landing .games-modal__card {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: min(420px, 100%);
  max-height: 80vh;
  overflow: auto;
}

body.landing .games-modal__title {
  margin: 0 0 1.25rem 0;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg);
}

body.landing .games-modal__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

body.landing .games-modal__item {
  display: grid;
  gap: 0.25rem;
  padding: 0.85rem 1rem;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg);
  transition: border-color 0.15s ease, background 0.15s ease;
}

body.landing .games-modal__item:hover {
  border-color: var(--accent-2);
  background: rgba(34, 211, 238, 0.04);
}

body.landing .games-modal__item-title {
  display: block;
  font-weight: 700;
  font-size: 1rem;
}

body.landing .games-modal__item-desc {
  display: block;
  color: var(--fg-muted);
  font-size: 0.85rem;
}

body.landing .games-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: var(--fg-muted);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
}

body.landing .games-modal__close:hover {
  color: var(--fg);
}

/* ---------------------------------------------------------------------------
 * Game host (replaces the hero while playing)
 * ------------------------------------------------------------------------- */

body.landing .game-host {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  z-index: 20;
}

body.landing.game-active {
  overflow: hidden;
}

body.landing .game-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  background: var(--bg-elev);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 50%;
  z-index: 25;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
  transition: border-color 0.15s ease;
}

body.landing .game-close:hover {
  border-color: var(--accent-2);
}

body.landing.game-active .water,
body.landing.game-active .hero-mark,
body.landing.game-active .hero-overlay,
body.landing.game-active #nav {
  display: none;
}

/* ---------------------------------------------------------------------------
 * Breakout (brand-palette restyle)
 * ------------------------------------------------------------------------- */

body.landing .breakout-wrap {
  position: relative;
  width: min(95vw, calc(95vh * 4 / 3));
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow:
    0 20px 60px rgba(34, 211, 238, 0.18),
    0 0 0 1px var(--border);
}

body.landing .breakout-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: none;
}

body.landing .breakout-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  text-align: center;
  transition: opacity 0.25s ease;
  gap: 0.25rem;
}

body.landing .breakout-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

body.landing .breakout-overlay__title {
  font-size: 2.5rem;
  margin: 0 0 0.5rem 0;
  letter-spacing: 0.5em;
  color: var(--fg);
  font-weight: 700;
}

body.landing .breakout-overlay p {
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin: 0.15rem 0;
  line-height: 1.6;
}

body.landing .breakout-overlay kbd {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.75rem;
  color: var(--fg);
}

body.landing .breakout-overlay__btn {
  margin-top: 1.25rem;
  padding: 0.75rem 2rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--fg);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  transition: border-color 0.15s ease, transform 0.1s ease;
}

body.landing .breakout-overlay__btn:hover {
  border-color: var(--accent-2);
  transform: translateY(-1px);
}

body.landing .breakout-overlay__btn:active {
  transform: translateY(0);
}

/* ---------------------------------------------------------------------------
 * Asteroids
 * ------------------------------------------------------------------------- */

body.landing .asteroids-wrap {
  position: relative;
  width: min(95vw, calc(95vh * 4 / 3));
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow:
    0 20px 60px rgba(34, 211, 238, 0.18),
    0 0 0 1px var(--border);
}

body.landing .asteroids-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

body.landing .asteroids-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  text-align: center;
  transition: opacity 0.25s ease;
  gap: 0.25rem;
}

body.landing .asteroids-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

body.landing .asteroids-overlay__title {
  font-size: 2.5rem;
  margin: 0 0 0.5rem 0;
  letter-spacing: 0.5em;
  color: var(--fg);
  font-weight: 700;
}

body.landing .asteroids-overlay p {
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin: 0.15rem 0;
  line-height: 1.6;
}

body.landing .asteroids-overlay kbd {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.75rem;
  color: var(--fg);
}

body.landing .asteroids-overlay__btn {
  margin-top: 1.25rem;
  padding: 0.75rem 2rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--fg);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  transition: border-color 0.15s ease, transform 0.1s ease;
}

body.landing .asteroids-overlay__btn:hover {
  border-color: var(--accent-2);
  transform: translateY(-1px);
}

body.landing .asteroids-overlay__btn:active {
  transform: translateY(0);
}

/* ---------------------------------------------------------------------------
 * Space Invaders
 * ------------------------------------------------------------------------- */

body.landing .space-invaders-wrap {
  position: relative;
  width: min(95vw, calc(95vh * 8 / 9));
  aspect-ratio: 8 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow:
    0 20px 60px rgba(34, 211, 238, 0.18),
    0 0 0 1px var(--border);
  background: #000;
}

body.landing .space-invaders-canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

body.landing .space-invaders-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  text-align: center;
  transition: opacity 0.25s ease;
  gap: 0.25rem;
}

body.landing .space-invaders-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

body.landing .space-invaders-overlay__title {
  font-size: 2.5rem;
  margin: 0 0 0.5rem 0;
  letter-spacing: 0.5em;
  color: var(--fg);
  font-weight: 700;
}

body.landing .space-invaders-overlay p {
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin: 0.15rem 0;
  line-height: 1.6;
}

body.landing .space-invaders-overlay kbd {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.75rem;
  color: var(--fg);
}

body.landing .space-invaders-overlay__btn {
  margin-top: 1.25rem;
  padding: 0.75rem 2rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--fg);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  transition: border-color 0.15s ease, transform 0.1s ease;
}

body.landing .space-invaders-overlay__btn:hover {
  border-color: var(--accent-2);
  transform: translateY(-1px);
}

body.landing .space-invaders-overlay__btn:active {
  transform: translateY(0);
}

/* ---------------------------------------------------------------------------
 * Landing depth sections — "descend into the ocean"
 * ------------------------------------------------------------------------- */

/* Size the landing sections to the viewport with browser controls shown.
   Using the dynamic height here moves every later section (and resizes its
   canvas) when a phone's address bar retracts mid-swipe. */
body.landing .hero,
body.landing .depth,
body.landing .site-footer {
  min-height: 100vh;
  min-height: 100svh;
}

body.landing .hero {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  row-gap: 1.75rem;
  padding: 4.25rem var(--page-gutter) clamp(1rem, 3svh, 2rem);
  overflow: hidden;
}

@media (min-width: 42rem) and (max-height: 32rem) {
  body.landing .hero {
    grid-template: auto / 1fr 1fr;
    align-items: center;
    column-gap: 2rem;
  }
  body.landing .hero-mark {
    font-size: clamp(4.5rem, 11vw, 7rem);
  }
}

/* Everything below the waterline is one continuous water column: a single
   gradient that carries the deep-water tone from just under the hero all the
   way down, darkening to black at the bottom of the page. The depth sections
   are transparent so this shows through both of them seamlessly. */
body.landing .deep {
  position: relative;
  /* Starts at the water scene's bottom tone (#000617, see .water) so the hero
     and the deep sections meet with no seam line, then darkens to black. */
  background: linear-gradient(180deg, #000617 0%, #000 100%);
}

body.landing .depth {
  position: relative;
  align-items: center;
  overflow: hidden;
  display: grid;
  grid-template: 1fr auto / minmax(0, 1fr);
  gap: clamp(1rem, 3svh, 2rem);
  padding: 4.5rem var(--page-gutter) clamp(1rem, 3svh, 2rem);
}

body.landing .depth__bubbles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 0;
}

/* The seabed's lower edge meets the footer at the same color. */
.ocean-floor {
  display: block;
  width: 100%;
  height: clamp(3rem, 7vw, 6rem);
}

body.landing .depth__inner {
  margin-inline: auto;
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--container);
  display: flex;
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
}

body.landing .depth__text {
  flex: 1 1 0;
  min-width: 0;
}

body.landing .depth__graphic {
  flex: 1.4 1 0;
  min-width: 0;
  display: flex;
  justify-content: center;
}

body.landing .depth__title,
.contact__title {
  margin: 0 0 0.75rem 0;
  font-size: clamp(1.6rem, 3.2vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--fg);
}

.contact__title {
  font-size: clamp(1.8rem, 4vw, 3.25rem);
}

body.landing .depth__lead {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--fg-muted);
  max-width: 42ch;
}

body.landing .depth__eyebrow {
  margin: 0 0 0.75rem;
  color: #84bddb;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* What we do (#capabilities) */
body.landing .depth--capabilities {
  background:
    radial-gradient(circle at 82% 50%, rgba(1, 98, 177, 0.1), transparent 32%),
    transparent;
}

body.landing .depth__inner--capabilities .depth__text {
  flex: 0.85 1 0;
}

body.landing .depth__inner--capabilities .depth__graphic {
  flex: 1.55 1 0;
}

body.landing .capability-list {
  width: 100%;
  max-width: 43rem;
  border-top: 1px solid rgba(132, 189, 219, 0.2);
}

body.landing .capability {
  position: relative;
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid rgba(132, 189, 219, 0.2);
}

body.landing .capability::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 0;
  height: 1px;
  background: #84bddb;
  transition: width 0.45s ease;
}

body.landing .capability:hover::after {
  width: 100%;
}

body.landing .capability__number {
  padding-top: 0.2rem;
  color: #0162b1;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

body.landing .capability h3 {
  margin: 0 0 0.4rem;
  color: var(--fg);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.25;
}

body.landing .capability p {
  max-width: 54ch;
  margin: 0;
  color: #9ba1b5;
  font-size: 0.92rem;
  line-height: 1.55;
}

body.landing .capability__details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.55rem;
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
}

body.landing .capability__details li {
  padding: 0.2rem 0.55rem;
  border: 1px solid rgba(132, 189, 219, 0.16);
  border-radius: 999px;
  color: #84bddb;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.035em;
}

/* How we work (#services) */
body.landing .partnership-steps {
  display: grid;
  gap: 0.85rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
}

body.landing .partnership-steps li {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.85rem 0.65rem 0.85rem 0;
  border-top: 1px solid rgba(132, 189, 219, 0.14);
  cursor: default;
  transition: border-color 0.2s ease, background 0.2s ease;
}

body.landing .partnership-steps li:hover,
body.landing .partnership-steps li:focus-visible,
body.landing .partnership-steps li.is-active {
  border-top-color: rgba(143, 220, 236, 0.5);
}

body.landing .partnership-steps li:hover strong,
body.landing .partnership-steps li:focus-visible strong,
body.landing .partnership-steps li.is-active strong {
  color: #8fdcec;
}

body.landing .partnership-steps strong {
  color: #cfe1f5;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

body.landing .partnership-steps span {
  color: #9ba1b5;
  font-size: 0.86rem;
  line-height: 1.5;
}

/* Route-to-production current (#services) */
body.landing .route-current {
  width: 100%;
  max-width: 36rem;
  margin: 0;
  display: grid;
  gap: 0.65rem;
}

body.landing .route-current__zones,
body.landing .route-current__caption {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  text-align: center;
}

body.landing .route-current__zones span {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6d89a6;
  transition: color 0.2s ease;
}

body.landing .route-current__zones span.is-active {
  color: #8fdcec;
}

body.landing .route-current__viewport {
  position: relative;
  width: 100%;
  height: 18rem;
  border-top: 1px solid rgba(132, 189, 219, 0.2);
  border-bottom: 1px solid rgba(132, 189, 219, 0.2);
  background: linear-gradient(
    180deg,
    rgba(1, 20, 46, 0.28) 0%,
    rgba(0, 6, 23, 0.08) 50%,
    rgba(1, 20, 46, 0.28) 100%
  );
  overflow: hidden;
}

body.landing .route-current__canvas {
  display: block;
  width: 100%;
  height: 100%;
}

body.landing .route-current__caption span {
  font-size: 0.76rem;
  color: #7c91a8;
  letter-spacing: 0.02em;
}

body.landing .depth__graphic svg {
  width: 100%;
  max-width: 520px;
  height: auto;
}

/* How we partner (#services) */
body.landing .depth--services .depth__title {
  color: #f1f2f7;
}
body.landing .depth--services .depth__lead {
  color: #9ba1b5;
}
body.landing .depth--services .compass {
  max-width: 400px;
  overflow: visible;
}

/* Example applications (#applications) */
body.landing .depth--applications {
  background:
    radial-gradient(circle at 22% 52%, rgba(30, 92, 132, 0.08), transparent 32%),
    transparent;
}

body.landing .depth__inner--applications {
  align-items: stretch;
}

body.landing .depth__inner--applications .depth__text {
  flex: 1.25 1 0;
}

body.landing .depth__inner--applications .depth__graphic {
  flex: 0.85 1 0;
  align-items: stretch;
}

body.landing .application-list {
  margin-top: 2rem;
  border-top: 1px solid rgba(132, 189, 219, 0.18);
}

body.landing .application {
  display: grid;
  grid-template-columns: minmax(9rem, 0.7fr) minmax(0, 1.3fr);
  gap: 1.5rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid rgba(132, 189, 219, 0.18);
}

body.landing .application h3 {
  margin: 0;
  color: #dce7f2;
  font-size: 0.92rem;
  line-height: 1.4;
}

body.landing .application p {
  margin: 0;
  color: #929aad;
  font-size: 0.86rem;
  line-height: 1.55;
}

body.landing .production-principles {
  width: 100%;
  max-width: 28rem;
  margin-left: auto;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border: 1px solid rgba(132, 189, 219, 0.18);
  background: linear-gradient(145deg, rgba(8, 25, 44, 0.72), rgba(2, 8, 19, 0.42));
}

body.landing .production-principles__label {
  margin: 0 0 0.65rem;
  color: #84bddb;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

body.landing .production-principles h3 {
  margin: 0;
  color: var(--fg);
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  line-height: 1.25;
}

body.landing .production-principles dl {
  margin: 1.5rem 0;
}

body.landing .production-principles dl div {
  display: grid;
  grid-template-columns: minmax(7rem, 0.8fr) minmax(0, 1.2fr);
  gap: 1rem;
  padding: 0.8rem 0;
  border-top: 1px solid rgba(132, 189, 219, 0.14);
}

body.landing .production-principles dt {
  color: #cfe1f5;
  font-size: 0.78rem;
  font-weight: 700;
}

body.landing .production-principles dd {
  margin: 0;
  color: #929aad;
  font-size: 0.78rem;
  line-height: 1.5;
}

@media (prefers-reduced-motion: no-preference) {
  .compass__dial {
    transform-box: view-box;
    transform-origin: center;
    animation: compass-dial-turn 120s linear infinite;
  }
}
@keyframes compass-dial-turn {
  to { transform: rotate(1turn); }
}

body.landing a.section-next {
  position: relative;
  display: flex;
  width: fit-content;
  max-width: 100%;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.45em;
  margin-inline-start: auto;
  color: #84bddb;
  font-size: 0.88rem;
  text-decoration: none;
  text-underline-offset: 0.25em;
}

body.landing a.section-next:is(:hover, :focus-visible) {
  color: #cfe1f5;
  text-decoration: underline;
}

/* Reveal-on-scroll: hidden until the section gets `.revealed` (added in JS). */
body.landing .depth .depth__text,
body.landing .depth .depth__graphic {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

body.landing .depth.revealed .depth__text {
  opacity: 1;
  transform: none;
}

body.landing .depth.revealed .depth__graphic {
  opacity: 1;
  transform: none;
  transition-delay: 0.25s;
  transition-duration: 0.5s;
}

body.landing.game-active .deep,
body.landing.game-active .site-footer {
  display: none;
}

.site-footer {
  position: relative;
  background: #04070b;
  padding: 1rem 1.5rem 7rem;
}

body.landing .site-footer {
  display: grid;
  align-content: center;
  padding-block: 4.5rem;
}

body.landing .site-footer__inner {
  width: 100%;
}

.site-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  grid-template-areas: "nav contact";
  align-items: start;
  gap: clamp(2rem, 5vw, 5rem);
  max-width: var(--container);
  margin-inline: auto;
}

.site-footer__nav {
  grid-area: nav;
}

.site-footer__nav ul {
  display: grid;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer__nav a {
  display: inline-block;
  padding-block: 0.5rem;
  color: var(--fg);
  text-decoration: none;
}

.site-footer__nav a:hover {
  color: var(--accent-2);
}

.contact__inner {
  grid-area: contact;
  min-width: 0;
  scroll-margin-top: 6rem;
}

.contact__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1.5rem;
  border: 0;
  padding: 0;
  margin: 2rem 0 0;
  min-width: 0;
}

.contact__fields label {
  display: grid;
  gap: 0.4rem;
  font-weight: 600;
}

.contact__fields input,
.contact__fields textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  font: inherit;
  font-weight: 400;
  color: var(--fg);
  background: #080f16;
  border: 1px solid #526675;
  border-radius: 0.4rem;
}

.contact__comments {
  grid-column: 1 / -1;
}

.contact__comments textarea {
  resize: vertical;
  min-height: 7rem;
}

.contact__send {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  justify-self: start;
  padding: 0.65rem 1.4rem;
  border-radius: 0.4rem;
  color: #03111b;
  background: #8fdcec;
  font-weight: 700;
}

.contact__send:hover:enabled { background: #b9edfa; }
.contact__send:disabled { opacity: 0.65; cursor: default; }
.contact__status { min-height: 1.6em; margin: 0.75rem 0 0; }

@media (max-width: 600px) {
  .contact__fields { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  body.landing .depth__inner {
    flex-direction: column;
  }
  body.landing .depth__inner--capabilities {
    align-items: stretch;
    gap: 1.75rem;
  }
  body.landing .capability {
    grid-template-columns: 2rem minmax(0, 1fr);
    gap: 0.75rem;
    padding: 1.1rem 0;
  }
  body.landing .capability p {
    font-size: 0.86rem;
  }
  body.landing .partnership-steps {
    margin-top: 1.25rem;
  }
  body.landing .partnership-steps li {
    grid-template-columns: 4.75rem minmax(0, 1fr);
    gap: 0.75rem;
  }
  body.landing .depth__inner--applications {
    align-items: stretch;
  }
  body.landing .application {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.35rem;
  }
  body.landing .production-principles {
    max-width: none;
    margin: 0;
  }
  .site-footer__inner {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "contact" "nav";
  }
}

/* Show section content immediately when motion is reduced. */
@media (prefers-reduced-motion: reduce) {
  body.landing .depth .depth__text,
  body.landing .depth .depth__graphic {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------------------------------------------------------------------------
 * AI adoption grid (#adoption). The stage list
 * holds every caption and is fully visible without JS; the 30×30 grid (which is
 * also the play/pause button) and its captions appear only once
 * `.aiviz--live` is added by frontend/index/adoption.ts. Sources are listed in
 * an HTML comment in public/index.html, not in the page UI.
 * ------------------------------------------------------------------------- */
body.landing .aiviz {
  --aiviz-on: #f5b85c;
  --aiviz-line: #7d5f2e;
  --aiviz-off: #3a2d18;
  --aiviz-ground: #02030b;
}

body.landing .aiviz__inner {
  margin-inline: auto;
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--container);
}

body.landing .aiviz__title {
  max-width: 24ch;
  margin-bottom: 2rem;
}

body.landing .aiviz__figure {
  margin: 0;
  display: flex;
  flex-direction: column;
}

/* Live figure: grid beside its caption; stacked on narrow screens. Hidden
   until JS builds the grid. */
body.landing .aiviz__panel {
  display: none;
}
body.landing .aiviz--live .aiviz__panel {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3.5rem);
}
body.landing .aiviz__panel .aiviz__grid {
  flex: 0 1 26rem;
  min-width: 0;
}
body.landing .aiviz__readout {
  flex: 1 1 0;
  min-width: 0;
  max-width: 34rem;
}

/* The stage list holds every caption. While the grid runs it is read by
   assistive tech only (the visible captions are aria-hidden copies). Without
   JS, or under reduced motion while paused, it shows as plain text. */
body.landing .aiviz--live:not(.aiviz--static) .aiviz__figcaption {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
body.landing .aiviz__figcaption {
  margin-top: 1.5rem;
}
body.landing .aiviz__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  max-width: 48rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--fg-muted);
}
body.landing .aiviz__stage {
  display: flow-root;
}

body.landing .aiviz__stage-title {
  display: inline;
  margin: 0;
  font-size: inherit;
  font-weight: 600;
  color: var(--fg);
}
body.landing .aiviz__stage-body {
  display: inline;
  margin: 0;
}

/* Static mini-grid (no-JS figure): `--full` lit rows plus `--part` cells. */
body.landing .aiviz__mini {
  --c: 0.2rem;
  float: left;
  margin: 0.2rem 0.75rem 0 0;
  width: calc(var(--c) * 30);
  height: calc(var(--c) * 30);
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(var(--c) - 1px), var(--aiviz-ground) calc(var(--c) - 1px) var(--c)),
    repeating-linear-gradient(180deg, transparent 0 calc(var(--c) - 1px), var(--aiviz-ground) calc(var(--c) - 1px) var(--c)),
    linear-gradient(var(--aiviz-on), var(--aiviz-on)) 0 calc(var(--full) * var(--c)) / calc(var(--part) * var(--c)) var(--c) no-repeat,
    linear-gradient(var(--aiviz-on), var(--aiviz-on)) 0 0 / 100% calc(var(--full) * var(--c)) no-repeat,
    var(--aiviz-off);
}
body.landing .aiviz--live .aiviz__mini {
  display: none;
}

body.landing .aiviz__caption {
  margin: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
}
body.landing .aiviz__caption.is-shown {
  opacity: 1;
}

body.landing .aiviz__grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(30, 1fr);
  margin: 0;
  font: inherit;
  color: inherit;
  background: var(--aiviz-ground);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  /* 30×30 in the same box as the old 20×20: gaps scale by 2/3 too. */
  gap: calc(2px * 2 / 3);
  width: 100%;
  aspect-ratio: 1;
  padding: 6px;
  border: 1px solid var(--aiviz-line);
  border-radius: 6px;
  transition: border-color 0.6s ease;
}

body.landing .aiviz__cell {
  border-radius: 1px;
  background: var(--aiviz-off);
  transition: background-color 0.8s ease var(--d, 0s), opacity 0.7s ease var(--d, 0s);
}
body.landing .aiviz__grid .aiviz__cell.is-on {
  background: var(--aiviz-on);
}

body.landing .aiviz__caption {
  min-height: 3.9em;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--fg);
}



/* Without JS the grid is not built; only the plain stage list shows. */
body.landing .aiviz:not(.aiviz--live) .aiviz__figcaption {
  order: 1;
  margin-top: 0;
}
@media (max-width: 720px) {
  body.landing .aiviz--live .aiviz__panel {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  body.landing .aiviz__panel .aiviz__grid {
    flex: none;
    width: 100%;
    max-width: 24rem;
    margin: 0 auto;
    gap: calc(1px * 2 / 3);
    padding: 4px;
  }
  body.landing .aiviz__readout {
    max-width: 24rem;
    width: 100%;
    margin: 0 auto;
  }
}

@media (max-width: 720px) {
  body.landing .depth--adoption .aiviz__title {
    margin-bottom: 1.25rem;
  }
  /* Reserve the longest caption's five lines so the grid stays still between frames. */
  body.landing .aiviz__caption {
    min-height: 5lh;
  }
  /* Allow for the title, caption, gaps, padding and controls. */
  body.landing .depth--adoption {
    --aiviz-reserve: 22.5rem;
  }
  body.landing .depth--adoption.aiviz--static {
    --aiviz-reserve: 33rem; /* + the plain stage list (reduced motion) */
  }
  body.landing .depth--adoption .aiviz__panel .aiviz__grid {
    max-width: max(7rem, min(24rem, calc(100vh - var(--aiviz-reserve))));
    max-width: max(7rem, min(24rem, calc(100svh - var(--aiviz-reserve))));
  }
  /* Larger labels in the compass's own units, so they stay readable when the
     compass is scaled down to fit a phone screen. */
  body.landing .depth--services .compass text {
    font-size: 18px;
    letter-spacing: 2px;
  }
  /* The compass is square, so its cap is the height left over. */
  body.landing .depth--services .depth__graphic .compass {
    max-width: max(8rem, min(340px, calc(100vh - 25rem)));
    max-width: max(8rem, min(340px, calc(100svh - 25rem)));
  }
}
/* Keep the scaled compass labels readable on short phones. */
@media (max-width: 720px) and (max-height: 620px) {
  body.landing .depth--services .compass text {
    font-size: 23px;
    letter-spacing: 1.5px;
  }
}
@media (max-width: 720px) and (max-height: 545px) {
  body.landing .depth--services .compass text {
    font-size: 26px;
    letter-spacing: 1px;
  }
}
/* Under 360px the title and the longest caption each wrap one line more. */
@media (max-width: 359px) {
  body.landing .depth--adoption {
    --aiviz-reserve: 26rem;
  }
  body.landing .depth--adoption.aiviz--static {
    --aiviz-reserve: 37.5rem;
  }
}

/* Reduced motion: no fades or staggered colour changes; steps swap instantly. */
@media (prefers-reduced-motion: reduce) {
  body.landing .aiviz__cell,
  body.landing .aiviz__caption,
  body.landing .aiviz__grid {
    transition: none;
  }
}

/* ---------------------------------------------------------------------------
 * AI adoption sonar (#adoption) — ocean-palette depth-sounding dial paired
 * with scannable, clickable stages.
 * ------------------------------------------------------------------------- */

body.landing .depth--adoption {
  --viz-cyan: #8fdcec;
  --viz-ice: #cfe1f5;
  --viz-blue: #84bddb;
  --viz-deep: #0162b1;
  --viz-line: rgba(132, 189, 219, 0.18);
  background:
    radial-gradient(circle at 26% 52%, rgba(1, 98, 177, 0.14), transparent 36%),
    transparent;
}

body.landing .aiviz__header {
  margin-bottom: 2.25rem;
}

body.landing .aiviz__header .aiviz__title {
  margin-bottom: 0;
  max-width: 22ch;
}

body.landing .aiviz--live .aiviz__steps--sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

body.landing .sonar__stage {
  display: grid;
  grid-template-columns: minmax(260px, 380px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
}

body.landing .sonar__dial {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
}

body.landing .sonar__canvas {
  display: block;
  width: 100%;
  height: 100%;
}

body.landing .aiviz__stage-list {
  display: grid;
  border-top: 1px solid var(--viz-line);
}

body.landing .stage-row {
  position: relative;
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 1.25rem;
  align-items: baseline;
  width: 100%;
  padding: 1.15rem 1rem 1.15rem 1.15rem;
  border-bottom: 1px solid var(--viz-line);
  text-align: left;
  transition: background 0.2s ease;
}

body.landing .stage-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--viz-cyan);
  opacity: 0;
  transition: opacity 0.25s ease;
}

body.landing .stage-row:hover {
  background: rgba(132, 189, 219, 0.04);
}

body.landing .stage-row.is-active {
  background: rgba(143, 220, 236, 0.06);
}

body.landing .stage-row.is-active::before {
  opacity: 1;
}

body.landing .stage-row__stat {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--viz-cyan);
  letter-spacing: 0.02em;
}

body.landing .stage-row__body {
  display: grid;
  gap: 0.25rem;
}

body.landing .stage-row__body strong {
  color: var(--fg);
  font-size: 1rem;
  font-weight: 600;
}

body.landing .stage-row__body span {
  color: #9ba1b5;
  font-size: 0.88rem;
  line-height: 1.5;
}

body.landing .aiviz__mobile-detail {
  display: none;
}

@media (max-width: 900px) {
  body.landing .sonar__stage {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }
  body.landing .sonar__dial {
    max-width: 240px;
    margin: 0 auto;
  }
}

@media (max-width: 720px) {
  body.landing .depth {
    row-gap: 0.65rem;
    padding-block: 4rem max(0.75rem, env(safe-area-inset-bottom));
  }
  body.landing .depth__eyebrow {
    margin-bottom: 0.4rem;
    font-size: 0.68rem;
  }
  body.landing .depth__title {
    margin-bottom: 0.5rem;
    font-size: clamp(1.38rem, 6vw, 1.85rem);
  }
  body.landing .depth__lead {
    font-size: 0.88rem;
    line-height: 1.48;
  }
  body.landing .depth__inner {
    gap: 1.15rem;
  }

  /* #adoption: sonar + 4-tab stat bar + active readout fit on one screen. */
  body.landing .aiviz__header {
    margin-bottom: 1rem;
  }
  body.landing .sonar__stage {
    gap: 1rem;
  }
  body.landing .sonar__dial {
    max-width: clamp(160px, 24svh, 205px);
  }
  body.landing .aiviz__stage-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.45rem;
    border-top: 0;
  }
  body.landing .stage-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.15rem;
    justify-items: center;
    text-align: center;
    padding: 0.55rem 0.25rem;
    border: 1px solid var(--viz-line);
    border-radius: 0.35rem;
    background: rgba(7, 19, 36, 0.38);
  }
  body.landing .stage-row::before {
    display: none;
  }
  body.landing .stage-row.is-active {
    border-color: rgba(143, 220, 236, 0.65);
    background: rgba(143, 220, 236, 0.1);
  }
  body.landing .stage-row__stat {
    font-size: 0.92rem;
  }
  body.landing .stage-row__body {
    display: block;
  }
  body.landing .stage-row__body strong {
    display: block;
    font-size: 0.64rem;
    font-weight: 600;
    line-height: 1.2;
    color: #cfe1f5;
  }
  body.landing .stage-row__body span {
    display: none;
  }
  body.landing .aiviz__mobile-detail {
    display: grid;
    gap: 0.3rem;
    min-height: 5.5rem;
    align-content: start;
    padding: 0.9rem 1rem;
    border: 1px solid var(--viz-line);
    border-left: 2px solid var(--viz-cyan);
    border-radius: 0.35rem;
    background: rgba(7, 19, 36, 0.48);
  }
  body.landing .aiviz__mobile-detail strong {
    color: var(--fg);
    font-size: 0.96rem;
    font-weight: 600;
  }
  body.landing .aiviz__mobile-detail p {
    margin: 0;
    color: #9ba1b5;
    font-size: 0.86rem;
    line-height: 1.48;
  }

  /* #capabilities: all three pillars fit cleanly on one phone screen. */
  body.landing .depth__inner--capabilities {
    gap: 1rem;
  }
  body.landing .capability {
    grid-template-columns: 1.75rem minmax(0, 1fr);
    gap: 0.65rem;
    padding: 0.78rem 0;
  }
  body.landing .capability h3 {
    margin-bottom: 0.25rem;
    font-size: 1rem;
  }
  body.landing .capability p {
    font-size: 0.82rem;
    line-height: 1.44;
  }
  body.landing .capability__details {
    gap: 0.3rem;
    margin-top: 0.5rem;
  }
  body.landing .capability__details li {
    padding: 0.14rem 0.45rem;
    font-size: 0.64rem;
  }

  /* #services: headline, all 3 steps, and live current fit together on screen. */
  body.landing .partnership-steps {
    gap: 0.45rem;
    margin-top: 0.85rem;
  }
  body.landing .partnership-steps li {
    grid-template-columns: 4.5rem minmax(0, 1fr);
    gap: 0.65rem;
    padding: 0.5rem 0;
  }
  body.landing .partnership-steps strong {
    font-size: 0.72rem;
  }
  body.landing .partnership-steps span {
    font-size: 0.8rem;
    line-height: 1.4;
  }
  body.landing .route-current {
    gap: 0.4rem;
  }
  body.landing .route-current__zones span {
    font-size: 0.64rem;
    letter-spacing: 0.06em;
  }
  body.landing .route-current__viewport {
    height: 9.25rem;
  }
  body.landing .route-current__caption span {
    font-size: 0.7rem;
  }

  /* #applications: tighter rows and 2x2 production grid so it fits one screen. */
  body.landing .application-list {
    margin-top: 0.8rem;
  }
  body.landing .application {
    padding: 0.55rem 0;
  }
  body.landing .application h3 {
    font-size: 0.86rem;
  }
  body.landing .application p {
    font-size: 0.8rem;
    line-height: 1.4;
  }
  body.landing .production-principles {
    padding: 0.95rem 1rem;
  }
  body.landing .production-principles__label {
    margin-bottom: 0.35rem;
  }
  body.landing .production-principles h3 {
    font-size: 1.05rem;
  }
  body.landing .production-principles dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem 0.85rem;
    margin: 0.75rem 0;
  }
  body.landing .production-principles dl div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.15rem;
    padding: 0.45rem 0 0;
  }
  body.landing .production-principles dt {
    font-size: 0.74rem;
  }
  body.landing .production-principles dd {
    font-size: 0.73rem;
    line-height: 1.38;
  }
}


