/* Self-hosted fonts: Atkinson Hyperlegible for text, Rubik for headings. */
/* latin-ext */
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/AtkinsonHyperlegible-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/AtkinsonHyperlegible-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/AtkinsonHyperlegible-700-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/AtkinsonHyperlegible-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* hebrew */
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/Rubik-500-hebrew.woff2) format('woff2');
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
/* latin-ext */
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/Rubik-500-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/Rubik-500-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* hebrew */
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/Rubik-700-hebrew.woff2) format('woff2');
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
/* latin-ext */
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/Rubik-700-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/Rubik-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* hebrew */
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(../fonts/Rubik-800-hebrew.woff2) format('woff2');
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
/* latin-ext */
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(../fonts/Rubik-800-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(../fonts/Rubik-800-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #0f1e33;
  --ink-deep: #0a1526;
  --ink-raised: #16294a;
  --paper: #f6f3ec;
  --muted: #b3bdcc;
  --line: #2a3b5a;
  --yellow: #ffe033;
  --yellow-ink: #1a1500;
  --blue: #8db4ff;
  --amber: #ffb547;
  --focus: #ffe033;
  --display: "Rubik", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --measure: 34rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .site-header::before { transition: none; }
}

body {
  margin: 0;
  background:
    radial-gradient(120% 80% at 80% 0%, #1b3560 0%, transparent 60%),
    var(--ink);
  color: var(--paper);
  font-family: var(--body);
  font-size: clamp(1.125rem, 0.4vw + 1rem, 1.3rem);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

a { color: var(--yellow); text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
a:hover { text-decoration-thickness: 0.14em; }

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 50;
  padding: 0.75rem 1.1rem;
  background: var(--yellow);
  color: var(--yellow-ink);
  font-weight: 700;
  border-radius: 0.6rem;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

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

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 1em; text-wrap: pretty; }

/* Header */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem var(--gutter);
  background: linear-gradient(to bottom, rgba(10, 21, 38, 0.92), rgba(10, 21, 38, 0));
}

/* Once the page scrolls, text passes under the header, so it turns solid
   with a short soft edge below. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0 0 -1.25rem 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to bottom, rgb(10, 21, 38) calc(100% - 1.25rem), rgba(10, 21, 38, 0));
  opacity: 0;
  transition: opacity 200ms ease;
}
.site-header[data-scrolled="true"]::before,
.doc-page .site-header::before { opacity: 1; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--paper);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
}
.brand img { width: 2.4rem; height: 2.4rem; border-radius: 22%; }

.site-nav { display: flex; align-items: center; gap: 0.4rem; }
.site-nav a {
  color: var(--paper);
  text-decoration: none;
  font-weight: 700;
  padding: 0.55rem 0.8rem;
  border-radius: 0.6rem;
}
.site-nav a:hover { background: rgba(255, 255, 255, 0.08); }
.site-nav .nav-get { background: var(--yellow); color: var(--yellow-ink); }
.site-nav .nav-get:hover { background: #fff07a; }

@media (max-width: 34rem) {
  .site-nav .nav-optional { display: none; }
}

/* Buttons */

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  font-family: var(--body);
}
.btn-primary { background: var(--yellow); color: var(--yellow-ink); }
.btn-primary:hover { background: #fff07a; }
.btn-quiet { border-color: rgba(246, 243, 236, 0.45); color: var(--paper); background: transparent; }
.btn-quiet:hover { border-color: var(--paper); }

/* The story: a sticky 3D stage with chapters scrolling over it */

.story { position: relative; }

.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  margin-bottom: -100vh;
  margin-bottom: -100svh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 900ms ease;
}
.stage.ready canvas { opacity: 1; }

.chapter {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 6rem var(--gutter) 4rem;
}

.chapter-text { max-width: var(--measure); }

.chapter h1 { font-size: clamp(2.6rem, 6.2vw, 5.4rem); margin-bottom: 1.4rem; }
.chapter h2 { font-size: clamp(2.1rem, 4.4vw, 3.8rem); margin-bottom: 1.2rem; }
.chapter .lede { font-size: clamp(1.25rem, 1.1vw + 1rem, 1.6rem); color: var(--paper); }
.chapter p { color: #dfe5ee; }

.note {
  font-size: 1rem;
  color: var(--muted);
  border-left: 3px solid var(--amber);
  padding-left: 0.9rem;
  margin-top: 1.4rem;
}

.get-list { list-style: none; padding: 0; margin: 1.4rem 0 0; display: grid; gap: 1rem; }
.get-list li { padding-left: 1.1rem; border-left: 3px solid var(--line); }
.get-list strong { display: block; font-family: var(--display); font-weight: 700; font-size: 1.2rem; }

@media (min-width: 56rem) {
  .chapter { padding-left: max(var(--gutter), calc((100vw - 76rem) / 2 + var(--gutter))); }
  .chapter-text { width: 46%; max-width: var(--measure); }
}

@media (max-width: 55.99rem) {
  .chapter { align-items: flex-end; padding-top: 56vh; padding-top: 56svh; padding-bottom: 1.5rem; }
  .chapter-text {
    background: rgba(10, 21, 38, 0.94);
    border: 1px solid var(--line);
    border-radius: 1.25rem;
    padding: 1.1rem 1.15rem 0.35rem;
    font-size: 1.0625rem;
    line-height: 1.5;
  }
  .chapter p { margin-bottom: 0.75em; }
  .chapter h1 { font-size: clamp(1.9rem, 8.2vw, 2.6rem); margin-bottom: 0.8rem; }
  .chapter h2 { font-size: clamp(1.6rem, 7vw, 2.2rem); margin-bottom: 0.7rem; }
  .chapter .lede { font-size: 1.125rem; }
  .chapter .actions { margin-top: 1rem; margin-bottom: 0.8rem; }
  .chapter .btn { min-height: 3rem; }
}

/* Pause control for the moving demo (WCAG 2.2.2), always in the header */

.motion-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  min-width: 2.75rem;
  justify-content: center;
  padding: 0.5rem 0.85rem;
  border-radius: 0.6rem;
  border: 2px solid rgba(246, 243, 236, 0.35);
  background: transparent;
  color: var(--paper);
  font: 700 1rem var(--body);
  cursor: pointer;
}
.motion-toggle:hover { border-color: var(--paper); }
.motion-toggle[hidden] { display: none; }
.motion-toggle svg { width: 1.15rem; height: 1.15rem; flex: none; }
.motion-toggle .icon-play, .motion-toggle[data-paused="true"] .icon-pause { display: none; }
.motion-toggle[data-paused="true"] .icon-play { display: block; }

@media (max-width: 56rem) {
  .motion-toggle { padding: 0.5rem; }
  .motion-toggle .motion-label {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0; border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* Closing panels */

.panel {
  position: relative;
  z-index: 1;
  padding: clamp(4rem, 9vw, 7rem) var(--gutter);
  border-top: 1px solid var(--line);
  background: var(--ink-deep);
}
.panel-inner { max-width: 70rem; margin: 0 auto; }
.panel h2 { font-size: clamp(2rem, 4vw, 3.2rem); margin-bottom: 1.2rem; }
.panel p { max-width: var(--measure); color: #dfe5ee; }

.follow {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  align-items: start;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.4rem;
  padding: 0.8rem 1.2rem 0.8rem 0.9rem;
  border-radius: 1rem;
  background: var(--ink-raised);
  border: 1px solid var(--line);
  color: var(--paper);
  text-decoration: none;
  font-weight: 700;
}
.social-link:hover { border-color: var(--paper); }
.social-link svg { width: 1.8rem; height: 1.8rem; flex: none; }
.social-link span small { display: block; font-weight: 400; color: var(--muted); font-size: 0.95rem; }

/* Footer */

.site-footer {
  position: relative;
  z-index: 1;
  background: var(--ink-deep);
  border-top: 1px solid var(--line);
  padding: 2.5rem var(--gutter) 3rem;
  font-size: 1rem;
  color: var(--muted);
}
.footer-inner {
  max-width: 70rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
  justify-content: space-between;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; }
.site-footer a { color: var(--paper); }

/* Legal and information pages */

.doc {
  position: relative;
  z-index: 1;
  max-width: 46rem;
  margin: 0 auto;
  padding: 7.5rem var(--gutter) 4rem;
}
.doc h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); margin-bottom: 0.6rem; }
.doc .updated { color: var(--muted); margin-bottom: 2.4rem; }
.doc h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin: 2.6rem 0 0.9rem; }
.doc h3 { font-size: 1.25rem; margin: 1.8rem 0 0.6rem; font-weight: 700; }
.doc p, .doc li { color: #e4e9f1; }
.doc ul, .doc ol { padding-left: 1.3rem; margin: 0 0 1em; }
.doc li { margin-bottom: 0.45rem; }
.doc .callout {
  background: var(--ink-raised);
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: 0.9rem;
  padding: 1.1rem 1.3rem 0.3rem;
  margin: 1.6rem 0;
}
.doc table { border-collapse: collapse; width: 100%; margin: 0 0 1.4rem; font-size: 1rem; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--line); }
.doc th { font-family: var(--display); font-weight: 700; }
/* Narrow screens: each row becomes a block, with the column heading shown
   above each value. */
@media (max-width: 30rem) {
  .doc thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .doc table, .doc tbody, .doc tr, .doc td { display: block; }
  .doc tr { padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
  .doc td { padding: 0.1rem 0; border: 0; }
  .doc td:first-child { font-weight: 700; margin-bottom: 0.3rem; }
  .doc td:not(:first-child)::before {
    content: attr(data-label) ": ";
    color: var(--muted);
  }
}

.no-webgl .stage { display: none; }
