/* Typepace — application styles.
   Principle: content is the interface. Chrome recedes; the text is the hero. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  position: relative;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--t-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

/* A very wide, very faint wash of the accent behind everything. It never
   touches contrast — the text sits on top of it and the tint is a few percent
   — but it is the single most effective rule for stopping a dark theme from
   reading as a flat sheet of black. Fixed, so it does not scroll away. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(120% 62% at 50% -18%, var(--accent-wash), transparent 68%),
    radial-gradient(90% 48% at 92% 108%, var(--accent-wash), transparent 72%);
}

/* Headings are monospace. That is the one real risk in this design, and the
   justification is that the subject of the product is monospaced text: every
   heading here labels a measurement. Tight negative tracking keeps mono from
   sprawling at display sizes. */
h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: var(--track-display);
}
h1 {
  font-size: var(--t-display);
}
h2 {
  font-size: var(--t-title);
}
h3 {
  font-size: var(--t-head);
  letter-spacing: -0.02em;
}
h4 {
  font-size: var(--t-body);
  letter-spacing: -0.01em;
}
p {
  margin: 0;
}

/* Every figure on screen is a reading taken off someone's hands, so digits are
   tabular everywhere — a counter updating ten times a second must not reflow. */
.num,
.metric,
time,
[data-numeric] {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* The instrument label: small, monospaced, widely tracked, upper case. Used
   for anything that names a reading rather than being read itself. */
.card__label,
.rcard__k,
.ldash__top,
.ltrack,
.resume__kicker,
.setting-block__head h4 {
  font-family: var(--font-mono);
  letter-spacing: var(--track-eyebrow);
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Two-tone focus ring: an accent outline sitting on a ring of page colour.
   A single accent outline vanishes when the focused control is itself accent
   coloured — the primary button, a selected theme card — and those are exactly
   the controls a keyboard user lands on most. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--bg);
  border-radius: 4px;
}

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

/* A skip link that stays hidden while focused is no skip link at all: a
   sighted keyboard user tabs to it, sees nothing, and cannot tell what the
   Enter key is about to do. It reveals itself on focus. */
/* `:focus`, not `:focus-visible`. A skip link is only ever reachable by
   keyboard, so there is no mouse-focus case to suppress — and `:focus-visible`
   would leave it hidden for anyone whose browser judges the focus differently. */
.skip-link:focus {
  position: fixed;
  top: var(--s3);
  left: var(--s3);
  z-index: 100;
  width: auto;
  height: auto;
  margin: 0;
  padding: 10px var(--s4);
  overflow: visible;
  clip: auto;
  border-radius: 100px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: var(--t-small);
  font-weight: 600;
  box-shadow: var(--shadow-2);
}

/* ---------------------------------------------------------------- Layout */

.app {
  display: flex;
  flex-direction: column;
  /* Against the viewport, not the parent. `100%` resolved against `#root`,
     which has no height rule, so it resolved to nothing — on a monitor taller
     than the page the footer stopped mid-screen with a void below it. `dvh`
     tracks the collapsing browser chrome on phones; the `vh` line is the
     fallback for engines without it. */
  min-height: 100vh;
  min-height: 100dvh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: stretch;
  gap: var(--s5);
  height: 56px;
  padding: 0 var(--s5);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--hairline);
}

/* Chrome recedes during an active session (§3.1) */
.app[data-focus="on"] .topbar {
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-2) var(--ease);
}

.wordmark {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.wordmark:hover {
  text-decoration: none;
}
.wordmark svg {
  display: block;
}

/* Navigation is a tab strip, not a row of pills. An instrument labels its
   channels along an edge and marks the live one with a rule — which also frees
   the accent-filled pill to mean "primary action" and nothing else. */
.nav {
  display: flex;
  gap: 0;
  margin-left: var(--s4);
}
.nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0 var(--s4);
  /* `--ink-2`, not `--ink-3`. A 13px label is normal text, so it owes 4.5:1,
     and `--ink-3` is only gated at 3:1 — measured, it lands between 3.75 and
     5.22 across the six palettes and misses in five of them. An inactive tab
     still recedes: the marker rule, not the ink, is what says which one is
     live, so nothing is lost by making the other three readable. */
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: var(--t-small);
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: color var(--dur-1) var(--ease);
}
.nav a::after {
  content: "";
  position: absolute;
  left: var(--s3);
  right: var(--s3);
  bottom: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform var(--dur-2) var(--ease);
}
.nav a:hover {
  color: var(--ink);
  text-decoration: none;
}
.nav a:hover::after {
  transform: scaleX(0.4);
}
.nav a[aria-current="page"] {
  color: var(--ink);
}
.nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

/* The same tab strip on a phone, moved to the edge the thumb owns. Shown by
   the narrow-viewport media query below; hidden here so it costs a desktop
   nothing but a `display` declaration.

   The marker rule sits along the strip's *top* edge rather than its bottom,
   which keeps it doing what it does on the desktop bar: lying between a label
   and the content that label names. The same idea reflected, not a second one. */
.rail {
  display: none;
  position: fixed;
  inset: auto 0 0;
  z-index: 40;
  border-top: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  padding-bottom: env(safe-area-inset-bottom);
}
.rail a {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--rail-h);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: var(--t-small);
  font-weight: 500;
  letter-spacing: -0.01em;
  /* Four adjacent full-height targets: kill the 300ms tap delay rather than
     let a section change feel like a slow one. */
  touch-action: manipulation;
  transition: color var(--dur-1) var(--ease);
}
.rail a::after {
  content: "";
  position: absolute;
  left: var(--s4);
  right: var(--s4);
  top: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform var(--dur-2) var(--ease);
}
.rail a:hover {
  color: var(--ink);
  text-decoration: none;
}
.rail a[aria-current="page"] {
  color: var(--ink);
}
.rail a[aria-current="page"]::after {
  transform: scaleX(1);
}

/* Chrome recedes during an active session (§3.1) — the topbar's rule applied
   to the other edge. A strip sitting under the thumb while you type is worse
   than one sitting above your eyes. */
.app[data-focus="on"] .rail {
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-2) var(--ease);
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--s2);
}

/* The streak reads as a lit indicator lamp rather than a badge. */
.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  font-family: var(--font-mono);
  font-size: var(--t-small);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
.streak-pill[data-active="false"] {
  border-color: var(--hairline);
  background: transparent;
  color: var(--ink-3);
}

main {
  flex: 1;
  width: 100%;
}

.view {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s6) var(--s5) var(--s8);
  animation: viewIn var(--dur-3) var(--ease);
}
.view--wide {
  max-width: 1280px;
}
@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--s5);
}
.row {
  display: flex;
  align-items: center;
  gap: var(--s3);
  flex-wrap: wrap;
}
.spacer {
  flex: 1;
}

/* ---------------------------------------------------------------- Buttons */

/* The signature: controls are keycaps.
   Typepace's whole subject is the physical act of pressing keys, so the
   control language is taken from the object itself — a small machined corner,
   a hairline of light along the top edge, weight sitting underneath, and a
   press that actually travels. It is one idea applied consistently to buttons,
   segmented controls and the on-screen keyboard, which is what makes it read
   as a system rather than a decoration. Everything else on the page stays
   quiet so this is the thing you remember. */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  height: 36px;
  padding: 0 var(--s4);
  border: 1px solid var(--hairline);
  border-radius: var(--r-key);
  background: var(--panel);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--t-small);
  font-weight: 500;
  letter-spacing: 0.005em;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--key-face), var(--key-lift);
  transition: transform var(--dur-1) var(--ease-key),
    box-shadow var(--dur-1) var(--ease), background var(--dur-1) var(--ease),
    border-color var(--dur-1) var(--ease);
}
.btn:hover {
  background: var(--panel-2);
  border-color: var(--accent-line);
}
/* The press: the cap travels down onto its own shadow and the lift collapses. */
.btn:active {
  transform: translateY(1px);
  box-shadow: var(--key-face);
}

.btn--primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
  font-weight: 600;
}
.btn--primary:hover {
  background: color-mix(in srgb, var(--accent) 88%, var(--ink));
  border-color: transparent;
}

.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-2);
  box-shadow: none;
}
.btn--ghost:hover {
  background: var(--panel);
  border-color: var(--hairline);
  color: var(--ink);
}
.btn--ghost:active {
  transform: translateY(1px);
  box-shadow: none;
}

.btn--lg {
  height: 44px;
  padding: 0 var(--s5);
  font-size: var(--t-body);
}
.btn--icon {
  width: 34px;
  height: 34px;
  padding: 0;
  background: transparent;
  border-color: transparent;
  color: var(--ink-2);
  box-shadow: none;
}
.btn--icon:hover {
  background: var(--panel);
  border-color: var(--hairline);
  color: var(--ink);
}
.btn--icon:active {
  transform: translateY(1px);
}
.btn[disabled] {
  opacity: 0.4;
  cursor: default;
  box-shadow: none;
}

/* Segmented control — a row of caps in a machined tray. */
.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--panel) 60%, var(--bg));
  gap: 2px;
}
.segmented button {
  height: 30px;
  padding: 0 var(--s3);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: var(--t-small);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: color var(--dur-1) var(--ease),
    background var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.segmented button:hover {
  color: var(--ink);
}
.segmented button[aria-pressed="true"] {
  background: var(--panel-2);
  border-color: var(--hairline);
  color: var(--ink);
  box-shadow: var(--key-face), var(--key-lift);
}

/* ---------------------------------------------------------------- Cards */

/* Panels, not cards. A hairline border and a flat fill read as machined
   sheet rather than as a floating consumer-app card; the elevation in this
   design belongs to the controls, which is where touch actually happens. */
.card {
  padding: var(--s5);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--panel) 42%, var(--bg));
}
.card--flat {
  border: 0;
  background: var(--panel);
}
.card--accent {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.card__label {
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.grid {
  display: grid;
  gap: var(--s4);
}
.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* ---------------------------------------------------- Typing surface (§4) */

.test-shell {
  max-width: 940px;
  margin: 0 auto;
  padding: var(--s5) var(--s5) var(--s8);
}

/* The toolbar carries the surface's measure and gutter itself, because it sits
   beside `.test-shell` rather than inside it. Without that, the source control
   — the one row wide enough to scroll on a phone — ran from viewport edge to
   viewport edge and read as broken rather than as scrollable. */
.test-toolbar {
  display: flex;
  justify-content: center;
  gap: var(--s3);
  flex-wrap: wrap;
  max-width: 940px;
  margin: 0 auto var(--s7);
  padding: 0 var(--s5);
  transition: opacity var(--dur-2) var(--ease);
}
.app[data-focus="on"] .test-toolbar {
  opacity: 0;
  pointer-events: none;
}

.livebar {
  display: flex;
  align-items: baseline;
  gap: var(--s6);
  margin-bottom: var(--s4);
  height: 34px;
  opacity: 0;
  transition: opacity var(--dur-2) var(--ease);
}
.livebar[data-on="true"] {
  opacity: 1;
}
.livebar b {
  font-size: 1.625rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--accent);
}
.livebar span {
  font-size: var(--t-small);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.livebar em {
  font-style: normal;
  font-weight: 600;
  color: var(--ink);
}

/* The hero: the text itself.

   The window is sized in `lh`, not in `em`, so it is always a whole number of
   lines. Said as `6.3em` it was three lines only at the one line-height it was
   written against — the phone, compact and relaxed all override line-height
   further down, and each of them left a fourth line sliced through the middle
   at the bottom of the surface. `--lines` is the number the reader counts. */
.typearea {
  --lines: 3;
  position: relative;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  line-height: 2.1;
  letter-spacing: 0.005em;
  outline: none;
  user-select: none;
  cursor: text;
  min-height: calc(var(--lines) * 1lh);
  max-height: calc(var(--lines) * 1lh);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
/* Code gets five: the surface anchors the active line second, so two extra
   lines of lookahead are what let you see the shape of the block you are in. */
.typearea[data-lang="code"] {
  --lines: 5;
  font-size: 1.125rem;
  line-height: 1.85;
  white-space: pre-wrap;
  text-align: left;
}
.typearea__scroll {
  transition: transform var(--dur-3) var(--ease);
}

.ch {
  position: relative;
  color: var(--type-pending);
  transition: color 60ms linear;
}
.ch[data-s="ok"] {
  color: var(--type-correct);
}
.ch[data-s="bad"] {
  color: var(--type-wrong);
  background: var(--error-soft);
  border-radius: 3px;
}
/* Correctness is never signalled by colour alone (§13) */
.ch[data-s="bad"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.28em;
  border-bottom: 2px solid var(--type-wrong);
}
.ch[data-s="fixed"] {
  color: var(--type-correct);
  text-decoration: underline dotted var(--ink-3);
  text-underline-offset: 0.28em;
}
.ch--space[data-s="bad"] {
  background: var(--error-soft);
}
/* Words are atomic boxes so wrapping never splits one. `pre` keeps the
   trailing space, which a browser would otherwise strip from a block edge. */
.wordwrap {
  display: inline-block;
  white-space: pre;
}

.caret {
  position: absolute;
  width: 2px;
  border-radius: 2px;
  background: var(--type-caret);
  transition: transform var(--dur-1) var(--ease);
  will-change: transform;
  pointer-events: none;
}
.caret[data-blink="true"] {
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

/* A quiet cue below the text, not a curtain over it. The row keeps its height
   after the cue disappears so nothing shifts when typing begins. */
.typearea__hintrow {
  display: grid;
  place-items: center;
  height: 34px;
  margin-top: var(--s3);
}
.typearea__hint {
  font-family: var(--font-ui);
  font-size: var(--t-small);
  color: var(--ink-3);
  pointer-events: none;
  transition: opacity var(--dur-2) var(--ease);
}
.typearea__hint span {
  padding: 5px 14px;
  border-radius: 100px;
  background: var(--panel);
}
.typearea__hint[hidden] {
  display: none;
}

.test-footer {
  display: flex;
  justify-content: center;
  gap: var(--s4);
  margin-top: var(--s6);
  font-size: var(--t-small);
  color: var(--ink-3);
  transition: opacity var(--dur-2) var(--ease);
}
.app[data-focus="on"] .test-footer {
  opacity: 0;
}
kbd {
  padding: 2px 6px;
  border: 1px solid var(--hairline);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--panel);
  font-family: var(--font-ui);
  font-size: var(--t-micro);
  color: var(--ink-2);
}

/* ------------------------------------------- Keyboard + hand guide (§6.1) */

.kbguide {
  margin-top: var(--s6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s3);
  transition: opacity var(--dur-2) var(--ease);
}
.kbrow {
  display: flex;
  gap: 5px;
}
.key {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-key);
  background: var(--panel);
  box-shadow: var(--key-face), var(--key-lift);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
  transition: all var(--dur-1) var(--ease-key);
}
.key--wide {
  width: 58px;
}
.key--space {
  width: 220px;
}
.key--home::after {
  content: "";
  position: absolute;
  margin-top: 22px;
  width: 10px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink-3);
}
.key[data-next="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  transform: translateY(-2px);
  box-shadow: var(--key-face), 0 3px 0 var(--accent-line),
    0 6px 14px var(--accent-soft);
}
.key[data-heat] {
  border-color: color-mix(in srgb, var(--error) 45%, var(--hairline));
}
.key[data-heat="3"] {
  background: color-mix(in srgb, var(--error) 26%, transparent);
}
.key[data-heat="2"] {
  background: color-mix(in srgb, var(--error) 16%, transparent);
}
.key[data-heat="1"] {
  background: color-mix(in srgb, var(--error) 8%, transparent);
}

.hands {
  display: flex;
  gap: var(--s6);
  font-size: var(--t-small);
  color: var(--ink-3);
}
.finger-cue {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: 5px var(--s3);
  border-radius: 100px;
  background: var(--panel);
  color: var(--ink-2);
  font-size: var(--t-small);
}
.finger-cue b {
  color: var(--ink);
  font-weight: 600;
}

/* ------------------------------------------------------- Results (§4.2) */

/* A summary, not a report.
   Everything a user wants in the two seconds after a test — how fast, how
   accurate, one thing to work on, and a way to go again — fits in a single
   card. Anything that rewards study rather than a glance is behind the
   disclosure at the bottom, so the default view stays short. */

.results {
  max-width: 820px;
  margin: 0 auto;
  padding: var(--s5) var(--s5) var(--s7);
}

.rpanel {
  padding: var(--s4);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--panel) 45%, var(--bg));
}

/* Header: what just happened on the left, what to do next on the right.
   "Start New Test" is the first control on the page and never scrolls away. */
.rhead {
  display: flex;
  align-items: center;
  gap: var(--s3);
  flex-wrap: wrap;
  margin-bottom: var(--s4);
}
.rhead__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--t-small);
  color: var(--ink-2);
  min-width: 0;
}
.rhead__hint {
  flex-basis: 100%;
  text-align: right;
}
/* Meaningless without a physical keyboard, and it costs a line on a phone. */
@media (pointer: coarse) {
  .rhead__hint {
    display: none;
  }
}

.rcards {
  display: grid;
  grid-template-columns: 1.35fr repeat(4, minmax(0, 1fr));
  gap: var(--s2);
}

.rcard {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: var(--s3);
  border-radius: var(--r-md);
  background: var(--panel);
  animation: metricIn var(--dur-3) var(--ease) backwards;
}
.rcard:nth-child(2) { animation-delay: 30ms; }
.rcard:nth-child(3) { animation-delay: 60ms; }
.rcard:nth-child(4) { animation-delay: 90ms; }
.rcard:nth-child(5) { animation-delay: 120ms; }

.rcard__top {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-3);
  min-width: 0;
}
.rcard__k {
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rcard__v {
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

/* The lead card carries the headline number and the accent. One emphasis on
   the page, so the eye knows where to land. */
.rcard--lead {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}
.rcard--lead .rcard__top {
  color: var(--accent);
}
.rcard--lead .rcard__v {
  font-size: 2.125rem;
  color: var(--accent);
}
.rcard__pb {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 5px;
  color: var(--success);
  font-size: var(--t-micro);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 3px;
}

/* Coach: headline and one action. The full diagnosis lives on the dashboard
   and under Details — the summary only has room for the verdict. */
.rcoach {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-top: var(--s2);
  padding: var(--s3);
  border-radius: var(--r-md);
  background: var(--panel);
}
.rcoach__icon {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
}
.rcoach__body {
  flex: 1;
  min-width: 0;
}
.rcoach__title {
  font-size: var(--t-small);
  font-weight: 600;
}
.rcoach__meta {
  font-size: var(--t-micro);
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Progress facts as one quiet line, not a row of cards. */
.rfoot {
  display: flex;
  align-items: center;
  gap: var(--s3);
  flex-wrap: wrap;
  margin-top: var(--s4);
  padding-top: var(--s3);
  border-top: 1px solid var(--hairline);
  font-size: var(--t-small);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.rfoot__xp {
  display: flex;
  align-items: center;
  gap: var(--s2);
}
.rfoot__xp .xpbar {
  width: 64px;
  height: 5px;
}

.rdetails {
  margin-top: var(--s4);
}
.rdetails > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 100px;
  background: var(--panel);
  color: var(--ink-2);
  font-size: var(--t-small);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.rdetails > summary::-webkit-details-marker {
  display: none;
}
.rdetails > summary:hover {
  color: var(--ink);
}
.rdetails > summary svg {
  transition: transform var(--dur-2) var(--ease);
}
.rdetails[open] > summary svg {
  transform: rotate(180deg);
}
.rdetails__body {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  margin-top: var(--s4);
  animation: viewIn var(--dur-3) var(--ease);
}

@keyframes metricIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Compact coach card for the results screen, where vertical space is the
   scarcest resource on the page. */
.coach--compact {
  padding: var(--s4);
  gap: var(--s3);
  align-items: center;
}
.coach--compact .coach__icon {
  flex-basis: 28px;
  width: 28px;
  height: 28px;
  font-size: 13px;
}
.coach--compact .coach__title {
  font-size: var(--t-small);
}
.coach--compact .coach__text {
  font-size: var(--t-small);
}
.coach--compact .coach__actions {
  margin-top: var(--s3);
}

/* Coach card — the signature interaction (§5.3) */
.coach {
  display: flex;
  gap: var(--s4);
  padding: var(--s5);
  border-radius: var(--r-lg);
  background: var(--panel);
  border: 1px solid transparent;
}
.coach--accent {
  background: var(--accent-soft);
}
.coach__icon {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}
.coach__body {
  flex: 1;
  min-width: 0;
}
.coach__title {
  font-weight: 600;
  margin-bottom: var(--s1);
}
.coach__text {
  color: var(--ink-2);
  font-size: var(--t-body);
}
.coach__text b {
  color: var(--ink);
  font-weight: 600;
}
.coach__actions {
  margin-top: var(--s4);
  display: flex;
  gap: var(--s2);
  flex-wrap: wrap;
}

/* ------------------------------------------------------------- Charts */

.chart {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.chart .grid-line {
  stroke: var(--hairline);
  stroke-width: 1;
}
.chart .axis-label {
  fill: var(--ink-3);
  font-size: 10px;
  font-family: var(--font-ui);
}
.chart .series {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chart .series--muted {
  stroke: var(--ink-3);
  stroke-width: 1.5;
  stroke-dasharray: 3 4;
}
.chart .area {
  fill: var(--accent-soft);
  stroke: none;
}
.chart .dot {
  fill: var(--accent);
}
.chart .bar {
  fill: var(--accent);
}

/* A hundred-word run needs 100 bars at a 3px floor — wider than a phone. The
   bars scroll inside their own box rather than pushing the page sideways;
   dropping the floor instead would make them invisible. */
.sparkbar {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 44px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.sparkbar::-webkit-scrollbar {
  display: none;
}
.sparkbar i {
  flex: 1 0 3px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
  opacity: 0.85;
}

/* Consistency / accuracy meter */
.meter {
  height: 6px;
  border-radius: 100px;
  background: var(--panel-2);
  overflow: hidden;
}
.meter i {
  display: block;
  height: 100%;
  border-radius: 100px;
  background: var(--accent);
  transition: width var(--dur-3) var(--ease);
}
.meter--success i {
  background: var(--success);
}
.meter--warn i {
  background: var(--warn);
}

/* Calendar heatmap (§12) */
.cal {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 11px);
  gap: 3px;
  overflow-x: auto;
  padding-bottom: var(--s2);
}
.cal i {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: var(--panel-2);
}
.cal i[data-l="1"] {
  background: color-mix(in srgb, var(--accent) 30%, transparent);
}
.cal i[data-l="2"] {
  background: color-mix(in srgb, var(--accent) 55%, transparent);
}
.cal i[data-l="3"] {
  background: color-mix(in srgb, var(--accent) 78%, transparent);
}
.cal i[data-l="4"] {
  background: var(--accent);
}

/* ------------------------------------------------------ Lists & tables */

.list {
  display: flex;
  flex-direction: column;
}
.list__row {
  display: flex;
  align-items: center;
  gap: var(--s4);
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--hairline);
}
.list__row:last-child {
  border-bottom: 0;
}
.list__row b {
  font-weight: 600;
}
.list__row small {
  color: var(--ink-2);
  font-size: var(--t-small);
}
.num {
  font-variant-numeric: tabular-nums;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink-2);
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.tag--error {
  background: var(--error-soft);
  color: var(--error);
}
.tag--warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.tag--success {
  background: var(--success-soft);
  color: var(--success);
}
.tag--accent {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ------------------------------------------------ Learn / courses (§6) */

/* Continue learning — the single most important control on the page for a
   returning user, so it is the first thing and it is a whole-card target. */
.resume {
  display: flex;
  align-items: center;
  gap: var(--s4);
  width: 100%;
  padding: var(--s4);
  border: 1px solid var(--accent-line);
  border-radius: var(--r-lg);
  background: var(--accent-soft);
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform var(--dur-1) var(--ease);
}
.resume:hover {
  transform: translateY(-1px);
}
.resume__icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: var(--accent);
  color: var(--accent-ink);
}
.resume__body {
  flex: 1;
  min-width: 0;
}
.resume__kicker {
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.resume__title {
  font-weight: 600;
  margin-top: 1px;
}
.resume__sub {
  font-size: var(--t-small);
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.resume__pct {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  font-size: var(--t-small);
  font-weight: 600;
}
.resume__go {
  color: var(--accent);
  font-size: 18px;
}

/* Learning dashboard — four facts, one line each. */
.ldash {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s2);
  margin-top: var(--s3);
}
.ldash__tile {
  min-width: 0;
  padding: var(--s3);
  border-radius: var(--r-md);
  background: var(--panel);
}
.ldash__top {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-3);
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.ldash__top span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ldash__v {
  margin-top: 3px;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ldash__sub {
  font-size: var(--t-micro);
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ltrack {
  font-size: var(--t-small);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: var(--s3);
}

.lcourses {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

/* A course is a <details>: closed it is one compact row, open it is the full
   module breakdown. Native disclosure, so it is keyboard- and
   screen-reader-correct without any work. */
.lcard {
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--panel) 45%, var(--bg));
  overflow: hidden;
}
.lcard + .lcard,
.lcard.lcard {
  margin-top: 0;
}
details.lcard {
  margin-top: var(--s3);
}
.lcourses details.lcard {
  margin-top: 0;
}
.lcard__head {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.lcard__head::-webkit-details-marker {
  display: none;
}
.lcard__head:hover {
  background: var(--panel);
}
.lcard__icon {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
}
.lcard__title {
  font-size: var(--t-body);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lcard__sub {
  font-size: var(--t-small);
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lcard__progress {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex: 0 0 108px;
}
.lcard__progress .meter {
  width: 108px;
}
.lcard__chev {
  color: var(--ink-3);
  display: grid;
  place-items: center;
  transition: transform var(--dur-2) var(--ease);
}
details[open] > .lcard__head .lcard__chev {
  transform: rotate(180deg);
}
.lcard__body {
  padding: 0 var(--s4) var(--s4);
  animation: viewIn var(--dur-2) var(--ease);
}
/* Prose caps out at a comfortable measure. Past ~75 characters the eye loses
   its place returning to the start of the next line. */
.lcard__blurb {
  margin-bottom: var(--s3);
  max-width: 72ch;
}
.coach__text,
.card p.small,
.card p.muted {
  max-width: 75ch;
}

.lmodule {
  margin-top: var(--s3);
  border-top: 1px solid var(--hairline);
}
.lmodule__head {
  display: flex;
  align-items: baseline;
  gap: var(--s2);
  padding: var(--s3) 0 var(--s1);
  flex-wrap: wrap;
}
.lmodule__title {
  font-size: var(--t-small);
  font-weight: 600;
}
.micro.num.ok {
  color: var(--success);
}

.lrow {
  display: flex;
  align-items: center;
  gap: var(--s3);
  width: 100%;
  padding: 7px var(--s2);
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: var(--t-small);
  text-align: left;
  cursor: pointer;
  transition: background var(--dur-1) var(--ease);
}
.lrow:hover:not([disabled]) {
  background: var(--panel);
}
.lrow[disabled] {
  cursor: default;
  opacity: 0.55;
}
.lrow__dot {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--hairline);
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-3);
}
.lrow[data-state="done"] .lrow__dot {
  background: var(--success);
  border-color: var(--success);
  color: var(--accent-ink);
}
.lrow[data-state="current"] .lrow__dot {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.lrow__title {
  font-weight: 500;
}
/* The concept note is reference, not headline — one line, clipped. It uses
   `--ink-2` rather than `--ink-3`: this is real content explaining what a
   construct does, and `--ink-3` is scaled for micro *labels*, where the 3:1
   large-text threshold applies. As body copy it measured 3.65:1. */
.lrow__sub {
  font-size: var(--t-micro);
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lrow__meta {
  margin-left: auto;
  font-size: var(--t-micro);
  color: var(--ink-3);
  white-space: nowrap;
}

/* The concept note above a lesson's typing surface. */
.lesson-note {
  max-width: 68ch;
  margin: 0 auto var(--s5);
  padding: var(--s3) var(--s4);
  border-radius: var(--r-md);
  border-left: 2px solid var(--accent);
  background: var(--panel);
  font-size: var(--t-small);
  color: var(--ink-2);
  transition: opacity var(--dur-2) var(--ease);
}
.app[data-focus="on"] .lesson-note {
  opacity: 0.45;
}

/* ------------------------------------------------- Curriculum path (§6) */

.unit {
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.unit__head {
  display: flex;
  align-items: center;
  gap: var(--s4);
  padding: var(--s4) var(--s5);
  background: var(--panel);
}
.unit__head h3 {
  font-size: var(--t-body);
}
.lesson {
  display: flex;
  align-items: center;
  gap: var(--s4);
  width: 100%;
  padding: var(--s3) var(--s5);
  border: 0;
  border-top: 1px solid var(--hairline);
  background: var(--bg);
  color: inherit;
  font-family: inherit;
  font-size: var(--t-body);
  text-align: left;
  cursor: pointer;
  transition: background var(--dur-1) var(--ease);
}
.lesson:hover:not([disabled]) {
  background: var(--panel);
}
.lesson[disabled] {
  cursor: default;
  color: var(--ink-3);
}
.lesson__dot {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--hairline);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
}
.lesson[data-state="done"] .lesson__dot {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.lesson[data-state="current"] {
  background: var(--accent-soft);
}
.lesson[data-state="current"] .lesson__dot {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.lesson__meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--s3);
  font-size: var(--t-small);
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------- Achievements (§7) */

.badge {
  display: flex;
  gap: var(--s3);
  align-items: flex-start;
  padding: var(--s4);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  background: var(--bg);
}
.badge[data-earned="false"] {
  opacity: 0.5;
}
.badge__mark {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--panel);
  font-size: 16px;
}
.badge[data-earned="true"] .badge__mark {
  background: var(--accent-soft);
}
.badge__n {
  font-weight: 600;
  font-size: var(--t-small);
}
.badge__d {
  color: var(--ink-2);
  font-size: var(--t-small);
}

.xpbar {
  height: 8px;
  border-radius: 100px;
  background: var(--panel-2);
  overflow: hidden;
}
.xpbar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand-1), var(--brand-2));
  transition: width var(--dur-3) var(--ease);
}

/* --------------------------------------------------- Theme picker (§18) */

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: var(--s3);
}

/* Each card previews its own palette using that theme's literal colours, not
   the active ones — you should be able to see what you are choosing. */
.theme-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  padding: var(--s3);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  background: var(--panel);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  color: var(--ink);
  transition: transform var(--dur-1) var(--ease),
    border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.theme-card:hover {
  transform: translateY(-1px);
  border-color: var(--accent-line);
}
.theme-card[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.theme-card__swatch {
  position: relative;
  height: 54px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(128, 128, 128, 0.22);
}
/* A miniature of the typing surface: pending text, typed text, caret. */
.theme-card__swatch i {
  position: absolute;
  height: 5px;
  border-radius: 3px;
}
.theme-card__name {
  font-size: var(--t-small);
  font-weight: 600;
}
.theme-card__blurb {
  font-size: var(--t-micro);
  color: var(--ink-2);
  line-height: 1.35;
}
.theme-card__check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 700;
}

.swatch-row {
  display: flex;
  gap: var(--s2);
  flex-wrap: wrap;
}
.swatch {
  position: relative;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  cursor: pointer;
  transition: transform var(--dur-1) var(--ease),
    box-shadow var(--dur-1) var(--ease);
}
.swatch:hover {
  transform: scale(1.08);
}
.swatch[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}
.swatch--auto {
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
}

.setting-block {
  padding: var(--s4) 0;
  border-bottom: 1px solid var(--hairline);
}
.setting-block:last-child {
  border-bottom: 0;
}
.setting-block__head {
  display: flex;
  align-items: baseline;
  gap: var(--s3);
  margin-bottom: var(--s3);
}
.setting-block__head h4 {
  font-size: var(--t-small);
  font-weight: 600;
  margin: 0;
}
.setting-block__head p {
  font-size: var(--t-micro);
  color: var(--ink-3);
}

/* ------------------------------------------------------ Ad slots (§19) */

/* Structural guarantee: a slot cannot render unless its zone allows it.
   No slot exists anywhere inside the active-session view. */
.adslot {
  display: block;
  border: 1px dashed var(--hairline);
  border-radius: var(--r-md);
  background: transparent;
  color: var(--ink-3);
  overflow: hidden;
  contain: layout size style;
}
.adslot__label {
  display: block;
  padding: 6px var(--s3) 0;
  font-size: var(--t-micro);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.adslot__body {
  display: grid;
  place-items: center;
  color: var(--ink-3);
  font-size: var(--t-small);
}
/* Reserved heights prevent any layout shift when a unit fills (§19.1) */
.adslot[data-zone="results"] .adslot__body {
  height: 90px;
}
.adslot[data-zone="sidebar"] .adslot__body {
  height: 250px;
}
.adslot[data-zone="footer"] .adslot__body {
  height: 90px;
}

.sidebar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--s6);
  align-items: start;
}
.sidebar {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}

/* ------------------------------------------------------------- Misc */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: var(--s5);
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(3px);
  animation: fade var(--dur-2) var(--ease);
}
@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.sheet__panel {
  width: min(460px, 100%);
  /* The theme sheet is the tallest thing that uses this, and on a laptop in
     landscape it would otherwise run off the bottom with no way to reach the
     accent row. */
  max-height: min(88vh, 760px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--s6);
  border-radius: var(--r-xl);
  background: var(--bg);
  box-shadow: var(--shadow-3);
  animation: sheetIn var(--dur-3) var(--ease);
}
@keyframes sheetIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.toast-host {
  position: fixed;
  left: 50%;
  bottom: var(--s6);
  z-index: 70;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s5);
  border-radius: 100px;
  background: var(--ink);
  color: var(--bg);
  font-size: var(--t-small);
  font-weight: 500;
  box-shadow: var(--shadow-2);
  animation: toastIn var(--dur-3) var(--ease);
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.muted {
  color: var(--ink-2);
}
.dim {
  color: var(--ink-3);
}
.small {
  font-size: var(--t-small);
}
.micro {
  font-size: var(--t-micro);
}
.center {
  text-align: center;
}
.mono {
  font-family: var(--font-mono);
}
hr.hair {
  border: 0;
  border-top: 1px solid var(--hairline);
  margin: var(--s5) 0;
}

/* Certificate (§9) */
/* ------------------------------------------------------- Responsive */

@media (max-width: 900px) {
  /* Five across gets cramped before the phone breakpoint: lead on top, four
     beneath. Laid out on one line so the full-width card reads as a compact
     banner rather than a tall block with a void beside the number. */
  .rcards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .rcard--lead {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: baseline;
    gap: var(--s3);
  }
  .rcard--lead .rcard__top {
    align-self: center;
  }
  .sidebar-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    position: static;
  }
  .grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  :root {
    --t-hero: 2rem;
    --t-title: 1.375rem;
  }
  .view,
  .test-shell,
  .results {
    padding-left: var(--s4);
    padding-right: var(--s4);
    /* Room for the section strip, which is fixed to the viewport and would
       otherwise sit on top of the last card on the page. */
    padding-bottom: calc(var(--s8) + var(--rail-h) + env(safe-area-inset-bottom));
  }
  .topbar {
    gap: var(--s3);
    padding: 0 var(--s4);
  }
  /* The four sections move to the bottom strip. Kept in the top bar they got
     79px of a 375px row — three of the four destinations sat off the end of a
     scroll region with no affordance saying so, which is a navigation that
     only works if you already know it is there. */
  .nav {
    display: none;
  }
  .rail {
    display: flex;
  }
  .typearea {
    font-size: 1.25rem;
    line-height: 2;
  }
  /* A control group wider than the phone scrolls inside its own pill rather
     than pushing the page sideways — the body must never scroll horizontally.
     `min-width: 0` is the load-bearing part: a flex item defaults to
     `min-width: auto` and refuses to shrink below its content without it. */
  .segmented {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .test-toolbar > .row {
    width: 100%;
  }
  .segmented::-webkit-scrollbar {
    display: none;
  }
  .segmented button {
    flex: 0 0 auto;
  }
  .test-toolbar {
    margin-bottom: var(--s6);
    padding-left: var(--s4);
    padding-right: var(--s4);
  }
  .grid--3,
  .grid--2 {
    grid-template-columns: minmax(0, 1fr);
  }
  /* Lead card spans the top row; the rest pair up beneath it, so the whole
     summary still lands above the fold on a phone. */
  .rcards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rcard--lead {
    grid-column: 1 / -1;
  }
  .rcard--lead .rcard__v {
    font-size: 2rem;
  }
  .rhead .btn {
    flex: 1 1 auto;
  }
  .rhead__meta {
    flex-basis: 100%;
  }

  /* Four dashboard tiles across a phone truncates their own labels into
     "LEA…", which is worse than useless. Two up, and they read. */
  .ldash {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  /* Give the course title the room instead of the progress bar — you can read
     a percentage from a short bar, you cannot read a clipped course name. */
  .lcard__progress {
    flex-basis: 62px;
  }
  .lcard__progress .meter {
    width: 62px;
  }
  .lcard__progress .micro {
    display: none;
  }
  /* The titles were let out of the ellipsis; everything beside them was not,
     so the same phone still showed "COURSES IN PROGRE…", "Brackets and bra…"
     and "From first keystroke to the w…". A wrapped label costs a row of
     pixels. A truncated one costs the word that carried the meaning — which
     is the argument the two-up rule above already makes, applied properly. */
  .lcard__title,
  .resume__title,
  .ldash__top span,
  .ldash__v,
  .ldash__sub {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  /* The subtitles wrap too, but stop at two lines: one of them is the day's
     plan, which is a whole sentence and has a disclosure to open if you want
     the rest. Two lines is a summary; four is the row eating the page. */
  .lcard__sub,
  .resume__sub {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    white-space: normal;
  }
  .resume {
    gap: var(--s3);
    padding: var(--s3);
  }
  .resume__pct {
    flex-direction: row;
    align-items: center;
    gap: var(--s2);
  }
  .resume__pct .meter {
    width: 48px !important;
  }
  .kbguide {
    display: none;
  }
}

/* Mobile typing: a real input is needed to raise the soft keyboard */
.mobile-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  border: 0;
  padding: 0;
  pointer-events: none;
}

/* ------------------------------------------------- Touch targets (§13) */

/* Two conditions, deliberately. `pointer: coarse` catches the tablet in
   landscape that is a touch device at a desktop width — the case a viewport
   query misses entirely. `max-width: 680px` catches the narrow window, and is
   the half that can actually be verified in a test harness. Either alone
   leaves a real gap; the desktop cost of the second is nil, since a window
   that narrow benefits from bigger targets anyway. */
@media (pointer: coarse), (max-width: 680px) {
  .btn {
    min-height: 44px;
  }
  .btn--icon {
    width: 44px;
    height: 44px;
  }
  .nav a,
  .wordmark {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .segmented {
    padding: 3px;
  }
  .segmented button {
    min-height: 38px;
    padding: 0 var(--s4);
  }
  .lrow {
    min-height: 48px;
  }
  .lcard__head,
  .rdetails > summary {
    min-height: 48px;
  }
  .swatch {
    width: 44px;
    height: 44px;
  }
  .theme-card {
    padding: var(--s3);
  }
  /* The lesson rows in a course list sit close together; a little more air
     stops a mis-tap opening the wrong lesson. */
  .lrow--lesson {
    padding-top: 10px;
    padding-bottom: 10px;
  }
}

@media print {
  .topbar,
  .adslot,
  .btn,
  .toast-host {
    display: none !important;
  }
  .view {
    padding: 0;
  }
}

/* ------------------------------------------------- Loading states (§18) */

/* A skeleton, not a spinner. Everything that loads here has a known shape —
   a stat tile, a course row — so reserving that shape keeps the layout still
   and tells the reader what is arriving. A spinner would say only "wait". */
.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-sm);
  background: var(--panel);
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--ink) 7%, transparent),
    transparent
  );
  animation: sweep 1.25s ease-in-out infinite;
}
@keyframes sweep {
  to {
    transform: translateX(100%);
  }
}
/* Reduced motion gets a static placeholder rather than a sweeping one. */
@media (prefers-reduced-motion: reduce) {
  .skeleton::after {
    animation: none;
  }
}
:root[data-motion="reduced"] .skeleton::after {
  animation: none;
}

.skeleton--line {
  height: 0.8em;
  margin: 0.35em 0;
}
.skeleton--tile {
  height: 72px;
}
.skeleton--row {
  height: 56px;
  margin-bottom: var(--s2);
}

/* Empty states: an invitation to act, never a shrug. */
.empty {
  padding: var(--s7) var(--s5);
  border: 1px dashed var(--hairline);
  border-radius: var(--r-lg);
  text-align: center;
}
.empty__icon {
  width: 40px;
  height: 40px;
  margin: 0 auto var(--s4);
  display: grid;
  place-items: center;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-key);
  background: var(--accent-soft);
  color: var(--accent);
}
.empty__title {
  font-family: var(--font-display);
  font-size: var(--t-head);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.empty__body {
  margin: 6px auto 0;
  max-width: 46ch;
  color: var(--ink-2);
  font-size: var(--t-small);
}
.empty__action {
  margin-top: var(--s5);
}

/* --------------------------------------------- Navigation styles (§18) */

/* Four treatments of the same markup. Everything else the Appearance page
   offers — spacing, radius, type, colour — reaches the app as custom
   properties and needs no selector; navigation is the exception, because
   these differ in layout rather than in value. */

/* Glass (default): translucent, blurred, content shows through as you scroll. */
:root[data-nav="glass"] .topbar {
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
}

/* Solid: opaque, with a hard edge. The honest choice on a slow device — no
   backdrop filter means no per-frame blur over scrolling content. */
:root[data-nav="solid"] .topbar {
  background: var(--panel);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom-color: var(--hairline);
}

/* Floating: a detached panel inset from the edges, so the page reads as
   content passing underneath an instrument rather than inside a chrome. */
:root[data-nav="floating"] .topbar {
  position: sticky;
  top: var(--s3);
  width: calc(100% - var(--s5) * 2);
  margin: var(--s3) auto 0;
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  box-shadow: var(--shadow-2);
}
:root[data-nav="floating"] .view,
:root[data-nav="floating"] .test-shell,
:root[data-nav="floating"] .results {
  padding-top: var(--s5);
}

/* Minimal: no bar at all. For anyone who wants nothing but the text — the
   controls stay, the surface they sat on does not. */
:root[data-nav="minimal"] .topbar {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom-color: transparent;
}
:root[data-nav="minimal"] .nav a::after {
  height: 1px;
}

/* The phone's bottom strip takes the same four treatments. Whichever bar you
   are looking at, you chose its surface once. */
:root[data-nav="solid"] .rail {
  background: var(--panel);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
:root[data-nav="floating"] .rail {
  inset: auto var(--s4) calc(var(--s3) + env(safe-area-inset-bottom)) var(--s4);
  padding-bottom: 0;
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  box-shadow: var(--shadow-2);
  /* So the marker rule stops at the rounded corner instead of crossing it. */
  overflow: hidden;
}
:root[data-nav="minimal"] .rail {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-top-color: transparent;
}
:root[data-nav="minimal"] .rail a::after {
  height: 1px;
}

/* Density: the spacing ramp is already scaled by variable, but a few fixed
   heights need to come along or the rhythm breaks. */
:root[data-density="compact"] .topbar {
  height: 48px;
}
:root[data-density="relaxed"] .topbar {
  height: 64px;
}
:root[data-density="compact"] .typearea {
  line-height: 1.9;
}
:root[data-density="relaxed"] .typearea {
  line-height: 2.3;
}

/* ------------------------------------------------ Appearance page (§18) */

/* Option tiles. One shape for modes, fonts and navigation styles, so the page
   reads as one set of decisions rather than four unrelated widgets. */
.opt-row {
  display: flex;
  gap: var(--s2);
  flex-wrap: wrap;
}
.opt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: var(--s2);
}
.opt {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s3) var(--s4);
  border: 1px solid var(--hairline);
  border-radius: var(--r-key);
  background: var(--panel);
  box-shadow: var(--key-face), var(--key-lift);
  color: var(--ink);
  font-family: inherit;
  font-size: var(--t-small);
  cursor: pointer;
  text-align: left;
  transition: transform var(--dur-1) var(--ease-key),
    border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.opt:hover {
  border-color: var(--accent-line);
}
.opt:active {
  transform: translateY(1px);
  box-shadow: var(--key-face);
}
.opt[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.opt--wide {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 92px;
}
.opt__icon {
  display: grid;
  place-items: center;
}
.opt__name {
  font-weight: 600;
}
.opt__blurb {
  color: var(--ink-2);
  font-size: var(--t-micro);
  line-height: 1.35;
}
.opt[aria-pressed="true"] .opt__blurb {
  color: color-mix(in srgb, var(--accent) 70%, var(--ink));
}
/* Each typeface option is set in its own faces — you pick by reading it. */
.opt__specimen {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.opt[aria-pressed="true"] .opt__specimen {
  color: var(--accent);
}

/* A miniature of each navigation treatment, drawn rather than described. */
.opt__nav {
  position: relative;
  display: block;
  width: 100%;
  height: 26px;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  overflow: hidden;
}
.opt__nav i {
  position: absolute;
  top: 7px;
  height: 4px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--ink) 34%, transparent);
}
.opt__nav i:nth-child(1) { left: 8px; width: 18px; }
.opt__nav i:nth-child(2) { left: 32px; width: 12px; }
.opt__nav i:nth-child(3) { right: 8px; width: 10px; }
.opt__nav[data-preview="glass"]::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 18px;
  background: color-mix(in srgb, var(--ink) 10%, transparent);
  backdrop-filter: blur(2px);
}
.opt__nav[data-preview="solid"]::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 18px;
  background: color-mix(in srgb, var(--ink) 22%, transparent);
}
.opt__nav[data-preview="floating"]::before {
  content: "";
  position: absolute;
  inset: 3px 4px auto 4px;
  height: 16px;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--ink) 20%, transparent);
}
.opt__nav[data-preview="floating"] i {
  top: 9px;
}
.opt__nav[data-preview="minimal"]::before {
  content: none;
}

.setting-block {
  padding: var(--s5) 0;
  border-bottom: 1px solid var(--hairline);
}
.setting-block:last-of-type {
  border-bottom: 0;
}

/* =====================================================================
   Site chrome and content pages
   ===================================================================== */

/* A narrower measure for documents that are mostly sentences. Anything past
   about 70 characters costs the reader the start of the next line. */
.view--prose {
  max-width: 760px;
}

/* --------------------------------------------------------- page header */

.page__head {
  margin-bottom: var(--s7);
  padding-bottom: var(--s5);
  border-bottom: 1px solid var(--hairline);
}
.page__eyebrow {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s3);
}
.page__title {
  font-size: var(--t-display);
  line-height: 1.08;
  letter-spacing: var(--track-display);
}
.page__lede {
  margin-top: var(--s4);
  max-width: 62ch;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink-2);
}

/* ------------------------------------------------------------ sections */

.psec {
  margin-top: var(--s7);
}
.psec:first-of-type {
  margin-top: 0;
}
.psec__title {
  font-size: var(--t-title);
  letter-spacing: -0.02em;
  margin-bottom: var(--s4);
}

.prose > * + * {
  margin-top: var(--s4);
}
.prose p {
  max-width: 68ch;
  line-height: 1.7;
  color: var(--ink-2);
}
.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--accent-line);
}
.prose a:hover {
  text-decoration-color: var(--accent);
}

/* --------------------------------------------------------- point grids */

.pgrid {
  display: grid;
  gap: var(--s3);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.pgrid[data-cols="3"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.pgrid[data-cols="4"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.pgrid__item {
  padding: var(--s5);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: var(--panel);
}
.pgrid__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: var(--s3);
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent);
}
.pgrid__title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.pgrid__body {
  margin-top: 6px;
  font-size: var(--t-small);
  line-height: 1.6;
  color: var(--ink-2);
}

/* The stat variant: a figure and its label, set like a rating on a plate. */
.pgrid__item--stat {
  text-align: center;
  padding: var(--s5) var(--s3);
}
.pgrid__stat {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.pgrid__statk {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--ink-3);
}

/* --------------------------------------------------------- fact tables */

.facts {
  border-top: 1px solid var(--hairline);
}
.facts dt {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--ink-3);
  padding-top: var(--s3);
}
.facts dd {
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--hairline);
  color: var(--ink);
  font-size: var(--t-small);
}
@media (min-width: 681px) {
  .facts {
    display: grid;
    grid-template-columns: 15em 1fr;
    align-items: baseline;
  }
  .facts dt {
    padding-bottom: var(--s3);
    border-bottom: 1px solid var(--hairline);
  }
}

/* ----------------------------------------------------------------- FAQ */

.faq {
  border-top: 1px solid var(--hairline);
}
.faq__item {
  border-bottom: 1px solid var(--hairline);
}
.faq__q {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s4) 0;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  list-style: none;
  color: var(--ink);
}
.faq__q::-webkit-details-marker {
  display: none;
}
.faq__q span {
  flex: 1;
  min-width: 0;
}
.faq__q svg {
  color: var(--ink-3);
  transition: transform var(--dur-2) var(--ease);
}
.faq__item[open] .faq__q svg {
  transform: rotate(180deg);
}
.faq__q:hover {
  color: var(--accent);
}
.faq__a {
  padding: 0 0 var(--s5);
  max-width: 68ch;
}
.faq__a p + p {
  margin-top: var(--s3);
}
.faq__a p {
  font-size: var(--t-small);
  line-height: 1.7;
  color: var(--ink-2);
}

/* ------------------------------------------------------------ CTA band */

.cta {
  display: flex;
  align-items: center;
  gap: var(--s5);
  flex-wrap: wrap;
  margin-top: var(--s8);
  padding: var(--s6);
  border: 1px solid var(--accent-line);
  border-radius: var(--r-xl);
  background: var(--accent-soft);
}
.cta__title {
  font-size: var(--t-title);
  letter-spacing: -0.02em;
}
.cta__body {
  margin-top: 4px;
  color: var(--ink-2);
  font-size: var(--t-small);
  max-width: 52ch;
}
.cta__actions {
  display: flex;
  gap: var(--s2);
  flex-wrap: wrap;
  margin-left: auto;
}

/* ------------------------------------------------------- courses page */

.filters {
  display: flex;
  gap: var(--s5);
  flex-wrap: wrap;
  margin: var(--s6) 0 var(--s5);
  padding-bottom: var(--s5);
  border-bottom: 1px solid var(--hairline);
}
.filters__group {
  display: flex;
  align-items: center;
  gap: var(--s3);
}
.filters__label {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--ink-3);
}
.filters__count {
  font-size: var(--t-small);
  color: var(--ink-3);
  margin-bottom: var(--s4);
}

.ccard {
  padding: var(--s5);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: var(--panel);
}
.ccard + .ccard {
  margin-top: var(--s3);
}
.ccard__top {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
}
.ccard__title {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.ccard__sub {
  margin-top: 2px;
  font-size: var(--t-small);
  color: var(--ink-2);
}
.ccard__blurb {
  margin-top: var(--s4);
  font-size: var(--t-small);
  line-height: 1.65;
  color: var(--ink-2);
  max-width: 68ch;
}
.ccard__modules {
  display: grid;
  gap: var(--s2);
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin-top: var(--s4);
  padding: var(--s4) 0 0;
  border-top: 1px solid var(--hairline);
  padding-left: 0;
  list-style: none;
}
.ccard__modules li {
  padding: var(--s3);
  border-radius: var(--r-md);
  background: var(--bg);
}
.ccard__modules b {
  font-size: var(--t-small);
}
.ccard__foot {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-top: var(--s4);
}

/* ----------------------------------------------------- community page */

.roadmap {
  padding-left: 0;
  list-style: none;
  border-top: 1px solid var(--hairline);
}
.roadmap__item {
  padding: var(--s4) 0;
  border-bottom: 1px solid var(--hairline);
}
.roadmap__head {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-bottom: 4px;
}
.roadmap__item p {
  max-width: 68ch;
  line-height: 1.6;
}

/* ------------------------------------------------------- contact page */

.contact__grid {
  display: grid;
  gap: var(--s3);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: var(--s7);
}
.contact__card {
  padding: var(--s5);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: var(--panel);
}
.contact__label {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--ink-3);
}
.contact__body {
  margin: var(--s3) 0 var(--s4);
  font-size: var(--t-small);
  line-height: 1.65;
  color: var(--ink-2);
}
.contact__mail {
  font-family: var(--font-mono);
  font-size: var(--t-small);
  font-weight: 500;
  /* Ink with an accent underline, not accent ink. `--accent` on `--panel`
     measures 4.27:1 in Drafting, and a 13px address is normal text owing 4.5.
     Putting the colour in the rule keeps the link obviously a link and lets
     the text clear the bar in all six palettes. */
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--accent);
  word-break: break-all;
}
.contact__mail:hover {
  color: var(--accent);
}

/* --------------------------------------------------------------- legal */

.legalnote {
  margin-bottom: var(--s7);
  padding: var(--s4) var(--s5);
  border-left: 2px solid var(--warn);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  background: var(--panel);
  font-size: var(--t-small);
  line-height: 1.65;
  color: var(--ink-2);
}

/* ---------------------------------------------------------------- blog */

.postlead {
  display: block;
  padding: var(--s6);
  border: 1px solid var(--accent-line);
  border-radius: var(--r-xl);
  background: var(--accent-soft);
  color: var(--ink);
  transition: border-color var(--dur-1) var(--ease);
}
.postlead:hover {
  text-decoration: none;
  border-color: var(--accent);
}
.postlead__meta,
.postcard__meta {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-bottom: var(--s3);
}
.postlead__title {
  font-size: var(--t-title);
  line-height: 1.2;
  letter-spacing: -0.025em;
  max-width: 24ch;
}
.postlead__dek {
  margin-top: var(--s3);
  max-width: 60ch;
  line-height: 1.6;
  color: var(--ink-2);
}
.postlead__go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--s5);
  font-family: var(--font-mono);
  font-size: var(--t-small);
  font-weight: 500;
  color: var(--accent);
}

.postgrid {
  display: grid;
  gap: var(--s3);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: var(--s3);
}
.postcard {
  display: flex;
  flex-direction: column;
  padding: var(--s5);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: var(--panel);
  color: var(--ink);
  transition: border-color var(--dur-1) var(--ease);
}
.postcard:hover {
  text-decoration: none;
  border-color: var(--accent-line);
}
.postcard__title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.postcard__dek {
  margin-top: 6px;
  font-size: var(--t-small);
  line-height: 1.6;
  color: var(--ink-2);
}
.postcard__date {
  margin-top: var(--s4);
}

.post__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: var(--s5);
  font-family: var(--font-mono);
  font-size: var(--t-small);
  color: var(--ink-3);
}
.post__back svg {
  transform: rotate(180deg);
}
.post__back:hover {
  color: var(--ink);
  text-decoration: none;
}
.post__head {
  padding-bottom: var(--s5);
  border-bottom: 1px solid var(--hairline);
}
.post__meta {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-bottom: var(--s4);
}
.post__title {
  font-size: var(--t-display);
  line-height: 1.1;
  letter-spacing: var(--track-display);
}
.post__dek {
  margin-top: var(--s4);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink-2);
}
.post__body {
  margin-top: var(--s6);
}
.post__body p {
  line-height: 1.75;
  color: var(--ink-2);
}
.post__body > * + * {
  margin-top: var(--s4);
}
.post__h {
  margin-top: var(--s7) !important;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.post__quote {
  margin-top: var(--s6) !important;
  margin-bottom: var(--s6);
  padding-left: var(--s5);
  border-left: 2px solid var(--accent);
  font-size: 1.125rem;
  line-height: 1.55;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.post__list {
  padding-left: var(--s5);
  color: var(--ink-2);
}
.post__list li {
  line-height: 1.7;
}
.post__list li + li {
  margin-top: 6px;
}
.post__foot {
  margin-top: var(--s7);
  padding-top: var(--s5);
  border-top: 1px solid var(--hairline);
}

/* ================================================== the footer =========
   An instrument's specification plate: the panel on the back carrying the
   model, the ratings and the compliance marks. It is where a machine states
   the boring true facts about itself, so this one does the same — and the
   figures on the plate are read from the catalogue rather than typed here.
   ===================================================================== */

.sitefoot {
  margin-top: auto;
  border-top: 1px solid var(--hairline);
  background: var(--panel);
}
.sitefoot[hidden] {
  display: none;
}
/* Chrome recedes during a session (§3.1) — the caret's neighbourhood is
   sacred, and a link list is exactly the sort of thing that leaves it. */
.app[data-focus="on"] .sitefoot {
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-2) var(--ease);
}
.sitefoot__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s6) var(--s5) var(--s4);
}
.sitefoot__grid {
  display: grid;
  gap: var(--s6);
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 2fr);
}
.sitefoot__mark {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.sitefoot__mark:hover {
  text-decoration: none;
}
.sitefoot__desc {
  margin-top: var(--s3);
  /* Wider, not narrower. Cutting the measure to 42ch pushed the description on
     to a fifth line and made the block taller than it was before — the
     line-height is what buys the space back here. */
  max-width: 52ch;
  font-size: var(--t-small);
  line-height: 1.55;
  color: var(--ink-2);
}

.sitefoot__social {
  display: flex;
  /* Stays at 8px: adjacent touch targets need that much between them, and
     tightening a horizontal gap saves no height anyway. */
  gap: var(--s2);
  margin-top: var(--s4);
  padding-left: 0;
  list-style: none;
}
.sitefoot__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  background: var(--bg);
  color: var(--ink-2);
  transition: color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.sitefoot__social a:hover {
  color: var(--accent);
  border-color: var(--accent-line);
  text-decoration: none;
}

.sitefoot__cols {
  display: grid;
  gap: var(--s5);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.sitefoot__label {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: var(--s3);
}
.sitefoot__links {
  display: grid;
  gap: var(--s2);
  /* The UA puts 40px of padding on every `ul`; without clearing it the links
     sit indented from the label that names them. */
  padding-left: 0;
  list-style: none;
}
.sitefoot__links a {
  font-size: var(--t-small);
  color: var(--ink-2);
  transition: color var(--dur-1) var(--ease);
}
.sitefoot__links a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* The plate itself: the etched line of ratings. */
.sitefoot__plate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3);
  margin-top: var(--s5);
  padding: var(--s3) 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.sitefoot__sep {
  color: var(--accent);
}

.sitefoot__bottom {
  display: flex;
  align-items: center;
  gap: var(--s5);
  flex-wrap: wrap;
  padding-top: var(--s3);
}
.sitefoot__copy {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  color: var(--ink-3);
}
.sitefoot__legal {
  display: flex;
  gap: var(--s5);
  margin-left: auto;
}
.sitefoot__legal a {
  font-size: var(--t-micro);
  color: var(--ink-3);
}
.sitefoot__legal a:hover {
  color: var(--ink);
}

/* --------------------------------------------------------- narrow ---- */

@media (max-width: 900px) {
  .sitefoot__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s5);
  }
}

@media (max-width: 680px) {
  .pgrid,
  .pgrid[data-cols="3"],
  .contact__grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .pgrid[data-cols="4"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cta {
    padding: var(--s5);
  }
  .cta__actions {
    margin-left: 0;
    width: 100%;
  }
  .cta__actions .btn {
    flex: 1 1 auto;
  }
  .filters {
    gap: var(--s4);
  }
  .filters__group {
    flex: 1 1 100%;
    min-width: 0;
  }
  .filters__group .segmented {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .sitefoot__inner {
    padding: var(--s5) var(--s4) var(--s4);
  }
  /* Three across rather than two: with 4/2/2 links the two-column version
     stranded Company on a row of its own under a column-height hole. */
  .sitefoot__cols {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--s4) var(--s3);
  }
  .sitefoot__links {
    gap: var(--s2);
  }
  .sitefoot__bottom {
    gap: var(--s3);
  }
  .sitefoot__legal {
    margin-left: 0;
    gap: var(--s4);
  }
  /* The rail sits over the bottom of the page, so the plate needs to clear
     it exactly as the views do. */
  .sitefoot__inner {
    padding-bottom: calc(var(--s6) + var(--rail-h) + env(safe-area-inset-bottom));
  }
}

/* Touch targets (§13) reach the footer too. */
@media (pointer: coarse), (max-width: 680px) {
  .sitefoot__links a,
  .sitefoot__legal a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
  }
  .sitefoot__social a {
    width: 44px;
    height: 44px;
  }
  .faq__q {
    min-height: 48px;
  }
}

/* ============================================ Curriculum structure =====
   The touch-typing course carries what a professional syllabus carries:
   what a module is for, what it expects of you on the way out, and a
   checkpoint you clear before the next one opens. Those three things are
   the difference between a list of drills and a course.
   ===================================================================== */

/* Objectives sit between the module heading and its lessons — the "why"
   before the "what", which is the order a syllabus states them in. */
.lobjectives {
  margin: 0 0 var(--s3);
  padding: var(--s3) var(--s4);
  border-left: 2px solid var(--accent-line);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: color-mix(in srgb, var(--panel) 55%, transparent);
  list-style: none;
}
.lobjectives li {
  position: relative;
  padding-left: var(--s4);
  font-size: var(--t-small);
  line-height: 1.55;
  color: var(--ink-2);
}
.lobjectives li + li {
  margin-top: 5px;
}
.lobjectives li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* The module's exit standard, stated on the heading row. A target you can
   see while working is worth more than one filed on another page. */
.lmodule__exit {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ------------------------------------------------------- checkpoints */

.lcheck {
  margin-top: var(--s3);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  background: var(--bg);
}
.lcheck--ready {
  border-color: color-mix(in srgb, var(--success) 45%, var(--hairline));
}
.lcheck__head {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  font-family: var(--font-mono);
  font-size: var(--t-small);
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  list-style: none;
}
.lcheck__head::-webkit-details-marker {
  display: none;
}
.lcheck__head:hover {
  color: var(--ink);
}
.lcheck__head svg {
  margin-left: auto;
  color: var(--ink-3);
  transition: transform var(--dur-2) var(--ease);
}
.lcheck[open] .lcheck__head svg {
  transform: rotate(180deg);
}
.lcheck__mark {
  font-family: var(--font-mono);
  color: var(--ink-3);
}
.lcheck--ready .lcheck__mark {
  color: var(--success);
}
.lcheck__list {
  margin: 0;
  padding: 0 var(--s4) var(--s4) var(--s4);
  list-style: none;
}
.lcheck__list li {
  position: relative;
  padding-left: var(--s5);
  font-size: var(--t-small);
  line-height: 1.55;
  color: var(--ink-2);
}
.lcheck__list li + li {
  margin-top: 6px;
}
/* An empty box, because these are things you have yet to prove. */
.lcheck__list li::before {
  content: "☐";
  position: absolute;
  left: 0;
  font-family: var(--font-mono);
  color: var(--ink-3);
}
.lcheck--ready .lcheck__list li::before {
  color: var(--success);
}

/* ---------------------------------------------------- common mistakes */

.lmistakes {
  margin: 0 var(--s4) var(--s4);
  padding-top: var(--s3);
  border-top: 1px solid var(--hairline);
}
.lmistakes__title {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: var(--s3);
}
.lmistakes__row {
  display: grid;
  gap: 2px var(--s4);
  padding: 6px 0;
  font-size: var(--t-small);
  line-height: 1.5;
}
.lmistakes__row + .lmistakes__row {
  border-top: 1px solid var(--hairline);
}
.lmistakes__row b {
  color: var(--warn);
  font-weight: 500;
}
.lmistakes__row span {
  color: var(--ink-2);
}
@media (min-width: 681px) {
  .lmistakes__row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
    align-items: baseline;
  }
}

/* ================================================ The certificate ======
   An artifact, not a screen. It ignores the theme and is always the light
   document treatment, because a diploma that arrives graphite-on-black
   because of a setting is not something anyone forwards to an employer.
   A4 landscape exactly (1.414:1), so it prints with no cropping.
   ===================================================================== */

.certsheet {
  --paper: #FAFAF9;
  --paper-ink: #141516;
  --paper-ink-2: #55575A;
  --paper-ink-3: #83868B;
  --paper-rule: #DFDEDA;
  --paper-copper: #8F5527;

  position: relative;
  display: flex;
  flex-direction: column;
  margin: 0;
  aspect-ratio: 1.4142;
  padding: 4.4% 5.6%;
  background:
    radial-gradient(120% 70% at 50% -20%, rgba(143, 85, 39, 0.055), transparent 70%),
    var(--paper);
  color: var(--paper-ink);
  /* Container units, so every rule below scales with the sheet rather than
     with the viewport. The certificate has to hold its proportions at 320px
     in a phone's profile page and at full width on a printed sheet. */
  container-type: inline-size;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}

/* The machined double frame, and one copper rule across the head — the only
   colour on the sheet apart from the mark. */
.certsheet::before,
.certsheet::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border: 1px solid var(--paper-rule);
}
.certsheet::before { inset: 2.1%; }
.certsheet::after { inset: 2.8%; }
.certsheet__rule {
  position: absolute;
  top: 2.1%;
  left: 2.1%;
  right: 2.1%;
  height: 3px;
  background: linear-gradient(90deg, #C0794A, var(--paper-copper) 50%, #6E4520);
}

/* Machined corner brackets on the inner frame. */
.certsheet__corner {
  position: absolute;
  width: 3.2cqw;
  height: 3.2cqw;
  border: 2px solid var(--paper-copper);
  pointer-events: none;
}
.certsheet__corner[data-c="tl"] { top: 2.8%; left: 2.8%; border-right: 0; border-bottom: 0; }
.certsheet__corner[data-c="tr"] { top: 2.8%; right: 2.8%; border-left: 0; border-bottom: 0; }
.certsheet__corner[data-c="bl"] { bottom: 2.8%; left: 2.8%; border-right: 0; border-top: 0; }
.certsheet__corner[data-c="br"] { bottom: 2.8%; right: 2.8%; border-left: 0; border-top: 0; }

.certsheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4cqw;
}
.certsheet__brand {
  display: flex;
  align-items: center;
  gap: 1.6cqw;
  font-family: var(--font-display);
  font-size: 3.4cqw;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.certsheet__brand svg {
  width: 5.6cqw;
  height: 5.6cqw;
}
.certsheet__serial {
  text-align: right;
  line-height: 1.35;
}
.certsheet__serial-k,
.certsheet__serial-v {
  display: block;
  font-family: var(--font-mono);
}
.certsheet__serial-k {
  font-size: 1.7cqw;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper-ink-3);
}
.certsheet__serial-v {
  font-size: 2.3cqw;
  font-weight: 600;
  color: var(--paper-ink-2);
}

.certsheet__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.certsheet__eyebrow {
  font-family: var(--font-mono);
  font-size: 2.1cqw;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--paper-copper);
}
.certsheet__awarded {
  margin-top: 2.2cqw;
  font-size: 2.2cqw;
  color: var(--paper-ink-2);
}
.certsheet__name {
  margin-top: 1.1cqw;
  padding-bottom: 1.2cqw;
  border-bottom: 2px solid var(--paper-copper);
  font-size: 6.4cqw;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.certsheet__title {
  margin-top: 1.8cqw;
  font-family: var(--font-mono);
  font-size: 2.3cqw;
  font-weight: 600;
  color: var(--paper-ink-2);
}
.certsheet__statement {
  margin-top: 1.2cqw;
  max-width: 62cqw;
  font-size: 2.1cqw;
  line-height: 1.5;
  color: var(--paper-ink-2);
}

/* The figures, banded so the eye lands on them without them shouting. */
.certsheet__stats {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  margin: 0 0 2cqw;
  padding: 1.6cqw 0;
  background: #F1F0ED;
  border-radius: var(--r-sm);
}
.certsheet__stat {
  text-align: center;
  padding: 0 1cqw;
}
.certsheet__stat + .certsheet__stat {
  border-left: 1px solid var(--paper-rule);
}
.certsheet__stat dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 4cqw;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--paper-ink);
  /* The date is the widest value and would wrap to two lines, which breaks
     the band's alignment and takes the footer off the sheet with it. */
  white-space: nowrap;
}
.certsheet__stat dt {
  order: 2;
  margin-top: 0.6cqw;
  font-family: var(--font-mono);
  font-size: 1.6cqw;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper-ink-3);
}
/* dt precedes dd in the markup for semantics; flex puts the figure first. */
.certsheet__stat {
  display: flex;
  flex-direction: column;
}

.certsheet__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4cqw;
}
.certsheet__sig {
  flex: 1;
  min-width: 0;
}
.certsheet__sigmark {
  font-family: var(--font-ui);
  font-size: 3.4cqw;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #1B1D1F;
}
.certsheet__sigline {
  height: 1px;
  margin-top: 1cqw;
  width: 74%;
  background: var(--paper-rule);
}
.certsheet__sigrole {
  margin-top: 1cqw;
  font-size: 1.7cqw;
  line-height: 1.5;
  color: var(--paper-ink-3);
}

/* The seal. Copper in every tier: bronze, silver and gold inks would have
   introduced three colours the brand does not have, to say something the
   word inside the seal already says. */
.certsheet__seal {
  flex: 0 0 auto;
  width: 12.4cqw;
  height: 12.4cqw;
  margin-bottom: -0.6cqw;
  color: var(--paper-copper);
}

/* Fine print, set across the foot the way a real document sets it. */
.certsheet__fine {
  margin-top: 1cqw;
  text-align: center;
  font-size: 1.4cqw;
  letter-spacing: 0.02em;
  color: #9A9C9F;
}

/* The controls beside the sheet. */
.certrow {
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex-wrap: wrap;
  margin-top: var(--s4);
}
.certrow__meta {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  color: var(--ink-3);
}
@media (max-width: 680px) {
  .certrow__meta {
    margin-left: 0;
    flex-basis: 100%;
  }
}

/* ----------------------------------------------------------- printing */

@page {
  size: A4 landscape;
  margin: 10mm;
}

@media print {
  /* Only the sheet goes on the paper. Everything else is chrome. */
  :root.printing-cert body * {
    visibility: hidden;
  }
  :root.printing-cert .certsheet.is-printing,
  :root.printing-cert .certsheet.is-printing * {
    visibility: visible;
  }
  :root.printing-cert .certsheet.is-printing {
    position: fixed;
    inset: 0;
    width: 100%;
    height: auto;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }
  :root.printing-cert .topbar,
  :root.printing-cert .rail,
  :root.printing-cert .sitefoot,
  :root.printing-cert .certrow,
  :root.printing-cert .toast-host {
    display: none !important;
  }
  /* Printers drop backgrounds by default, which would take the stats band and
     the copper rule with them. */
  .certsheet,
  .certsheet * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ========================================= Certificate verification ====
   A search box that has to look like it means something, and a verdict that
   has to be legible at a glance without shouting.
   ===================================================================== */

.verify__form {
  margin-bottom: var(--s6);
}
.verify__label {
  display: block;
  margin-bottom: var(--s2);
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--ink-3);
}
.verify__row {
  display: flex;
  gap: var(--s2);
  flex-wrap: wrap;
}
/* The neutral text input. No flex sizing of its own: `flex: 1 1 16em` inside a
   column stack makes 16em the *height* and then grows it to fill, which is how
   a name field ended up 550px tall. Callers size it. */
.field {
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0 var(--s4);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  background: var(--panel);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1rem;
}
.field::placeholder {
  color: var(--ink-3);
}
.field:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}

/* A certificate number, which is upper-case by construction and reads better
   monospaced and tracked. A person's name is neither of those things. */
.verify__input {
  flex: 1 1 16em;
  font-family: var(--font-mono);
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.verify__input::placeholder {
  letter-spacing: 0.06em;
}

.verify__row .btn {
  height: 46px;
}

.verify__result {
  margin-bottom: var(--s7);
}
.verify__verdict {
  display: flex;
  gap: var(--s4);
  align-items: flex-start;
  padding: var(--s5);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: var(--panel);
}
.verify__verdict + .certsheet {
  margin-top: var(--s4);
}
.verify__verdict p {
  margin-top: 4px;
  max-width: 62ch;
  line-height: 1.6;
  color: var(--ink-2);
}
.verify__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
}
/* Colour is never the only signal: each verdict carries its own glyph and its
   own words, so the three read apart in greyscale and to a screen reader. */
.verify__verdict--ok {
  border-color: color-mix(in srgb, var(--success) 45%, var(--hairline));
}
.verify__verdict--ok .verify__mark {
  background: var(--success-soft);
  color: var(--success);
}
.verify__verdict--bad {
  border-color: color-mix(in srgb, var(--error) 45%, var(--hairline));
}
.verify__verdict--bad .verify__mark {
  background: var(--error-soft);
  color: var(--error);
}
.verify__verdict--unknown .verify__mark {
  background: var(--warn-soft);
  color: var(--warn);
}

/* A quieter button for inline actions like "Edit name". */
.btn--sm {
  height: 30px;
  min-height: 30px;
  padding: 0 var(--s3);
  font-size: var(--t-small);
}
@media (pointer: coarse), (max-width: 680px) {
  .btn--sm {
    min-height: 34px;
  }
}

/* The name dialog. One short sentence, one field, two buttons — it exists to
   take a name, so it should not look like a settings panel. */
.namedlg {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}
.namedlg p {
  max-width: 42ch;
}
.namedlg .field {
  height: 44px;
}
:root .sheet__panel:has(.namedlg) {
  width: min(400px, 100%);
  padding: var(--s5);
}

/* Says which kind of figure the band is showing: the run that earned the
   award, or a best that keeps rising. Without it, a number that changes on a
   dated document looks like an error rather than a feature. */
.certsheet__caption {
  margin: -1.4cqw 0 2cqw;
  text-align: center;
  font-size: 1.5cqw;
  color: var(--paper-ink-3);
}
