@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/static/fonts/dm-sans-latin.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/static/fonts/dm-sans-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/ibm-plex-mono-latin.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/ibm-plex-mono-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/barlow-condensed-600-latin.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/barlow-condensed-600-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/fonts/barlow-condensed-700-latin.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/fonts/barlow-condensed-700-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF; }
:root {
  color-scheme: dark;
  --bg: #0c0c0e; --surface: #151518; --surface-soft: #1d1d21; --text: #ede6d8;
  --muted: #968f82; --border: #2c2b2f; --accent: #f2a541; --accent-hover: #f7b95f;
  --accent-soft: #2a2218; --on-accent: #141211; --success: #8fc79a; --error: #f08a7e; --missing: #f2a541;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  /* the screen is always dark, in every theme; --screen-band is translucent over --screen-bg */
  --screen-bg: #000; --screen-band: rgb(0 0 0 / .82); --screen-text: #ede6d8; --screen-muted: #a39b8c;
  --screen-error: #ff8f84; --screen-missing: #f2a541; --screen-accent: #f2a541; --screen-ok: #8fd19e; --screen-faint: #857e72;
  font: 16px/1.6 "DM Sans", system-ui, sans-serif;
  background: var(--bg); color: var(--text);
  font-synthesis: none;
}
:root[data-theme="light"] { color-scheme: light; --bg: #f5f1e8; --surface: #fffdf8; --surface-soft: #ebe5d8; --text: #26231e; --muted: #655e52; --border: #d3cab8; --accent: #8a5600; --accent-hover: #6b4200; --accent-soft: #f1e2c4; --on-accent: #fffaf0; --success: #2d6a3e; --error: #a63132; --missing: #8a5600; }
:root[data-theme="paper"] { color-scheme: light; --bg: #e9dcc3; --surface: #f3e9d3; --surface-soft: #dfd0b2; --text: #3a2e1f; --muted: #66563f; --border: #c2af8b; --accent: #7a4a14; --accent-hover: #5a3409; --accent-soft: #e4d3ae; --on-accent: #fff8e8; --success: #3d5f30; --error: #9c3630; --missing: #7a4a14; }
:root[data-theme="blue"] { color-scheme: dark; --bg: #0b1118; --surface: #121b25; --surface-soft: #1a2633; --text: #dde6ef; --muted: #93a3b5; --border: #2a3a4b; --accent: #7cb8e8; --accent-hover: #a0cdf0; --accent-soft: #17293a; --on-accent: #08131d; --success: #8fd0ae; --error: #f2958c; --missing: #e3c88a; }
:root[data-font-size="small"] { font-size: 15px; }
:root[data-font-size="large"] { font-size: 19px; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; }
/* static film grain; never animated */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .04; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
::selection { color: var(--bg); background: var(--accent); }
a { color: var(--text); text-decoration: none; text-underline-offset: .25em; overflow-wrap: anywhere; }
a:hover { color: var(--accent); }
button, input, select, textarea { font: inherit; max-width: 100%; min-width: 0; }
button, .button-link, summary { cursor: pointer; }
button, .button-link { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 42px; padding: .55rem 1.05rem; border: 1px solid transparent; border-radius: 6px; background: var(--accent); color: var(--on-accent); font-size: .875rem; font-weight: 600; line-height: 1.4; transition: background-color 120ms ease-out, color 120ms ease-out, border-color 120ms ease-out, transform 120ms ease-out; }
button:active:not(:disabled), .button-link:active { transform: translateY(1px); }
button:hover, .button-link:hover { background: var(--accent-hover); color: var(--on-accent); }
button[type="button"] { background: transparent; color: var(--text); border-color: var(--border); }
button[type="button"]:hover { background: var(--surface-soft); border-color: var(--muted); color: var(--text); }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { border: 1px solid var(--border); border-radius: 6px; padding: .65rem .8rem; background: var(--surface-soft); color: var(--text); line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline-offset: 2px; }
input[type="checkbox"] { appearance: auto; padding: 0; width: 1rem; height: 1rem; accent-color: var(--accent); flex-shrink: 0; }
h1, h2, h3 { font-family: var(--display); text-transform: uppercase; line-height: 1.1; letter-spacing: .08em; font-weight: 600; overflow-wrap: anywhere; text-wrap: balance; }
h1 { font-size: 2.4rem; margin: 0 0 .8rem; }
h2 { font-size: 1.5rem; margin: 2rem 0 .8rem; }
h3 { font-size: 1.15rem; letter-spacing: .06em; }
.hint { color: var(--muted); font-size: .8rem; }
.hint a { text-decoration: underline; }
.eyebrow { margin: 0 0 .35rem; color: var(--accent); font: 600 .8rem/1 var(--display); letter-spacing: .3em; text-transform: uppercase; }
p { margin: .75rem 0 1.25rem; }
.site-header { width: 100%; border-bottom: 1px solid var(--border); }
.site-nav { width: min(100% - 64px, 1120px); margin: auto; min-height: 80px; display: flex; align-items: center; gap: 2.25rem; font-size: .85rem; }
.brand { display: inline-flex; flex-shrink: 0; align-items: center; gap: .65rem; color: var(--text); font: 700 1.5rem/1 var(--display); letter-spacing: .16em; text-transform: uppercase; }
.brand:hover { color: var(--text); }
.brand-mark { color: var(--accent); flex-shrink: 0; }
.nav-links, .nav-account { display: flex; align-items: center; gap: 1.3rem; min-width: 0; }
.nav-links { flex: 1; }
.nav-account { gap: 1rem; }
.nav-links > a, .nav-account > a, .nav-user { color: var(--muted); white-space: nowrap; }
.nav-links > a:hover, .nav-account > a:hover { color: var(--accent); }
.nav-user { max-width: 8rem; overflow: hidden; text-overflow: ellipsis; }
.nav-account .nav-signup { color: var(--text); }
.stats { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; font-family: var(--mono); font-size: .72rem; color: var(--muted); }
.stats svg { color: var(--accent); flex-shrink: 0; }
.logout-form { margin: 0; }
.logout-form button { min-height: 36px; border: 0; padding: .35rem 0; background: transparent; color: var(--muted); font-size: inherit; font-weight: 400; white-space: nowrap; }
.logout-form button:hover { color: var(--accent); }
.appearance { position: relative; }
.appearance summary { color: var(--muted); min-height: 36px; display: flex; align-items: center; gap: .45rem; list-style: none; white-space: nowrap; }
.appearance summary::after { content: ""; width: 6px; height: 6px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.appearance summary::-webkit-details-marker { display: none; }
.appearance summary:hover, .appearance[open] summary { color: var(--accent); }
.appearance-panel { position: absolute; z-index: 20; right: 0; top: calc(100% + .5rem); width: 210px; max-width: calc(100vw - 32px); padding: 1rem; display: grid; gap: .45rem; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.appearance-panel label { color: var(--muted); font-size: .75rem; }
.appearance-panel select + label { margin-top: .4rem; }
.appearance-panel select { font-size: .85rem; }
main { width: min(100% - 64px, 1120px); margin: 0 auto; padding: 3rem 0 4rem; min-width: 0; }
.skip-link { position: absolute; left: 1rem; top: -5rem; z-index: 50; background: var(--accent); color: var(--on-accent); padding: .5rem 1rem; }
.skip-link:focus { top: .5rem; }
.auth-page main { display: grid; place-items: center; min-height: calc(100svh - 88px); padding: 2rem 0 6rem; }
.auth-shell { width: min(100%, 380px); padding: 2.25rem 2rem; background: var(--surface); border-radius: 4px; }
.auth-heading { text-align: center; margin-bottom: 2rem; }
.auth-heading h1 { font-size: 2.2rem; margin-bottom: .6rem; }
.auth-heading p { color: var(--muted); margin: 0; font-size: .95rem; }
.auth-provider { display: flex; align-items: center; justify-content: center; gap: .75rem; width: 100%; min-height: 46px; padding: .7rem; border: 1px solid var(--border); border-radius: 6px; font-size: .875rem; background: transparent; }
.auth-provider:hover { background: var(--surface); color: var(--text); border-color: var(--muted); }
.auth-divider { display: flex; align-items: center; gap: 1rem; margin: 1.6rem 0; font-size: .75rem; color: var(--muted); }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; background: var(--border); flex: 1; }
.auth-form { display: grid; gap: 1rem; }
.auth-form label { display: grid; gap: .45rem; font-size: .8rem; color: var(--muted); }
.auth-form input { width: 100%; font-size: 1rem; min-height: 46px; background: var(--surface-soft); border-color: transparent; }
.auth-form input:focus { border-color: var(--accent); }
.auth-form button { width: 100%; min-height: 46px; margin-top: .3rem; }
.auth-recovery { text-align: right; margin: .8rem 0 1.7rem; font-size: .8rem; }
.auth-recovery a { color: var(--muted); }
.auth-recovery a:hover, .auth-footer a { color: var(--accent); }
.auth-footer { text-align: center; font-size: .85rem; color: var(--muted); margin: 1.7rem 0 0; }
main > form:not(.library-filters) { display: grid; gap: 1rem; max-width: 36rem; }
main > form > label { display: grid; gap: .4rem; }
main > form > button { justify-self: start; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 2.25rem; }
.page-intro { color: var(--muted); margin: 0; max-width: 46ch; font-size: .95rem; }
.library-filters { display: flex; flex-wrap: wrap; gap: 1rem; align-items: end; margin: 0 0 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.library-filters label { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .8rem; }
.library-filters select { background: transparent; min-width: 9rem; font-size: .8rem; padding: .5rem .65rem; }
.library-filters button { min-height: 38px; padding: .45rem .9rem; background: var(--surface-soft); color: var(--text); font-size: .8rem; }
.video-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 2rem 1.5rem; }
.video-card { min-width: 0; }
.video-card > a { display: block; }
.video-card img { display: block; width: 100%; height: auto; box-sizing: content-box; aspect-ratio: 16/9; object-fit: cover; padding: 6% 0; background: var(--screen-bg); border-radius: 2px; }
.video-card strong { display: block; margin: .8rem 0 .3rem; font: 600 1.15rem/1.25 var(--display); letter-spacing: .05em; text-transform: uppercase; }
.video-card a:hover strong { color: var(--accent); }
.video-meta, .video-progress { font-size: .78rem; color: var(--muted); margin-top: .25rem; }
.video-progress { color: var(--accent); font-family: var(--mono); font-size: .7rem; }
.empty-state { margin: 3rem 0; text-align: center; color: var(--muted); }
body[data-mode="practice"] main { max-width: 860px; padding-top: 1.5rem; }
body[data-mode="typing"] main { --stage: min(100%, 1280px, max(38rem, calc((100svh - 34rem) * 16 / 9))); width: min(100% - 64px, 1600px); max-width: none; padding-top: 1rem; }
body[data-mode="typing"] #typing-app { width: var(--stage); margin-inline: auto; }
body[data-mode="typing"] main > .practice-heading { width: min(100%, 1120px); margin-inline: auto; }
@media (min-width: 1100px) { body[data-mode="typing"] main { --stage: 100%; } }
/* Stage: settings left, video centre, controls right. Once typing starts the rails fold away and the video grows. */
.stage { display: grid; grid-template-columns: 15rem minmax(0, 1fr) 15rem; column-gap: 1.5rem; align-items: start; transition: grid-template-columns .3s ease, column-gap .3s ease; }
.stage-left, .stage-right { min-width: 0; transition: opacity .25s ease, visibility .25s; }
.stage-left { grid-column: 1; grid-row: 1; }
.stage-center { grid-column: 2; grid-row: 1; justify-self: center; width: 100%; max-width: max(36rem, calc((100svh - 30rem) * 16 / 9)); transition: max-width .3s ease; }
.stage-right { grid-column: 3; grid-row: 1; }
.stage-center .screen { max-width: none; }
.stage-left > *, .stage-right > * { margin-block: 0 .75rem; }
.stage-left .mode-help { text-align: left; font-size: .7rem; margin-bottom: .5rem; }
.stage-left .practice-toolbar { flex-direction: column; align-items: stretch; gap: .5rem; padding: .75rem 1rem; }
.stage-left .practice-toolbar label { justify-content: space-between; }
.stage-left .practice-toolbar label:has(> input) { justify-content: start; }
.stage-right .typing-controls { flex-direction: column; align-items: stretch; margin-top: 0; }
.stage-right .typing-controls label { justify-content: space-between; }
.stage-right .typing-controls #typing-play, .stage-right .typing-controls #typing-replay { width: 100%; }
.stage-right .playback-actions { flex-wrap: wrap; justify-content: stretch; }
.stage-right .playback-actions button { flex: 1; }
.stage-center .typing-stats { margin: 1rem 0 0; flex-wrap: wrap; row-gap: .4rem; }
#typing-app.is-typing .stage { grid-template-columns: 0 minmax(0, 1fr) 0; column-gap: 0; }
#typing-app.is-typing :is(.stage-left, .stage-right) { opacity: 0; visibility: hidden; overflow: hidden; height: 0; }
@media (max-width: 1099px) {
  .stage { display: block; }
  .stage-center { max-width: none; }
  #typing-app.is-typing :is(.stage-left, .stage-right) { display: none; }
}
@media (prefers-reduced-motion: reduce) { .stage, .stage-left, .stage-right, .stage-center { transition: none; } }
.practice-heading { margin-bottom: 1.4rem; }
.practice-heading > a { color: var(--muted); font-size: .75rem; }
.practice-heading > a:hover { color: var(--accent); }
.practice-heading h1 { margin: .65rem 0 0; font-size: 1.45rem; }
.practice-toolbar { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .7rem 1.5rem; padding: .6rem 1rem; margin-bottom: 1.5rem; background: var(--surface); border-radius: 7px; }
.practice-toolbar label { display: inline-flex; align-items: center; gap: .5rem; font-size: .75rem; color: var(--muted); }
.practice-toolbar select { padding: .25rem .4rem; min-height: 32px; border: 0; background: transparent; font-family: inherit; font-size: .75rem; color: var(--text); }
#preference-status:empty { display: none; }
#preference-status { color: var(--error); font-size: .8rem; }
.practice-layout { display: grid; gap: 1.75rem; }
/* ponytail: 30rem ~ chrome above+below the video; keeps Check in view at 1280x720 */
.practice-video { width: min(100%, 880px, max(18rem, calc((100svh - 30rem) * 16 / 9))); margin: auto; min-width: 0; }
#player-error { margin: 0; padding: .5rem 1rem; color: var(--screen-error); text-align: center; }
.screen { max-width: 880px; margin-inline: auto; padding: 1rem 0 3rem; background: var(--screen-bg); border-radius: 2px 2px 0 0; }
.practice-video .screen { padding-bottom: 0; }
#player { display: block; width: 100%; height: auto; aspect-ratio: 16/9; border: 0; background: var(--screen-bg); }
.playback-actions { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: .75rem; }
.playback-actions button { min-height: 36px; padding: .3rem .65rem; background: transparent; color: var(--muted); font-size: .75rem; font-weight: 400; }
.playback-actions button:hover { color: var(--accent); background: var(--surface); }
.practice-workspace { width: 100%; min-width: 0; }
.typing-stats { display: flex; justify-content: center; align-items: baseline; gap: 2rem; margin: 0 0 1.3rem; font-family: var(--mono); }
.typing-stats > div { display: flex; align-items: baseline; gap: .5rem; }
.typing-stats dt { font-size: .7rem; color: var(--muted); }
.typing-stats dd { font-size: .85rem; margin: 0; color: var(--accent); font-variant-numeric: tabular-nums; }
.answer-form { background: var(--screen-bg); padding: .5rem 1rem 1rem; border-radius: 0 0 2px 2px; }
#answer { display: block; width: 100%; min-height: 56px; padding: .6rem .5rem; background: var(--screen-band); color: var(--screen-text); border: 0; border-bottom: 2px solid transparent; border-radius: 0; font-family: inherit; font-size: 1.25rem; font-weight: 600; line-height: 1.4; text-align: center; text-shadow: 0 1px 2px #000; caret-color: var(--screen-accent); }
#answer:focus { border-bottom-color: var(--screen-accent); }
#answer:focus-visible { outline: none; }
.answer-form :focus-visible { outline-color: var(--screen-accent); }
.answer-actions { display: flex; justify-content: center; gap: .6rem; margin-top: .4rem; }
.answer-actions button { min-height: 40px; min-width: 6rem; padding: .4rem 1.1rem; font-size: .85rem; }
.answer-actions button[type="submit"] { background: var(--screen-accent); color: var(--screen-bg); border-color: var(--screen-accent); }
.answer-actions button[type="submit"]:hover { background: color-mix(in srgb, var(--screen-accent) 85%, #fff); color: var(--screen-bg); }
.answer-actions #reveal { background: transparent; color: var(--screen-text); border-color: color-mix(in srgb, var(--screen-muted) 60%, transparent); }
.answer-actions #reveal:hover { background: rgb(255 255 255 / .1); color: var(--screen-text); border-color: var(--screen-muted); }
.practice-help { margin: 1.5rem auto 0; max-width: 66ch; color: var(--muted); font-size: .75rem; }
.practice-help summary { padding: .4rem 0; text-align: center; list-style-position: inside; }
.practice-help .hint { font-size: .8rem; line-height: 1.8; }
#follow-status { margin-top: 1rem; text-align: center; color: var(--accent); font-size: .8rem; }
#follow-status button { min-height: 32px; margin-left: .6rem; font-size: .75rem; }
#result:not(:empty), #revealed:not(:empty) { margin-top: 1.5rem; }
.practice-feedback { padding-top: 1.25rem; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.practice-feedback p { font-size: .875rem; color: var(--muted); }
.practice-feedback p.marks { font: 1rem/1.8 var(--mono); }
.practice-feedback button, .practice-feedback > a { margin: 0 .5rem .4rem 0; }
.practice-feedback > a { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: .55rem 1rem; border-radius: 6px; background: var(--accent); color: var(--on-accent); font-size: .875rem; }
.visual-keyboard { max-width: 620px; margin: 1.75rem auto 0; }
.keyboard-row { display: flex; justify-content: center; gap: .3rem; margin: .3rem 0; }
.visual-keyboard [data-key] { display: inline-flex; align-items: center; justify-content: center; flex: 0 1 2.6rem; min-width: 0; height: 2.2rem; border-radius: 4px; background: var(--surface); color: var(--muted); font: .65rem var(--mono); border: 1px solid var(--border); }
.visual-keyboard [data-key=" "] { flex-basis: 12rem; }
.visual-keyboard [data-key].is-pressed { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.ok { color: var(--success); } .bad { color: var(--error); } .bad:not(:has(.fix)) { text-decoration: line-through; } .bad s { text-decoration: line-through; } .bad .fix { color: var(--success); text-decoration: none; display: inline-block; }
.stat-sub .xp { display: inline-block; font-weight: 600; color: var(--text); }
.ok::before { content: "\2713 "; } .bad::before { content: "\2717 "; }
.miss { color: var(--missing); text-decoration: underline dotted; } .miss::before { content: "\2013 "; }
.marks > span { margin-right: .4rem; }
[role="alert"] { color: var(--error); font-size: .875rem; padding: .75rem 0; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; overflow-wrap: anywhere; }
td, th { padding: .75rem .5rem; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 400; }
tr.marking { background: var(--accent-soft); }
.credits { max-width: 34rem; margin: 1.5rem 0; font-size: 1rem; border-collapse: separate; border-spacing: 0 .15rem; }
.credits, .credits tbody { display: block; }
.credits thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.credits tbody tr { display: flex; align-items: baseline; gap: .6rem; padding: .35rem .25rem; }
.credits td { padding: 0; border: 0; }
.credits td:first-child { flex: 0 0 2rem; color: var(--muted); font: .8rem var(--mono); }
.credits td:nth-child(2) { order: 1; font-family: var(--display); font-weight: 600; font-size: 1.15rem; letter-spacing: .08em; text-transform: uppercase; }
.credits td:nth-child(3) { order: 3; font: .85rem var(--mono); color: var(--muted); white-space: nowrap; }
.credits tr::after { content: ""; order: 2; flex: 1; align-self: flex-end; border-bottom: 1px dotted color-mix(in srgb, var(--muted) 55%, transparent); margin-bottom: .35em; }
.credits tr.me td { color: var(--accent); }
.me { color: var(--accent); }
kbd { font: .85em var(--mono); color: var(--text); background: var(--surface); border-radius: 3px; padding: .15em .35em; }
@media (max-width: 1000px) { .site-nav { gap: 1.5rem; } .nav-user { display: none; } .nav-links { gap: 1rem; } }
@media (max-width: 760px) {
  .site-nav { width: calc(100% - 40px); min-height: 100px; padding: 16px 0 12px; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; }
  .brand { font-size: 1.2rem; gap: .5rem; }
  .brand-mark { width: 26px; }
  .nav-account { justify-content: end; gap: .75rem; font-size: .75rem; }
  .nav-account > a, .logout-form button { font-size: .75rem; }
  .nav-account .nav-signup { display: none; }
  .nav-account .stats { display: none; }
  .nav-links { grid-column: 1/-1; grid-row: 2; gap: 1.4rem; font-size: .75rem; }
  .appearance summary { min-height: 32px; }
  .appearance-panel { right: 0; }
  main { width: calc(100% - 40px); padding-top: 2rem; }
  .auth-page main { min-height: calc(100svh - 100px); padding: 2rem 0 3rem; }
  .page-heading { margin-bottom: 1.75rem; }
  .library-filters { gap: .75rem; }
  .library-filters label { flex: 1 1 130px; display: grid; gap: .3rem; }
  .library-filters select { min-width: 0; width: 100%; }
  body[data-mode="practice"] main { padding-top: .8rem; }
  .practice-heading { margin-bottom: .9rem; }
  .practice-heading h1 { font-size: 1.2rem; margin-top: .4rem; }
  .practice-toolbar { justify-content: start; gap: .4rem .9rem; padding: .45rem .65rem; margin-bottom: 1rem; }
  .practice-toolbar label { font-size: .7rem; gap: .35rem; }
  .practice-toolbar label:first-child { flex-basis: 100%; }
  .practice-layout { gap: 1rem; }
  .typing-stats { gap: 1rem; margin-bottom: .8rem; }
  .typing-stats > div { gap: .3rem; }
  .typing-stats dt { font-size: .65rem; }
  .typing-stats dd { font-size: .75rem; }
  .screen { padding-top: .5rem; }
  .answer-form { padding: .4rem .75rem .75rem; }
  #answer { min-height: 48px; font-size: 1.1rem; }
  .visual-keyboard [data-key] { height: 1.8rem; font-size: .6rem; }
}
@media (max-width: 380px) { .site-nav { width: calc(100% - 32px); column-gap: 8px; } .nav-account { gap: .6rem; } main { width: calc(100% - 32px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* Visible typing uses the upstream word/caret layout without a framework runtime. */
/* ponytail: 39rem = all page chrome plus the subtitle block; the screen is exactly as wide as the video, like practice */
body[data-mode="typing"] .screen { width: 100%; padding-top: .5rem; }
@media (max-width: 760px) { body[data-mode="typing"] main { --stage: 100%; } }
body[data-mode="typing"] .practice-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 1rem; margin-bottom: 1rem; }
body[data-mode="typing"] .practice-heading h1 { margin: 0; }
.typing-player { width: 100%; aspect-ratio: 16 / 9; background: var(--screen-bg); }
.typing-player #player, .typing-player iframe { width: 100%; height: 100%; border: 0; }
#typing-app .practice-toolbar { margin-bottom: .75rem; }
#typing-app .mode-help { margin: 0 0 .5rem; }
#typing-app #typing-mode-help { margin-bottom: .25rem; line-height: 1.45; font-size: .75rem; }
.typing-controls { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; font-size: .8rem; margin-top: .75rem; }
.typing-controls label { display: flex; align-items: center; gap: .5rem; }
.typing-controls select { padding: .4rem; }
.typing-seek-label { flex: 1; min-width: 130px; }
#typing-seek { width: 100%; padding: 0; accent-color: var(--accent); }
.typing-offset { display: flex; align-items: center; justify-content: center; gap: .35rem; flex-wrap: wrap; color: var(--muted); font: .75rem var(--mono); margin: 1rem 0; }
.typing-offset button { padding: .3rem .5rem; min-height: 36px; font-size: .7rem; }
.typing-offset output { min-width: 4rem; text-align: center; }
.typing-workspace { container-type: inline-size; position: relative; margin: 0; padding: .5rem 1.25rem 0; text-align: center; }
.screen:has(> .typing-workspace:not([hidden])) { padding-bottom: 1rem; }
.typing-line, .typing-next { font-size: clamp(1rem, 4.4cqi, 2rem); line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 1.8em; }
.typing-line { font-weight: 600; text-shadow: 0 1px 2px #000; color: var(--screen-muted); }
.typing-next { color: var(--screen-faint); font-size: clamp(.9rem, 3.96cqi, 1.8rem); min-height: 1.7em; margin: 0 0 .5rem; }
.typing-line [data-state="c"] { color: var(--screen-text); }
.typing-line [data-state="x"], .typing-line [data-state="e"] { color: var(--screen-error); background: color-mix(in srgb, var(--screen-error) 15%, transparent); }
.typing-line [data-state="m"] { color: var(--screen-missing); text-decoration: underline; text-decoration-style: dotted; }
.typing-workspace .hint { margin: 0 0 .4rem; font-size: .7rem; color: var(--screen-muted); }
.typing-workspace .session-progress { margin-bottom: .25rem; color: var(--screen-muted); }
.typing-workspace .session-progress progress { background: color-mix(in srgb, var(--screen-muted) 30%, transparent); accent-color: var(--screen-accent); }
.typing-workspace .session-progress progress::-webkit-progress-bar { background: color-mix(in srgb, var(--screen-muted) 30%, transparent); }
.typing-workspace .session-progress progress::-webkit-progress-value { background: var(--screen-accent); }
.typing-workspace .session-progress progress::-moz-progress-bar { background: var(--screen-accent); }
.typing-caret { position: relative; }
.typing-caret::before { content: ''; position: absolute; left: -1px; top: 0; width: 2px; height: 1.25em; background: var(--screen-accent); }
.typing-unrevealed { visibility: hidden; }
.typing-surface { position: relative; margin-bottom: .5rem; }
.typing-surface:focus-within { box-shadow: 0 2px 0 var(--screen-accent); }
.typing-capture { position: absolute; inset: 0; display: block; width: 100%; height: 100%; min-height: 0; max-height: none; margin: 0; padding: 0; resize: none; opacity: 0; cursor: text; font-size: 16px; }
.typing-capture:disabled { pointer-events: none; }
#typing-status, #typing-save-status { color: var(--muted); font-size: .8rem; }
#typing-summary { padding: 1rem 0; border-top: 1px solid var(--border); }
#typing-keyboard .keyboard-row { display: flex; justify-content: center; gap: .25rem; margin: .25rem auto; max-width: 680px; }
#typing-keyboard [data-key] { padding: .45rem .15rem; min-width: 0; border: 1px solid var(--border); border-radius: 4px; text-align: center; font: .6rem var(--mono); color: var(--muted); }
#typing-keyboard [data-key].next { border-color: var(--accent); color: var(--accent); }
#typing-keyboard [data-key].pressed-correct { background: var(--success); color: var(--bg); }
#typing-keyboard [data-key].pressed-wrong { background: var(--error); color: var(--bg); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
#transcript-tools { border-block: 1px solid var(--border); padding: 0 0 1.5rem; margin: 1.5rem 0 2rem; }
#transcript-tools textarea { display: block; width: 100%; margin-top: .5rem; }
.transcript-token { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin: 1rem 0; }
#audio-sync-progress { width: min(100%, 450px); accent-color: var(--accent); }
@media (max-width: 600px) { .typing-controls { gap: .5rem; } #typing-keyboard [data-key] { font-size: .45rem; padding-block: .5rem; } }
.typing-warning { padding: .7rem 1rem; border-left: 2px solid var(--missing); background: var(--accent-soft); color: var(--text); font-size: .85rem; }
#typing-session-notice { color: var(--accent); font-size: .8rem; }
.video-dictation-link { display: inline-block; color: var(--muted); font-size: .75rem; margin: .4rem 0 0; }
.video-dictation-link:hover { color: var(--accent); }
.video-card .video-delete { display: block; min-height: 24px; margin: .25rem 0 0; padding: 0; border: 0; background: none; color: var(--muted); font-size: .75rem; font-weight: 400; }
.video-card .video-delete:hover { background: none; color: var(--error); }

/* Put the exercise first; explanations and repairs stay close to their controls. */
.video-typing-link { font-size: .8rem; margin-top: .75rem; }
.mode-help { text-align: center; margin: -.4rem 0 1rem; }
.timing-settings { margin: .8rem 0; color: var(--muted); font-size: .75rem; }
.timing-settings summary { cursor: pointer; padding: .5rem 0; }
.timing-settings .hint { font-size: .75rem; }
.timing-settings .typing-offset { justify-content: start; margin: .5rem 0; }
.session-progress { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; color: var(--muted); font: .7rem var(--mono); }
.session-progress label { flex-shrink: 0; }
.session-progress progress { display: block; width: 100%; min-width: 0; height: 4px; border: none; border-radius: 2px; overflow: hidden; accent-color: var(--accent); background: var(--surface-soft); }
.session-progress progress::-webkit-progress-bar { background: var(--surface-soft); }
.session-progress progress::-webkit-progress-value { background: var(--accent); }
.session-progress progress::-moz-progress-bar { background: var(--accent); }
#typing-summary h3 { font-size: 1rem; font-weight: 500; margin-top: 1.5rem; }
.typing-review-list { list-style: none; margin: 1rem 0; padding: 0; max-height: 28rem; overflow-y: auto; }
.typing-review-list li { padding: 1rem 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.typing-review-list strong { color: var(--muted); font: .75rem var(--mono); }
.typing-review-list p { margin: .6rem 0; }
.review-target { font: 1rem/1.7 var(--mono); }
.typing-review-list button { margin: .3rem 0; min-height: 42px; background: var(--surface-soft); color: var(--text); font-size: .8rem; }
.session-next-actions { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; padding: .5rem 0; font-size: .85rem; }
@media (max-width: 600px) { .mode-help { text-align: left; } .session-progress { gap: .65rem; font-size: .65rem; } }

/* Plain-language toolbar descriptions, key hints, library rows. */
.practice-toolbar + .toolbar-help { margin-top: -1.1rem; }
.toolbar-help { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 1.25rem; margin: .35rem auto 1rem; padding: 0; max-width: 46rem; text-align: center; color: var(--muted); font-size: .75rem; line-height: 1.7; }
.typing-workspace .typing-keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 1rem; margin: 0; line-height: 1.3; color: var(--screen-muted); font-size: .7rem; }
.typing-keys kbd { background: rgb(255 255 255 / .12); color: var(--screen-text); }
@keyframes caret-pulse { from { opacity: 1; } to { opacity: .15; } }
.typing-workspace.is-idle .typing-caret::before { animation: caret-pulse .4s ease-in-out infinite alternate; }
.section-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.section-row h2 { margin-top: 0; }
.section-row a { color: var(--muted); font-size: .8rem; }
.your-videos { margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
.verify-note { padding: .7rem 1rem; border-left: 2px solid var(--accent); background: var(--accent-soft); color: var(--text); font-size: .85rem; overflow-wrap: anywhere; }
.empty-state { position: relative; overflow: hidden; margin: 1.5rem 0 2rem; padding: 3rem 1.5rem; border-radius: 2px; background: var(--screen-bg); color: var(--screen-text); }
.empty-state::before { content: ""; position: absolute; inset: 0; background: url("/static/media/scene-empty.webp") center / cover; opacity: .35; }
.empty-copy { position: relative; display: grid; justify-items: center; gap: .25rem; max-width: 34rem; margin: auto; }
.empty-copy p { margin: 0 0 .5rem; color: var(--screen-text); text-shadow: 0 1px 2px #000; }
.empty-copy .button-link { margin-top: .5rem; background: var(--screen-accent); color: var(--screen-bg); }
.empty-copy .button-link:hover { background: color-mix(in srgb, var(--screen-accent) 85%, #fff); color: var(--screen-bg); }
.empty-state :focus-visible { outline-color: var(--screen-accent); }

/* Results emphasis: one dominant number, muted secondary row. */
.result-stats .acc, .stat-hero strong, .stat-hero .acc { font: 600 clamp(2.4rem, 8vw, 3.5rem)/1.1 var(--display); color: var(--accent); vertical-align: -.1em; }
.result-stats { margin-bottom: .25rem; }
.result-stats + .stat-sub { margin: 0 0 .75rem; }
.stat-hero { margin: 1rem 0 .25rem; color: var(--muted); }
.stat-sub { margin: 0 0 1.5rem; color: var(--muted); font-size: .875rem; }
.cta-quiet { display: inline-block; padding: .3rem .75rem; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); transition: color 120ms ease-out, border-color 120ms ease-out, transform 120ms ease-out; }
.cta-quiet::after { content: " \2192"; }
.cta-quiet:hover { color: var(--accent); border-color: var(--accent); }

/* Micro-interactions: all motion lives here, <=400ms, off under reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  /* only the char just typed (sits right before the caret) animates; spans are rebuilt only when the line changes */
  .typing-line[data-line="0"] { animation: band-in-a 240ms ease-out; }
  .typing-line[data-line="1"] { animation: band-in-b 240ms ease-out; }
  .typing-line [data-state="c"]:has(+ .typing-caret) { animation: ink 120ms ease-out; }
  .typing-line [data-state="x"]:has(+ .typing-caret) { position: relative; animation: nudge 180ms ease-out; }
  .typing-caret::before { animation: blink 1s steps(1) 500ms infinite; }
  .marks > span { animation: word-in 200ms ease-out backwards; }
  .marks > span:nth-child(2) { animation-delay: 30ms; } .marks > span:nth-child(3) { animation-delay: 60ms; }
  .marks > span:nth-child(4) { animation-delay: 90ms; } .marks > span:nth-child(5) { animation-delay: 120ms; }
  .marks > span:nth-child(6) { animation-delay: 150ms; } .marks > span:nth-child(7) { animation-delay: 180ms; }
  .marks > span:nth-child(8) { animation-delay: 210ms; } .marks > span:nth-child(9) { animation-delay: 240ms; }
  .marks > span:nth-child(n+10) { animation-delay: 270ms; }
  .stat-sub .xp { animation: pulse 400ms ease-out 300ms; }
}
@keyframes band-in-a { from { opacity: 0; transform: translateY(6px); } }
@keyframes band-in-b { from { opacity: 0; transform: translateY(6px); } }
@keyframes ink { from { color: var(--screen-muted); } }
@keyframes nudge { from { top: -2px; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes word-in { from { opacity: 0; } }
@keyframes pulse { 40% { transform: scale(1.15); color: var(--accent); } }
.stage-center :is(#typing-status, #typing-session-notice) { text-align: center; margin: .5rem 0 0; }
/* Typing focus: the page title and notices step aside so the video can use the height. */
body:has(#typing-app.is-typing) main > :is(.practice-heading, p) { display: none; }

/* Phones: show the demo and ask for a laptop (typing needs a keyboard). Desktop test browsers have a fine pointer, so they are unaffected. */
.phone-gate { display: none; }
@media (pointer: coarse) and (max-width: 600px) {
  body[data-mode] .phone-gate { display: flex; flex-direction: column; align-items: center; gap: 1rem; text-align: center; min-height: 100svh; padding: 2rem 1.25rem; box-sizing: border-box; background: var(--bg); color: var(--text); }
  body[data-mode] .phone-gate h1 { margin: 0; font-size: 1.6rem; }
  body[data-mode] .phone-gate p { margin: 0; max-width: 28rem; color: var(--muted); }
  body[data-mode] .phone-gate video { width: 100%; max-width: 28rem; aspect-ratio: 16 / 9; border-radius: 12px; border: 1px solid var(--border); background: #000; }
  body[data-mode] .phone-gate button { font: inherit; padding: .7rem 1.2rem; border: 0; border-radius: 8px; background: var(--accent); color: var(--on-accent); }
  body[data-mode] > :is(.skip-link, .site-header, main) { display: none; }
}
