/* ==========================================================================
   noteflow.study/flashcards

   Design v2, "paper with weight" (DESIGN.md). Its own tokens, light and
   dark, so it does not lean on css/styles.css while that is redesigned.
   Values are DESIGN.md section 2's, Paper only (marketing always uses it).
   ========================================================================== */

/* Fallbacks sized to the real faces (measured against Instrument Sans and
   Serif), so the headline keeps its lines and the deck under it keeps its
   place when the web fonts arrive. One face per weight: Arial's bold runs
   wider than Instrument Sans 600, its regular narrower than 400. */
@font-face { font-family: "Instrument Sans Fallback"; src: local("Arial"), local("ArialMT"), local("Helvetica"), local("Liberation Sans"); font-weight: 400 500; size-adjust: 101.9%; ascent-override: 95.2%; descent-override: 24.5%; line-gap-override: 0%; }
@font-face { font-family: "Instrument Sans Fallback"; src: local("Arial Bold"), local("Arial-BoldMT"), local("Helvetica Bold"), local("Liberation Sans Bold"); font-weight: 600 700; size-adjust: 97.1%; ascent-override: 99.9%; descent-override: 25.7%; line-gap-override: 0%; }
@font-face { font-family: "Instrument Serif Fallback"; src: local("Times New Roman Italic"), local("TimesNewRomanPS-ItalicMT"), local("Times Italic"), local("Liberation Serif Italic"); font-style: italic; size-adjust: 87.8%; ascent-override: 112.8%; descent-override: 35.3%; line-gap-override: 0%; }
@font-face { font-family: "Instrument Serif Fallback"; src: local("Times New Roman"), local("TimesNewRomanPSMT"), local("Times"), local("Liberation Serif"); font-style: normal; size-adjust: 87.8%; ascent-override: 112.8%; descent-override: 35.3%; line-gap-override: 0%; }

:root {
  color-scheme: light;
  --paper: #F3F1EC; --sheet: #FFFEFB; --wash: #F4F2EC; --wash-2: #EDEAE3; --rail-on: #EAE7E0;
  --ink: #161615; --ink-2: #55534D; --ink-3: #67645D; --ink-4: #A9A59C; --on-ink: #FBFAF7;
  --rule: #ECE9E2; --rule-2: #DEDAD1; --rule-ink: #161615;
  --shade: 22 22 21; --shade-k: 1; --key-edge: #000000;
  --violet: #4F2A7F; --hl: #D6C2FF; --hl-ink: #161615; --hl-blend: multiply;
  --danger: #B23A30; --ok: #2F7D57; --pen: #D23A2C;
  --hover: color-mix(in srgb, var(--ink) 5%, transparent);

  /* Subject tints: the chips only. */
  --bio-bg: #E3EDDC; --bio: #305A2D; --chem-bg: #DDE8F2; --chem: #1F4A6B;
  --maths-bg: #F6E6D3; --maths: #6E3E14; --eng-bg: #F5E1E7; --eng: #712C47;
  --lang-bg: #F3EDCC; --lang: #625010; --hist-bg: #EFE5DC; --hist: #5E4330;
  --other-bg: #EDEAE3; --other: #55534D;

  --sans: "Instrument Sans", "Instrument Sans Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", "Instrument Serif Fallback", "Iowan Old Style", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --r-xs: 6px; --r-sm: 10px; --r-md: 14px; --r-lg: 18px; --r-xl: 24px;
  --t-fast: 110ms; --ease: cubic-bezier(.2, .7, .2, 1);
  /* The v2 springs, sampled (DESIGN.md section 7), for what CSS moves. */
  --spring-key: linear(0, .177 8%, .486 16%, .75 24%, .92 31.9%, 1.005 39.9%, 1.034 47.9%, 1.035 55.9%, 1.024 63.9%, 1.014 71.9%, 1.006 79.8%, 1.001 87.8%, 1);
  --spring-key-t: .25s;
  --spring-settle: linear(0, .039 3.6%, .129 7.2%, .243 10.8%, .365 14.5%, .481 18.1%, .587 21.7%, .678 25.3%, .755 28.9%, .818 32.5%, .869 36.1%, .908 39.7%, .937 43.4%, .96 47%, .976 50.6%, .987 54.2%, .994 57.8%, .999 61.4%, 1.002 65%, 1.004 68.7%, 1.005 72.3%, 1.004 83.1%, 1.002 93.9%, 1);
  --spring-settle-t: .55s;

  --hl-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 40' preserveAspectRatio='none'%3E%3Cpath d='M6 7.5C40 4.6 82 6.8 121 5.2C151 4 176 5.8 196 4.4L199 11.5L196.8 19L199.6 27.5L195 35.6C160 37.2 121 34.6 81 36.6C51 38 25 35.8 3.2 37.6L0.6 27.4L3 17.6L1 9.2Z' fill-opacity='.84'/%3E%3Cpath d='M6 7.5C40 4.6 82 6.8 121 5.2C151 4 176 5.8 196 4.4L198 15.6C150 16.8 100 14.8 50 16.6C30 17.2 15 16.4 2 16.9L1 9.2Z' fill-opacity='.3'/%3E%3Cpath d='M1.5 26.2C40 25 90 27.4 140 25.6C165 24.8 185 26 198.6 25.4L195 35.6C160 37.2 121 34.6 81 36.6C51 38 25 35.8 3.2 37.6Z' fill-opacity='.32'/%3E%3Cpath d='M6 7.5L13 7.1L11.6 37.3L3.2 37.6L0.6 27.4L3 17.6L1 9.2Z' fill-opacity='.4'/%3E%3Cpath d='M189 4.7L196 4.4L199 11.5L196.8 19L199.6 27.5L195 35.6L188 35.8Z' fill-opacity='.3'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #151514; --sheet: #1F1E1C; --wash: #252422; --wash-2: #2C2B29; --rail-on: #2A2927;
    --ink: #EDEBE5; --ink-2: #B5B1A8; --ink-3: #8E8A82; --ink-4: #5F5C56; --on-ink: #191918;
    --rule: #2A2927; --rule-2: #3A3936; --rule-ink: #EDEBE5;
    --shade: 0 0 0; --shade-k: 2.8; --key-edge: #8E8A82;
    --violet: #C2A8F5; --hl: #4A3778; --hl-ink: #F4F0FF; --hl-blend: normal;
    --danger: #E0695F; --ok: #5BB98C; --pen: #F2735F;
    --bio-bg: #232F22; --bio: #A6CD9A; --chem-bg: #1D2A36; --chem: #9AC1E0;
    --maths-bg: #35291C; --maths: #E4B78C; --eng-bg: #35232A; --eng: #E6A8BE;
    --lang-bg: #322D1A; --lang: #DCC774; --hist-bg: #2F2822; --hist: #D6B9A0;
    --other-bg: #2C2B29; --other: #B5B1A8;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #151514; --sheet: #1F1E1C; --wash: #252422; --wash-2: #2C2B29; --rail-on: #2A2927;
  --ink: #EDEBE5; --ink-2: #B5B1A8; --ink-3: #8E8A82; --ink-4: #5F5C56; --on-ink: #191918;
  --rule: #2A2927; --rule-2: #3A3936; --rule-ink: #EDEBE5;
  --shade: 0 0 0; --shade-k: 2.8; --key-edge: #8E8A82;
  --violet: #C2A8F5; --hl: #4A3778; --hl-ink: #F4F0FF; --hl-blend: normal;
  --danger: #E0695F; --ok: #5BB98C; --pen: #F2735F;
  --bio-bg: #232F22; --bio: #A6CD9A; --chem-bg: #1D2A36; --chem: #9AC1E0;
  --maths-bg: #35291C; --maths: #E4B78C; --eng-bg: #35232A; --eng: #E6A8BE;
  --lang-bg: #322D1A; --lang: #DCC774; --hist-bg: #2F2822; --hist: #D6B9A0;
  --other-bg: #2C2B29; --other: #B5B1A8;
}


/* Height (0 lying on the desk, 1 held) is a number the shadow is worked out
   from; registered so a hover can spring it. */
@property --h { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --rv { syntax: "<number>"; inherits: true; initial-value: 1; }

/* ---- base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap {
  width: 100%; max-width: 1320px; margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
kbd {
  display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px;
  font-family: var(--mono); font-size: 12px; font-weight: 500; line-height: 1; color: var(--ink-2);
  background: var(--sheet); border-radius: var(--r-xs); box-shadow: inset 0 0 0 1px var(--rule-2), 0 1px 0 var(--rule-2);
}

/* Depth from height: one light from above, the shadow from --h. */
.liftable, .sheet, .face {
  box-shadow: 0 0 0 1px var(--rule),
    0 calc(1px + 18px * var(--h)) calc(2px + 40px * var(--h)) calc(-2px - 12px * var(--h)) rgb(var(--shade) / calc((.07 + .12 * var(--h)) * var(--shade-k))),
    0 calc(1px + 3px * var(--h)) calc(2px + 6px * var(--h)) rgb(var(--shade) / calc((.04 + .03 * var(--h)) * var(--shade-k)));
}
.sheet { --h: 0; background: var(--sheet); border-radius: var(--r-xl); }
@supports (corner-shape: squircle) { .sheet { corner-shape: squircle; border-radius: calc(var(--r-xl) * 1.6); } }

/* ---- buttons --------------------------------------------------------------
   One ink key per screen; everything else is a sheet or a ghost. A press
   goes down on the `key` spring. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border: 0; border-radius: var(--r-md);
  font-size: 15px; font-weight: 600; letter-spacing: -.012em; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap; -webkit-tap-highlight-color: transparent;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--spring-key-t) var(--spring-key);
}
.btn svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.btn:disabled { cursor: default; color: var(--ink-4); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; font-weight: 500; }
.btn-2 { background: var(--sheet); color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule-2), 0 1px 1px rgb(var(--shade) / calc(.05 * var(--shade-k))); }
.btn-2:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 5%, var(--sheet)); }
.btn-2:active:not(:disabled) { background: var(--wash-2); transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.btn-ghost:active:not(:disabled) { background: var(--wash-2); transform: translateY(1px); }

/* The ink key: ink fill, 2px proud on its edge; a press (--p, on the `key`
   spring in flashcards.js) moves it down and closes the edge. */
.key {
  --p: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border-radius: var(--r-lg);
  background: var(--ink); color: var(--on-ink); text-decoration: none; white-space: nowrap;
  font-size: 16.5px; font-weight: 600; letter-spacing: -.012em; -webkit-tap-highlight-color: transparent;
  transform: translateY(calc(var(--p) * 2px)) scale(calc(1 - var(--p) * .012));
  box-shadow: 0 calc(2px - var(--p) * 2px) 0 var(--key-edge), 0 calc(8px - var(--p) * 7px) calc(16px - var(--p) * 12px) -8px rgb(var(--shade) / calc(.5 * var(--shade-k)));
  transition: background-color var(--t-fast) var(--ease);
  border: 0; font-family: inherit; line-height: 1.2; cursor: pointer;
}
.key:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 90%, var(--paper)); }
.key:disabled { cursor: default; background: var(--ink-4); color: var(--on-ink); --p: 1; }
.key-sm { min-height: 44px; padding: 0 20px; border-radius: var(--r-md); font-size: 15.5px; }

/* ---- the highlighter swipe (DESIGN.md section 4) -------------------------
   Drawn once at pen speed behind a chisel-slanted edge: the hero's on load,
   the closing one when it scrolls in. */
.hl { position: relative; isolation: isolate; color: var(--hl-ink); white-space: nowrap; --rv: 1; }
.hl::before {
  content: ""; position: absolute; z-index: -1;
  left: -.16em; right: -.2em; top: .4em; bottom: .02em;
  background: var(--hl);
  -webkit-mask: var(--hl-mask) 0 0 / 100% 100% no-repeat; mask: var(--hl-mask) 0 0 / 100% 100% no-repeat;
  mix-blend-mode: var(--hl-blend);
  transform: rotate(-1.6deg) skewX(-12deg);
  clip-path: polygon(0 -10%, calc(var(--rv) * 114%) -10%, calc(var(--rv) * 114% - 14%) 110%, 0 110%);
}
.ink .hl { animation: hl-draw .4s cubic-bezier(.5, 0, .2, 1) .12s backwards; }
@keyframes hl-draw { from { --rv: 0; } to { --rv: 1; } }

/* ---- the top line: sticky, its hairline drawn once the page runs under it */
.top { position: sticky; top: 0; z-index: 40; background: var(--paper); border-bottom: 1px solid transparent; transition: border-color var(--t-fast) var(--ease); }
.top[data-scrolled] { border-bottom-color: var(--rule); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.lockup { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font-size: 18px; font-weight: 600; letter-spacing: -.025em; color: var(--ink); min-height: 44px; }
.lockup svg { width: 26px; height: 26px; color: var(--violet); flex: none; }
.top-nav { display: flex; align-items: center; gap: 2px; }
.nav-link { display: none; align-items: center; min-height: 44px; padding: 0 12px; border-radius: var(--r-sm); font-size: 14.5px; color: var(--ink-2); text-decoration: none; transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.nav-link:hover { background: var(--hover); color: var(--ink); }
.top-nav .btn { margin-left: 8px; }

/* ---- the hero -------------------------------------------------------------- */
.hero { padding-top: 12px; padding-bottom: 56px; }
.hero-head { display: grid; gap: 14px; }
.hero h1, .display { font-weight: 400; font-size: clamp(40px, 3.4vw + 27px, 76px); line-height: 1.02; letter-spacing: -.02em; }
.hero h1 .l1, .display .l1 { display: block; font-family: var(--sans); font-weight: 600; font-size: .8em; line-height: 1.05; letter-spacing: -.03em; }
.hero h1 .l2, .display .l2 { display: block; font-family: var(--serif); font-style: italic; margin-top: .06em; }
.lede { font-size: 17px; line-height: 1.5; color: var(--ink-2); max-width: 34ch; }
.keys-hint { display: none; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-top: 14px; font-size: 13.5px; color: var(--ink-3); }
.keys-hint kbd + kbd, .keys-hint kbd:not(:first-child) { margin-left: 8px; }
@media (hover: hover) and (pointer: fine) { .keys-hint { display: flex; } }

/* ---- the desk ----------------------------------------------------------------
   One --rail-on well with two things lying on it: the notes sheet and the
   deck. Beside each other on a desk, the notes above the deck on a phone.
   The well clips (so a deck sliding off its right edge goes off the desk);
   the stage inside it does not, so cards thrown off the notes fly over the
   sheet into the stack. */
.desk { margin-top: 22px; }
.well {
  display: grid; gap: 10px; padding: 10px; border-radius: var(--r-xl);
  background: var(--rail-on); overflow: clip;
}
@supports not (overflow: clip) { .well { overflow: hidden; } }
.deck-col { position: relative; z-index: 2; min-width: 0; display: grid; align-content: start; }
.deck-head { display: grid; gap: 6px; padding: 6px 4px 0; }
.deck-label { font-size: 13.5px; color: var(--ink-3); padding-left: 2px; }

/* The deck picker: a v2 segmented control, a --wash-2 track with a sheet
   thumb that is sent on `settle` and can be thrown (flashcards.js). */
.seg-scroll { overflow-x: auto; scrollbar-width: none; margin-inline: -14px; padding: 2px 14px 4px; }
.seg-scroll::-webkit-scrollbar { display: none; }
.seg {
  --tx: 0px; --tw: 0px;
  position: relative; display: inline-flex; padding: 3px; border-radius: var(--r-md);
  background: var(--wash-2); box-shadow: inset 0 0 0 1px var(--rule-2); touch-action: pan-x;
}
.seg-thumb {
  position: absolute; top: 3px; bottom: 3px; left: 0; width: var(--tw); transform: translateX(var(--tx));
  border-radius: calc(var(--r-md) - 3px); background: var(--sheet); pointer-events: none;
  box-shadow: 0 0 0 1px var(--rule-2), 0 1px 2px rgb(var(--shade) / calc(.08 * var(--shade-k))), 0 2px 6px -2px rgb(var(--shade) / calc(.06 * var(--shade-k)));
}
.seg button {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 15px; border: 0; background: none; border-radius: calc(var(--r-md) - 3px);
  font-size: 14.5px; font-weight: 500; letter-spacing: -.01em; color: var(--ink-2); white-space: nowrap; cursor: pointer;
  transition: color var(--t-fast) var(--ease); -webkit-tap-highlight-color: transparent;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-checked="true"] { color: var(--ink); font-weight: 600; cursor: grab; }
.seg button:focus-visible { outline-offset: -2px; }
.seg svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fg); flex: none; }
.t-bio { --fg: var(--bio); } .t-chem { --fg: var(--chem); } .t-maths { --fg: var(--maths); }
.t-eng { --fg: var(--eng); } .t-hist { --fg: var(--hist); } .t-lang { --fg: var(--lang); }

/* A stack on a --rail-on well. Heights are fixed, so nothing shifts when the
   script deals the cards: they are placed absolutely in a stage whose size
   never depends on them. */
.stage {
  --card-w: min(300px, calc(100% - 40px)); --card-h: 184px; --pile-w: 96px; --pile-h: 60px;
  position: relative; height: 360px; margin-top: 4px; border-radius: var(--r-lg);
  touch-action: pan-y; outline: none;
}
.stage:focus-visible { box-shadow: inset 0 0 0 2px var(--ink); }
.fcard {
  --h: 0;
  position: absolute; left: 50%; top: 18px; width: var(--card-w); height: var(--card-h);
  perspective: 1200px; transform: translateX(-50%); transform-origin: 50% 50%;
  touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.is-live .fcard { will-change: transform; }
.fcard[data-held] { cursor: grabbing; }
.fcard.is-gone { pointer-events: none; }
.flip { position: absolute; inset: 0; transform-style: preserve-3d; }
.face {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 8px;
  padding: 16px 18px 14px; border-radius: var(--r-lg); background: var(--sheet);
  backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden;
}
.face.back { transform: rotateY(180deg); }
.face .meta { font-size: 13px; color: var(--ink-3); line-height: 1.3; }
.face .q { flex: 1; min-height: 0; font-size: 19px; font-weight: 500; line-height: 1.3; letter-spacing: -.015em; overflow: hidden; }
.face.back .q { font-weight: 400; }
.face .foot { font-size: 13px; color: var(--ink-3); line-height: 1.3; }
.face.is-long .q { font-size: 17px; }
.face.is-longer .q { font-size: 15.5px; line-height: 1.34; }
.face.is-longest .q { font-size: 14px; line-height: 1.36; }
@supports (corner-shape: squircle) {
  .face { corner-shape: squircle; border-radius: calc(var(--r-lg) * 1.6); }
  .well { corner-shape: squircle; border-radius: calc(var(--r-xl) * 1.6); }
}
.fc-static.u1 { transform: translate(-50%, 10px) scale(.955); }
.fc-static.u2 { transform: translate(-50%, 20px) scale(.91); }

.pile { position: absolute; bottom: 36px; width: var(--pile-w); height: var(--pile-h); border-radius: 10px; border: 1px dashed var(--rule-2); }
.pile.l { left: 14px; } .pile.r { right: 14px; }
.pile-label { position: absolute; bottom: 10px; width: var(--pile-w); text-align: center; font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.pile-label.l { left: 14px; } .pile-label.r { right: 14px; }
.pile-label b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.stage-note {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
  width: calc(100% - 2 * (var(--pile-w) + 28px)); text-align: center; font-size: 13.5px; line-height: 1.35; color: var(--ink-2);
}

.deck-done {
  position: absolute; left: 50%; top: 30px; width: min(380px, calc(100% - 40px)); transform: translateX(-50%);
  display: grid; gap: 10px; justify-items: center; text-align: center; color: var(--ink-2); font-size: 15px; line-height: 1.45;
}
.deck-done .done-title { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 40px; line-height: 1.04; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }

/* Your notes, a sheet lying on the desk. Writing in it lifts it a little
   off the desk on `settle`: it is the thing in your hand. */
.notes-sheet {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; gap: 10px; padding: 16px;
  border-radius: var(--r-lg);
  transition: --h var(--spring-settle-t) var(--spring-settle);
}
.notes-sheet:focus-within { --h: .35; }
@supports (corner-shape: squircle) { .notes-sheet { border-radius: calc(var(--r-lg) * 1.6); } }
.notes-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.notes-head h2 { font-size: 16.5px; font-weight: 600; letter-spacing: -.015em; line-height: 1.25; }
.notes-head .count { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.notes-head .count.is-over { color: var(--danger); }
.notes-sheet textarea {
  flex: 1; min-height: 132px; width: 100%; padding: 12px 14px; resize: none;
  font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--sheet);
  border: 1px solid var(--rule-2); border-radius: var(--r-md);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.notes-sheet textarea::placeholder { color: var(--ink-3); }
.notes-sheet textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--rail-on); }
.notes-sheet textarea:disabled { background: var(--wash); color: var(--ink-3); }
.notes-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.status { min-height: 20px; font-size: 13.5px; line-height: 1.4; color: var(--ink-3); }
.status.is-error { color: var(--danger); }
.status a { color: var(--ink); text-underline-offset: 3px; }

.string-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; margin-top: 6px; }
.string { display: block; width: 100%; height: 44px; overflow: visible; touch-action: pan-y; cursor: grab; }
.string path { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.string .track { stroke: var(--rule-2); } .string .done { stroke: var(--ink); }
.string-label { min-width: 52px; text-align: right; font-size: 13.5px; color: var(--ink-3); }

.deck-foot { padding: 0 4px 4px; }
.deck-bar { display: grid; gap: 14px; margin-top: 4px; }
.grade { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; }
.grade .btn { padding-inline: 12px; }
.keep { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--rule-2); }
.keep .btn { width: 100%; }
.keep p { order: 2; font-size: 13.5px; color: var(--ink-3); text-align: center; }

/* ---- sections ------------------------------------------------------------- */
.section { padding-top: 64px; }
.shead { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 24px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--rule-ink); margin-bottom: 24px; }
.shead h2, .split-copy h2 { font-size: 26px; font-weight: 600; line-height: 1.12; letter-spacing: -.028em; }
.shead p { font-size: 15px; color: var(--ink-2); }
.split { display: grid; gap: 20px 72px; }
.split-copy { display: grid; gap: 12px; align-content: start; }
.split-copy p { font-size: 17px; line-height: 1.5; color: var(--ink-2); max-width: 36ch; }

/* How spaced repetition brings cards back: one card riding the string. */
.rep { padding: 14px; }
.rep-field { position: relative; height: 168px; border-radius: var(--r-lg); background: var(--rail-on); overflow: hidden; }
.rep-string { position: absolute; left: 12px; bottom: 34px; width: calc(100% - 24px); height: 64px; }
.rep-string .ticks line { stroke: var(--ink-4); stroke-width: 1.5; stroke-linecap: round; }
.rep-card {
  --h: .3;
  position: absolute; left: 0; top: 0; width: 116px; padding: 10px 12px; border-radius: var(--r-md);
  background: var(--sheet); display: grid; gap: 1px; will-change: transform;
}
.rep-card span { font-size: 12px; color: var(--ink-3); }
.rep-card b { font-size: 17px; font-weight: 600; letter-spacing: -.015em; white-space: nowrap; }
.rep-stops { display: none; list-style: none; margin: 0; padding: 0; position: absolute; left: 12px; right: 12px; bottom: 10px; height: 18px; }
.rep-stops li { position: absolute; top: 0; transform: translateX(-50%); font-size: 12.5px; color: var(--ink-3); white-space: nowrap; transition: color var(--t-fast) var(--ease); }
.rep-stops li.is-at { color: var(--ink); font-weight: 600; }
.rep-bar { display: grid; gap: 12px; padding: 16px 4px 4px; }
.rep-say { font-size: 16.5px; color: var(--ink); min-height: 25px; }
.rep-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.rep-btns .btn { flex: 1; }
.rep-btns [data-rep-reset] { flex: none; }

/* Challenge a friend: the deck above, as a challenge. */
.ch { overflow: hidden; }
.ch-head { display: flex; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--rule); font-size: 13.5px; color: var(--ink-3); }
.ch-head span:first-child { color: var(--ink); font-weight: 600; }
.ch-play { padding: 18px; transition: opacity var(--t-fast) var(--ease); }
.ch-play.is-out { opacity: 0; }
.ch-q { font-size: 19px; font-weight: 500; line-height: 1.3; letter-spacing: -.015em; min-height: 50px; }
.ch-opts { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.opt {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) 18px; gap: 10px; align-items: center; width: 100%;
  min-height: 52px; padding: 10px 14px; border: 0; border-radius: var(--r-md); text-align: left; cursor: pointer;
  background: var(--sheet); box-shadow: inset 0 0 0 1px var(--rule-2); font-size: 15px; line-height: 1.35; color: var(--ink);
  transition: background-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--spring-key-t) var(--spring-key);
}
.opt:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 4%, var(--sheet)); }
.opt:active:not(:disabled) { transform: translateY(1px); background: var(--wash-2); }
.opt:disabled { cursor: default; }
.opt .k { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.opt svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; visibility: hidden; }
.opt[data-state="right"] { box-shadow: inset 0 0 0 1.5px var(--ok); }
.opt[data-state="right"] svg { visibility: visible; color: var(--ok); }
.opt[data-state="wrong"] { box-shadow: inset 0 0 0 1.5px var(--danger); color: var(--ink-2); }
.opt[data-state="dim"] { color: var(--ink-3); }
.ch-foot { display: flex; justify-content: flex-end; min-height: 36px; margin-top: 14px; }
.ch-end { display: grid; justify-items: center; gap: 10px; padding: 26px 18px 22px; text-align: center; }
.score-wrap { position: relative; padding: 18px 40px 14px; }
.score { font-family: var(--serif); font-size: 76px; line-height: 1; letter-spacing: -.02em; color: var(--ink); }
.score .of { font-size: .5em; color: var(--ink-3); margin-left: .06em; }
.ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; transform: rotate(-3deg); }
.ring path { fill: none; stroke: var(--pen); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; stroke-dasharray: 1 1; stroke-dashoffset: 0; }
.ch-end.ink .ring path { animation: ring-draw .8s cubic-bezier(.5, 0, .2, 1) .3s backwards, ring-dry .5s ease-out 1.1s backwards; }
@keyframes ring-draw { from { stroke-dashoffset: 1; stroke-width: 3.4; } to { stroke-dashoffset: 0; stroke-width: 3.4; } }
@keyframes ring-dry { from { stroke-width: 3.4; } to { stroke-width: 2.6; } }
.ch-comment { font-size: 15px; color: var(--ink-2); max-width: 34ch; }

/* Practice exams: one sheet you can lift. */
.band {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 16px; align-items: center;
  padding: 20px; text-decoration: none; color: var(--ink);
  transition: --h var(--spring-settle-t) var(--spring-settle), transform var(--spring-settle-t) var(--spring-settle);
}
.band:hover { --h: .5; transform: translateY(-2px) scale(1.004); }
.band .dd { width: 44px; height: 44px; grid-row: span 2; }
.dd path { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.band h2 { font-size: 19px; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; }
.band p { font-size: 15px; color: var(--ink-2); }
.band-go { grid-column: 2; display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 500; }
.band-go svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* How to make flashcards: three ruled steps, no fills. */
.steps { list-style: none; margin: 0; padding: 0; display: grid; }
.steps li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 4px 12px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.steps li:first-child { padding-top: 4px; }
.step-n { grid-row: span 2; font-size: 15px; font-weight: 600; color: var(--ink-3); line-height: 1.5; }
.steps h3 { font-size: 18px; font-weight: 600; letter-spacing: -.016em; line-height: 1.3; }
.steps p { font-size: 15.5px; line-height: 1.55; color: var(--ink-2); max-width: 44ch; }
.steps-after { margin-top: 20px; font-size: 15px; line-height: 1.55; color: var(--ink-2); max-width: 70ch; }
.steps-after a { color: var(--ink); font-weight: 500; text-underline-offset: 3px; }

/* The sample decks as text: ruled rows under an ink rule, like the FAQ. */
.samples { border-top: 1px solid var(--rule-ink); }
.sample { border-bottom: 1px solid var(--rule); }
.sample summary {
  display: flex; align-items: center; gap: 12px; min-height: 60px; padding-block: 14px;
  cursor: pointer; list-style: none; font-size: 17px; font-weight: 500; letter-spacing: -.012em;
}
.sample summary::-webkit-details-marker { display: none; }
.sample-name { display: inline-flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.sample-n { font-size: 13.5px; font-weight: 400; color: var(--ink-3); }
.sample summary svg { width: 16px; height: 16px; flex: none; color: var(--ink-3); }
.sample summary svg path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.sample[open] summary .v { display: none; }
.qa { list-style: none; margin: 0; padding: 0; counter-reset: qa; }
.qa li { display: grid; gap: 2px; padding: 12px 0; border-top: 1px solid var(--rule); }
.qa-m { font-size: 13px; color: var(--ink-3); }
.qa-q { font-size: 16px; font-weight: 500; letter-spacing: -.01em; line-height: 1.4; }
.qa-a { font-size: 15.5px; line-height: 1.5; color: var(--ink-2); }
.sample-go { margin: 6px 0 22px; }

/* Coming from Quizlet or Anki: what an import looks like. */
.import { margin: 0; padding: 18px; display: grid; gap: 12px; }
.import figcaption { font-size: 13.5px; color: var(--ink-3); }
.import-lines {
  margin: 0; padding: 14px 16px; overflow-x: auto; border-radius: var(--r-md); background: var(--wash);
  font-family: var(--mono); font-size: 13.5px; line-height: 1.75; color: var(--ink); tab-size: 6;
}
.import-out { font-size: 15px; color: var(--ink-2); }

/* Questions */
.faq { border-top: 1px solid var(--rule-ink); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 60px; padding-block: 14px; cursor: pointer; list-style: none;
  font-size: 17px; font-weight: 500; letter-spacing: -.012em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { width: 16px; height: 16px; flex: none; color: var(--ink-3); }
.faq summary svg path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.faq details[open] summary .v { display: none; }
.faq details p { padding-bottom: 20px; font-size: 16px; line-height: 1.6; color: var(--ink-2); max-width: 62ch; }

/* The closing: the screen's own swipe and ink key. */
.closing { padding-top: 96px; padding-bottom: 88px; text-align: center; }
.closing .display { display: inline-block; text-align: left; }
.closing p { margin: 18px auto 26px; font-size: 17px; color: var(--ink-2); max-width: 40ch; }

.site-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 22px; padding-bottom: max(40px, env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--rule); }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 2px 4px; margin-left: -10px; }
.site-foot nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; border-radius: var(--r-sm); font-size: 14px; color: var(--ink-2); text-decoration: none; }
.site-foot nav a:hover { background: var(--hover); color: var(--ink); }
.site-foot p { font-size: 13.5px; color: var(--ink-3); }

/* Sections rise in on `glide` the first time they come into view (the
   script sets this only for those below the fold, and never under reduced
   motion). */
.rise-wait { opacity: 0; }
.rise-in { transition: opacity .3s var(--ease); }

/* ---- wider -------------------------------------------------------------------- */
@media (min-width: 560px) {
  .wrap { padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px)); }
  .nav-link { display: inline-flex; }
  .well { padding: 14px; gap: 14px; }
  .notes-sheet { padding: 20px; }
  .stage { --card-w: min(360px, calc(100% - 64px)); --card-h: 214px; --pile-w: 112px; --pile-h: 68px; height: 400px; }
  .keep { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; }
  .keep .btn { width: auto; }
  .keep p { order: 0; text-align: left; }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 32px; }
  .steps li, .steps li:first-child { grid-template-columns: minmax(0, 1fr); padding: 4px 0 0; border-bottom: 0; }
  .step-n { grid-row: auto; display: block; padding-bottom: 10px; margin-bottom: 6px; border-bottom: 1px solid var(--rule-2); }
  .qa li { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 2px 32px; align-items: baseline; }
  .qa-m { grid-column: 1; grid-row: 2; }
  .qa-q { grid-column: 1; grid-row: 1; }
  .qa-a { grid-column: 2; grid-row: 1 / span 2; }
  .import { padding: 22px; }
  .face { padding: 18px 22px 16px; }
  .face .q { font-size: 21px; }
  .face.is-long .q { font-size: 18px; }
  .face.is-longer .q { font-size: 16px; }
  .face.is-longest .q { font-size: 14.5px; }
  .rep { padding: 18px; }
  .rep-field { height: 188px; }
  .rep-stops { display: block; }
  .rep-bar { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 18px 6px 4px; }
  .rep-btns .btn { flex: none; }
  .band { grid-template-columns: auto minmax(0, 1fr) auto; padding: 22px 26px; }
  .band .dd { grid-row: auto; }
  .band-text { display: grid; gap: 2px; }
  .band-go { grid-column: auto; }
}
@media (min-width: 960px) {
  .wrap { padding-left: 48px; padding-right: 48px; }
  .hero { padding-top: 24px; padding-bottom: 72px; }
  /* The notes beside the deck, the same height as it. */
  .well { grid-template-columns: minmax(300px, 4fr) minmax(0, 6fr); gap: 16px; padding: 16px; }
  .notes-sheet { padding: 22px 22px 18px; }
  .notes-sheet textarea { min-height: 0; }
  .deck-head { gap: 8px; padding: 0 6px; }
  .seg-scroll { margin-inline: -6px -16px; padding-inline: 6px 16px; }
  .hero-head { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: end; gap: 56px; }
  .hero h1, .display { font-size: clamp(56px, 3.2vw + 28px, 76px); }
  .hero-side { padding-bottom: 8px; }
  .lede { font-size: 18.5px; }
  .desk { margin-top: 28px; }
  .stage { --card-w: min(420px, calc(100% - 56px)); --card-h: 248px; --pile-w: 128px; --pile-h: 78px; height: 412px; margin-top: 6px; }
  .stage .fcard { top: 26px; }
  .face { padding: 22px 26px 18px; }
  .face .meta, .face .foot { font-size: 13.5px; }
  .face .q { font-size: 24px; line-height: 1.26; }
  .face.is-long .q { font-size: 20px; }
  .face.is-longer .q { font-size: 17.5px; }
  .face.is-longest .q { font-size: 15.5px; }
  .pile { bottom: 42px; } .pile.l, .pile-label.l { left: 22px; } .pile.r, .pile-label.r { right: 22px; }
  .pile-label { bottom: 14px; font-size: 13.5px; }
  .deck-done { top: 64px; }
  .deck-done .done-title { font-size: 52px; }
  .notes-head h2 { font-size: 19px; }
  /* Under the deck: the string, then the buttons with the way to keep them. */
  .deck-foot { padding: 0 6px 2px; }
  .deck-bar { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 20px; margin-top: 2px; }
  .grade { display: flex; }
  .grade .btn { padding-inline: 16px; }
  .keep { padding-top: 0; border-top: 0; display: flex; justify-content: flex-end; }
  .keep p { text-align: right; max-width: 24ch; font-size: 13.5px; line-height: 1.35; }
  .section { padding-top: 112px; }
  .shead h2, .split-copy h2 { font-size: 34px; }
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); }
  .rep { padding: 22px; }
  .rep-field { height: 190px; }
  .rep-card { width: 132px; padding: 12px 14px; }
  .rep-card b { font-size: 19px; }
  .closing { padding-top: 144px; padding-bottom: 120px; }
  .closing p { font-size: 18.5px; }
}

/* ---- reduced motion: everything shown at rest ----------------------------- */
@media (prefers-reduced-motion: reduce) {
  .ink .hl, .ch-end.ink .ring path { animation: none; }
  .band { transition: none; }
  .btn, .opt { transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
}

/* ==========================================================================
   The revamp (November 2026): the home page's rhythm without its
   exceptions (DESIGN.md section 9: no lit ground, no turning headline, no
   other apps, the lockup stays NoteFlow). A centred head over the desk, one
   dark band, the same deck made twice, the app it lands in, and a closing
   with the sign-up line.
   ========================================================================== */

/* ---- the head: centred over the desk ------------------------------------- */
.hero-head { justify-items: center; text-align: center; gap: 16px; }
.hero h1 .l1, .hero h1 .l2 { display: block; }
.hero .lede { max-width: 40ch; margin-inline: auto; }
.facts { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-size: 14.5px; color: var(--ink-2); }
.facts li { display: inline-flex; align-items: center; gap: 6px; }
.facts svg { width: 15px; height: 15px; fill: none; stroke: var(--ok); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hero > .wrap > .keys-hint { justify-content: center; margin-top: 16px; }

/* Section heads that open a section rather than label a list: centred,
   larger, the ink rule dropped (the content under them is its own sheet). */
.shead-c { display: grid; justify-content: center; justify-items: center; text-align: center; gap: 10px; border-bottom: 0; padding-bottom: 0; margin-bottom: 36px; }
.shead-c h2.big { font-size: clamp(30px, 2.6vw + 18px, 52px); line-height: 1.05; letter-spacing: -.032em; max-width: 20ch; }
.shead-c p { font-size: 17px; }

/* ---- the dark band: the dark paper's own values, whatever the theme ------- */
.night {
  --paper: #151514; --sheet: #1F1E1C; --wash: #252422; --wash-2: #2C2B29; --rail-on: #2A2927;
  --ink: #EDEBE5; --ink-2: #B5B1A8; --ink-3: #8E8A82; --ink-4: #5F5C56; --on-ink: #191918;
  --rule: #2A2927; --rule-2: #3A3936; --rule-ink: #EDEBE5;
  --shade: 0 0 0; --shade-k: 2.8; --key-edge: #8E8A82;
  --hl: #4A3778; --hl-ink: #F4F0FF; --hl-blend: normal; --ok: #5BB98C;
  color-scheme: dark;
  background: var(--paper); color: var(--ink);
  margin-top: 96px; padding-top: 88px; padding-bottom: 96px;
}
/* On the dark theme the page is already that paper; a hairline either side
   keeps the band a place of its own. */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .night { --paper: #0F0F0E; border-block: 1px solid #2A2927; } }
:root[data-theme="dark"] .night { --paper: #0F0F0E; border-block: 1px solid #2A2927; }
.night + .section { padding-top: 96px; }
.night .steps-after { margin-inline: auto; text-align: center; }

/* The steps, large: the numeral is the step. Sans, so the screen's one
   serif moment stays the headline's. */
.night .step-n { font-size: 56px; line-height: 1; font-weight: 600; letter-spacing: -.04em; color: var(--ink); border-bottom-color: var(--rule-2); }
.night .steps h3 { font-size: 21px; }
.night .steps p { font-size: 16px; }

/* ---- the same deck, made twice ------------------------------------------- */
.vs { display: grid; gap: 14px; }
.vs-col { padding: 20px 22px 22px; display: grid; align-content: start; gap: 14px; }
.vs-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--rule-ink); }
.vs-name { font-size: 17px; font-weight: 600; letter-spacing: -.016em; }
.vs-count { font-size: 14px; color: var(--ink-3); }
.vs-count b { font-size: 40px; line-height: .9; font-weight: 600; letter-spacing: -.04em; color: var(--ink); margin-right: 4px; }
.vs-steps { list-style: none; margin: 0; padding: 0; counter-reset: vs; display: grid; }
.vs-steps li {
  counter-increment: vs; display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: baseline;
  padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: 16px; color: var(--ink);
  transition: color var(--t-fast) var(--ease);
}
.vs-steps li::before { content: counter(vs); font-size: 13.5px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
/* While the deck is being made: steps not reached yet sit back, the one being
   done carries the weight. Colour only; nothing moves. */
.vs.is-playing .vs-steps li { color: var(--ink-4); }
.vs.is-playing .vs-steps li.is-done { color: var(--ink-2); }
.vs.is-playing .vs-steps li.is-now { color: var(--ink); font-weight: 600; }
.vs.is-playing .vs-steps li.is-now::before { color: var(--ink); }
.vs-after { font-size: 15px; color: var(--ink-2); }
.vs-col[data-vs-col="nf"] { --h: .5; }
.vs-bar { display: grid; justify-items: center; gap: 10px; text-align: center; }
.vs-say { font-size: 16px; color: var(--ink-2); min-height: 24px; max-width: 52ch; }

/* ---- spaced repetition: when it comes back, as the moment ----------------- */
.rep-big { display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 4px 12px; padding: 6px 4px 18px; text-align: center; }
.rep-big span { font-size: 17px; color: var(--ink-3); }
.rep-big b { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(40px, 3vw + 26px, 64px); line-height: 1; letter-spacing: -.02em; color: var(--ink); }

/* ---- where the cards go: the app, photographed ----------------------------
   A screenshot of the real app with a sample student's work in it
   (scripts/app-shots; DESIGN.md section 9), never a drawing of it. The copy
   stands over it and the picture takes the full measure, so the app's own
   type stays readable. Framed as the homepage's window is: rounded, a
   hairline and one shadow. /planner and /ai-tutor use the same frame. */
.split-app { grid-template-columns: minmax(0, 1fr); gap: 28px; }
.ticks { list-style: none; margin: 4px 0 0; padding: 0; display: grid; border-top: 1px solid var(--rule-ink); }
.ticks li { padding: 10px 0 10px 26px; position: relative; border-bottom: 1px solid var(--rule); font-size: 16px; color: var(--ink); }
.ticks li::before { content: ""; position: absolute; left: 2px; top: 17px; width: 11px; height: 6px; border-left: 1.8px solid var(--ok); border-bottom: 1.8px solid var(--ok); transform: rotate(-45deg); }
.more { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 15.5px; font-weight: 500; text-decoration: none; }
.more:hover { text-decoration: underline; text-underline-offset: 3px; }
.more svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.appshot {
  margin: 0; border-radius: 20px; overflow: hidden; background: var(--wash);
  box-shadow:
    0 0 0 1px var(--rule-2),
    0 28px 68px -20px rgb(var(--shade) / calc(.22 * var(--shade-k))),
    0 6px 16px -4px rgb(var(--shade) / calc(.08 * var(--shade-k)));
}
@supports (corner-shape: squircle) { .appshot { corner-shape: squircle; border-radius: 30px; } }
.appshot picture, .appshot img { display: block; width: 100%; height: auto; }
/* A phone gets the phone's screenshot, at a phone's width. */
@media (max-width: 760px) { .appshot { width: min(100%, 420px); margin-inline: auto; } }

/* ---- the closing: the home page's sign-up line ---------------------------- */
.reserve { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 460px; margin: 0 auto; }
.reserve input {
  flex: 1 1 220px; min-width: 0; height: 48px; padding: 0 16px; border: 0; border-radius: var(--r-lg);
  background: var(--sheet); color: var(--ink); font-size: 16px;
  box-shadow: inset 0 0 0 1px var(--rule-2);
}
.reserve input::placeholder { color: var(--ink-3); }
.reserve input:focus { outline: none; box-shadow: inset 0 0 0 1px var(--ink), 0 0 0 3px var(--rail-on); }
.reserve .key { height: 48px; flex: 0 0 auto; }

@media (min-width: 760px) {
  .vs { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
}
@media (min-width: 960px) {
  .hero-head { grid-template-columns: minmax(0, 1fr); gap: 18px; padding-top: 20px; }
  .hero h1 { font-size: clamp(60px, 3.6vw + 28px, 84px); }
  .hero .lede { font-size: 19px; }
  .desk { margin-top: 40px; }
  .night { margin-top: 128px; padding-top: 120px; padding-bottom: 128px; }
  .night + .section { padding-top: 128px; }
  .night .step-n { font-size: 72px; }
  .vs-col { padding: 26px 28px 28px; }
  .split-app { gap: 40px; }
  /* The heading, the line and the link down the left; the list beside them. */
  .split-app .split-copy { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto 1fr; column-gap: 72px; }
  .split-app .split-copy > * { grid-column: 1; }
  .split-app .split-copy > .more { align-self: start; justify-self: start; }
  .split-app .split-copy > .ticks { grid-column: 2; grid-row: 1 / span 3; align-self: start; margin-top: 0; }
}


/* ==========================================================================
   Light on the paper that follows the clock (DESIGN.md section 9,
   "/flashcards"). Two lights, each from its own side: one pools from the top
   left over the head and the desk (Lagoon's shape), the other sweeps in from
   the top right over the sign-up (Aurora's). Their colours are the app's
   Adaptive sky for this minute of the visitor's day (--sky-top, --sky-mid,
   set by the head script): peach at sunrise, blue through the day, gold and
   rose at sunset, deep blue at night. Light or dark still follows the device.
   One light per screen, on the ground only: sheets, buttons, the highlighter
   and the logo stay flat.

   Inside the light the ink steps are Adaptive's neutral greys, checked at
   every five minutes of the day against both colours at full strength:
   --ink-3 never falls below 5.19:1 on the light paper or 5.03:1 on the dark
   (Paper's own --ink-3 would fall to about 4.2:1).
   ========================================================================== */
:root { --sky-top: 90 165 240; --sky-mid: 150 215 240; --sky-a: .32; --sky-b: .16; }
.lit-sky { position: relative; isolation: isolate; }
.lit-sky::before {
  content: ""; position: absolute; z-index: -1; left: 0; right: 0; top: 0; height: 1180px; pointer-events: none;
  background: radial-gradient(ellipse 88% 72% at 6% -10%, rgb(var(--sky-top) / var(--sky-a)) 0%, rgb(var(--sky-mid) / var(--sky-b)) 40%, rgb(var(--sky-mid) / 0) 74%);
}
.lit-sky .top, .lit-sky .hero { --ink-2: #3D3D3D; --ink-3: #454545; }
/* The top line is part of the ground until the page runs under it. */
.lit-sky .top:not([data-scrolled]) { background: transparent; }

.lit-sky-close { position: relative; isolation: isolate; --ink-2: #3D3D3D; --ink-3: #454545; }
.lit-sky-close::before {
  content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none;
  background: linear-gradient(200deg, rgb(var(--sky-mid) / var(--sky-a)) 0%, rgb(var(--sky-top) / var(--sky-b)) 32%, rgb(var(--sky-top) / .05) 54%, rgb(var(--sky-top) / 0) 74%);
  /* Fades in from nothing at the top and out before the footer: the light
     has no edge of its own. */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 30%, #000 62%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 30%, #000 62%, transparent 100%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --sky-a: .24; --sky-b: .1; }
  :root:not([data-theme="light"]) .lit-sky .top, :root:not([data-theme="light"]) .lit-sky .hero,
  :root:not([data-theme="light"]) .lit-sky-close { --ink-2: #C8C8C8; --ink-3: #BDBDBD; }
}
:root[data-theme="dark"] { --sky-a: .24; --sky-b: .1; }
:root[data-theme="dark"] .lit-sky .top, :root[data-theme="dark"] .lit-sky .hero,
:root[data-theme="dark"] .lit-sky-close { --ink-2: #C8C8C8; --ink-3: #BDBDBD; }

/* ---- asking to be tried -------------------------------------------------- */
.try-hint {
  margin: 0 0 4px; text-align: center; font-size: 14px; color: var(--ink-2);
  transition: opacity 220ms var(--ease);
}
.try-hint.is-used { opacity: 0; }
.vs-bar { margin: -8px 0 28px; }
.vs-say { min-height: 3em; max-width: 62ch; }
@media (min-width: 760px) { .vs-say { min-height: 1.5em; } }
.vs-play { display: inline-flex; align-items: center; gap: 8px; }
.vs-play svg { width: 14px; height: 14px; fill: currentColor; }
