/* Layout: a blackboard, and on it one sheet of graded paper. Everything else is chalk written straight on the board. */
@font-face { font-family: Archivo; font-weight: 800; font-display: swap; src: url(../fonts/archivo-latin-800-normal.woff2) format('woff2'); }
@font-face { font-family: Archivo; font-weight: 900; font-display: swap; src: url(../fonts/archivo-latin-900-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 500; font-display: swap; src: url(../fonts/inter-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 700; font-display: swap; src: url(../fonts/inter-latin-700-normal.woff2) format('woff2'); }

/* One look, the classroom of the videos (src/theme.ts): the board is dark in every browser theme, by choice. */
:root {
  color-scheme: dark;
  --board: #0E2A22;
  --board-2: #17443A;
  --line: #2C6152;
  --chalk: #F7F5EC;
  --soft: #B5D8C8;
  --accent: #FFD23F;
  --on-accent: #0E2A22;
  --wrong: #FF7A7A;
  --right: #4BE38A;
  --paper: #FFF6DC;
  --paper-line: #E4D4A4;
  --ink: #0B1330;
  --ink-soft: #4B5270;
  --pen: #CF2E2A;
  --pass: #0B6B3C;
  --display: Archivo, 'Arial Black', 'Helvetica Neue', sans-serif;
  --body: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --step--1: .82rem;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: clamp(1.45rem, 1.1rem + 1.6vw, 2rem);
  --step-3: clamp(2.1rem, 1.3rem + 4vw, 3.6rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--board) radial-gradient(120% 80% at 20% 0%, var(--board-2), var(--board) 70%) no-repeat;
  color: var(--chalk); font: 500 var(--step-0)/1.55 var(--body);
}
img, svg, video { max-width: 100%; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); font-weight: 900; line-height: 1.04; margin: 0; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); font-weight: 800; }
p { margin: 0; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 68rem; margin-inline: auto; padding-inline: 20px; }
main { flex: 1; display: flex; flex-direction: column; gap: 4.5rem; padding-block: 2.5rem 5rem; }
.stack { display: flex; flex-direction: column; gap: 1.1rem; }
.lead { font-size: var(--step-1); line-height: 1.4; color: var(--soft); max-width: 34ch; }
.measure { max-width: 62ch; }
.label { font: 700 var(--step--1)/1.2 var(--body); letter-spacing: .09em; text-transform: uppercase; color: var(--soft); }
.en { font-family: var(--display); font-weight: 800; letter-spacing: -.005em; }

/* header */
.top { border-bottom: 2px dashed var(--line); }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem 1.5rem; padding-block: .8rem; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; font: 900 1.2rem/1 var(--display); text-transform: uppercase; letter-spacing: .01em; }
.brand .face { width: 2.6rem; height: 2.6rem; flex: none; }
.brand b { color: var(--accent); font-weight: 900; }
.top nav { display: flex; flex-wrap: wrap; gap: .2rem 1.3rem; }
.top nav a { font-weight: 700; text-decoration: none; padding-block: .35rem; border-bottom: 3px solid transparent; }
.top nav a[aria-current] { border-color: var(--accent); }
.preview { background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: var(--step--1); padding-block: .45rem; }

/* buttons */
.actions { display: flex; flex-wrap: wrap; gap: .8rem; }
.btn { display: inline-flex; align-items: center; gap: .5rem; font: 800 1rem/1 var(--display); text-transform: uppercase; letter-spacing: .03em; text-decoration: none;
  padding: .95rem 1.3rem; border: 3px solid var(--accent); border-radius: 6px; background: var(--accent); color: var(--on-accent); cursor: pointer; }
.btn:hover { color: var(--on-accent); background: var(--chalk); border-color: var(--chalk); }
.btn.ghost { background: transparent; color: var(--chalk); border-color: var(--chalk); }
.btn.ghost:hover { background: var(--chalk); color: var(--board); }

/* the sheet of paper: the one object on the board */
.sheet { background: var(--paper); color: var(--ink); border-radius: 4px; padding: 1.6rem clamp(1.1rem, 4vw, 2rem) 1.3rem; display: flex; flex-direction: column; gap: 1.15rem;
  box-shadow: 0 1px 0 var(--paper-line), 10px 12px 0 rgba(0, 0, 0, .28); position: relative; min-width: 0; }
.sheet::before { content: ''; position: absolute; top: -.7rem; left: 50%; width: 5.5rem; height: 1.5rem; transform: translateX(-50%) rotate(-2deg); background: rgba(255, 210, 63, .82); }
.sheet .label { color: var(--ink-soft); }
.sheet .row { display: flex; flex-direction: column; gap: .3rem; padding-bottom: 1.05rem; border-bottom: 1.5px solid var(--paper-line); }
.sheet .row:last-of-type { border-bottom: 0; padding-bottom: 0; }
.sheet .say { font: 800 clamp(1.35rem, 1rem + 2vw, 2rem)/1.15 var(--display); overflow-wrap: anywhere; }
.sheet .say.es { font: 700 var(--step-1)/1.3 var(--body); }
.sheet .wrong .label { color: var(--pen); }
.sheet .wrong .say { color: var(--ink-soft); text-decoration: line-through; text-decoration-color: var(--pen); text-decoration-thickness: .11em; }
.sheet .plain .label { color: var(--ink-soft); }
.sheet .plain .say { color: var(--ink-soft); text-decoration: none; }
.sheet .right .label, .sheet .right .say { color: var(--pass); }
.sheet .native .say { color: var(--ink); }
.sheet .note { color: var(--ink-soft); font-size: .98rem; }
.sheet .why { font-size: var(--step-0); line-height: 1.5; }
.sheet .signed { align-self: flex-end; font: 900 1.5rem/1 var(--display); color: var(--pen); transform: rotate(-4deg) skewX(-8deg); margin-top: -.2rem; }

/* home */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 2.5rem 3.5rem; align-items: center; }
.hero .copy { display: flex; flex-direction: column; gap: 1.3rem; }
.hero .desk { position: relative; padding-top: 4.5rem; }
.hero .desk .sheet { transform: rotate(1.2deg); }
.hero .desk .face { position: absolute; top: -1.2rem; right: -.6rem; width: 8.5rem; height: 8.5rem; z-index: 1; }
.section { display: flex; flex-direction: column; gap: 1.6rem; }
.section > header { display: flex; flex-direction: column; gap: .5rem; }
.section > header p { color: var(--soft); }

.series { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16.5rem), 1fr)); gap: 0 2rem; }
.series a { display: flex; flex-direction: column; gap: .35rem; height: 100%; padding-block: 1.05rem; border-top: 2px dashed var(--line); text-decoration: none; }
.series h3 { text-transform: uppercase; font-size: 1.12rem; letter-spacing: .01em; }
.series p { color: var(--soft); font-size: .95rem; line-height: 1.4; }
.series .n { margin-top: auto; padding-top: .3rem; font: 700 var(--step--1)/1 var(--body); color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: .06em; text-transform: uppercase; }

/* lesson lists: what you say, struck out in chalk, then what is said */
.list { list-style: none; margin: 0; padding: 0; }
.list a { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .15rem 1.5rem; padding-block: .85rem; border-top: 2px dashed var(--line); text-decoration: none; }
.list li:last-child a { border-bottom: 2px dashed var(--line); }
.list .w { font: 800 1.08rem/1.25 var(--display); color: var(--soft); text-decoration: line-through; text-decoration-color: var(--wrong); text-decoration-thickness: .1em; overflow-wrap: anywhere; }
.list .w.plain { text-decoration: none; }
.list .r { font: 800 1.08rem/1.25 var(--display); color: var(--chalk); overflow-wrap: anywhere; }
.list a:hover .r { color: var(--accent); }
.list .i { grid-column: 1 / -1; font-size: .9rem; color: var(--soft); }
@media (max-width: 38rem) { .list a { grid-template-columns: minmax(0, 1fr); } }

.search { display: flex; flex-direction: column; gap: .5rem; }
.search input { width: 100%; max-width: 32rem; font: 500 1.05rem/1.2 var(--body); color: var(--chalk); background: transparent; border: 0; border-bottom: 3px solid var(--chalk); padding: .7rem .1rem; border-radius: 0; }
.search input::placeholder { color: var(--soft); opacity: .8; }
.search input:focus-visible { outline: 0; border-color: var(--accent); }
.count { font-size: var(--step--1); color: var(--soft); font-variant-numeric: tabular-nums; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; }

.band { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.2rem 2rem; align-items: center; padding-block: 1.8rem; border-block: 2px dashed var(--line); }
.band .stack { gap: .5rem; }
.band p { color: var(--soft); }
@media (max-width: 44rem) { .band { grid-template-columns: minmax(0, 1fr); } }

/* lesson page */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; }
.crumbs a { text-decoration: none; color: var(--accent); }
.tag { font: 700 var(--step--1)/1 var(--body); letter-spacing: .07em; text-transform: uppercase; padding: .35rem .55rem; border: 2px solid currentColor; border-radius: 4px; }
.tag.error { color: var(--wrong); }
.tag.meaning { color: var(--accent); }
.tag.upgrade { color: var(--soft); }
.lesson-head { display: flex; flex-direction: column; gap: 1rem; }
.lesson-head h1 { font-size: var(--step-2); font-size: clamp(1.7rem, 1.1rem + 2.6vw, 2.7rem); max-width: 22ch; }
.lesson-head .hook { font-size: var(--step-1); color: var(--soft); line-height: 1.4; max-width: 40ch; }
.lesson-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 17rem); gap: 2.5rem 3rem; align-items: start; }
.lesson-body aside { display: flex; flex-direction: column; gap: 1rem; }
.lesson-body aside .face { width: 11rem; height: 11rem; align-self: center; }
.lesson-body video { width: 100%; max-width: 17rem; aspect-ratio: 9 / 16; background: #000; border-radius: 6px; display: block; }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.pager a { font-weight: 700; text-decoration: none; max-width: 100%; }
.pager span { display: block; }

/* quiz */
.quiz { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 13rem); gap: 2rem 3rem; align-items: start; }
.quiz .face { width: 100%; max-width: 13rem; aspect-ratio: 1; }
.quiz .q { display: flex; flex-direction: column; gap: 1.2rem; min-width: 0; }
.quiz .ask { font: 900 var(--step-2)/1.1 var(--display); }
.quiz .intent { font-size: var(--step-1); color: var(--accent); font-weight: 700; }
.options { display: flex; flex-direction: column; gap: .8rem; }
.option { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem; align-items: center; width: 100%; text-align: left; cursor: pointer;
  font: 800 clamp(1.15rem, 1rem + 1vw, 1.5rem)/1.2 var(--display); color: var(--chalk); background: transparent; border: 3px solid var(--chalk); border-radius: 6px; padding: 1rem 1.1rem; overflow-wrap: anywhere; }
.option .letter { font-weight: 900; color: var(--accent); }
.option:hover:not(:disabled) { border-color: var(--accent); }
.option:disabled { cursor: default; opacity: .55; }
.option.is-right { border-color: var(--right); color: var(--right); opacity: 1; }
.option.is-wrong { border-color: var(--wrong); color: var(--wrong); opacity: 1; text-decoration: line-through; }
.verdict { font: 900 var(--step-1)/1.2 var(--display); }
.verdict.good { color: var(--right); }
.verdict.bad { color: var(--wrong); }
.score { font: 900 clamp(3rem, 2rem + 8vw, 6rem)/1 var(--display); color: var(--accent); font-variant-numeric: tabular-nums; }

/* resources */
.resources { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 0 2.5rem; }
.resources li { display: flex; flex-direction: column; gap: .6rem; padding-block: 1.3rem; border-top: 2px dashed var(--line); }
.resources h3 { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.resources p { color: var(--soft); }
.resources a { align-self: flex-start; margin-top: auto; font-weight: 700; color: var(--accent); }
.fine { font-size: .9rem; color: var(--soft); max-width: 62ch; }

footer { border-top: 2px dashed var(--line); padding-block: 1.6rem 2.2rem; color: var(--soft); font-size: .95rem; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .8rem 2rem; }
footer nav { display: flex; flex-wrap: wrap; gap: .4rem 1.3rem; }

@media (max-width: 52rem) {
  main { gap: 3.5rem; }
  .hero, .lesson-body, .quiz { grid-template-columns: minmax(0, 1fr); }
  .hero .desk { padding-top: 3.5rem; }
  .hero .desk .face { width: 7rem; height: 7rem; right: 0; }
  .lesson-body aside .face, .quiz .face { width: 8rem; max-width: 8rem; height: auto; align-self: flex-start; }
  .quiz .face { order: -1; }
}

/* pieces the pages add around the basics above */
del { text-decoration: line-through; }
.sheet-link { display: block; text-decoration: none; color: inherit; }
.sheet-link:hover { color: inherit; }
.lesson { display: flex; flex-direction: column; gap: 2.2rem; }
.more { font-weight: 700; color: var(--accent); }
.bands { display: flex; flex-direction: column; }
.bands .band + .band { border-top: 0; }
.band.plain { border: 0; padding-block: 0; }
.band.plain .face { width: 9.5rem; height: 9.5rem; }
.band .fine { text-align: center; }
.pager .label { display: block; }
.pager .end { text-align: right; margin-left: auto; }
.prose { font-size: 1.12rem; }
.prose h2 { margin-bottom: .2rem; }
.resources h3 .tag { font-size: .7rem; }
.preview .wrap { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; justify-content: space-between; }
.preview a, .preview a:hover { color: var(--on-accent); }
@media (max-width: 44rem) { .band.plain .face { width: 6.5rem; height: 6.5rem; } }
