/* Lesson pages: the YouTube mini lessons, their worksheets and answers. Static pages beside the app,
   in the app's dark brand (CLAUDE.md, Design rules): warm near-black with a faint graph-paper grid, cream text,
   pink only as a small accent, buttons with a solid edge that presses in. Fonts are the app's own, from /fonts. */
@font-face { font-family: 'Playfair Display'; font-weight: 400 900; font-display: swap; src: url(/fonts/playfair-display-latin.woff2) format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-weight: 300 700; font-display: swap; src: url(/fonts/source-sans-3-latin.woff2) format('woff2'); }
@font-face { font-family: 'Caveat'; font-weight: 400 700; font-display: swap; src: url(/fonts/caveat-latin.woff2) format('woff2'); }

:root {
  --void: #0F0D0E; --card: #1A1617; --card-edge: #2A2425; --line: #3D3536;
  --cream: #F5F0E8; --muted: #B9AFA3; --pink: #E8788E; --ink: #111111;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh; color: var(--cream); font: 400 17px/1.55 'Source Sans 3', system-ui, sans-serif;
  background-color: var(--void);
  background-image:
    linear-gradient(to right, rgba(245, 240, 232, .045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(245, 240, 232, .045) 1px, transparent 1px),
    linear-gradient(to right, rgba(245, 240, 232, .022) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(245, 240, 232, .022) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-attachment: fixed;
}
a { color: var(--cream); }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px 64px; }

/* top bar: the handwritten wordmark home, and the way back to every lesson */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0 8px; }
.mark { font-family: 'Caveat', cursive; font-weight: 700; font-size: 30px; color: var(--pink); text-decoration: none; line-height: 1; }
.bar nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; }
.bar nav a:hover { color: var(--cream); }

/* heading with the house double rule */
h1 { font-family: 'Playfair Display', Georgia, serif; font-weight: 800; font-size: clamp(32px, 6vw, 52px); line-height: 1.1; margin-top: 28px; }
.rule { width: 180px; height: 4px; background: var(--pink); margin-top: 12px; border-radius: 2px; }
.rule + .rule { height: 1.5px; margin-top: 4px; }
.meta { color: var(--muted); font-size: 15px; margin-top: 14px; }
h2 { font-family: 'Playfair Display', Georgia, serif; font-weight: 700; font-size: 26px; margin: 40px 0 14px; }

/* the video: a still until it is pressed, then YouTube's privacy-enhanced player */
.video { position: relative; margin-top: 24px; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: var(--card); border: 1px solid var(--card-edge); }
.video img, .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; object-fit: cover; }
.video button { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; cursor: pointer; }
.video .play { position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%;
  background: rgba(17, 17, 17, .88); box-shadow: 0 4px 0 #0A0809; display: flex; align-items: center; justify-content: center; }
.video .play svg { width: 34px; height: 34px; fill: var(--cream); margin-left: 6px; }
.video button:hover .play { background: #111; }
.video button:focus-visible { outline: 3px solid var(--pink); outline-offset: -3px; }
.video .soon { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); background: rgba(17, 17, 17, .88);
  color: var(--cream); border-radius: 999px; padding: 6px 16px; font-weight: 600; font-size: 15px; white-space: nowrap; }

/* buttons: cream with ink text for the main action, raised dark for the second */
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 24px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 14px;
  font: 700 17px/1 'Source Sans 3', system-ui, sans-serif; text-decoration: none; border: 0; cursor: pointer;
  transition: transform .08s ease-out, box-shadow .08s ease-out, background-color .15s; }
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.btn.main { background: var(--cream); color: var(--ink); box-shadow: 0 4px 0 #B3A998; }
.btn.main:hover { background: #fff; }
.btn.main:active { transform: translateY(3px); box-shadow: 0 1px 0 #B3A998; }
.btn.second { background: #2A2425; color: var(--cream); box-shadow: 0 4px 0 #0A0809, inset 0 0 0 1px var(--line); }
.btn.second:hover { background: #332C2D; }
.btn.second:active { transform: translateY(3px); box-shadow: 0 1px 0 #0A0809, inset 0 0 0 1px var(--line); }
.btn:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }

/* chapters */
.chapters { list-style: none; border-top: 1px solid var(--card-edge); }
.chapters li { border-bottom: 1px solid var(--card-edge); }
.chapters li > a, .chapters li > span { display: flex; align-items: baseline; gap: 16px; padding: 12px; text-decoration: none; }
.chapters a > span { display: contents; }
.chapters a:hover { background: rgba(245, 240, 232, .04); }
.chapters .t { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 3.2em; }

/* the app */
.app { margin-top: 44px; background: var(--card); border: 1px solid var(--card-edge); border-radius: 16px; padding: 22px; }
.app p { max-width: 46em; }
.app .actions { margin-top: 16px; }

/* the list of lessons, by revision topic */
.lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.lesson { display: block; background: var(--card); border: 1px solid var(--card-edge); border-radius: 14px; overflow: hidden; text-decoration: none; }
.lesson img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.lesson div { padding: 12px 14px 14px; }
.lesson b { display: block; font-family: 'Playfair Display', Georgia, serif; font-size: 19px; line-height: 1.25; }
.lesson small { color: var(--muted); font-size: 14px; }
.lesson:hover { border-color: var(--line); }
.lesson:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }

footer { margin-top: 56px; color: var(--muted); font-size: 14px; }
footer a { color: var(--muted); }
