:root {
  /* Must match the publications' color-scheme: with a mismatch the
     browser gives same-origin iframes an opaque canvas and the shared
     backdrop cannot show through the embedded views. */
  color-scheme: dark;
  --page: #040404;
  --surface: rgba(22, 20, 19, 0.8);
  --surface-strong: rgba(17, 16, 16, 0.94);
  --text: #ffffff;
  --text-dim: rgba(255, 255, 255, 0.66);
  --accent: #bf6a45;
  --accent-light: #deb29c;
  --border: rgba(255, 255, 255, 0.11);
  --card-border: rgba(255, 255, 255, 0.16);
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-highlight: rgba(255, 255, 255, 0.105);
  --glass-surface: linear-gradient(145deg, rgba(38, 34, 32, 0.78), rgba(17, 17, 17, 0.78));
  --shadow-soft: 0 20px 54px rgba(0, 0, 0, 0.54);
  --shadow-deep: 0 38px 100px rgba(0, 0, 0, 0.78);
  --toggle-top: 7.6rem;
  --nav-clearance: 11.4rem;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* { box-sizing: border-box; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { border-left: 1px solid rgba(255, 255, 255, 0.07); background: #050505; }
::-webkit-scrollbar-thumb { border: 2px solid #050505; background: #713b2b; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

html {
  min-height: 100%;
  background: var(--page);
}

body {
  position: relative;
  isolation: isolate;
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Space Grotesk", "Avenir Next", "Segoe UI", Arial, sans-serif;
  background: var(--page);
  overflow-x: hidden;
}

/* Backdrop: the whitepaper page's treatment, verbatim — large brain
   offset left under layered dark gradients, plus its noise/grid film. */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: -2;
  background:
    linear-gradient(
      90deg,
      rgba(10, 10, 10, 0.8) 0%,
      rgba(10, 10, 10, 0.48) 34%,
      rgba(10, 10, 10, 0.62) 54%,
      rgba(10, 10, 10, 0.9) 68%,
      rgba(10, 10, 10, 0.99) 100%
    ),
    linear-gradient(
      180deg,
      rgba(10, 10, 10, 0.7) 0%,
      rgba(10, 10, 10, 0.08) 30%,
      rgba(10, 10, 10, 0.24) 68%,
      rgba(10, 10, 10, 0.94) 100%
    ),
    radial-gradient(
      circle at 38% 44%,
      rgba(191, 106, 69, 0.16) 0%,
      rgba(105, 50, 34, 0.07) 28%,
      transparent 55%
    ),
    url("./assets/neural-brain-hero.webp") 50% center / cover no-repeat;
}

body::after {
  z-index: -1;
  opacity: 0.76;
  background:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.04'/%3E%3C/svg%3E"),
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: auto, 52px 52px, 52px 52px;
}

body.frame-active {
  background: var(--page);
  overflow: hidden;
}

.skip-link {
  position: absolute;
  left: -999rem;
  top: 0;
  z-index: 40;
  padding: 0.6rem 1rem;
  background: var(--surface-strong);
  color: var(--text);
}
.skip-link:focus { left: 0.75rem; top: 0.75rem; }

/* Ambient orbs: the whitepaper page's spec, verbatim. */
.ambient {
  position: fixed;
  z-index: 0;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  opacity: 0.22;
  filter: blur(120px);
  pointer-events: none;
}
.ambient-one { top: -15rem; left: 18%; background: #6d3626; }
.ambient-two { bottom: -19rem; left: -12rem; background: #592e22; }

/* ── Masthead: identical language to the standalone publication
      headers (wordmark, divider, tagline) ─────────────────────── */
.master-head {
  position: fixed;
  top: 0.9rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(calc(100% - 2rem), 55rem);
  padding: 0.85rem 2rem 0.78rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 2.2rem;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.1), transparent 52%),
    linear-gradient(145deg, rgba(36, 31, 31, 0.78), rgba(6, 6, 7, 0.78));
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.13),
    inset 0 -1px rgba(201, 111, 71, 0.17),
    0 18px 55px rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(24px) saturate(126%);
  backdrop-filter: blur(24px) saturate(126%);
}

.wordmark { display: inline-flex; align-items: center; flex-shrink: 0; }
.wordmark img {
  display: block;
  width: clamp(10rem, 17vw, 13rem);
  height: auto;
}

.head-divider {
  width: clamp(11rem, 20vw, 15rem);
  height: 1px;
  margin: 0.55rem 0 0.5rem;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.64), transparent);
}

.master-head p {
  margin: 0;
  font-family: "Space Mono", monospace;
  font-size: clamp(0.62rem, 1vw, 0.78rem);
  letter-spacing: 0.09em;
}

/* ── View toggle: its own floating pill beneath the masthead ──── */
.master-nav {
  position: fixed;
  top: var(--toggle-top);
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  justify-content: center;
  width: min(calc(100% - 2rem), 55rem);
}

.nav-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
  padding: 0.3rem 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, 0.1), transparent 52%),
    linear-gradient(145deg, rgba(36, 31, 31, 0.82), rgba(6, 6, 7, 0.82));
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.13),
    var(--shadow-soft);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.view-switch {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  overscroll-behavior-inline: contain;
}
.view-switch::-webkit-scrollbar { display: none; }

.view-tab {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  font: 500 0.86rem/1 "Space Grotesk", sans-serif;
  letter-spacing: 0.035em;
  padding: 0.68rem 1.15rem;
  cursor: pointer;
  white-space: nowrap;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
  scroll-snap-align: center;
}
.view-tab:hover { color: var(--text); }
.view-tab:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 2px;
}
.view-tab[aria-current="page"] {
  color: #fff;
  background: linear-gradient(135deg, #d37b55, #a34f2e);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.22),
    0 8px 22px rgba(191, 106, 69, 0.34);
}

/* ── Stage & views ──────────────────────────────────────────── */
.stage {
  position: relative;
  z-index: 1;
  padding-top: var(--nav-clearance);
  min-height: 100vh;
}

.view[hidden] { display: none; }

.view-frame {
  position: fixed;
  inset: var(--nav-clearance) 0 0 0;
  z-index: 1;
}
.view-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: transparent;
}

.frame-loading {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  margin: 0;
  color: var(--accent-light);
  font: 400 0.85rem/1 "Space Mono", monospace;
  letter-spacing: 0.08em;
  animation: pulse 1.1s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes pulse { from { opacity: 0.35; } to { opacity: 1; } }

/* ── Overview ───────────────────────────────────────────────── */
.overview-shell {
  max-width: 76rem;
  min-height: calc(100svh - var(--nav-clearance));
  margin: 0 auto;
  padding: clamp(1.4rem, 3.2vh, 2.4rem) clamp(1.1rem, 4vw, 2.5rem) 2.5rem;
}

.overview-hero {
  max-width: 72rem;
  margin: 0 auto;
  text-align: center;
}

/* Headline: the roadmap page's h1 format (white lead line, copper
   gradient second line). */
.overview-hero h1 {
  max-width: none;
  margin: 0;
  color: var(--text);
  font-size: clamp(3.65rem, 5.4vw, 5.7rem);
  font-weight: 500;
  letter-spacing: -0.07em;
  line-height: 0.9;
  text-shadow: 0 14px 56px rgba(0, 0, 0, 0.72), 0 0 26px rgba(255, 255, 255, 0.025);
}

.overview-hero h1 > span,
.overview-hero h1 em { display: block; }

.overview-hero h1 em {
  margin-top: 0.05em;
  background: linear-gradient(110deg, #e8c0ae 4%, #cf805f 48%, #a94f32 96%);
  background-clip: text;
  color: var(--accent-light);
  font-size: 0.72em;
  font-style: normal;
  letter-spacing: -0.06em;
  line-height: 1;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.overview-lead {
  max-width: 52rem;
  margin: clamp(0.95rem, 2.1vh, 1.35rem) auto 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(1rem, 1.45vw, 1.14rem);
  line-height: 1.5;
  text-wrap: balance;
}
.overview-lead span { display: block; }
.overview-lead span + span {
  margin-top: 0.12rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.94em;
}

.pub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17.5rem, 1fr));
  gap: clamp(0.85rem, 1.5vw, 1.15rem);
  margin-top: clamp(1.4rem, 3vh, 2rem);
}

.pub-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.62rem;
  min-height: 13.1rem;
  padding: 1.2rem 1.25rem 1.15rem;
  border: 1px solid var(--card-border);
  border-radius: 1.1rem;
  background: var(--glass-surface);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.pub-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-highlight), transparent);
}

.pub-kicker {
  margin: 0;
  color: var(--accent-light);
  font: 400 0.72rem/1 "Space Mono", monospace;
  letter-spacing: 0.06em;
}

.pub-card h2 {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 500;
}

.pub-card p:not(.pub-kicker) {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.5;
  flex: 1;
}

.pub-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.8rem;
  margin-top: 0.35rem;
}

.pub-open {
  appearance: none;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: linear-gradient(145deg, rgba(191, 106, 69, 0.32), rgba(191, 106, 69, 0.12));
  color: var(--text);
  font: 500 0.85rem/1 "Space Grotesk", sans-serif;
  padding: 0.6rem 1.05rem;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}
.pub-open span {
  display: inline-block;
  margin-left: 0.2rem;
  transition: transform 160ms ease;
}
.pub-open:hover { background: rgba(191, 106, 69, 0.4); transform: translateY(-1px); }
.pub-open:hover span { transform: translateX(0.18rem); }
.pub-open:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 2px; }

.overview-footer {
  margin-top: clamp(1.5rem, 3.4vh, 2.4rem);
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

@media (min-width: 56rem) {
  .overview-hero h1 em {
    white-space: nowrap;
  }

  .pub-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 55.99rem) {
  :root {
    --toggle-top: 7.1rem;
    --nav-clearance: 10.85rem;
  }

  .master-head {
    top: max(0.7rem, var(--safe-top));
  }

  .master-nav {
    top: calc(var(--toggle-top) + var(--safe-top));
  }

  .overview-shell {
    padding-top: clamp(1.2rem, 2.7vh, 2rem);
  }

  .overview-hero h1 {
    font-size: clamp(3.2rem, 9vw, 4.6rem);
  }

  .overview-hero h1 em {
    font-size: 0.76em;
    line-height: 1.04;
  }

  .pub-card {
    min-height: 0;
  }

  .overview-footer {
    margin-top: 2.5rem;
  }
}
.overview-footer p {
  margin: 0;
  color: var(--text-dim);
  font: 400 0.74rem/1.6 "Space Mono", monospace;
  letter-spacing: 0.04em;
}

/* ── Small screens ──────────────────────────────────────────── */
@media (max-width: 40rem) {
  :root {
    --toggle-top: 6.25rem;
    --nav-clearance: 9.85rem;
  }

  .master-head {
    top: max(0.5rem, var(--safe-top));
    width: calc(100% - 1.2rem - var(--safe-left) - var(--safe-right));
    padding: 0.58rem 1rem 0.52rem;
    border-radius: 1.7rem;
  }
  .wordmark img { width: clamp(8.65rem, 38vw, 10.75rem); }
  .head-divider { width: clamp(9.5rem, 44vw, 12rem); margin: 0.42rem 0 0.38rem; }
  .master-head p { font-size: 0.56rem; letter-spacing: 0.055em; text-align: center; }
  .master-nav {
    top: calc(var(--toggle-top) + var(--safe-top));
    width: calc(100% - 1.2rem - var(--safe-left) - var(--safe-right));
  }
  .nav-row { justify-content: flex-start; width: 100%; overflow: hidden; }
  .view-switch { width: 100%; padding-inline: 0.08rem; }
  .view-tab {
    flex: 0 0 auto;
    min-height: 2.75rem;
    padding: 0.62rem 0.82rem;
    font-size: 0.78rem;
  }
  .stage { padding-top: calc(var(--nav-clearance) + var(--safe-top)); }
  .view-frame { inset: calc(var(--nav-clearance) + var(--safe-top)) 0 var(--safe-bottom) 0; }
  .overview-shell {
    min-height: calc(100svh - var(--nav-clearance) - var(--safe-top));
    padding: clamp(0.9rem, 2.4vh, 1.35rem) max(0.9rem, var(--safe-right)) max(1.5rem, var(--safe-bottom)) max(0.9rem, var(--safe-left));
  }
  .overview-hero h1 { font-size: clamp(2.75rem, 13.6vw, 3.75rem); line-height: 0.92; }
  .overview-hero h1 em { font-size: 0.74em; line-height: 1.02; }
  .overview-lead { max-width: 31rem; margin-top: 0.85rem; font-size: clamp(0.93rem, 4.15vw, 1.04rem); line-height: 1.45; }
  .overview-lead span + span { margin-top: 0.3rem; }
  .pub-grid { grid-template-columns: minmax(0, 1fr); gap: 0.78rem; margin-top: 1.1rem; }
  .pub-card { gap: 0.52rem; padding: 1rem 1.05rem; border-radius: 1rem; }
  .pub-card h2 { font-size: 1.18rem; }
  .pub-card p:not(.pub-kicker) { font-size: 0.88rem; line-height: 1.45; }
  .pub-open { min-height: 2.75rem; padding-inline: 1.05rem; }
  .overview-footer { margin-top: 1.35rem; padding-bottom: max(0.5rem, var(--safe-bottom)); }
  body::before {
    background:
      linear-gradient(
        180deg,
        rgba(10, 10, 10, 0.58) 0%,
        rgba(10, 10, 10, 0.28) 24%,
        rgba(10, 10, 10, 0.82) 62%,
        rgba(10, 10, 10, 0.99) 100%
      ),
      linear-gradient(
        90deg,
        rgba(10, 10, 10, 0.82) 0%,
        rgba(10, 10, 10, 0.38) 58%,
        rgba(10, 10, 10, 0.64) 100%
      ),
      radial-gradient(
        circle at 72% 20%,
        rgba(191, 106, 69, 0.14) 0%,
        transparent 48%
      ),
      url("./assets/neural-brain-hero.webp") 50% top / auto 68vh no-repeat;
  }
  body::after { opacity: 0.62; }
}

@media (max-width: 23.75rem) {
  :root {
    --toggle-top: 5.95rem;
    --nav-clearance: 9.45rem;
  }

  .master-head { padding-inline: 0.75rem; }
  .master-head p { font-size: 0.51rem; }
  .view-tab { padding-inline: 0.68rem; font-size: 0.74rem; }
  .overview-hero h1 { font-size: clamp(2.45rem, 13vw, 3rem); }
}

/* Short landscape displays need a compact chrome so the publication itself
   remains useful. Desktop and standard-height tablet geometry is untouched. */
@media (max-height: 35rem) and (min-width: 40.01rem) {
  :root {
    --toggle-top: 4.8rem;
    --nav-clearance: 8.2rem;
  }

  .master-head {
    top: max(0.38rem, var(--safe-top));
    width: min(calc(100% - 1.2rem), 48rem);
    padding: 0.42rem 1.4rem 0.38rem;
    border-radius: 1.55rem;
  }
  .wordmark img { width: 8.25rem; }
  .head-divider { width: 9.5rem; margin: 0.27rem 0 0.25rem; }
  .master-head p { font-size: 0.52rem; }
  .master-nav { top: calc(var(--toggle-top) + var(--safe-top)); }
  .view-tab { min-height: 2.5rem; padding: 0.55rem 0.95rem; font-size: 0.78rem; }
  .stage { padding-top: calc(var(--nav-clearance) + var(--safe-top)); }
  .view-frame { inset: calc(var(--nav-clearance) + var(--safe-top)) 0 var(--safe-bottom) 0; }
  .overview-shell { padding-top: 0.65rem; }
  .overview-hero h1 { font-size: clamp(2.4rem, 7vw, 3.55rem); }
  .overview-lead { margin-top: 0.55rem; font-size: 0.9rem; }
  .pub-grid { margin-top: 0.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .frame-loading { animation: none; }
  .pub-open:hover { transform: none; }
}
