/* Industry, design-system tokens and component classes. This file is the source of truth for the system's look; retune it here and see readme.md. */
@import url("https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;700&family=Barlow+Condensed:wght@400;600&display=swap");

:root {
  --color-bg: #f2f2f3;
  --color-surface: #e9e9ea;
  --color-text: #1d1f20;
  --color-accent: #5980a6;
  --color-accent-2: #728fab;
  --color-divider: color-mix(in srgb, #1d1f20 16%, transparent);

  /* The reversed plate: paper printed on a steel field. It is a treatment, not
     a shade, the splash, the board's hero, the guide's plate, a status tag and
     the app's own mark are all the same object, printed the other way round
     from the page around them.
     It gets its own two tokens rather than reaching for the end of the accent
     ramp, because the ramp means "strongest state" and inverts with the theme,
     while this has to stay a plate: on a dark page it lifts *off* the ground
     instead of sinking into it, which the ramp's darkest step cannot do. */
  /* The app header's measured height, republished by App.watchHeaderHeight for
     the sticky things that stop underneath it. Declared here so the cascade
     always has a value; nothing but that measurement ever writes it. */
  --app-header-h: 0px;

  --color-reverse-bg: #1d2d3d;
  --color-reverse-text: #f2f2f3;
  --color-reverse-line: color-mix(in srgb, var(--color-reverse-text) 25%, transparent);

  /* The "wrong answer" red, used by the graders and the sign-in error callout.
     A token so the dark theme can lift it, #a4553f is set for paper. */
  --color-error: #a4553f;

  /* Tonal ramps, generated in OKLCH on one shared lightness scale, so the
     same step of any role matches the others in visual value. */
  --color-neutral-100: #f5f5f8;
  --color-neutral-200: #e7e7ea;
  --color-neutral-300: #d4d4d7;
  --color-neutral-400: #b7b7ba;
  --color-neutral-500: #98989b;
  --color-neutral-600: #7a7a7d;
  --color-neutral-700: #5d5d60;
  --color-neutral-800: #424244;
  --color-neutral-900: #2b2b2d;

  --color-accent-100: #eef6ff;
  --color-accent-200: #d6ebff;
  --color-accent-300: #b5d9fd;
  --color-accent-400: #94bce3;
  --color-accent-500: #749dc4;
  --color-accent-600: #597ea3;
  --color-accent-700: #416180;
  --color-accent-800: #2c455d;
  --color-accent-900: #1d2d3d;

  --color-accent-2-100: #eef6ff;
  --color-accent-2-200: #d6ebff;
  --color-accent-2-300: #bdd8f2;
  --color-accent-2-400: #9ebbd8;
  --color-accent-2-500: #7e9cb8;
  --color-accent-2-600: #627d98;
  --color-accent-2-700: #486077;
  --color-accent-2-800: #314457;
  --color-accent-2-900: #1f2d3a;

  /* Freshness meter track, the fill colour is computed inline as a continuous
     red→green gradient keyed to each verse's retrievability. srs.freshColor
     picks the hue and leaves the lightness here, so the gradient can be mixed
     for the ground it is printed on. */
  --fresh-l: 45%;
  --color-fresh-track: var(--color-neutral-200);

  --font-heading: "Barlow Condensed", system-ui, sans-serif;
  --font-heading-weight: 600;
  --font-body: "Barlow", system-ui, sans-serif;

  --space-1: 3.4px;
  --space-2: 6.8px;
  --space-3: 10.2px;
  --space-4: 13.6px;
  --space-6: 20.4px;
  --space-8: 27.2px;

  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 7px;

  /* Elevation, derived from the ground: soft ink-tinted shadows on a
     light theme, a hairline edge + ambient darkness on a dark one. */
  --shadow-sm: 0 1px 2px color-mix(in srgb, #2b2b2d 14%, transparent);
  --shadow-md: 0 3px 10px color-mix(in srgb, #2b2b2d 16%, transparent);
  --shadow-lg: 0 12px 32px color-mix(in srgb, #2b2b2d 22%, transparent);

  /* Motion, three durations and one curve, so everything that moves in the app
     moves at the same few speeds. --ease-out is the curve the splash and the
     guide were already drawn with; naming it here is what lets the rest of the
     app match them. See the motion block near the bottom of this file. */
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-tap: 120ms; /* a control answering a press */
  --dur-swap: 260ms; /* something replacing something else */
  --dur-tell: 640ms; /* a figure being shown, worth watching */

  /* See the note beside its counterpart in the dark block below. */
  color-scheme: light;
}

/* ── the dark theme ──────────────────────────────────────────────────────────
   The system follows the reader by default, and a member who wants otherwise on
   one screen says so under Settings (see src/theme.js). What that leaves here is
   one selector: `data-theme` on the root element, always already settled to
   "light" or "dark", never "system". The choosing is done in JS and stamped
   before the first paint, because a stylesheet cannot say "dark unless the
   member asked for light" without writing this whole block out a second time
   under another selector, and one palette written twice is a palette that drifts.

   It is one block of token overrides and no rules of its own, everything below
   this point is written against the tokens, so the whole app turns over
   together. Two ideas carry it:

   The two ramps INVERT rather than being replaced. Their steps mean distance
   from the page's ground, not lightness: 100 is nearest the paper, 900 furthest
   into the ink. Read that way, "the strongest state" is the darkest step on a
   light page and the lightest on a dark one, so a committed cell in the board's
   map, its legend swatch and a member's own bar all stay the strongest thing on
   screen without a single view being touched.

   The reversed plate does NOT invert, which is exactly why it has its own two
   tokens. It is a plate printed the other way round from the page, so on a dark
   ground it has to lift *off* the page rather than sink into it, the accent
   ramp's far end would do the opposite. It stays a steel field with paper on it,
   just a steel field a few steps lighter than the room. */
:root[data-theme="dark"] {
  --color-bg: #131416;
  --color-surface: #1b1c1e;
  --color-text: #e9e9ec;
  --color-accent: #8ab0d6;
  --color-accent-2: #93a9c0;
  --color-divider: color-mix(in srgb, #e9e9ec 16%, transparent);

  /* Both ramps, end for end. */
  --color-neutral-100: #1a1a1c;
  --color-neutral-200: #232325;
  --color-neutral-300: #2f2f31;
  --color-neutral-400: #45454a;
  --color-neutral-500: #6a6a6e;
  --color-neutral-600: #8c8c90;
  --color-neutral-700: #adadb1;
  --color-neutral-800: #cfcfd2;
  --color-neutral-900: #ebebee;

  --color-accent-100: #16202a;
  --color-accent-200: #1d2b38;
  --color-accent-300: #26384a;
  --color-accent-400: #3d5a76;
  --color-accent-500: #5c82a8;
  --color-accent-600: #7ba1c6;
  --color-accent-700: #9dbcdb;
  --color-accent-800: #c2d8ee;
  --color-accent-900: #e3eefb;

  --color-accent-2-100: #171f27;
  --color-accent-2-200: #1e2831;
  --color-accent-2-300: #28343f;
  --color-accent-2-400: #3f5163;
  --color-accent-2-500: #5f7488;
  --color-accent-2-600: #7e94a8;
  --color-accent-2-700: #9db0c2;
  --color-accent-2-800: #c1cfdb;
  --color-accent-2-900: #e2eaf1;

  /* The plate, lifted off the room rather than sunk into it. */
  --color-reverse-bg: #26384a;

  /* The freshness gradient, lifted for the same reason as the red below: a
     45% lightness that reads on paper sinks into a dark ground. */
  --fresh-l: 60%;

  /* Lifted off #a4553f, which is mixed for paper and goes muddy on ink. */
  --color-error: #dc9077;

  /* Elevation the other way round, as the tokens' own note anticipated: a
     hairline edge and ambient darkness, since a soft ink shadow says nothing
     on a ground that is already dark. */
  --shadow-sm: 0 0 0 1px color-mix(in srgb, #e9e9ec 8%, transparent);
  --shadow-md: 0 0 0 1px color-mix(in srgb, #e9e9ec 9%, transparent), 0 3px 12px rgb(0 0 0 / 45%);
  --shadow-lg: 0 0 0 1px color-mix(in srgb, #e9e9ec 10%, transparent), 0 14px 36px rgb(0 0 0 / 55%);

  /* The one thing a token cannot reach: the browser's own widgets, form
     controls, scrollbars, the caret, which are painted by the UA and have to
     be told which way round the page is. It is declared on both grounds
     rather than only this one, because a member on a dark system who asks the
     app for paper has to get paper form controls with it. */
  color-scheme: dark;
}

html {
  margin: 0;
}
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
}
h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
}

.blueprint {
  position: relative;
  border: 1px solid var(--color-divider);
  border-radius: 0;
}
/* The overlay image treatments (halftone, duotone) clip their overlay
   (overflow:hidden); a blueprint wrapper draws its registration marks
   outside the box, so when both classes share a wrapper the frame must
   win. */
.blueprint.halftone,
.blueprint.plate,
.blueprint.duotone {
  overflow: visible;
}
.blueprint > .corner {
  position: absolute;
  width: 11px;
  height: 11px;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.blueprint > .corner::before,
.blueprint > .corner::after {
  content: "";
  position: absolute;
  background: currentColor;
}
.blueprint > .corner::before {
  left: 5px;
  top: 0;
  width: 1px;
  height: 100%;
}
.blueprint > .corner::after {
  top: 5px;
  left: 0;
  width: 100%;
  height: 1px;
}
.blueprint > .corner.tl {
  top: -6px;
  left: -6px;
}
.blueprint > .corner.tr {
  top: -6px;
  right: -6px;
}
.blueprint > .corner.bl {
  bottom: -6px;
  left: -6px;
}
.blueprint > .corner.br {
  bottom: -6px;
  right: -6px;
}

.duotone {
  position: relative;
  overflow: hidden;
}
.duotone::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--color-accent);
  mix-blend-mode: color;
}

/* ══════════════════════════════════════════════════════════════════════════
   Components, built with the tokens above. Plain CSS
   on plain HTML: no JavaScript, no build step. Each class is documented in
   readme.md and demonstrated in foundations/ and components/.
   ══════════════════════════════════════════════════════════════════════ */

*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 var(--space-2);
}
h1 {
  font-size: 42px;
}
h2 {
  font-size: 32px;
}
h3 {
  font-size: 25px;
}
h4 {
  font-size: 20px;
}
h5 {
  font-size: 16px;
}
h6 {
  font-size: 13px;
}
h6 {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
p {
  margin: 0 0 var(--space-3);
}
a {
  color: var(--color-accent);
  text-underline-offset: 3px;
  transition: color var(--dur-tap) linear;
}
a:hover {
  color: var(--color-accent-700);
}
@keyframes nudge {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}

/* Freshness earned by a submitted review card: the bar runs from the freshness
   the passage had (--fresh-from) to the one it just earned (--fresh-to), and
   the signed figure lands after it. Both widths are set inline by the
   view-model; the keyframes only move between them. */
@keyframes fresh-fill {
  from {
    width: var(--fresh-from, 0%);
  }
  to {
    width: var(--fresh-to, 0%);
  }
}
@keyframes fresh-land {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.fresh-fill {
  animation: fresh-fill 900ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.fresh-delta {
  animation: fresh-land 420ms ease-out 620ms both;
}
@media (prefers-reduced-motion: reduce) {
  .fresh-fill,
  .fresh-delta {
    animation-duration: 1ms;
    animation-delay: 0ms;
  }
}
img {
  display: block;
  max-width: 100%;
}
figure {
  margin: 0;
}
figcaption {
  font-size: 11px;
  margin-top: var(--space-1);
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.text-muted {
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
:focus {
  outline: none;
}
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
::selection {
  background: color-mix(in srgb, var(--color-accent) 30%, transparent);
}

/*, rules, */
.hr {
  height: 1px;
  border: 0;
  margin: var(--space-4) 0;
  background: var(--color-divider);
}

/*, buttons, */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  font-size: 14px;
  line-height: 1.2;
  color: var(--color-text); /* matches the .input's 14px,
     the pair sits side by side in sign-up rows */
  background: transparent;
  border: 1px solid transparent;
  padding: var(--space-2) calc(var(--space-3) * 1.2);
  border-radius: var(--radius-md);
  transition:
    background-color var(--dur-tap) linear,
    border-color var(--dur-tap) linear,
    color var(--dur-tap) linear,
    opacity var(--dur-tap) linear,
    transform var(--dur-tap) var(--ease-out);
}
.btn svg {
  display: block;
}
/* A press is answered by the button itself moving, not only by its fill
   changing, the one bit of motion in the app that has to land inside the
   frame the tap is still in. */
.btn:active:not(:disabled) {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--color-accent);
  color: var(--color-bg);
}
.btn-primary:hover {
  background: var(--color-accent-600);
}
.btn-primary:active {
  background: var(--color-accent-700);
}
.btn-primary-inverse {
  background: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent);
}
.btn-primary-inverse:hover {
  background: var(--color-accent-100);
}
.btn-primary-inverse:active {
  background: var(--color-accent-200);
}
.btn-secondary {
  border-color: var(--color-divider);
}
.btn-secondary:hover {
  background: color-mix(in srgb, var(--color-text) 7%, transparent);
}
.btn-secondary:active {
  background: color-mix(in srgb, var(--color-text) 14%, transparent);
}
.btn-ghost {
  color: var(--color-accent);
  padding-inline: var(--space-1);
}
.btn-ghost:hover {
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
}
.btn-ghost:active {
  background: color-mix(in srgb, var(--color-accent) 18%, transparent);
}
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
}
.btn-block {
  width: 100%;
  margin-top: var(--space-2);
}

/*, forms, */
.field > label {
  display: block;
  font-size: 12px;
  margin-bottom: 5px;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
.input {
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  font: inherit;
  font-size: 14px;
  color: var(--color-text);
  caret-color: var(--color-accent);
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  transition:
    border-color var(--dur-tap) linear,
    background-color var(--dur-tap) linear;
}
.input:hover {
  border-color: color-mix(in srgb, var(--color-text) 45%, transparent);
}
.input:focus-visible {
  border-color: var(--color-accent);
  outline-offset: 0;
}
textarea.input {
  min-height: 90px;
  resize: vertical;
}
.radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
}
.radio input,
.seg-opt input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.radio .dot {
  width: 16px;
  height: 16px;
  flex: none;
  border-radius: 50%;
  border: 1.5px solid var(--color-divider);
  transition:
    border-color var(--dur-tap) linear,
    background-color var(--dur-tap) linear,
    box-shadow var(--dur-tap) var(--ease-out);
}
.radio:hover .dot {
  border-color: var(--color-accent);
}
.radio input:checked + .dot {
  border-color: var(--color-accent);
  background: var(--color-accent);
  box-shadow: inset 0 0 0 4px var(--color-bg);
}
.radio input:focus-visible + .dot {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
.seg {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
}
.seg-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
  transition:
    background-color var(--dur-tap) linear,
    color var(--dur-tap) linear;
}
.seg-opt + .seg-opt {
  border-left: 1px solid var(--color-divider);
}
.seg-opt:has(input:checked) {
  background: var(--color-accent);
  color: var(--color-bg);
}
.seg-opt:not(:has(input:checked)):hover {
  background: color-mix(in srgb, var(--color-text) 7%, transparent);
}
.seg-opt:has(input:focus-visible) {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}

/*, cards, */
.card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.card-kicker {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
}
.card-title {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  font-size: 17px;
  line-height: 1.2;
}
.card-body {
  margin: 0;
  font-size: 13px;
  opacity: 0.8;
  flex: 1;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: color-mix(in srgb, var(--color-text) 50%, transparent);
}
.elev-sm {
  box-shadow: var(--shadow-sm);
}
.elev-md {
  box-shadow: var(--shadow-md);
}
.elev-lg {
  box-shadow: var(--shadow-lg);
}

/*, tags, */
.tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.02em;
  padding: 3px 10px;
  border-radius: calc(var(--radius-md) * 0.75);
}
.tag-accent {
  background: var(--color-accent-100);
  color: var(--color-accent-800);
}
.tag-accent-2 {
  background: var(--color-accent-2-100);
  color: var(--color-accent-2-800);
}
.tag-neutral {
  background: var(--color-neutral-100);
  color: var(--color-neutral-800);
}
.tag-outline {
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
}

/*, navigation, */
.nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-bottom: none;
}
.nav-brand {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  font-size: 18px;
  margin-right: auto;
}
.nav a {
  color: inherit;
  text-decoration: none;
  font-size: 14px;
}
.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--color-accent);
}

/*, tables, */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
  padding: var(--space-2);
  border-bottom: 1px solid var(--color-divider);
}
.table td {
  padding: var(--space-2);
  border-bottom: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent);
}
.table tbody tr {
  transition: background-color var(--dur-tap) linear;
}
.table tbody tr:hover {
  background: color-mix(in srgb, var(--color-text) 4%, transparent);
}

/*, dialog, */
.dialog-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--space-4);
  background: color-mix(in srgb, var(--color-neutral-900) 50%, transparent);
}
.dialog {
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
}
.dialog-title {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  font-size: 20px;
}
.dialog-body {
  font-size: 14px;
  opacity: 0.85;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

/*, blueprint frame: components are wireframe objects (see .blueprint
     and .corner above), square, transparent, hairline-bordered, */
.card,
.btn,
.input,
.tag,
.seg,
.dialog {
  border-radius: 0;
}
.card,
.dialog {
  background: transparent;
  border: 1px solid var(--color-divider);
}
.btn {
  border: 1px solid var(--color-divider);
}
.btn-primary {
  border-color: var(--color-accent);
}
.btn-ghost {
  border-color: transparent;
}

/*, app header responsive, */
.app-header {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 16px 36px;
  border-bottom: 1px solid var(--color-divider);
  position: sticky;
  top: 0;
  background: var(--color-bg);
  z-index: 20;
}

/*, board responsive layout, */
.board-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 36px 80px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.board-hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
}
.board-hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-left: 1px solid color-mix(in srgb, var(--color-reverse-text) 25%, transparent);
}
.board-map-grid {
  display: grid;
  grid-template-columns: repeat(28, 1fr);
  gap: 5px;
}
.board-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

/* ── the two-sided card ─────────────────────────────────────────────────────
   The flashcard activity (views/review.js) and the guide's demonstration of it
   share this, so the picture in the guide is the component, not a drawing of it.
   What turns the card is the only thing that differs and so is the only thing
   set per use: the activity toggles .is-flipped, the guide loops a keyframe.

   Both faces sit in the same grid cell rather than being absolutely positioned,
   so the card is as tall as its taller side, a long passage on the back is
   never clipped, and no height has to be guessed. */
.flip-card {
  perspective: 1000px;
}
.flip-card-inner {
  display: grid;
  transform-style: preserve-3d;
  transition: transform 640ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
.flip-card.is-flipped .flip-card-inner {
  transform: rotateY(180deg);
}
.flip-card-face {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 28px 30px;
  text-align: center;
  backface-visibility: hidden;
  border: 1px solid var(--color-divider);
  background: var(--color-bg);
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
}
.flip-card-back {
  transform: rotateY(180deg);
  border-color: var(--color-accent);
  font-family: var(--font-body);
  font-weight: 400;
}
/* The turn is the whole affordance, so without it the card still has to end up
   on the right face, it just gets there instantly. */
@media (prefers-reduced-motion: reduce) {
  .flip-card-inner {
    transition: none;
  }
}

/* ── the opening splash: the registration mark ──────────────────────────────
   The screen the app opens on while it works out whether the member is already
   signed in (src/views/splash.js). It is the app printed in reverse, steel
   field, type to paper, and everything on it is the system's own corner mark
   at three sizes: hung in the frame's four corners, drawn large and turning at
   the centre, and laid flat as the ruler under the wordmark.

   Nothing here is a measurement. The mark turns at its own pace, the bar
   advances in eight fixed steps, and the three lines cycle on a timer, because
   a boot has no figure the member could act on, what the screen shows is that
   the press is running, not how far along it is. (That is also why the cycle is
   aria-hidden and the view carries one truthful line beside it.)

   As in the guide, the view only names these classes, and everything is dropped
   under prefers-reduced-motion at the bottom of the block. */
.splash-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  /* The frame is the viewport, so its edge would only draw a box around the
     screen, the four corner marks are the whole frame. */
  border-color: transparent;

  /* One turn of the plate: the bar's eight steps and all three load steps fit
     inside it, so retuning the pace here keeps them in lockstep. It is set to
     `appConfig.splashMinMs`, the least the splash stays up, because a member
     on the fastest possible boot should still see the whole set of steps name
     itself. Lower the floor in config.js and the last line will not get its
     turn; lower this to match if you do. */
  --splash-turn: 2s;
}
.splash-field > .corner {
  color: color-mix(in srgb, var(--color-reverse-text) 75%, transparent);
}

/*, the mark, drawn large, */
.splash-mark {
  position: relative;
  width: 132px;
  height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Every part but the centre dot is placed against the box; the dot is left in
   flow so the flex centring puts it exactly on the crosshair. */
.splash-mark > i:not(.splash-mark-dot) {
  position: absolute;
  display: block;
}
.splash-mark-ring {
  inset: 0;
  border: 1px solid color-mix(in srgb, var(--color-reverse-text) 45%, transparent);
  animation: splash-rotate 9s linear infinite;
}
.splash-mark-pulse {
  inset: 26px;
  border: 1px solid color-mix(in srgb, var(--color-reverse-text) 22%, transparent);
  animation: splash-breathe 2.4s ease-in-out infinite;
}
.splash-mark-v {
  left: 50%;
  top: 14px;
  bottom: 14px;
  width: 1px;
  background: var(--color-reverse-text);
}
.splash-mark-h {
  top: 50%;
  left: 14px;
  right: 14px;
  height: 1px;
  background: var(--color-reverse-text);
}
/* Relative only to lift it over the crosshair, which is positioned and would
   otherwise paint across it. */
.splash-mark-dot {
  position: relative;
  z-index: 1;
  display: block;
  width: 9px;
  height: 9px;
  background: var(--color-reverse-text);
}
/* The mark's own rotation, which has nothing to do with --splash-turn: it runs
   at its own unhurried pace and never has to arrive anywhere. */
@keyframes splash-rotate {
  to {
    transform: rotate(360deg);
  }
}
@keyframes splash-breathe {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
}

/*, the plate: wordmark, scale, and the steps naming themselves, */
.splash-plate {
  position: relative;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.splash-wordmark {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.26em;
}
.splash-group {
  /* Set on the wordmark's own line spacing rather than the plate's 16px gap:
     it names whose board this is, so it belongs to the wordmark. */
  margin-top: -10px;
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--color-reverse-text) 55%, transparent);
}
/* The design draws the scale at 340px; on a phone it gives that up rather than
   push the frame off the screen. */
.splash-scale {
  width: 340px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
/* A drafting rule running under the type. It scrolls by exactly four 16px
   divisions, so the loop is seamless however long the boot takes. */
.splash-ticks {
  height: 8px;
  background-image: repeating-linear-gradient(
    to right,
    color-mix(in srgb, var(--color-reverse-text) 55%, transparent) 0 1px,
    transparent 1px 16px
  );
  animation: splash-ticks 2s linear infinite;
}
@keyframes splash-ticks {
  to {
    background-position-x: -64px;
  }
}
.splash-track {
  position: relative;
  height: 4px;
  background: color-mix(in srgb, var(--color-reverse-text) 22%, transparent);
}
.splash-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  display: block;
  background: var(--color-reverse-text);
  animation: splash-advance var(--splash-turn) steps(8, end) infinite;
}
/* Held full for the last stretch so the bar arrives before the turn is over,
   rather than snapping back under a line that is still on screen. */
@keyframes splash-advance {
  0% {
    width: 0;
  }
  82%,
  100% {
    width: 100%;
  }
}
/* Three lines over one turn of the bar, each up for its own third, so every
   step has named itself by the time the splash is allowed to leave. The base
   opacity is here and not inline so reduced motion can settle on one. */
.splash-cycle {
  position: relative;
  width: 340px;
  max-width: 100%;
  height: 14px;
}
.splash-cycle > div {
  position: absolute;
  inset: 0;
  text-align: center;
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0;
  animation: splash-cycle var(--splash-turn) infinite;
}
.splash-cycle > div:nth-child(2) {
  animation-delay: calc(var(--splash-turn) / 3);
}
.splash-cycle > div:nth-child(3) {
  animation-delay: calc(var(--splash-turn) / 3 * 2);
}
@keyframes splash-cycle {
  0% {
    opacity: 0;
  }
  6%,
  26% {
    opacity: 1;
  }
  32%,
  100% {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .splash-mark-ring,
  .splash-mark-pulse,
  .splash-ticks,
  .splash-cycle > div {
    animation: none;
  }
  /* Nothing advances, so the bar stands still at reduced weight, a track that
     is waiting rather than one that has finished. */
  .splash-fill {
    width: 100%;
    opacity: 0.35;
    animation: none;
  }
  /* The cycle is what carries the words, so one of the three has to stay up. */
  .splash-cycle > div:first-child {
    opacity: 1;
  }
}

/* ── the guide ──────────────────────────────────────────────────────────────
   The explainer screen draws five things rather than describing them: a map of
   the header, a passage crossing from the learn half of the set to the review
   half, the forgetting curve under a slider, the interval ladder with a marker
   climbing it, and a looping demonstration of each of the four activities.
   Everything that moves is a keyframe here, the view (src/views/guide.js) only
   names the classes, and all of it is dropped under prefers-reduced-motion at
   the bottom of the block. */
.guide-page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 36px 80px;
  display: flex;
  flex-direction: column;
  gap: 46px;
}
.guide-split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 30px;
  align-items: center;
}
.guide-activities {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  align-items: stretch;
}

/* A passage crossing from Learn to Review. The card is half the track wide, so
   one column across is exactly its own width plus the gap between them, no
   pixel figure has to agree with the flex layout above it. */
.guide-commit-track {
  position: relative;
  height: 140px;
}
.guide-commit-card {
  position: absolute;
  top: 30px;
  left: 0;
  width: calc(50% - 8px);
  animation: guide-commit 6.5s ease-in-out infinite;
}
@keyframes guide-commit {
  0%,
  14% {
    transform: translateX(0);
    opacity: 1;
  }
  46%,
  88% {
    transform: translateX(calc(100% + 16px));
    opacity: 1;
  }
  94%,
  96% {
    transform: translateX(calc(100% + 16px));
    opacity: 0;
  }
  97% {
    transform: translateX(0);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}
.guide-stamp {
  animation: guide-stamp 6.5s ease-in-out infinite;
}
@keyframes guide-stamp {
  0%,
  20% {
    opacity: 0;
  }
  34%,
  88% {
    opacity: 1;
  }
  94%,
  100% {
    opacity: 0;
  }
}

/* The four activity demonstrations. */
.guide-demo {
  position: relative;
  height: 76px;
  overflow: hidden;
}

/* The guide's flashcard is the real one (.flip-card above), turned by a looping
   keyframe instead of by the member, so the demonstration cannot come to look
   like something the activity does not do. Only the turn and the type size are
   set here; the card itself is shared. */
.guide-flip .flip-card-inner {
  height: 100%;
  transition: none;
  animation: guide-flip 5.5s ease-in-out infinite;
}
.guide-flip .flip-card-face {
  gap: 6px;
  padding: 0 12px;
  font-size: 15px;
}
.guide-flip .flip-card-back {
  font-size: 11px;
  line-height: 1.5;
}
@keyframes guide-flip {
  0%,
  38% {
    transform: rotateY(0);
  }
  54%,
  92% {
    transform: rotateY(180deg);
  }
  100% {
    transform: rotateY(360deg);
  }
}

.guide-order {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 9px;
}
.guide-order i {
  display: block;
  height: 13px;
  background: var(--color-accent-300);
  animation: guide-slot 4.5s ease-in-out infinite;
}
.guide-order i:nth-child(2) {
  animation-delay: 0.45s;
}
.guide-order i:nth-child(3) {
  animation-delay: 0.9s;
}
@keyframes guide-slot {
  0%,
  6% {
    transform: translateX(-115%);
    opacity: 0;
  }
  24%,
  86% {
    transform: none;
    opacity: 1;
  }
  100% {
    transform: translateX(-115%);
    opacity: 0;
  }
}

.guide-blanks {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  height: 100%;
  font-size: 13px;
  line-height: 1.6;
}
.guide-blank {
  display: inline-block;
  min-width: 54px;
  text-align: center;
  border-bottom: 1px solid var(--color-accent);
}
.guide-blank > span {
  display: inline-block;
  color: var(--color-accent);
  animation: guide-word 4.5s ease-in-out infinite;
}
@keyframes guide-word {
  0%,
  26% {
    opacity: 0;
    transform: translateY(5px);
  }
  42%,
  88% {
    opacity: 1;
    transform: none;
  }
  100% {
    opacity: 0;
    transform: translateY(5px);
  }
}

.guide-type {
  display: flex;
  align-items: center;
  font-size: 13px;
  line-height: 1.6;
}
.guide-type b {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  font-weight: 400;
  animation: guide-write 5.5s steps(34, end) infinite;
}
@keyframes guide-write {
  0% {
    width: 0;
  }
  74%,
  100% {
    width: 100%;
  }
}
.guide-caret {
  display: inline-block;
  flex: none;
  width: 1px;
  height: 15px;
  margin-left: 1px;
  background: var(--color-accent);
  animation: guide-caret 1.05s linear infinite;
}
@keyframes guide-caret {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

/* The interval ladder (srs.INTERVALS). Rendered bottom-up, column-reverse, so
   the first rung is the one at the foot of the ladder while the DOM keeps the
   model's own order for the stagger and for a screen reader, with each rung's
   bar as long as the gap it stands for. A marker climbs it on a loop: one
   keyframe, delayed per rung off --rung-i, exactly as .item-in staggers a list. */
.guide-ladder {
  display: flex;
  flex-direction: column-reverse;
  gap: 1px;
}
.guide-rung {
  --rung-delay: calc(var(--rung-i, 0) * 0.3s);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 0;
}
.guide-rung-label {
  flex: none;
  width: 9ch;
  font-size: 11px;
  letter-spacing: 0.02em;
  text-align: right;
  color: color-mix(in srgb, var(--color-text) 50%, transparent);
  animation: guide-rung-lit 7s linear infinite;
  animation-delay: var(--rung-delay);
}
.guide-rung-bar {
  height: 7px;
  min-width: 3px;
  background: color-mix(in srgb, var(--color-text) 14%, transparent);
  animation: guide-climb 7s linear infinite;
  animation-delay: var(--rung-delay);
}
@keyframes guide-climb {
  0%,
  100% {
    background: color-mix(in srgb, var(--color-text) 14%, transparent);
  }
  2% {
    background: var(--color-accent);
  }
  9% {
    background: color-mix(in srgb, var(--color-accent) 45%, transparent);
  }
  18% {
    background: color-mix(in srgb, var(--color-text) 14%, transparent);
  }
}
@keyframes guide-rung-lit {
  0%,
  100% {
    color: color-mix(in srgb, var(--color-text) 50%, transparent);
  }
  2%,
  9% {
    color: var(--color-accent);
  }
  18% {
    color: color-mix(in srgb, var(--color-text) 50%, transparent);
  }
}

/* Which way a mark moves the verse, beside each of the four bands. */
.guide-rule-dir {
  flex: none;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--color-divider);
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.guide-rule-dir.is-up {
  color: var(--color-accent);
  border-color: var(--color-accent);
}
.guide-rule-dir.is-down,
.guide-rule-dir.is-reset {
  color: hsl(8, 55%, 45%);
  border-color: color-mix(in srgb, hsl(8, 55%, 45%) 55%, transparent);
}

@media (max-width: 900px) {
  .guide-split,
  .guide-activities {
    grid-template-columns: repeat(2, 1fr);
  }
  .guide-split {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .guide-commit-card,
  .guide-stamp,
  .guide-flip .flip-card-inner,
  .guide-order i,
  .guide-rung-bar,
  .guide-rung-label,
  .guide-blank > span,
  .guide-type b,
  .guide-caret {
    animation: none;
  }
  .guide-type b {
    width: 100%;
  }
  /* Without the travel the card would sit in the left column with nothing to
     say, so park it where it lands. */
  .guide-commit-card {
    transform: translateX(calc(100% + 16px));
  }
}

/* ── motion ─────────────────────────────────────────────────────────────────
   The app's ambient movement: how a screen arrives, how a list settles, how a
   figure fills in, how a control answers a press. The splash and the guide above
   are set pieces, this block is everything else, and it follows the same rule
   they do: the keyframe lives here and the view only names a class.

   Two conventions make one rule cover a screen's worth of moving parts:

   - Anything that fills to a figure, a freshness meter, a progress bar, a day
     on the activity chart, declares only a `from`, so the `to` is whatever the
     view-model computed. The number stays the model's; only the getting there is
     this file's. These use `backwards` rather than `both` for the same reason,
     and because a lingering `forwards` transform would quietly turn a screen
     into the containing block for the fixed dialogs inside it.
   - Anything that arrives in a series, rows, cells, stats, is staggered off
     `--stagger-i`, set inline as the item's index, so one rule covers a list of
     any length instead of a run of nth-child. The delay is capped, so a hundred
     passages still finish arriving in about half a second.

   Everything is dropped under prefers-reduced-motion at the bottom of the
   block. */

/* The four ways something enters. Every screen in the app is built out of these
   plus the two meters below. */
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
}
@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
}
@keyframes swap-in {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
}

/* A whole screen arriving. Every top-level view names this, so moving between
   them reads as one continuous app rather than a series of hard cuts. */
.screen {
  animation: rise-in var(--dur-swap) var(--ease-out) backwards;
}

/* A stack whose lines arrive one after another, the end-of-session screens and
   the two full-screen shells. The splash draws itself the same way; this is that
   idea made reusable, since those screens are the splash's own siblings. */
.stack-in > * {
  animation: rise-in 440ms var(--ease-out) backwards;
}
.stack-in > *:nth-child(2) {
  animation-delay: 70ms;
}
.stack-in > *:nth-child(3) {
  animation-delay: 140ms;
}
.stack-in > *:nth-child(4) {
  animation-delay: 210ms;
}
.stack-in > *:nth-child(5) {
  animation-delay: 280ms;
}
.stack-in > *:nth-child(n + 6) {
  animation-delay: 350ms;
}

/* One item of a series. --stagger-i is its index, set inline by the view. */
.item-in {
  animation: rise-in 400ms var(--ease-out) backwards;
  animation-delay: calc(min(var(--stagger-i, 0), 14) * 34ms);
}

/* ── counting up ────────────────────────────────────────────────────────────
   The board's five figures, passages committed, days left, the weekly pace,
   today's reviews, the streak, count up to themselves rather than arriving
   already true. They are what the member came to the board to see, and watching
   one climb is what makes it read as something earned rather than a field on a
   form.

   It is done without a line of JavaScript, which is what keeps the views pure
   functions of the view-model (no state, no refs, nothing to mount). --count is
   registered as an <integer>, so it is a value the browser can interpolate; the
   element sets its target inline from the view-model and the keyframe walks it
   up from zero, while a counter turns the number into text. The figure is
   therefore the model's, exactly as with the meters above, only the climb
   belongs to this file.

   Two things follow from that and are worth knowing before editing either end.
   The digits live in ::after, so the element carries no text node: a test can
   assert on --count but not on the number (see test/views.test.mjs). And an
   unregistered custom property interpolates discretely rather than not at all,
   so on a browser without @property the figure reads 0 for half the duration and
   then snaps to its value, degraded, not broken, but the reason to keep the
   duration short. That is Firefox before 128; the app already asks for :has()
   and color-mix(), so the floor barely moves. */
@property --count {
  syntax: "<integer>";
  inherits: false;
  initial-value: 0;
}
/* Deliberately quicker than --dur-tell, which is what the meters take, even
   though a meter and this are often showing the same fact: a bar sweeps to its
   figure as one movement, where a counter has to be read at every value it
   passes through, so the same duration feels markedly slower here. Short enough
   to be a flourish rather than something waited on.

   The delay is roughly what the card above it takes to arrive, so the figure is
   sitting at zero when the member's eye reaches it and climbs from there,
   starting the climb under a screen that is still moving wastes it. */
.count-up {
  counter-reset: figure var(--count, 0);
  animation: count-up 450ms var(--ease-out) 120ms backwards;
}
.count-up::after {
  content: counter(figure);
}
@keyframes count-up {
  from {
    --count: 0;
  }
}

/* ── meters ─────────────────────────────────────────────────────────────────
   A bar whose width or height is a number the member is being told. It grows
   from empty to whatever the view-model set, so the figure is watched arriving
   rather than found already there. */
@keyframes meter-fill {
  from {
    width: 0;
  }
}
@keyframes meter-rise {
  from {
    height: 0;
  }
}
/* Both take the stagger too, so a column of them (the leaderboard) fills as a
   staircase; --stagger-i is inherited from the row, and defaults to 0 for the
   meters that stand alone. */
.meter-fill {
  animation: meter-fill var(--dur-tell) var(--ease-out) backwards;
  animation-delay: calc(min(var(--stagger-i, 0), 14) * 34ms);
}
.meter-rise {
  animation: meter-rise var(--dur-tell) var(--ease-out) backwards;
  animation-delay: calc(min(var(--stagger-i, 0), 14) * 34ms);
}
/* The exception: a bar that is stepped rather than revealed. The session
   progress bar is the same width from one card to the next except when it moves,
   so it transitions to its new figure instead of refilling from nothing. */
.meter-step {
  transition: width 420ms var(--ease-out);
}

/* The header's nav. Both the label colour and the rule under the current entry
   are set inline from the view-model, so moving between screens draws the
   underline in rather than snapping it across. */
.nav-btn {
  transition:
    color var(--dur-tap) linear,
    border-color 220ms var(--ease-out);
}

/* ── the board ──────────────────────────────────────────────────────────────
   The hero's stats arrive with the number they belong to; the map wakes up as a
   wave across the set; a queue row answers the pointer with the accent rule that
   marks it as the thing about to be opened. */
.board-hero-stats > div {
  animation: rise-in 460ms var(--ease-out) backwards;
}
.board-hero-stats > div:nth-child(2) {
  animation-delay: 80ms;
}
.board-hero-stats > div:nth-child(3) {
  animation-delay: 160ms;
}
.board-hero-stats > div:nth-child(4) {
  animation-delay: 240ms;
}

/* The map is a cell per passage, so the wave is spread over the whole set rather
   than per row, the same 12ms step reads as a sweep at 28 across and as a
   ripple at 14. Its own opacity is the verse's freshness (set inline), which is
   why the keyframe only names the value it starts from. */
.board-map-grid > button {
  animation: pop-in 380ms var(--ease-out) backwards;
  animation-delay: calc(min(var(--stagger-i, 0), 44) * 12ms);
  transition:
    transform var(--dur-tap) var(--ease-out),
    box-shadow var(--dur-tap) var(--ease-out);
}
.board-map-grid > button:hover {
  transform: scale(1.45);
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 2;
}

/* A queue row. The fill and the rule are both drawn here rather than inline,
   because the row's resting state has to be something a hover can outrank,
   an inline background could not be. */
.queue-row {
  background: transparent;
  box-shadow: inset 0 0 0 0 var(--color-accent);
  transition:
    background-color var(--dur-tap) linear,
    box-shadow 200ms var(--ease-out);
}
.queue-row:hover {
  background: color-mix(in srgb, var(--color-accent) 9%, transparent);
  box-shadow: inset 3px 0 0 0 var(--color-accent);
}

/* ── a sitting ──────────────────────────────────────────────────────────────
   A card is replaced rather than redrawn, so it enters from the side: the queue
   is a deck being dealt, and switching activity on the same verse is the same
   gesture. The key that replays this is the card index and the mode together
   (see viewmodel/review.js). */
.card-swap {
  animation: swap-in 320ms var(--ease-out) backwards;
}
/* What the card was worth, once it is handed in. The two freshness bars inside
   have their own keyframes (.fresh-fill, .fresh-delta above); this is the strip
   they arrive on. */
.result-strip {
  animation: rise-in 380ms var(--ease-out) backwards;
}
/* The passage, while Peek is held down. */
.reveal-in {
  animation: fade-in 200ms ease-out backwards;
}
/* The segmented switches, review mode, blank and scramble level, the on/off
   toggles. Their fill is set inline from the view-model, so the class adds only
   the transition between the two states it is given. */
.seg-btn {
  transition:
    background-color var(--dur-tap) linear,
    color var(--dur-tap) linear,
    border-color var(--dur-tap) linear;
}
.seg-btn:active {
  transform: translateY(1px);
}
/* A phrase waiting to be placed in "Order the phrases". */
.chunk {
  animation: rise-in 340ms var(--ease-out) backwards;
  animation-delay: calc(min(var(--stagger-i, 0), 14) * 34ms);
  transition:
    transform var(--dur-tap) var(--ease-out),
    border-color var(--dur-tap) linear,
    box-shadow var(--dur-tap) var(--ease-out);
}
.chunk:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.chunk:active {
  transform: translateY(0);
}
/* A choice being made: the options in "Pick the reference", the two columns of
   "Match verse to reference", and the activity cards on the test setup. Their
   fill is set inline from the view-model, so the class adds only the fade
   between the two states and the give under the pointer. */
.option {
  transition:
    background-color var(--dur-tap) linear,
    border-color var(--dur-tap) linear,
    color var(--dur-tap) linear,
    transform var(--dur-tap) var(--ease-out);
}
.option:hover {
  transform: translateY(-1px);
}
.option:active {
  transform: translateY(1px);
}
/* A blank in "Fill the blanks". Its underline turns accent or red when the
   attempt is marked, and fading between the two is what makes the marking read
   as one pass over the passage rather than a flicker. */
.blank-input {
  transition: border-color 240ms linear;
}

/* ── reciting aloud ─────────────────────────────────────────────────────────
   The whole of the voice interface that moves, and the only part that has to:
   a microphone is the one control here whose state cannot be seen by looking at
   it, and the switch being on is not the same as the engine listening, there
   is a permission prompt in between. So the dot is rendered only once it is
   really listening, and it beats. The words themselves arrive in the box as
   ordinary text, which needs nothing from this file. */
.mic-dot {
  width: 7px;
  height: 7px;
  flex: none;
  background: currentColor;
  animation: mic-pulse 1.4s var(--ease-out) infinite;
}
@keyframes mic-pulse {
  50% {
    opacity: 0.25;
    transform: scale(0.7);
  }
}

/* ── the passage list ───────────────────────────────────────────────────────
   The table's head stays put while the rows scroll under it. It is one sticky
   box holding both the column labels and, once rows are ticked, the selection
   bar above them, the whole reason for ticking a run of verses is the Review
   button in that bar, and on a list this long it used to scroll out of sight
   long before the member had finished choosing.

   It stops below the app header rather than at the top of the window, which is
   what --app-header-h is for: that header is sticky too, and its height is not
   a constant (it wraps in a narrow window, and settles when the web font
   arrives), so App.watchHeaderHeight measures it and publishes it here. Under
   the header's own z-index, so scrolling tucks this beneath it rather than
   through it. */
.list-head {
  position: sticky;
  top: var(--app-header-h, 0px);
  z-index: 10;
  background: var(--color-bg);
}
/* The bar over the ticked rows is not there until something is ticked, so it
   arrives from under the header it pushes down. */
.selection-bar {
  animation: selection-in var(--dur-swap) var(--ease-out) backwards;
}
@keyframes selection-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
}
/* A tick box. Its fill is inline (see ui/tokens.js checkBox), so the class adds
   the fade between states and the give under a press. */
.tick {
  transition:
    background-color var(--dur-tap) linear,
    border-color var(--dur-tap) linear,
    transform var(--dur-tap) var(--ease-out);
}
.tick:hover {
  transform: scale(1.18);
}
.tick:active {
  transform: scale(0.88);
}

/* ── the full-screen shells ─────────────────────────────────────────────────
   The sign-in gate and the profile form are what the splash resolves into, and
   they are a different screen from it in every way (see views/splash.js), so
   they cross-fade rather than arrive, and the steel field is allowed to settle
   into paper instead of being cut away from under the member. */
.shell-settle {
  animation: fade-in 320ms ease-out backwards;
}

/* ── dialogs ────────────────────────────────────────────────────────────────
   Both confirmations in the app (leaving a session, walking off an unsubmitted
   card) use these. The backdrop settles first and the box follows it up. */
.dialog-backdrop {
  animation: fade-in 180ms ease-out backwards;
}
.dialog-backdrop > .dialog {
  animation: dialog-in 240ms var(--ease-out) 40ms backwards;
}
@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
}

@media (prefers-reduced-motion: reduce) {
  /* .count-up keeps its counter, only the climb stops, so the figure is
     simply true from the first frame. */
  .count-up,
  .screen,
  .stack-in > *,
  .item-in,
  .meter-fill,
  .meter-rise,
  .board-hero-stats > div,
  .board-map-grid > button,
  .card-swap,
  .result-strip,
  .reveal-in,
  .chunk,
  .shell-settle,
  .selection-bar,
  .dialog-backdrop,
  .dialog-backdrop > .dialog {
    animation: none;
  }
  /* The states themselves still have to change; they just change at once. */
  .meter-step,
  .nav-btn,
  .queue-row,
  .seg-btn,
  .chunk,
  .option,
  .tick,
  .blank-input {
    transition: none;
  }
  /* The dot stays put rather than beating. It is still only rendered while the
     engine is listening, so "the microphone is open" survives the setting. */
  .mic-dot {
    animation: none;
  }
  /* Moving under the pointer is the only hover in this block that is motion
     rather than colour, so it is the only one dropped. */
  .board-map-grid > button:hover,
  .chunk:hover,
  .option:hover,
  .option:active,
  .tick:hover,
  .tick:active,
  .seg-btn:active,
  .btn:active:not(:disabled) {
    transform: none;
  }
}

@media (max-width: 720px) {
  .app-header {
    gap: 12px;
    padding: 12px 16px;
    flex-wrap: wrap;
  }
  .guide-page {
    padding: 20px 16px 60px;
    gap: 30px;
  }
  .guide-activities {
    grid-template-columns: 1fr;
  }
  .board-page {
    padding: 20px 16px 60px;
    gap: 24px;
  }
  .board-hero {
    grid-template-columns: 1fr;
  }
  .board-hero-stats {
    border-left: none;
    border-top: 1px solid color-mix(in srgb, var(--color-reverse-text) 25%, transparent);
  }
  .board-map-grid {
    grid-template-columns: repeat(14, 1fr);
  }
  .board-bottom {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* run mode */
.run-callout {
  display: flex;
  align-items: center;
}
