@font-face {
  font-family: Interface;
  src: local("Arial"), local("ArialMT"), url("../assets/fonts/arimo-latin.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: Interface;
  src: local("Arial Bold"), local("Arial-BoldMT"), url("../assets/fonts/arimo-latin.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: Editorial;
  src: local("Times New Roman Italic"), local("TimesNewRomanPS-ItalicMT"), url("../assets/fonts/tinos-italic-latin.woff2") format("woff2");
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: Geist;
  src: url("../assets/fonts/geist-latin.woff2") format("woff2");
  font-weight: 400 750;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --header-height: 68px;
  --scene-height: calc(100svh - var(--header-height));
  --scene-stride: clamp(390px, 78svh, 740px);
  --gutter: clamp(24px, 4vw, 70px);
  --stage-max: 1450px;
  --light: #f6f8fc;
  --muted: #adb8c7;
  --brand-font: Interface, Arial, sans-serif;
  font-family: Geist, var(--brand-font);
  background: #101923;
  color: var(--light);
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  --scene-color: #122131;
  --accent: #aaceff;
  --accent-rgb: 170, 206, 255;
  margin: 0;
  isolation: isolate;
}
button,
input,
textarea {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  cursor: pointer;
}
p,
h1,
h2,
h3 {
  margin: 0;
}
.icon {
  width: 20px;
  height: 20px;
  display: block;
  flex: none;
}
.icon-definitions,
.svg-defs,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
:focus-visible {
  outline: 2px solid #6bb5ff;
  outline-offset: 4px;
}
.skip-link {
  position: fixed;
  z-index: 5;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff;
  color: #15263a;
  transform: translateY(-150%);
}
.skip-link:focus {
  transform: none;
}

.masthead {
  position: sticky;
  z-index: 3;
  top: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
}
.masthead-inner {
  width: min(var(--stage-max), calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}
.nav-bubble {
  min-height: 40px;
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.09);
  box-shadow: inset 0 1px #ffffff13, 0 4px 13px #050c1724;
  transition: background-color 450ms ease, border-color 450ms ease;
}
.nav-bubble:hover {
  background: rgba(var(--accent-rgb), 0.19);
  border-color: rgba(var(--accent-rgb), 0.42);
}
.wordmark {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  color: #fff;
  font-family: var(--brand-font);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.045em;
  padding: 5px 15px;
}
.wordmark-mi {
  color: #278eff;
}
.site-nav {
  grid-column: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(12px, 1.5vw, 24px);
  color: #ebf0f8;
  font-size: 14px;
  font-weight: 500;
}
.site-nav a {
  display: grid;
  place-items: center;
}
.site-nav .nav-bubble {
  padding: 8px 17px;
}
.nav-mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}
.nav-mark img {
  display: block;
  filter: brightness(0) invert(1);
}
.site-nav a:first-child {
  justify-self: end;
}
.site-nav a:last-child {
  justify-self: start;
}
.site-nav a:hover {
  color: #fff;
}
.beta-link {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  background: var(--accent);
  color: #112840;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.beta-link .icon {
  width: 15px;
  height: 15px;
}
.beta-link:hover {
  background: #fff;
}

.scroll-story {
  display: grid;
  grid-template-areas: "story";
}
.scroll-track,
.story-stage {
  grid-area: story;
  min-width: 0;
}
.scroll-track {
  pointer-events: none;
}
.scroll-marker {
  height: var(--scene-stride);
  scroll-margin-top: var(--header-height);
}
.scroll-marker:last-child {
  height: var(--scene-height);
}
.story-stage {
  position: fixed;
  inset-inline: 0;
  top: var(--header-height);
  height: var(--scene-height);
  align-self: start;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  isolation: isolate;
}
body[data-chapter="scan"] {
  --scene-color: #123034;
  --accent: #a3eee0;
  --accent-rgb: 163, 238, 224;
}
body[data-chapter="find"] {
  --scene-color: #1d3230;
  --accent: #bae9cc;
  --accent-rgb: 186, 233, 204;
}
body[data-chapter="draft"] {
  --scene-color: #2b263d;
  --accent: #d6c5fd;
  --accent-rgb: 214, 197, 253;
}
body[data-chapter="send"] {
  --scene-color: #332b26;
  --accent: #f2cea7;
  --accent-rgb: 242, 206, 167;
}
body[data-chapter="activity"] {
  --scene-color: #152b3c;
  --accent: #b2daff;
  --accent-rgb: 178, 218, 255;
}
body[data-chapter="replies"] {
  --scene-color: #382c3c;
  --accent: #f6cce0;
  --accent-rgb: 246, 204, 224;
}
body[data-chapter="beta"] {
  --scene-color: #1b2843;
  --accent: #bed3ff;
  --accent-rgb: 190, 211, 255;
}
/* A single fixed backdrop keeps the grid and color continuous under the masthead. */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
body::before {
  background-color: var(--scene-color);
  transition: background-color 450ms ease;
  background-image:
    radial-gradient(
      ellipse at 50% 46%,
      rgba(var(--accent-rgb), 0.17) 0%,
      transparent 57%
    ),
    linear-gradient(0deg, #0d141da0, transparent 36%);
}
body::after {
  background-image:
    linear-gradient(to right, #dce7ff10 1px, transparent 1px),
    linear-gradient(to bottom, #dce7ff0b 1px, transparent 1px);
  background-size: clamp(64px, 7vw, 112px) 88px;
  background-position: center;
  mask-image: radial-gradient(
    ellipse at center,
    #000,
    #0009 60%,
    transparent 100%
  );
}
.stage-grid {
  width: min(var(--stage-max), calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 426px) minmax(0, 1fr);
  gap: clamp(32px, 4.8vw, 72px);
  align-items: center;
  padding-block: clamp(16px, 3.5svh, 44px);
  min-height: 0;
}
.chapter-messages {
  min-width: 0;
}
.chapter-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.chapter-kicker span {
  width: 14px;
  height: 1px;
  background: currentColor;
}
.chapter-message h1,
.chapter-message h2 {
  font-family: var(--brand-font);
  font-weight: 700;
  line-height: 1.01;
  letter-spacing: -0.065em;
}
.chapter-message h1 {
  font-size: clamp(40px, 4.4vw, 71px);
}
.chapter-message h1 em {
  display: inline-block;
  margin-top: 5px;
  font-family: Editorial, Georgia, serif;
  font-size: 0.92em;
  font-weight: 400;
  letter-spacing: -0.05em;
  color: var(--accent);
}
.chapter-message h2 {
  font-size: clamp(40px, 4.3vw, 68px);
  text-wrap: balance;
}
.start-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 29px;
  min-height: 40px;
  padding-block: 5px;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.55);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}
.start-link:hover {
  color: #fff;
}
.start-link .icon {
  width: 16px;
  height: 16px;
}
.chapter-notes {
  justify-self: end;
  width: min(100%, 220px);
}
.note-icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 19px;
  color: var(--accent);
  border-radius: 11px;
  background: rgba(var(--accent-rgb), 0.1);
  border: 1px solid rgba(var(--accent-rgb), 0.28);
}
.chapter-note h3 {
  font-size: clamp(16px, 1.55vw, 21px);
  line-height: 1.23;
  letter-spacing: -0.025em;
}
.chapter-note p {
  margin-top: 11px;
  color: #ced6e1;
  font-size: 14px;
  line-height: 1.55;
}
.stage-footer {
  width: min(var(--stage-max), calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
  min-height: 70px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(400px, 565px) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}
.scroll-hint,
.stage-context {
  color: #c4cedb;
  font-size: 12px;
  white-space: nowrap;
}
.scroll-hint {
  display: flex;
  align-items: center;
  gap: 8px;
}
.scroll-glyph {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 24px;
  border: 1px solid #cfddff40;
  border-radius: 8px;
  color: var(--accent);
}
.stage-context {
  justify-self: end;
}
.chapter-nav {
  display: grid;
  grid-template-columns: repeat(8, minmax(min-content, 1fr));
  gap: 5px;
}
.chapter-nav a {
  display: grid;
  grid-template-rows: 2px auto;
  gap: 7px;
  align-content: center;
  min-height: 42px;
  color: #b7c2d1;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
}
.chapter-tick {
  background: #deebff40;
  border-radius: 2px;
}
.chapter-nav a[aria-current] {
  color: var(--accent);
  font-weight: 700;
}
.chapter-nav a[aria-current] .chapter-tick {
  background: var(--accent);
}
.chapter-nav a:hover {
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  .nav-bubble {
    transition: none;
  }
}
