/* NATO Phonetic Trainer: "painted on a ship" (docs/design.md, D4). A haze-grey panel on a pale wall; large
   markings are white block capitals with one unit of black shading, small ones plain. One stylesheet, no inline
   styles (the CSP forbids them). */

@font-face { font-family: "Big Shoulders"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("big-shoulders-var-latin.56009a9f63.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("barlow-400-latin.e42fb205c9.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap; src: url("barlow-500-latin.2678a2313b.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url("barlow-600-latin.90ebc14b4b.woff2") format("woff2"); }

:root {
  color-scheme: light dark;
  --wall: #ECEEED;
  --ink: #1C2024;
  --muted: #545B61;
  --rule: #C3C8C6;
  --panel: #80878C;
  --panel-seam: #6B7277;
  --hull-white: #F6F7F5;
  --shade: #0E1113;
  --mark: #0E1113;
  --row-rule: #6E757A;
  --focus: #1C2024;
  --focus-panel: #0E1113;
  --sans: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --block: "Big Shoulders", "Barlow", "Arial Narrow", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --wall: #101214;
    --ink: #E4E6E5;
    --muted: #9EA5AB;
    --rule: #2A2F33;
    --panel: #3D4348;
    --panel-seam: #50575C;
    --hull-white: #F2F3F1;
    --shade: #000000;
    --mark: #E6E8E6;
    --row-rule: #555C61;
    --focus: #E4E6E5;
    --focus-panel: #F2F3F1;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--wall); color: var(--ink); font: 400 1.0625rem/1.5 var(--sans); }
p { text-wrap: pretty; }
.wrap { max-width: 64rem; margin: 0 auto; padding: 0 1.5rem; }
.vh {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.panel :focus-visible { outline-color: var(--focus-panel); }
[hidden] { display: none !important; }
.needs-js { display: none; }

/* ---- the wall: header, tabs, settings ---- */
.site { padding-top: 2.25rem; }
.site .wrap { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .5rem 2rem; }
.title { margin: 0; font: 600 1.875rem/1.15 var(--sans); }
.tabs { display: flex; gap: .25rem; margin-right: -.75rem; }
.tab {
  appearance: none; position: relative; min-height: 44px; padding: .7rem .75rem;
  border: 0; border-radius: 2px; background: none; color: var(--muted);
  font: 500 1.0625rem/1 var(--sans); cursor: pointer;
}
.tab[aria-selected="true"] { color: var(--ink); }
.tab[aria-selected="true"]::after {
  content: ""; position: absolute; left: .75rem; right: .75rem; bottom: .15rem; height: 3px; background: var(--ink);
}
.settings { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; justify-content: flex-end; margin-top: 1rem; }
.field { display: inline-flex; gap: .5rem; align-items: center; color: var(--muted); }
.settings .choices { margin: 0; gap: 0; }
.settings .choices label + label { margin-left: -1.5px; }
.settings .choices label:first-child { border-radius: 4px 0 0 4px; }
.settings .choices label:last-child { border-radius: 0 4px 4px 0; }
select {
  font: inherit; color: var(--ink); background: var(--wall);
  border: 1.5px solid var(--ink); border-radius: 4px; min-height: 44px; padding: .4rem .6rem;
}

/* ---- buttons ---- */
.btn, .toggle {
  appearance: none; display: inline-flex; align-items: center; gap: .5rem;
  min-height: 44px; padding: .55rem 1.15rem;
  border: 1.5px solid var(--ink); border-radius: 4px; background: transparent; color: var(--ink);
  font: 500 1.0625rem/1.2 var(--sans); cursor: pointer;
}
.btn-solid { background: var(--ink); color: var(--wall); }
.toggle[aria-pressed="false"] { border-style: dashed; color: var(--muted); }
.btn-on-panel { border-color: var(--mark); color: var(--mark); }
.btn-on-panel.btn-solid { background: var(--mark); color: var(--panel); }
.btn-quiet { border-color: var(--rule); color: var(--muted); }
.ico { width: 1.25em; height: 1.25em; margin-left: -.15rem; flex: none; }
.ico-fill { fill: currentColor; }
.ico-line { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.play-sm {
  appearance: none; display: inline-grid; place-items: center; flex: none;
  width: 44px; height: 44px; padding: 0; margin-left: auto;
  border: 1.5px solid var(--mark); border-radius: 4px; background: transparent; color: var(--mark); cursor: pointer;
}
.play-sm .ico { margin: 0; }

/* ---- screens ---- */
.screen { margin-top: 1.25rem; }
.prompt { margin: 0 0 .85rem; font-size: 1.1875rem; }
.hint { margin: .75rem 0 0; color: var(--muted); font-size: .9375rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: 1rem; }
.grade { display: flex; flex-wrap: wrap; gap: .75rem; }
.timing { margin: 1rem 0 0; }
.recent { margin: .5rem 0 0; color: var(--muted); font-size: .9375rem; }

/* ---- the panel and its markings ---- */
.panel {
  background: var(--panel); border: 1px solid var(--panel-seam); border-radius: 3px;
  padding: 1.25rem 1.5rem 1.5rem; color: var(--mark);
}
.label {
  margin: 0 0 1rem; color: var(--mark);
  font: 600 .9375rem/1.2 var(--block); letter-spacing: .08em; text-transform: uppercase;
}
.mark {
  margin: 0; color: var(--hull-white);
  font-family: var(--block); font-weight: 800; line-height: 1;
  letter-spacing: .08em; text-transform: uppercase;
  text-shadow: .045em .045em 0 var(--shade);
}
.mark.xl { font-size: 8.5rem; line-height: .9; }
.mark.lg { font-size: 3.25rem; }
.mark.md { font-size: 1.875rem; }
.small-mark { color: var(--mark); font-family: var(--block); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }

/* ---- cards ---- */
.card-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2.5rem; min-height: 8rem; }
.answer { display: grid; gap: .75rem; }
.answer.covered { visibility: hidden; }
.reveal { animation: wipe .25s ease-out both; }
@keyframes wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; } }
.stress { margin: 0; color: var(--mark); font: 500 1.5rem/1.2 var(--block); letter-spacing: .03em; }
.stress b, .say b { font-weight: 800; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.round-end { margin-top: 1.5rem; display: grid; gap: .9rem; justify-items: start; }
.end-line { margin: 0; font: 500 1.25rem/1.3 var(--block); letter-spacing: .03em; }

/* letter progress: a marker under each letter, filled for solid, half for shaky, empty for new */
.strip-panel { margin-top: 2rem; padding: 1rem 1.25rem 1.1rem; }
.strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(26, minmax(0, 1fr)); gap: .6rem 4px; }
.strip li { display: grid; justify-items: center; gap: 6px; padding: 3px 0 5px; border: 2px solid transparent; border-radius: 3px; }
.strip li.current { border-color: var(--mark); }
.strip .small-mark { font-size: 1.125rem; line-height: 1; }
.marker { position: relative; display: block; width: 1.15rem; height: .45rem; border: 1.5px solid var(--mark); border-radius: 1px; }
.solid .marker, .marker.solid { background: var(--mark); }
.shaky .marker::before, .marker.shaky::before { content: ""; position: absolute; inset: 0 50% 0 0; background: var(--mark); }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; margin: .75rem 0 0; color: var(--muted); font-size: .9375rem; }
.legend .key { display: inline-flex; align-items: center; gap: .5rem; }
.legend .marker { border-color: var(--ink); }
.legend .marker.solid, .legend .marker.shaky::before { background: var(--ink); }

/* ---- spell and decode ---- */
.choices-row { display: flex; flex-wrap: wrap; gap: .75rem 2rem; margin-bottom: 1.25rem; }
.choices { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.25rem; }
.choices-row .choices { margin: 0; }
.choices-label { align-self: center; color: var(--muted); margin-right: .25rem; }
.choices label {
  position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: .5rem .9rem;
  border: 1.5px solid var(--rule); border-radius: 4px; cursor: pointer;
}
.choices input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.choices label:has(input:checked) { border-color: var(--ink); background: var(--ink); color: var(--wall); }
.choices label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.own { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin: 0 0 1.25rem; }
.own input {
  flex: 1 1 16rem; min-width: 0; min-height: 44px; padding: .5rem .75rem;
  font: inherit; color: var(--ink); background: transparent; border: 1.5px solid var(--ink); border-radius: 4px;
}
.own .hint { flex-basis: 100%; margin: 0; }
.spell-string { overflow-wrap: anywhere; }
.rows { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 2.5rem; }
.rows li { display: flex; align-items: center; gap: 1rem; min-height: 3.5rem; padding: .45rem 0; border-top: 1px solid var(--row-rule); }
.rows .ch { width: 1.4em; flex: none; }
.rows .pause { font: 500 1.0625rem/1.2 var(--block); letter-spacing: .06em; text-transform: uppercase; }
.rows .verdict { font: 600 1rem/1.2 var(--block); letter-spacing: .04em; text-transform: uppercase; }
.rows li.wrong .verdict { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.decode-form { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.decode-input {
  flex: 1 1 12rem; min-width: 0; padding: .2rem 0 .3rem;
  background: transparent; border: 0; border-bottom: 3px solid var(--hull-white); border-radius: 0;
  caret-color: var(--hull-white);
}

/* ---- chart ---- */
.chart-cols { display: grid; grid-template-columns: 1fr 1fr; column-gap: 2.5rem; }
.chart-list { list-style: none; margin: 0; padding: 0; }
.chart-list.digits { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; column-gap: 2.5rem; margin-top: 1.5rem; }
.chart-row {
  display: grid; grid-template-columns: 1.6rem 7.25rem minmax(0, 1fr) 44px 1.15rem;
  align-items: center; column-gap: .75rem; min-height: 3.25rem; padding: .2rem 0; border-top: 1px solid var(--row-rule);
}
.digits .chart-row { grid-template-columns: 1.6rem 7.25rem minmax(0, 1fr) 44px; }
.chart-row .small-mark { font-size: 1.3125rem; }
.say { color: var(--mark); font: 500 1.1875rem/1.2 var(--block); letter-spacing: .03em; }
.note { margin: .85rem 0 0; color: var(--muted); font-size: .9375rem; }

/* ---- the 404 page ---- */
.title a { color: inherit; text-decoration: none; }
.lost { margin-top: 2rem; }
.lost h1 { font-weight: 800; }
.lost-line { margin-top: 1rem; }
.lost-line a, .prompt a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* the row being spoken in Spell's Play all */
.rows li.now { box-shadow: inset 4px 0 0 var(--hull-white); padding-left: .6rem; }

/* ---- footer ---- */
.foot { margin-top: 4rem; padding-bottom: 2.75rem; color: var(--muted); font-size: .9375rem; }
.foot .wrap::before { content: ""; display: block; height: 1px; margin-bottom: 1.25rem; background: var(--rule); }
.foot p { margin: 0 0 .2rem; }
.foot a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.forget { margin-top: 1rem; }
.confirm { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin: .75rem 0 0; color: var(--ink); }

/* ---- phone ---- */
@media (max-width: 40rem) {
  .wrap { padding: 0 1rem; }
  .site { padding-top: 1.25rem; }
  .title { font-size: 1.5rem; }
  .tabs { margin: 0 0 0 -.75rem; }
  .settings { justify-content: flex-start; }
  .panel { padding: .9rem .9rem 1rem; }
  .mark.xl { font-size: 6rem; }
  .mark.lg { font-size: 2.4rem; }
  .mark.md { font-size: 1.6rem; }
  .card-row { gap: .75rem 1.5rem; min-height: 6rem; }
  .strip-panel { padding: .85rem .75rem .9rem; }
  .strip { grid-template-columns: repeat(13, minmax(0, 1fr)); }
  .rows { grid-template-columns: 1fr; }
  .chart-cols, .chart-list.digits { grid-template-columns: 1fr; }
  .chart-row { grid-template-columns: 1.4rem 6.25rem minmax(0, 1fr) 44px 1.15rem; column-gap: .55rem; }
  .digits .chart-row { grid-template-columns: 1.4rem 6.25rem minmax(0, 1fr) 44px; }
}
