/* Mona Sans, served from this site (variable: weight 200–900, width 75–125%), in three subsets */
@font-face { font-family: "Mona Sans"; font-style: normal; font-weight: 200 900; font-stretch: 75% 125%; font-display: swap; src: url("../assets/fonts/mona-sans-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; }
@font-face { font-family: "Mona Sans"; font-style: normal; font-weight: 200 900; font-stretch: 75% 125%; font-display: swap; src: url("../assets/fonts/mona-sans-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; }
@font-face { font-family: "Mona Sans"; font-style: normal; font-weight: 200 900; font-stretch: 75% 125%; font-display: swap; src: url("../assets/fonts/mona-sans-vietnamese.woff2") format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }

/* Neuron's page: cobalt on mist and paper, cream cards, rooms that follow a study night. */
:root {
  --font: "Mona Sans", ui-sans-serif, system-ui, sans-serif;
  --sf: -apple-system, "SF Pro Text", "SF Pro Display", system-ui, sans-serif;
  --rounded: ui-rounded, "SF Pro Rounded", -apple-system, system-ui, sans-serif;
  --hand: "Bradley Hand", "Noteworthy", "Segoe Print", cursive;

  --mist: #e9eef7;
  --paper: #f2f5fa;
  --cream: #fefdf9;
  --sheet: #e6decf;
  --cobalt: #2e61d1;
  --cobalt-deep: #294cb8;
  --cobalt-ink: #1b3c96;
  --learnt: #2eb86b;
  --getting: #85db9e;
  --review: #e64c57;
  --ember: #ff8c52;
  --night: #0b1120;

  /* the words' ink: dark on the light rooms by default */
  --ink: #10141e;
  --ink-rgb: 16, 20, 30;
  --soft: 0.8;
  --ink-2: rgba(var(--ink-rgb), 0.74);
  --ink-3: rgba(var(--ink-rgb), 0.62);
  --line: rgba(var(--ink-rgb), 0.12);
  --chip: rgba(var(--ink-rgb), 0.055);
  --thumb: #10141e;
  --thumb-ink: #ffffff;
  color-scheme: light;
}
body[data-tone="dark"] {
  --ink: #f2f4fa;
  --ink-rgb: 242, 244, 250;
  --ink-2: rgba(var(--ink-rgb), 0.76);
  --ink-3: rgba(var(--ink-rgb), 0.64);
  --line: rgba(var(--ink-rgb), 0.16);
  --chip: rgba(var(--ink-rgb), 0.08);
  --thumb: #f2f4fa;
  --thumb-ink: #0b1120;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--mist); }
body { font-family: var(--font); color: var(--ink); background: var(--mist); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; }
::selection { background: rgba(46, 97, 209, 0.22); color: inherit; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; border-radius: 8px; }

.skip { position: fixed; left: 16px; top: -60px; z-index: 60; padding: 10px 16px; border-radius: 999px; background: var(--cobalt); color: #fff; font-weight: 600; }
.skip:focus { top: 16px; }
#runway { width: 1px; }

/* ——— nav: its ink is set every frame from the room under it (no transitions) ——— */
.nav {
  --nav-rgb: 16, 20, 30;
  position: fixed; inset: 0 0 auto; z-index: 40; height: 72px; padding: 0 clamp(24px, 3.4vw, 56px);
  display: flex; align-items: center; gap: 18px; color: rgb(var(--nav-rgb));
}
.nav-mark { display: inline-flex; align-items: center; gap: 10px; font-weight: 720; font-size: 17px; letter-spacing: -0.01em; }
.nav-logo { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; width: 18px; height: 18px; }
.nav-logo i { border-radius: 3px; background: currentColor; opacity: 0.35; }
.nav-logo i:first-child { opacity: 1; background: #4bbc6b; }
.nav-app { display: inline-flex; align-items: center; gap: 9px; padding: 6px 12px 6px 6px; border-radius: 999px; font-weight: 650; font-size: 15px; }
.nav-app img { width: 28px; height: 28px; border-radius: 7px; box-shadow: 0 2px 8px rgba(10, 20, 50, 0.18); }
.nav-app::before { content: ""; width: 1px; height: 22px; margin: 0 6px 0 -8px; background: rgba(var(--nav-rgb), 0.22); }
.nav-store { margin-left: auto; display: block; border-radius: 9px; }
.nav-store img { width: 120px; height: 40px; }
.nav-store:hover img { opacity: 0.86; }

/* ——— the stage ——— */
.stage { position: fixed; inset: 0; overflow: hidden; }
.rooms, .room, .gl, .glass-layer, .air, .words { position: absolute; inset: 0; }
.air-back { z-index: 1; pointer-events: none; }
.gl { z-index: 2; }
.glass-layer { z-index: 3; pointer-events: none; }
.air { z-index: 4; pointer-events: none; }
.air-back { z-index: 1; }
.words { z-index: 5; pointer-events: none; }
.words > * { pointer-events: auto; }

/* the HTML on a device's glass */
.glass { position: absolute; left: 0; top: 0; transform-origin: 0 0; overflow: hidden; visibility: hidden; contain: layout paint; backface-visibility: hidden; }
.glass-in { position: absolute; inset: 0; }
.glass-island { position: absolute; left: 0; top: 11px; z-index: 29; width: 126px; height: 37px; border-radius: 19px; background: #000; opacity: 0; pointer-events: none; }
.glass-punch { position: absolute; left: 0; top: 13px; z-index: 29; width: 12px; height: 12px; border-radius: 50%; background: #000; box-shadow: inset 0 0 0 1.5px #16171b; opacity: 0; pointer-events: none; }
/* the iPhone Duo's inner display, half by half, with a soft shadow down the crease */
.glass-duo .glass-crease { position: absolute; top: 0; bottom: 0; width: 14px; z-index: 28; pointer-events: none; }
.glass-duo-left .glass-crease { right: 0; background: linear-gradient(to left, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0)); }
.glass-duo-right .glass-crease { left: 0; background: linear-gradient(to right, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0)); }
.app-duo-half { right: auto; bottom: auto; }
.glass-sheen { position: absolute; inset: -10% -60%; pointer-events: none; z-index: 30; background: linear-gradient(112deg, transparent 40%, rgba(255, 255, 255, 0.07) 47%, rgba(255, 255, 255, 0.02) 52%, transparent 58%); }
.app { position: absolute; inset: 0; overflow: hidden; font-family: var(--sf); transform-origin: 0 0; }
/* a morphing piece: placed by its frame, origin at its top-left */
.mp { position: absolute; left: 0; top: 0; transform-origin: 0 0; }

/* rooms: each a field of colour with one soft light; the iris that opens them is feathered by a mask */
.room { visibility: hidden; }
.room > i, .room > b { position: absolute; inset: 0; }
.room-hero { background: linear-gradient(180deg, #e8eef8 0%, #f3f6fb 58%, #e5ebf4 100%); visibility: visible; }
.room-hero > i { background: radial-gradient(ellipse 40% 52% at 70% 46%, rgba(76, 122, 230, 0.22), transparent 70%), radial-gradient(ellipse 60% 40% at 8% 100%, rgba(148, 178, 224, 0.3), transparent 70%); }
.room-why { background: linear-gradient(170deg, #121a31 0%, #0b1120 55%, #070b16 100%); }
/* the desk lamp's pool of light falls on the pages beside the phone */
.room-why > i { background: radial-gradient(ellipse 34% 40% at 70% 10%, rgba(255, 196, 120, 0.12), transparent 72%), radial-gradient(ellipse 50% 50% at 70% 92%, rgba(255, 170, 90, 0.06), transparent 70%); }
.room-make { background: linear-gradient(180deg, #f5f1e8 0%, #faf7f0 55%, #efe9dc 100%); }
.room-make > i { background: radial-gradient(ellipse 44% 50% at 30% 44%, rgba(46, 97, 209, 0.1), transparent 72%), radial-gradient(ellipse 60% 40% at 100% 100%, rgba(219, 204, 163, 0.35), transparent 70%); }
.room-learn { background: linear-gradient(180deg, #e6ecf6 0%, #f2f5fa 52%, #e1e7f1 100%); }
.room-learn > i { background: radial-gradient(ellipse 46% 52% at 70% 44%, rgba(133, 219, 158, 0.18), transparent 72%), radial-gradient(ellipse 50% 50% at 0% 100%, rgba(148, 178, 224, 0.3), transparent 70%); }
.room-test { background: linear-gradient(165deg, #1d3a8f 0%, #13296b 50%, #0c1b4a 100%); }
.room-test > i { background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0) 40%), radial-gradient(ellipse 60% 40% at 70% 100%, rgba(5, 12, 40, 0.35), transparent 70%); }
.room-recall { background: linear-gradient(180deg, #f6f8fc 0%, #fbfcfe 50%, #eef2f8 100%); }
.room-recall > i { background: radial-gradient(ellipse 60% 50% at 62% 50%, rgba(46, 97, 209, 0.1), transparent 72%); }
.room-plan { background: linear-gradient(180deg, #f7f2ea 0%, #fbf8f2 55%, #f1e9de 100%); }
.room-plan > i { background: radial-gradient(ellipse 44% 50% at 30% 46%, rgba(255, 140, 82, 0.13), transparent 72%), radial-gradient(ellipse 50% 50% at 100% 0%, rgba(46, 97, 209, 0.08), transparent 70%); }
.room-chain { background: linear-gradient(170deg, #1a1210 0%, #120c0b 55%, #0a0707 100%); }
.room-chain > i { background: radial-gradient(ellipse 40% 50% at 70% 52%, rgba(255, 128, 50, calc(0.16 + 0.14 * var(--fire, 0))), transparent 72%), radial-gradient(ellipse 70% 40% at 50% 100%, rgba(255, 140, 82, 0.08), transparent 70%); }
/* the glaze washes the room too: Mist, Dust, Sand (set from the chain chapter) */
.room-chain > b { opacity: var(--glaze-a, 0); background: var(--glaze, #e9eef7); }
.room-everywhere { background: linear-gradient(180deg, #eceff4 0%, #f6f7fa 55%, #e4e8ef 100%); }
.room-everywhere > i { background: radial-gradient(ellipse 50% 54% at 64% 46%, color-mix(in oklab, var(--rimc, #2e61d1) 16%, transparent), transparent 72%); }
.room-pro { background: linear-gradient(180deg, #e9eef7 0%, #f4f6fb 55%, #e3e9f3 100%); }
.room-pro > i { background: radial-gradient(ellipse 44% 50% at 30% 46%, rgba(46, 97, 209, 0.16), transparent 72%); }
.room-close { background: linear-gradient(170deg, #2e61d1 0%, #2550b6 50%, #1b3c96 100%); }
.room-close > i { background: radial-gradient(ellipse 50% 46% at 50% 34%, rgba(255, 255, 255, 0.16), transparent 72%), radial-gradient(ellipse 60% 40% at 50% 100%, rgba(10, 20, 60, 0.3), transparent 70%); }

/* the chapters, along the bottom; ink set per frame */
.rail {
  --rail-rgb: 16, 20, 30;
  position: absolute; left: 50%; bottom: 18px; z-index: 6; transform: translateX(-50%);
  display: flex; gap: clamp(12px, 1.5vw, 22px); padding: 8px 16px; border-radius: 999px; visibility: hidden;
}
.rail button { position: relative; padding: 4px 0 7px; font-size: 12.5px; font-weight: 620; white-space: nowrap; color: rgba(var(--rail-rgb), 0.6); }
.rail button i { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 1px; background: rgb(var(--rail-rgb)); transform-origin: 0 50%; transform: scaleX(0); opacity: 0.85; }
.rail button[aria-current="true"], .rail button:hover { color: rgb(var(--rail-rgb)); }

/* the static text of the page, for screen readers (and visible when it has focus) */
.outline { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.outline:focus-within { position: fixed; inset: 24px; z-index: 70; width: auto; height: auto; clip: auto; clip-path: none; white-space: normal; overflow: auto; padding: 32px; border-radius: 20px; background: #fff; color: #10141e; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); }
.outline h2 { margin: 18px 0 6px; font-size: 20px; }
.outline h3 { margin: 12px 0 4px; font-size: 16px; }
.outline li { margin-left: 18px; font-size: 15px; line-height: 1.5; }

/* the curtain: the hero's words in their own place, from the first paint */
.curtain { position: fixed; inset: 0; z-index: 35; pointer-events: none; background: linear-gradient(180deg, #e8eef8 0%, #f3f6fb 58%, #e5ebf4 100%); }
.stage { opacity: 1; }
.stage.is-warming { opacity: 0.001; }
.stage.is-in { transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.stage.is-jumping { opacity: 0; transition: opacity 0.2s ease-out; }
