/* Sawubona - the app's layout on the field-journal paper kit.
   assets/art/paper.css (generated) holds the surfaces, marks and --j-* tokens;
   this file places them: the desk and its collage, the sheet, the open notebook
   (camera | practice), the lesson contents, Plate I, the card drawer and About. */

/* ------------------------------------------------------------------ tokens */

:root {
  color-scheme: light;
  --link: var(--j-forest);
  --done: var(--j-forest);
  --bar: var(--j-forest);
  --ph-bg: radial-gradient(ellipse at 50% 40%, #eff1e8, #dce0d2 74%);
  --ph-ink: #3b4637;
  --mode-on: #2e4535;
  --mark-filter: none;
  --sketch-filter: none;
  --sketch-blend: multiply;
  --card-filter: none;
  --record: #a8472f;
  --hand-art-opacity: 1;
  /* the drawn signer (src/figure.js reads these from its canvas) */
  --figure-ink: #1f2a1e;
  --figure-cloth: #3f5640;
  --figure-wash: #9fae8a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --link: #b3c4a0;
    --done: #a9c49a;
    --bar: #9aab87;
    --ph-bg: radial-gradient(ellipse at 50% 40%, #2c372f, #1b231d 74%);
    --ph-ink: #d3ccb8;
    --mode-on: #405c48;
    --mark-filter: invert(.9) sepia(.2) hue-rotate(180deg);
    --sketch-filter: invert(1) hue-rotate(180deg);
    --sketch-blend: screen;
    --card-filter: brightness(.9);
    --hand-art-opacity: .85;
    --figure-ink: #ede6d4; --figure-line: #141a14; --figure-light: #efe7d6; --figure-cloth: #56715a;
    --figure-wash: #55694f; --figure-skin: #c9956d; --figure-skin-shade: #a67655;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --link: #b3c4a0;
  --done: #a9c49a;
  --bar: #9aab87;
  --ph-bg: radial-gradient(ellipse at 50% 40%, #2c372f, #1b231d 74%);
  --ph-ink: #d3ccb8;
  --mode-on: #405c48;
  --mark-filter: invert(.9) sepia(.2) hue-rotate(180deg);
  --sketch-filter: invert(1) hue-rotate(180deg);
  --sketch-blend: screen;
  --card-filter: brightness(.9);
  --hand-art-opacity: .85;
  --figure-ink: #ede6d4; --figure-line: #141a14; --figure-light: #efe7d6; --figure-cloth: #56715a;
  --figure-wash: #55694f; --figure-skin: #c9956d; --figure-skin-shade: #a67655;
}

/* ------------------------------------------------------------------- basics */

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--j-ink);
  font: 17px/1.55 var(--j-font-body);
  overflow-x: hidden;
}
h1, h2, h3, p, figure, ol, ul { margin: 0; }
a { color: var(--link); text-decoration-color: color-mix(in srgb, var(--j-mustard) 80%, transparent);
  text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--j-mustard); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:where(a, button, input, [tabindex]):focus-visible {
  outline: 3px solid var(--j-focus);
  outline-offset: 3px;
  border-radius: 3px;
}
.j-btn:focus-visible { border-radius: 999px; }
strong, b { font-weight: 700; }
kbd {
  display: inline-block;
  padding: 0 6px;
  font: 700 13px/20px var(--j-font-type);
  color: var(--j-ink);
  background: var(--j-page);
  border: 1px solid var(--j-pencil);
  border-bottom-width: 2px;
  border-radius: 4px;
  vertical-align: 1px;
}
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 20;
  padding: 10px 16px;
  color: var(--j-cream);
  background: var(--j-ink);
  border-radius: 4px;
  font-weight: 600;
}
.skip-link:focus { top: 12px; }
.pencil { color: var(--j-pencil); }
.small { font-size: 14.5px; line-height: 1.5; }
.tag {
  display: inline-block;
  padding: 2px 5px 1px;
  font: 700 10px/1.2 var(--j-font-body);
  letter-spacing: .14em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  border-radius: 3px;
  vertical-align: 2px;
}
.text-btn {
  padding: 4px 2px;
  background: none;
  border: 0;
  color: var(--link);
  font: 600 15.5px/1.4 var(--j-font-body);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--j-mustard) 80%, transparent);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.text-btn:hover { text-decoration-color: var(--j-mustard); }
.line-input {
  min-width: 0;
  padding: 6px 2px 5px;
  background: transparent;
  border: 0;
  border-bottom: 1.5px solid var(--j-pencil);
  border-radius: 0;
  font: 16px/1.4 var(--j-font-type);
  color: var(--j-ink);
}
.line-input::placeholder { color: var(--j-pencil); opacity: 1; }
.line-input:focus { border-bottom-color: var(--j-ink); }

/* Tabs show what belongs to them: data-only lists the tabs an element is part of. */
body[data-tab="signs"] [data-only]:not([data-only~="signs"]),
body[data-tab="spell"] [data-only]:not([data-only~="spell"]),
body[data-tab="dict"] [data-only]:not([data-only~="dict"]),
body[data-tab="about"] [data-only]:not([data-only~="about"]),
body[data-tab="sentences"] [data-only]:not([data-only~="sentences"]) { display: none !important; }

/* ------------------------------------------------------ the desk and collage */

.desk {
  position: relative;
  max-width: 1440px;
  margin: 0 auto;
  padding: 118px 180px 96px;
}
/* The deckle's edge strips overlap at the corners and leave hairline ticks
   there; a paper corner is never that square anyway. */
.j-sheet::before {
  clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 16px, 100% calc(100% - 16px),
    calc(100% - 16px) 100%, 16px 100%, 0 calc(100% - 16px), 0 16px);
}
.sheet {
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 44px 64px 40px;
}
/* The collage sits behind the sheet: only what lies in the margins shows. */
.collage, .margin-notes { position: static; }
.c { position: absolute; z-index: 0; margin: 0; }
.c-table { top: 4px; right: 22px; width: 440px; }
.c-protea { top: 290px; left: 2px; width: 250px; }
.c-koppies { bottom: -6px; left: -36px; width: 330px; }
.c-king { bottom: 132px; right: -6px; width: 280px; }
.margin-notes .c { z-index: 2; }
.c-green {
  top: 142px; left: 18px; width: 152px;
  --tilt: -3deg;
  padding: 16px 14px;
  font: 600 10.5px/1.7 var(--j-font-body);
  letter-spacing: .2em;
  text-transform: uppercase;
}
.c-sticky { top: 520px; right: 22px; width: 148px; --tilt: 2deg; font: 14px/1.4 var(--j-font-type); }
.c-sticky .j-tape { position: absolute; top: -12px; left: 50%; margin-left: -46px; --tape-w: 92px; --tape-h: 24px; --tilt: -5deg; }
.c-kraft { top: 1040px; left: 24px; width: 146px; --tilt: 2.5deg; font: 13.5px/1.45 var(--j-font-type); }
.c-cream { bottom: 590px; right: 30px; width: 142px; --tilt: -2deg; font: 13px/1.45 var(--j-font-type); }

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

.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px 24px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 44px; height: 44px; filter: var(--mark-filter); }
.wordmark {
  font: 700 40px/1 var(--j-font-display);
  font-variation-settings: "opsz" 72, "SOFT" 60;
  letter-spacing: -.01em;
}
.tagline { margin-top: 6px; font-size: 10.5px; letter-spacing: .26em; color: var(--j-ink-soft); }
.tabs { display: flex; flex-wrap: wrap; gap: 6px 26px; margin-bottom: 2px; }
.tab {
  padding: 4px 0 5px;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  font: 500 18px/1.2 var(--j-font-body);
  color: var(--j-ink);
}
.tab:hover { border-bottom-color: color-mix(in srgb, var(--j-mustard) 55%, transparent); }
.tab[aria-selected="true"] { font-weight: 700; border-bottom-color: var(--j-mustard); }

.hero { max-width: 780px; margin: 46px auto 38px; text-align: center; }
.hero h1 {
  font: 800 64px/1.02 var(--j-font-display);
  font-variation-settings: "opsz" 144, "SOFT" 100;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.hero-sub { margin-top: 14px; font-size: 21px; color: var(--j-ink-soft); text-wrap: balance; }
.hero-counts { margin-top: 14px; color: var(--j-pencil); font-size: 13.5px; }
/* With the camera on, the headline steps aside to one line, so the word, Record
   and the stamped result fit on a laptop screen. */
body.live :is(.hero[data-only="signs"], .hero[data-only="spell"]) { margin: 8px auto 22px; }
body.live :is(.hero[data-only="signs"], .hero[data-only="spell"]) h1 { font-size: 30px; font-weight: 700; }
body.live :is(.hero[data-only="signs"], .hero[data-only="spell"]) :is(.hero-sub, .hero-counts) { display: none; }

/* ------------------------------------------------------ the notebook pages */

.page-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font: 700 14px/1.2 var(--j-font-type);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.page-label .j-icon { width: 22px; height: 22px; }
.page-title {
  font: 700 30px/1.1 var(--j-font-display);
  font-variation-settings: "opsz" 72, "SOFT" 50;
  letter-spacing: -.01em;
}
.page-sub { margin: 8px 0 0; font-size: 15.5px; line-height: 1.5; color: var(--j-ink-soft); }
.step-title {
  font: 700 14px/30px var(--j-font-type);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.step-text { font-size: 16.5px; line-height: 30px; }

/* -------- left page: the camera, as a mounted photo */

.spread { align-items: start; }
/* The practice page runs longer than the camera page: the camera stays in view beside it. */
.camera-page { position: sticky; top: 8px; padding-top: 34px; }
@media (max-width: 760px) { .camera-page { position: relative; top: auto; } }
.cam-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding: 4px 10px 3px;
  font: 400 12.5px/1 var(--j-font-type);
  letter-spacing: .04em;
  text-transform: none;
  color: var(--j-pencil);
  border: 1.5px solid currentColor;
  border-radius: 999px;
}
.cam-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .6; }
.cam-state.live { color: var(--j-stamp-match); }
.cam-state.live::before { opacity: 1; }

.photo { margin: 0 4px; padding: 12px 12px 8px; }
.video-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--ph-bg);
  outline: 3px solid transparent;
  outline-offset: -3px;
}
body.live .video-wrap { background: #141a15; }
#video, #overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* mirrored for the person signing; tracking uses the raw frame */
}
body.recording .video-wrap { outline-color: var(--record); }

.camera-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 16px 20px;
  color: var(--ph-ink);
  background: var(--ph-bg);
  transition: opacity .35s ease;
}
body.live .camera-placeholder { opacity: 0; pointer-events: none; }
.framing-sketch { width: 86%; max-width: 380px; height: auto; overflow: visible; }
.sketch-lines path { vector-effect: non-scaling-stroke; }
.sketch-lines .leader { opacity: .8; }
.sketch-hand { filter: var(--sketch-filter); mix-blend-mode: var(--sketch-blend); opacity: .92; }
.sketch-notes text { font: 700 13px var(--j-font-type); letter-spacing: .03em; }
.placeholder-title {
  margin-top: 6px;
  font: italic 500 19px/1.2 var(--j-font-display);
  font-variation-settings: "opsz" 36, "SOFT" 100;
}
.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 4px 9px 3px;
  font: 700 12px/1.2 var(--j-font-type);
  letter-spacing: .06em;
  color: var(--j-ink);
  background: color-mix(in srgb, var(--j-photo) 88%, transparent);
  border-radius: 3px;
  box-shadow: 0 1px 2px rgb(0 0 0 / .15);
}
body:not(.live) .badge { display: none; }
body.recording .badge { color: #fbf6ea; background: var(--record); }
.photo-caption {
  margin-top: 8px;
  text-align: center;
  font: 12.5px/1.3 var(--j-font-type);
  color: var(--j-pencil);
}

.cam-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 26px;
}
.accuracy-mode, .u-listen { display: flex; align-items: flex-start; gap: 7px; font-size: 14px; line-height: 1.25; }
.accuracy-mode small { display: block; color: var(--j-pencil); font: 12px/1.3 var(--j-font-type); }
.accuracy-mode input, .u-listen input { margin-top: 2px; flex: 0 0 auto; }
.accuracy-mode:has(input:disabled) { opacity: .55; }
.record-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.record-btn { background: var(--record); }
.record-btn:hover:not(:disabled) { background: #8f3b26; }
.record-btn:disabled {
  color: var(--j-pencil);
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--j-pencil);
}
body:not(.live) .space-hint { display: none; }
.space-hint { font-size: 15px; color: var(--j-pencil); }
body.recording .record-btn .j-icon { animation: rec-pulse 1s ease-in-out infinite; }
@keyframes rec-pulse { 50% { opacity: .35; } }
.framing-hint { margin-top: 20px; }
.cam-word { display: none; }
.result, .verdict { scroll-margin: 16px; }
.framing-hint span { min-height: 2.9em; }
.prep { max-width: 330px; margin: 30px 0 0 14px; padding: 24px 22px 18px; }
.prep .j-tape { position: absolute; top: -11px; left: 38px; --tape-w: 86px; --tape-h: 22px; --tilt: -6deg; }
.prep-title { margin-bottom: 6px; }
.prep ul { list-style: none; padding: 0; font: 14.5px/1.45 var(--j-font-type); }
.prep li { position: relative; padding-left: 18px; margin: 4px 0; }
.prep li::before { content: "\2013"; position: absolute; left: 0; }

/* -------- right page: the practice, on lined paper */

.work-page { --line-gap: 30px; --line-top: 34px; padding-top: 34px; }
.page-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.mode {
  padding: 8px 13px 7px;
  font: 700 12.5px/1 var(--j-font-type);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--j-ink);
  background: var(--j-page);
  border: 1.5px solid color-mix(in srgb, var(--j-ink) 35%, transparent);
  border-radius: 4px 4px 2px 2px;
}
.mode:hover { border-color: var(--j-ink); }
.mode[aria-pressed="true"] { color: #f4efe3; background: var(--mode-on); border-color: var(--mode-on); }

.lesson-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; line-height: 30px; }
.lesson-line a { font-weight: 700; font-size: 16px; }
.lesson-line .pencil { font-size: 15px; }
.lesson-line .change-link { font-size: 14.5px; font-weight: 600; }

.steps { list-style: none; padding: 0; margin: 6px 0 0; }
.step { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 0 14px; padding: 0 0 12px; }
.step-n {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  font: 700 15px/1 var(--j-font-type);
  border: 1.5px solid currentColor;
  border-radius: 50%;
  background: var(--j-page);
}
.step + .step { position: relative; }
.step + .step::before {           /* the pencil thread joining the steps */
  content: "";
  position: absolute;
  left: 15px;
  top: -12px;
  height: 12px;
  border-left: 1.5px dashed color-mix(in srgb, var(--j-pencil) 70%, transparent);
}
body[data-step="watch"] .step[data-step-name="watch"] .step-n,
body[data-step="sign"] .step[data-step-name="sign"] .step-n,
body[data-step="see"] .step[data-step-name="see"] .step-n {
  color: #1f2a1e;
  background: var(--j-mustard);
  border-color: var(--j-mustard);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--j-mustard) 30%, transparent);
}

.quiz-word {
  margin: 4px 0 6px;
  font: 700 54px/1.02 var(--j-font-display);
  font-variation-settings: "opsz" 144, "SOFT" 50;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
}
.quiz-word .gloss { display: block; }
.quiz-word .gloss-note { display: block; margin-top: 4px; font: 14px/1.3 var(--j-font-type); color: var(--j-pencil); letter-spacing: .04em; }
.quiz-word.empty { font: italic 20px/1.4 var(--j-font-body); color: var(--j-pencil); }
.quiz-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 22px; line-height: 30px; }
.watch-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16.5px; }
.watch-link .j-icon { width: 20px; height: 20px; }
.watch-link .ext { margin-left: 2px; font-weight: 400; }

.result { min-height: 30px; }
.verdict {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
  gap: 8px;
  margin: 8px 0 10px;
}
.verdict .j-stamp { font-size: 19px; margin: 6px 2px; }
.verdict-text { font: 15px/1.6 var(--j-font-type); }
.verdict-text strong { font-weight: 700; }
.small-btn { margin-top: 4px; min-height: 40px; padding: 7px 16px 7px 18px; font-size: 15px; }
.small-btn .j-icon { width: 20px; height: 20px; }
.log { list-style: none; padding: 0; font: 15px/30px var(--j-font-type); }
.log-n { color: var(--j-pencil); }
.log-word { font-weight: 700; }
.log-kind.k-yes { color: var(--j-stamp-match); }
.log-kind.k-close { color: var(--j-stamp-close); }
.log-kind.k-no { color: var(--j-stamp-not); }
#quiz-score { line-height: 30px; }

/* What did I sign? - the three nearest, drawn as ruled bars */
.candidates { list-style: none; padding: 0; margin: 4px 0 6px; }
.candidates li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16% auto auto;
  align-items: center;
  gap: 14px;
  min-height: 42px;
  font: 18px/1.2 var(--j-font-body);
}
.candidates li.best .cand-label { font: 700 27px/1.1 var(--j-font-display); font-variation-settings: "opsz" 96, "SOFT" 50; }
.cand-label { overflow-wrap: break-word; }   /* between words, not mid-word */
.bar { height: 9px; background: color-mix(in srgb, var(--j-pencil) 22%, transparent); border-radius: 5px 3px 4px 2px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--bar); border-radius: inherit; }
.candidates li:not(.best) .bar > span { opacity: .55; }
.cand-dist { font: 700 13px/30px var(--j-font-type); letter-spacing: .06em; text-transform: uppercase; }
#guess-note, #phrase-note { line-height: 1.7; margin-top: 6px; }
.cand-yes { font-size: 14px; white-space: nowrap; }
/* How sure a guess is: a word in the note, never colour alone */
.sure--sure { color: var(--done); }
.sure--unsure { color: var(--record); }

/* A phrase: the signs found, in order */
.phrase-list { list-style: none; counter-reset: sign; padding: 0; margin: 4px 0; }
.phrase-list li {
  counter-increment: sign;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 12px;
  padding: 3px 0;
}
.phrase-list li::before { content: counter(sign) "."; min-width: 1.4em; font: 700 15px/1 var(--j-font-type); color: var(--j-pencil); }
.phrase-word { font: 700 26px/1.2 var(--j-font-display); font-variation-settings: "opsz" 72, "SOFT" 50; }
.phrase-alts { font: 14px/1.4 var(--j-font-type); color: var(--j-pencil); }

/* -------- fingerspelling on the right page */

.spell-target, .spell-free { margin-top: 4px; }
.spell-word {
  display: flex;
  flex-wrap: wrap;
  gap: 0 .12em;
  margin: 2px 0 4px;
  font: 800 52px/1.15 var(--j-font-display);
  font-variation-settings: "opsz" 144, "SOFT" 60;
}
.spell-word > span { position: relative; min-width: .62em; text-align: center; }
.spell-word .todo { color: var(--j-pencil); font-weight: 400; }
.spell-word .done { color: var(--done); }
.spell-word .current { color: var(--j-ink); }
.spell-word .current::after {
  content: "";
  position: absolute;
  left: 8%; right: 8%; bottom: .02em;
  height: 5px;
  border-radius: 3px;
  background: var(--j-mustard);
}
.spell-word .skip { color: var(--j-pencil); font-style: italic; font-weight: 300; }
.spell-hint { min-height: 60px; font: 15px/30px var(--j-font-type); }
.spell-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 4px; }
.spell-controls .line-input { flex: 1 1 160px; max-width: 240px; }
.free-row { display: flex; align-items: flex-end; gap: 16px; margin-top: 6px; }
.spell-buffer {
  flex: 1;
  min-height: 60px;
  font: 700 40px/60px var(--j-font-type);
  letter-spacing: .18em;
  overflow-wrap: anywhere;
  border-bottom: 1.5px solid var(--j-pencil);
}

.spell-readout {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) 112px;
  align-items: center;
  gap: 18px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1.5px dashed color-mix(in srgb, var(--j-pencil) 55%, transparent);
}
.spell-dial { position: relative; width: 116px; height: 116px; }
.spell-dial svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.dial-track { fill: none; stroke: color-mix(in srgb, var(--j-pencil) 24%, transparent); stroke-width: 7; }
.dial-fill {
  fill: none;
  stroke: var(--bar);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
  transition: stroke-dashoffset .2s ease;
}
.spell-dial.unsure .dial-fill { stroke: var(--j-mustard); }
.spell-letter {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 800 52px/1 var(--j-font-display);
  font-variation-settings: "opsz" 144, "SOFT" 60;
}
.spell-meta .step-title { line-height: 1.35; margin-bottom: 4px; }
.spell-confidence { font: 600 19px/1.3 var(--j-font-display); margin-top: 2px; }
#spell-alts { margin-top: 4px; font-family: var(--j-font-type); font-size: 13.5px; }
.spell-guide { margin: 0; text-align: center; }
.spell-guide img { width: 112px; height: 112px; margin: 0 auto; }
.spell-guide figcaption { font: 12px/1.3 var(--j-font-type); margin-top: 2px; }
.spell-guide figcaption b { font: 700 16px/1 var(--j-font-display); margin-right: 3px; }

/* ------------------------------------------------------ below the notebook */

.how { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin: 58px 0 8px; }
.how-card { width: 212px; padding: 22px 18px 18px; text-align: center; }
.how-card .j-icon { width: 30px; height: 30px; }
.how-card h2 { margin: 6px 0 2px; font: 700 21px/1.2 var(--j-font-display); font-variation-settings: "opsz" 48, "SOFT" 50; }
.how-card p { font-size: 14.5px; line-height: 1.4; }
.how-arrow { width: 78px; height: 30px; color: var(--j-pencil); flex: none; }

/* The lesson contents: a second, smaller notebook */
.lessons { margin-top: 58px; grid-template-columns: 1.5fr 1fr; }
.lessons.j-notebook::after { left: 60%; }
.contents-page { padding-left: 34px; padding-right: 32px; }
.contents {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  columns: 2;
  column-gap: 26px;
}
.contents li { break-inside: avoid; }
.lesson-btn {
  position: relative;
  display: flex;
  align-items: baseline;
  width: 100%;
  padding: 3px 0 3px 16px;
  background: none;
  border: 0;
  text-align: left;
  font: 15.5px/24px var(--j-font-body);
  color: var(--j-ink);
}
.lesson-name { min-width: 0; }
.lesson-btn .leader {
  flex: 1 1 6px;
  min-width: 6px;
  margin: 0 5px;
  border-bottom: 2px dotted color-mix(in srgb, var(--j-pencil) 70%, transparent);
  transform: translateY(-5px);
}
.lesson-count { font: 13px/24px var(--j-font-type); color: var(--j-pencil); }
.lesson-btn .tag { margin-left: 4px; font-size: 9px; color: var(--j-pencil); }
.lesson-btn:hover .lesson-name { text-decoration: underline; text-decoration-color: var(--j-mustard); text-underline-offset: 3px; }
.lesson-btn[aria-pressed="true"] .lesson-name {
  font-weight: 700;
  background: linear-gradient(transparent 55%, color-mix(in srgb, var(--j-mustard) 55%, transparent) 55% 92%, transparent 92%);
}
.lesson-btn[aria-pressed="true"]::before {
  content: "\2192";
  position: absolute;
  left: 0;
  font: 700 15px/24px var(--j-font-type);
}
.lesson-btn.own .lesson-name { font-style: italic; }
.lesson-group {
  position: relative;
  display: flex;
  align-items: baseline;
  padding: 3px 0 3px 16px;
  font: 15.5px/24px var(--j-font-body);
}
.lesson-group .leader {
  flex: 1 1 6px;
  min-width: 6px;
  margin: 0 5px;
  border-bottom: 2px dotted color-mix(in srgb, var(--j-pencil) 70%, transparent);
  transform: translateY(-5px);
}
.lesson-group .tag { margin-left: 4px; font-size: 9px; color: var(--j-pencil); }
.lesson-parts { display: flex; gap: 3px; align-self: center; }
.part-btn {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  font: 700 12.5px/1 var(--j-font-type);
  color: var(--j-ink);
  background: none;
  border: 1.5px solid color-mix(in srgb, var(--j-pencil) 75%, transparent);
  border-radius: 50%;
}
.part-btn:hover { border-color: var(--j-ink); }
.part-btn[aria-pressed="true"] { color: #1f2a1e; background: var(--j-mustard); border-color: var(--j-mustard); }
.part-btn:focus-visible { border-radius: 50%; }
.lesson-group:has([aria-pressed="true"]) > .lesson-name {
  font-weight: 700;
  background: linear-gradient(transparent 55%, color-mix(in srgb, var(--j-mustard) 55%, transparent) 55% 92%, transparent 92%);
}
.lesson-group:has([aria-pressed="true"])::before {
  content: "\2192";
  position: absolute;
  left: 0;
  font: 700 15px/24px var(--j-font-type);
}
.footnote { margin-top: 18px; font-size: 13.5px; color: var(--j-pencil); }

.words-page { --line-gap: 30px; --line-top: 34px; padding-top: 34px; }
/* One ruled line per line of title, so a wrapped title stays on the rules. */
.words-page .page-title { line-height: 30px; margin: 15px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 10px 10px; margin: 6px 0 10px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 2px 1px 10px;
  font: 700 13.5px/24px var(--j-font-type);
  letter-spacing: .05em;
  color: var(--j-ink);
  background: var(--j-kraft);
  border-radius: 2px;
  box-shadow: 0 1px 1px rgb(var(--j-shadow) / .2);
  transform: rotate(-.8deg);
}
.chip:nth-child(3n + 2) { transform: rotate(.7deg); }
.chip:nth-child(3n) { transform: rotate(-.3deg); }
.chip button {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  background: none;
  border: 0;
  font: 18px/1 var(--j-font-body);
  color: var(--j-ink-soft);
}
.chip button:hover { color: var(--j-stamp-not); }
#lesson-note { line-height: 30px; }
.add-word { margin-top: 24px; }
.add-word > label { display: block; }
.search-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 4px; }
.search-row .j-icon { width: 20px; height: 20px; color: var(--j-pencil); }
.search-row .line-input { flex: 1 1 160px; }
.lesson-cleared { display: inline-flex; align-items: baseline; gap: 6px; font: 14.5px/1.4 var(--j-font-type); }
.suggestions {
  list-style: none;
  padding: 6px 0;
  margin: 8px 0 0 30px;
  background: var(--j-cream);
  border: 1px solid color-mix(in srgb, var(--j-pencil) 40%, transparent);
  border-radius: 3px;
  box-shadow: 0 8px 18px -10px rgb(var(--j-shadow) / .45);
}
.suggestions button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 4px 12px;
  background: none;
  border: 0;
  text-align: left;
  font: 15px/26px var(--j-font-type);
  color: var(--j-ink);
}
.suggestions button:hover { background: color-mix(in srgb, var(--j-mustard) 25%, transparent); }
.suggestions .j-icon { width: 18px; height: 18px; }

/* -------------------------------------------------------------- Plate I */

.plate-wrap { margin-top: 56px; }
.plate { padding: 38px 34px 32px; }
.plate h2 {
  text-align: center;
  font: 600 28px/1.2 var(--j-font-display);
  font-variation-settings: "opsz" 60, "SOFT" 30;
}
.plate-sub { margin: 8px 0 26px; text-align: center; color: var(--j-ink-soft); }
.plate-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 14px 10px; }
.j-plate-cell { position: relative; padding: 6px 4px 8px; border-radius: 6px; }
.j-plate-cell img { width: 100%; height: auto; aspect-ratio: 1; }
/* Instructional hands, not decoration: at night they keep --hand-art-opacity rather than the
   collage's .5. Each selector must outweigh paper.css's :root[data-theme] .j-art--ink (0,3,0). */
.plate-grid .j-plate-cell img.j-art--ink, .spell-readout .spell-guide img.j-art--ink,
.spell-cue .cue-btn img.j-art--ink, .loupe .loupe-art img.j-art--ink { opacity: var(--hand-art-opacity); }
.j-plate-cell figcaption { font-size: 12px; line-height: 1.3; }
.j-plate-cell figcaption b { display: block; margin-bottom: 2px; font: 700 19px/1 var(--j-font-display); }
/* Each hand is a button: it lays the letter out larger, with its tip. */
.plate-btn {
  display: block;
  width: 100%;
  background: none;
  border: 0;
  color: var(--j-ink);
  font: inherit;
  cursor: zoom-in;
  transition: background-color .25s ease, box-shadow .25s ease;
}
.plate-btn:hover { background: color-mix(in srgb, var(--j-kraft) 40%, transparent); }
.plate-btn:focus-visible { border-radius: 6px; }
.plate-btn img { transition: transform .25s ease; }
.cell-cap { display: block; margin-top: 6px; font: 12px/1.3 var(--j-font-type); }
.cell-cap b { display: block; margin-bottom: 2px; font: 700 19px/1 var(--j-font-display); }
/* The letter to make next is ringed; the letter the camera is reading lights up. */
.j-plate-cell.is-wanted { background: color-mix(in srgb, var(--j-mustard) 16%, transparent); box-shadow: 0 0 0 2px var(--j-mustard); }
.j-plate-cell.is-read {
  background: radial-gradient(ellipse at 50% 38%, color-mix(in srgb, var(--j-mustard) 46%, transparent),
    color-mix(in srgb, var(--j-mustard) 12%, transparent) 72%);
  box-shadow: 0 0 0 2px var(--j-sage), 0 0 22px 3px color-mix(in srgb, var(--j-mustard) 50%, transparent);
}
.j-plate-cell.is-wanted.is-read { box-shadow: 0 0 0 2.5px var(--j-mustard), 0 0 22px 3px color-mix(in srgb, var(--j-mustard) 50%, transparent); }
.j-plate-cell.is-read img { transform: scale(1.07) rotate(-1deg); }
.j-plate-cell.is-wanted::before, .j-plate-cell.is-read::before {
  position: absolute;
  top: 4px; right: 5px;
  font: 700 9.5px/1 var(--j-font-body);
  letter-spacing: .16em;
  text-transform: uppercase;
}
.j-plate-cell.is-wanted::before { content: "next"; }
.j-plate-cell.is-read::before { content: "reading"; }
.j-plate-cell.is-wanted.is-read::before { content: "\2713  reading"; }
.plate-notes { margin-top: 30px; padding-top: 22px; background: var(--j-rule-img) 0 0 / 600px 6px repeat-x; }
.plate-notes h3 { margin-bottom: 10px; }
.plate-notes ul { columns: 2; column-gap: 40px; padding-left: 1.1em; }
.plate-notes li { break-inside: avoid; margin: 0 0 10px; font-size: 15.5px; line-height: 1.5; }

/* ------------------------------------------------- the card drawer (Dictionary) */

.drawer {
  padding: 26px 24px 28px;
  background:
    linear-gradient(rgb(0 0 0 / .2), transparent 18px),
    repeating-linear-gradient(91deg, rgb(255 255 255 / .03) 0 7px, rgb(0 0 0 / .035) 7px 9px, transparent 9px 17px),
    linear-gradient(#7d5f41, #6d5238);
}
.drawer-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 24px; }
.drawer-head .j-label-holder { margin: 0 4px; }
.search-slip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 380px;
  padding: 6px 14px;
  color: #1f2a1e;
  background: #fbf8ef;
  border-radius: 3px;
  box-shadow: 0 1px 1px rgb(0 0 0 / .2), 0 6px 12px -8px rgb(0 0 0 / .5);
  transform: rotate(-.4deg);
  filter: var(--card-filter);
}
.search-slip .j-icon { width: 20px; height: 20px; color: #4a463e; }
.search-slip input {
  flex: 1;
  min-width: 0;
  padding: 6px 0;
  background: transparent;
  border: 0;
  font: 16px/1.4 var(--j-font-type);
  color: #1f2a1e;
}
.search-slip input::placeholder { color: #5a564d; opacity: 1; }
.search-slip:focus-within { outline: 3px solid var(--j-mustard); outline-offset: 3px; }
.search-slip input:focus-visible { outline: none; }
.drawer-count {
  margin: 18px 4px 0;
  font: 700 13.5px/1.4 var(--j-font-type);
  letter-spacing: .04em;
  color: #fbf6ea;
  text-shadow: 0 1px 1px rgb(0 0 0 / .45);
}
.dict-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 16px;
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
}
.dict-card { display: flex; flex-direction: column; padding: 2px 16px 10px; filter: var(--card-filter); }
.dict-card:nth-child(4n + 1) { transform: rotate(-.35deg); }
.dict-card:nth-child(4n + 3) { transform: rotate(.3deg); }
/* The headword wraps on the card's ruled lines (24px) rather than being cut short. */
.dict-word {
  font: 700 19px/24px var(--j-font-display);
  font-variation-settings: "opsz" 36, "SOFT" 40;
  color: #1f2a1e;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.dict-note, .dict-where { font: 13.5px/24px var(--j-font-type); color: #4f4b43; overflow-wrap: anywhere; }
.dict-where .tag { font-size: 8.5px; }
.dict-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 2px; }
.mini {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 4px;
  background: none;
  border: 0;
  font: 700 12.5px/24px var(--j-font-type);
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #2e4535;
  text-decoration: none;
}
.mini .j-icon { width: 16px; height: 16px; }
.mini:hover:not(:disabled) { text-decoration: underline; text-decoration-color: #b08a2c; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.mini:disabled { color: #4f4b43; cursor: default; }
.mini:focus-visible { outline-color: #1f2a1e; }

/* -------------------------------------------------------------------- About */

.about-spread { align-items: start; }
.about-spread .j-page > .page-title { margin: 26px 0 10px; }
.about-spread .page-label + .page-title { margin-top: 0; }
.about-spread p { font-size: 16.5px; line-height: 1.6; }
.about-spread p + p { margin-top: 10px; }
.measures { list-style: none; padding: 0; margin: 12px 0 0; }
.measures li {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  align-items: baseline;
  padding: 10px 0;
  font-size: 15.5px;
  line-height: 1.5;
  border-top: 1px dashed color-mix(in srgb, var(--j-pencil) 45%, transparent);
}
.measures .figure {
  font: 800 34px/1 var(--j-font-display);
  font-variation-settings: "opsz" 144, "SOFT" 80;
  color: var(--done);
  white-space: nowrap;
}
.limits, .credits { padding-left: 1.1em; }
.limits li, .credits li { margin: 0 0 10px; font-size: 15.5px; line-height: 1.55; }
.limits li::marker { color: var(--j-stamp-not); }
.credits li::marker { color: var(--j-sage); }

/* ------------------------------------------------------------------- footer */

.foot { margin-top: 46px; }
.foot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  padding-top: 14px;
  color: var(--j-ink-soft);
}
.theme-toggle {
  padding: 7px 14px 6px;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: var(--j-ink);
  background: none;
  border: 1.5px solid color-mix(in srgb, var(--j-ink) 40%, transparent);
  border-radius: 999px;
}
.theme-toggle:hover { border-color: var(--j-ink); }
.theme-toggle[aria-pressed="true"] { color: var(--j-page); background: var(--j-ink); border-color: var(--j-ink); }
.theme-toggle[aria-pressed="true"]::before { content: "\2713\00a0"; content: "\2713\00a0" / ""; }

/* ------------------------------------------------ the drawn signer (figure) */

/* A drawing mounted on the page: photo paper, a strip of tape, a slight tilt. */
.fig-card { margin: 0; padding: 8px 8px 6px; }
.fig-tape {
  position: absolute;
  top: -11px;
  left: 50%;
  z-index: 2;
  margin-left: -34px;
  --tape-w: 68px;
  --tape-h: 20px;
  --tilt: 3deg;
}
.fig-no { margin: 0 0 6px 2px; color: var(--j-ink-soft); }
.fig-frame { position: relative; }
/* The canvas's pixel size never feeds back into its layout size. */
.fig-canvas { display: block; width: 100%; max-width: 100%; aspect-ratio: 1 / 1.02; }
.waiting .fig-canvas {
  background: repeating-linear-gradient(135deg, transparent 0 7px,
    color-mix(in srgb, var(--j-pencil) 13%, transparent) 7px 8px);
}
.fig-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 14px;
  text-align: center;
  font: italic 14.5px/1.45 var(--j-font-body);
  color: var(--j-ink-soft);
}
.fig-cap { margin-top: 6px; text-align: center; font: 12px/1.35 var(--j-font-type); color: var(--j-pencil); }

/* Quiz, step 1: the word, then the drawing and its controls side by side */
.quiz-progress { display: flex; align-items: center; gap: 8px; font: 14px/30px var(--j-font-type); color: var(--j-pencil); }
.quiz-progress .tally { margin: 0; }
.sign-plate {
  display: grid;
  grid-template-columns: minmax(0, 232px) max-content;
  align-items: center;
  gap: 16px 18px;
  margin: 16px 0 12px;
}
.sign-plate .fig-card { max-width: 232px; }

/* Player controls: Play, speed, the left-handed mirror (and, on the desk, a scrubber) */
.player { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.player--wide { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 14px; }
.play-btn { min-height: 42px; padding: 8px 20px 8px 15px; font-size: 16px; }
.play-btn .j-icon { width: 20px; height: 20px; }
.j-btn:disabled, .j-btn:disabled:hover {
  color: var(--j-pencil);
  background: transparent;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--j-pencil) 70%, transparent);
}
.speed {
  display: inline-flex;
  border: 1.5px solid color-mix(in srgb, var(--j-ink) 42%, transparent);
  border-radius: 999px;
  overflow: hidden;
}
.speed button {
  min-width: 46px;
  min-height: 34px;
  padding: 4px 10px;
  background: none;
  border: 0;
  font: 700 14px/1 var(--j-font-type);
  color: var(--j-ink);
}
.speed button + button { border-left: 1.5px solid color-mix(in srgb, var(--j-ink) 42%, transparent); }
.speed button:hover { background: color-mix(in srgb, var(--j-mustard) 22%, transparent); }
.speed button[aria-pressed="true"] { color: #1f2a1e; background: var(--j-mustard); }
.speed button:focus-visible { outline-offset: -4px; border-radius: 999px; }
.toggle, .choice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 4px 12px 4px 9px;
  background: none;
  border: 1.5px solid color-mix(in srgb, var(--j-ink) 42%, transparent);
  border-radius: 999px;
  font: 700 12px/1 var(--j-font-type);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--j-ink);
}
.toggle .j-icon { width: 18px; height: 18px; }
.toggle:hover, .choice:hover { border-color: var(--j-ink); }
.toggle[aria-pressed="true"] { color: #1f2a1e; background: var(--j-mustard); border-color: var(--j-mustard); }
.toggle[aria-pressed="true"]::after { content: "\2713"; margin-left: 1px; }
.toggle:focus-visible, .choice:focus-visible { border-radius: 999px; }
.scrub { display: flex; flex: 1 1 200px; min-width: 150px; }
.scrub input { width: 100%; margin: 0; accent-color: var(--bar); }
.scrub input:disabled { opacity: .5; }
.play-time { min-width: 7.6em; font: 13px/1 var(--j-font-type); color: var(--j-pencil); }

/* Compare, after a try */
.verdict-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.j-btn--quiet { color: var(--link); background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.j-btn--quiet:hover { background: color-mix(in srgb, var(--j-mustard) 24%, transparent); }
#guess-actions { margin-top: 10px; }
.log-compare {
  padding: 0 2px;
  background: none;
  border: 0;
  font: 700 12.5px/30px var(--j-font-type);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--j-mustard) 80%, transparent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* Tallies: how often a sign has been matched, in pencil strokes */
.tally { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; color: var(--done); }
.tally svg { width: 19px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.tally-more { font: 700 11.5px/1 var(--j-font-type); color: var(--j-ink); }
.chip .tally { margin-left: 5px; }
.lesson-progress { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 14px; font: 14px/30px var(--j-font-type); color: var(--j-pencil); }
.lesson-progress .text-btn { font-size: 14.5px; }

/* Dictionary cards: the source link on its own line, under the headword */
.dict-src-line { line-height: 24px; }
.dict-src {
  font: 700 11px/24px var(--j-font-type);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #2e4535;
  text-decoration: none;
}
.dict-src:hover { text-decoration: underline; text-decoration-color: #b08a2c; }
.dict-src:focus-visible { outline-color: #1f2a1e; }

/* ------------------------------------------ on the desk: Watch and Compare */

.viewer, .loupe {
  max-width: none;
  max-height: 100dvh;
  padding: 18px;
  overflow: auto;
  color: var(--j-ink);
  background: transparent;
  border: 0;
}
.viewer { width: min(900px, 100vw); }
.loupe { width: min(780px, 100vw); }
.viewer::backdrop, .loupe::backdrop { background: rgb(24 32 23 / .58); }
.viewer-sheet { padding: 40px 44px 30px; }
.viewer-tape { position: absolute; top: -9px; left: 50%; z-index: 2; margin-left: -62px; --tape-w: 124px; --tape-h: 26px; --tilt: -2deg; }
.sheet-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  color: var(--j-ink);
  background: none;
  border: 1.5px solid color-mix(in srgb, var(--j-ink) 38%, transparent);
  border-radius: 50%;
}
.sheet-close:hover { border-color: var(--j-ink); background: color-mix(in srgb, var(--j-mustard) 20%, transparent); }
.sheet-close:focus-visible { border-radius: 50%; }
.sheet-close .j-icon { width: 20px; height: 20px; }
.viewer .page-label { margin-bottom: 6px; padding-right: 50px; }
.viewer-word {
  padding-right: 50px;
  font: 800 46px/1.04 var(--j-font-display);
  font-variation-settings: "opsz" 144, "SOFT" 60;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
}
.viewer-note { margin-top: 4px; font: 14px/1.3 var(--j-font-type); color: var(--j-pencil); }
.viewer-choices { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 14px; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { padding: 4px 12px; }
.choice[aria-pressed="true"] { color: #f4efe3; background: var(--mode-on); border-color: var(--mode-on); }
.viewer-figs {
  display: grid;
  grid-template-columns: minmax(0, 420px);
  justify-content: center;
  gap: 22px 34px;
  margin: 26px 0 20px;
}
.viewer-figs.two { grid-template-columns: repeat(2, minmax(0, 360px)); }
.viewer .fig-card { padding: 10px 10px 8px; }
.fig-card--you .fig-no { color: var(--j-stamp-close); }
.viewer-explain {
  max-width: 62ch;
  margin: 16px auto 0;
  text-align: center;
  font: italic 15px/1.5 var(--j-font-body);
  color: var(--j-ink-soft);
}
.viewer-credit { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 26px; margin-top: 12px; }
.viewer-credit .text-btn { display: inline-flex; align-items: center; gap: 6px; }
.viewer-credit .text-btn .j-icon { width: 18px; height: 18px; }
.viewer-credit .text-btn:disabled { color: var(--j-ink-soft); text-decoration: none; cursor: default; }

/* Plate I, one hand laid out larger */
.loupe-sheet { padding: 46px 46px 30px; }
.loupe-kicker { text-align: center; color: var(--j-ink-soft); }
.loupe-body {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  align-items: center;
  gap: 30px;
  margin-top: 16px;
}
.loupe-art { border-radius: 50%; background: radial-gradient(circle at 50% 46%, color-mix(in srgb, var(--j-sage) 22%, transparent), transparent 68%); }
.loupe-art img { width: 100%; height: auto; aspect-ratio: 1; opacity: var(--hand-art-opacity); }
.loupe-letter { font: 800 100px/.9 var(--j-font-display); font-variation-settings: "opsz" 144, "SOFT" 60; }
.loupe-note { margin-top: 10px; font: 700 15px/1.4 var(--j-font-type); }
.loupe-tip-label { margin-top: 18px; color: var(--j-ink-soft); }
.loupe-tip { margin-top: 4px; font-size: 17px; line-height: 1.55; }
.loupe-src { margin-top: 14px; font: 12.5px/1.5 var(--j-font-type); color: var(--j-pencil); }
.loupe-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding-top: 14px;
  color: var(--j-ink-soft);
  background: var(--j-rule-img) 0 0 / 600px 6px repeat-x;
}
.loupe-nav .text-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; font: 700 20px/1 var(--j-font-display); }
.loupe-nav .j-icon { width: 20px; height: 20px; }

/* Spell a word: the next letter's drawing beside the word */
.spell-cue { display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: start; gap: 4px 16px; margin: 10px 0 4px; }
.spell-cue.empty { grid-template-columns: minmax(0, 1fr); }
.cue-btn {
  display: block;
  width: 104px;
  height: 104px;
  padding: 4px;
  background: var(--j-photo);
  border: 0;
  border-radius: 2px;
  box-shadow: 0 1px 1px rgb(var(--j-shadow) / .16), 0 8px 16px -10px rgb(var(--j-shadow) / .45);
  transform: rotate(-1.5deg);
  cursor: zoom-in;
}
.cue-btn img { width: 100%; height: 100%; opacity: var(--hand-art-opacity); }
.cue-btn:hover { box-shadow: 0 0 0 2px var(--j-mustard), 0 8px 16px -10px rgb(var(--j-shadow) / .45); }
.cue-letter {
  display: inline-block;
  margin-left: 6px;
  font: 800 26px/1 var(--j-font-display);
  letter-spacing: 0;
  text-transform: none;
  vertical-align: -3px;
}
.cue-note { font: 700 14.5px/1.45 var(--j-font-type); }
.spell-cue .spell-hint { margin-top: 2px; }
.spell-readout:has(.spell-guide[hidden]) { grid-template-columns: 116px minmax(0, 1fr); }

/* -------------------------------------------------------------- motion */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; animation-iteration-count: 1 !important; }
  .j-plate-cell.is-read img { transform: none; }
}

/* ---------------------------------------------------------- narrower desks */

/* The margins get too narrow for the collage well before the phone layout. */
@media (max-width: 1279px) {
  .collage, .margin-notes { display: none; }
  .desk { padding: 40px 24px 60px; }
}
@media (max-width: 1000px) {
  .sheet { padding: 36px 36px 32px; }
  .plate-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .spread .j-page { padding-left: 26px; padding-right: 26px; }
  .spell-readout { grid-template-columns: 100px minmax(0, 1fr); }
  .spell-dial { width: 100px; height: 100px; }
  .spell-guide { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; text-align: left; }
  .spell-guide img { width: 80px; height: 80px; margin: 0; }
  .contents { columns: 1; }
  .lessons { grid-template-columns: 1fr 1fr; }
  .lessons.j-notebook::after { left: 50%; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .desk { padding: 10px 6px 32px; }
  .sheet { padding: 28px 16px 26px; }
  .top { align-items: flex-start; flex-direction: column; }
  .wordmark { font-size: 34px; }
  .brand-mark { width: 38px; height: 38px; }
  .tagline { font-size: 9.5px; letter-spacing: .2em; }
  .tabs { gap: 6px 14px; }
  .tab { font-size: 16px; }
  .hero { margin: 30px auto 26px; }
  .hero h1 { font-size: 40px; }
  .hero-sub { font-size: 18px; }
  .spread .j-page, .lessons .j-page, .about-spread .j-page { padding: 24px 16px 26px; }
  .lessons { grid-template-columns: 1fr; }
  .lessons.j-notebook::after { display: none; }
  .photo { margin: 0; }
  .prep { margin-left: 6px; }
  .quiz-word { font-size: 42px; }
  /* narrow: the word, then watch and "That's it" on the line under it; the bar gives way */
  .candidates li { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; }
  .candidates li .bar { display: none; }
  .candidates li .cand-label { grid-column: 1 / -1; }
  .candidates li.best .cand-label { font-size: 25px; }
  .spell-word { font-size: 42px; }
  .how { flex-direction: column; margin-top: 40px; }
  .how-card { width: min(260px, 100%); }
  .how-arrow { transform: rotate(90deg); margin: 8px 0; }
  .plate { padding: 30px 16px 24px; }
  .plate h2 { font-size: 23px; }
  .plate-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 6px; }
  .plate-notes ul { columns: 1; }
  .drawer { padding: 20px 12px 18px; }
  .search-slip { flex: 1 1 100%; }
  .dict-list { grid-template-columns: 1fr; }
  .foot-row { flex-direction: column; align-items: flex-start; }
  .sign-plate { grid-template-columns: minmax(0, 1fr); justify-items: start; }
  .sign-plate .fig-card { width: min(250px, 100%); max-width: none; }
  .player { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .viewer, .loupe { padding: 8px; }
  .viewer-sheet { padding: 34px 14px 22px; }
  .viewer-word { font-size: 32px; }
  .viewer-figs, .viewer-figs.two { gap: 14px; margin: 18px 0 16px; }
  .viewer-figs.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .viewer .fig-card { padding: 5px 5px 4px; }
  .viewer .fig-cap { font-size: 11px; }
  .scrub { flex-basis: 100%; order: 5; }
  .loupe-sheet { padding: 40px 22px 22px; }
  .loupe-body { grid-template-columns: minmax(0, 1fr); gap: 10px; justify-items: center; text-align: center; }
  .loupe-art { width: min(230px, 100%); }
  .loupe-letter { font-size: 68px; }
  .loupe-tip { font-size: 16px; }
  .spell-cue { grid-template-columns: 84px minmax(0, 1fr); gap: 4px 12px; }
  .cue-btn { width: 84px; height: 84px; }
}

/* A phone with the camera on: the camera page becomes a strip held at the top of
   the screen - the picture, Record and the word to sign - and the practice
   scrolls beneath it, so the word, the camera and the result are seen together. */
@media (max-width: 760px) {
  body.live .camera-page {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    align-items: center;
    gap: 6px 12px;
    padding: 8px 10px 8px;
    background: var(--j-page);
    border-bottom: 1px dashed var(--j-rule-line);
    box-shadow: 0 12px 14px -14px rgb(var(--j-shadow) / .6);
  }
  body.live .camera-page > :is(.page-label, .prep), body.live :is(.photo-caption, .space-hint) { display: none; }
  body.live .photo { grid-column: 1; margin: 0; padding: 5px 5px 4px; }
  body.live .cam-controls { grid-column: 2; flex-direction: column; align-items: flex-start; gap: 6px; margin: 0; }
  body.live .accuracy-mode { display: none; }
  body.live .record-row { gap: 6px; }
  body.live .cam-controls .j-btn { min-height: 44px; padding: 8px 16px 8px 12px; }
  body.live .cam-word { display: block; line-height: 1.15; }
  body.live .cam-word .j-caps { display: block; color: var(--j-ink-soft); }
  body.live .cam-word-text { font: 700 21px/1.1 var(--j-font-display); overflow-wrap: anywhere; }
  body.live .framing-hint { grid-column: 1 / -1; margin: 0; font-size: 13.5px; line-height: 1.35; }
  body.live .framing-hint span { min-height: 0; }
  body.live :is(.result, .verdict) { scroll-margin: 250px 0 16px; }
}
