/* Harriet Music. Ink-blue on white, the instrument's own colour as accent (set per page in --accent), Harriet's
   petrol for the tutor. Bricolage Grotesque for headings and interface, Newsreader for reading.
   The one signature element is the course score: the course drawn as a one-line percussion staff, a bar per
   section and a note per lesson. */

:root {
  --ink: #1e2235;
  --ink-2: #555b70;
  --paper: #ffffff;
  --wash: #eef1f6;
  --line: #d9dee7;
  --harriet: #2d6f73;
  --spark: #f4c95d;
  --accent: #f4c95d;
  --good: #2f7f52;
  --bad: #b8403a;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --text: "Newsreader", Georgia, "Times New Roman", serif;
  --wrap: 1180px;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.1875rem/1.62 var(--text);
  font-optical-sizing: auto;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--harriet); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; background: var(--ink); color: #fff; padding: .5em 1em; z-index: 20; font-family: var(--display); }
.skip:focus { top: 8px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }

/* Type */
.display {
  font: 760 clamp(2.15rem, 4.6vw, 3.55rem)/1.04 var(--display);
  letter-spacing: -0.025em;
  margin: .25em 0 .35em;
  text-wrap: balance;
}
.display-lesson { font-size: clamp(2rem, 4vw, 3.1rem); max-width: 22ch; }
.display-home { font-size: clamp(2.5rem, 6vw, 4.4rem); max-width: 15ch; }
.lead { font-size: 1.32rem; line-height: 1.5; color: var(--ink-2); max-width: 36em; margin: 0 0 1.2em; }
.h2 { font: 700 1.6rem/1.15 var(--display); letter-spacing: -0.015em; margin: 0 0 .7em; }
.section-note { color: var(--ink-2); margin: -.4em 0 1.2em; }

.prose { max-width: 66ch; }
.prose h2 { font: 700 1.45rem/1.2 var(--display); letter-spacing: -0.01em; margin: 1.8em 0 .5em; }
.prose h3 { font: 650 1.2rem/1.25 var(--display); margin: 1.5em 0 .4em; }
.prose p { margin: 0 0 1em; }
.prose strong { font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin: .25em 0; }
.prose a { text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font: 640 1rem/1 var(--display);
  padding: .95em 1.4em;
  border-radius: 999px;
  border: 2px solid transparent;
  text-decoration: none;
  cursor: pointer;
}
.btn-accent { background: var(--accent); color: var(--ink); }
.btn-accent:hover { background: color-mix(in srgb, var(--accent) 85%, #000); }
.btn-ghost { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn-small { padding: .65em 1.1em; font-size: .9rem; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* Masthead */
.masthead { border-bottom: 1px solid var(--line); background: var(--paper); }
.masthead-row { display: flex; align-items: center; gap: 1.5rem; min-height: 68px; }
.topnav { min-width: 0; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; flex: none; }
.brand-name { font: 760 1.25rem/1 var(--display); letter-spacing: -0.02em; white-space: nowrap; }
.topnav { display: flex; gap: 1.25rem; font: 560 1rem/1 var(--display); overflow-x: auto; }
.topnav a { text-decoration: none; padding: .4em 0; border-bottom: 2px solid transparent; white-space: nowrap; }
.topnav a:hover, .topnav a[aria-current] { border-bottom-color: var(--accent); }
.masthead-app { margin-left: auto; }
.langs { position: relative; margin-left: auto; font: 600 .92rem/1 var(--display); }
.langs + .masthead-app { margin-left: 0; }
.langs summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .45em; padding: .55em .8em;
  border: 1.5px solid var(--line); border-radius: 999px; white-space: nowrap;
}
.langs summary::-webkit-details-marker { display: none; }
.langs summary::after { content: ""; width: .45em; height: .45em; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.langs[open] summary, .langs summary:hover { border-color: var(--ink); }
.langs-code { display: none; }
.langs ul {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; list-style: none; margin: 0; padding: 6px; min-width: 160px;
  background: var(--paper); border: 1.5px solid var(--ink); border-radius: 14px; box-shadow: 0 10px 30px rgb(30 34 53 / 14%);
}
.langs li a { display: block; padding: .6em .8em; border-radius: 9px; text-decoration: none; }
.langs li a:hover { background: var(--wash); }
.langs li a[aria-current] { font-weight: 760; }
@media (max-width: 640px) { .langs-name { display: none; } .langs-code { display: inline; } }

/* Breadcrumbs */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .35em; padding: 0; margin: 0; font: 500 .9rem/1.4 var(--display); color: var(--ink-2); }
.crumbs li + li::before { content: "/"; margin-right: .35em; color: var(--line); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* Hero */
.hero { background: var(--wash); padding: 28px 0 40px; }
.hero-grid { display: grid; gap: 32px; align-items: center; margin-top: 12px; }
.hero-cover { margin: 0; }
.hero-cover img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 28px 28px 28px 6px; }
.facts { display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 1.6em; }
.facts div { padding: 0 1.4rem 0 0; margin-right: 1.4rem; border-right: 1px solid var(--line); }
.facts div:last-child { border: 0; margin: 0; }
.facts dt { font: 500 .85rem/1.3 var(--display); color: var(--ink-2); }
.facts dd { margin: 0; font: 760 1.75rem/1.1 var(--display); }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.15fr .85fr; gap: 56px; } }

/* The course score */
.score-wrap { margin-top: 36px; }
.score { list-style: none; display: flex; flex-wrap: wrap; padding: 0; margin: 0; row-gap: 22px; }
.score .bar { position: relative; flex: 1 1 auto; padding: 0 12px; border-left: 2px solid var(--ink); }
.score .bar.is-final { padding-right: 24px; }
/* the end of the course: a real final barline, thin 2px + gap 3px + thick 6px */
.score .bar.is-final::after {
  content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 11px;
  background: linear-gradient(to right, var(--ink) 0 2px, transparent 2px 5px, var(--ink) 5px 11px);
}
/* a section shown alone that is not the last ends with a single barline */
.score .bar.is-closed { border-right: 2px solid var(--ink); }
.bar-name {
  display: block; font: 560 .78rem/1.2 var(--display); color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 24ch; margin-bottom: 8px;
}
.notes {
  list-style: none; display: flex; gap: 8px; padding: 0; margin: 0; align-items: center; min-height: 22px;
  background: linear-gradient(var(--ink), var(--ink)) 0 50% / 100% 2px no-repeat;
}
.note {
  display: block; width: 18px; height: 18px; border-radius: 50%;
  background: var(--paper); border: 2.5px solid var(--ink);
}
.note:hover { background: var(--accent); }
.note.is-passed { background: var(--ink); }
.note.is-current { background: var(--accent); border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent); }
/* a lesson that is only in the app: a small filled square on the line, not a link */
.note.is-app { width: 12px; height: 12px; border-radius: 2px; border: 0; background: var(--ink-2); margin: 3px; cursor: default; }
.note.is-app:hover { background: var(--ink-2); }
.score-key-app { white-space: nowrap; }
.score-key-app .note.is-app { display: inline-block; vertical-align: -1px; margin: 0 6px 0 4px; width: 10px; height: 10px; }
.score-key { font: 500 .9rem/1.4 var(--display); color: var(--ink-2); margin: 14px 0 0; }
.score-compact { margin-top: 22px; }
.score-compact .bar { padding: 0 8px; }
.score-compact .bar-name { display: none; }
.score-compact .notes { gap: 5px; min-height: 14px; }
.score-compact .note { width: 12px; height: 12px; border-width: 2px; }
.score-compact .note.is-app { width: 8px; height: 8px; margin: 2px; }
.score-compact .bar.is-final { padding-right: 20px; }
/* the lesson head, proposal D: the whole course from 980px, only the lesson's section below */
.score-section { display: none; }
@media (max-width: 979px) {
  .lesson-head .score-compact { display: none; }
  .score-section { display: block; margin-top: 20px; }
}
.score-section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 0 10px; font: 560 .9rem/1.3 var(--display); }
.ss-pos { color: var(--ink-2); }
.ss-title { font-weight: 700; }
.ss-all { margin-left: auto; color: var(--ink); text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.score-one .bar { padding: 0 14px; }
.score-one .bar.is-final { padding-right: 26px; }
.score-one .notes { justify-content: space-between; min-height: 28px; }
.score-one .note { width: 20px; height: 20px; }
.score-one .note.is-app { width: 13px; height: 13px; }
@media (min-width: 900px) {
  .score-hub .bar { flex: var(--n) 1 calc(var(--n) * 30px + 26px); }
  .score-hub .notes { justify-content: space-between; }
  .score-hub .bar-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; max-width: none; }
  .score-hub { align-items: flex-end; }
}

/* Two columns */
.columns { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; padding-top: 40px; padding-bottom: 64px; }
.col-main { min-width: 0; }
@media (min-width: 980px) {
  .columns { grid-template-columns: minmax(0, 1fr) 320px; gap: 64px; }
  .sticky { position: sticky; top: 24px; }
}
.block-section { margin: 0 0 56px; }

/* Hub: what you will learn */
.learn { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px 32px; }
@media (min-width: 700px) { .learn { grid-template-columns: 1fr 1fr; } }
.learn li { padding-left: 30px; position: relative; }
.learn li::before {
  content: ""; position: absolute; left: 0; top: .5em; width: 14px; height: 14px; border-radius: 50%;
  border: 2.5px solid var(--ink); background: var(--accent);
}

/* Hub: curriculum */
.curriculum { border-top: 2px solid var(--ink); }
.unit { border-bottom: 1px solid var(--line); }
.unit summary {
  display: grid; grid-template-columns: 2.2rem 1fr auto; align-items: baseline; gap: 12px;
  padding: 18px 4px; cursor: pointer; list-style: none; font-family: var(--display);
}
.unit summary::-webkit-details-marker { display: none; }
.unit summary::after { content: "+"; grid-column: 3; grid-row: 1; justify-self: end; font: 500 1.4rem/1 var(--display); }
.unit[open] summary::after { content: "−"; }
.unit-n { font-weight: 760; font-size: 1.3rem; color: var(--ink-2); }
.unit-title { font-weight: 700; font-size: 1.2rem; }
.unit-meta { grid-column: 2; font-size: .9rem; color: var(--ink-2); }
.unit-lessons { list-style: none; margin: 0 0 14px; padding: 0; }
.unit-lessons a { display: grid; grid-template-columns: 2.2rem 1fr auto; gap: 12px; padding: 12px 4px; text-decoration: none; border-radius: 10px; }
.unit-lessons a:hover { background: var(--wash); }
.unit-lessons .ul-row { display: grid; grid-template-columns: 2.2rem 1fr auto; gap: 12px; padding: 12px 4px; color: var(--ink-2); }
.unit-lessons .is-app .ul-title { color: var(--ink-2); }
.ul-tag {
  display: inline-block; margin-left: .4em; padding: .15em .55em; border-radius: 999px; vertical-align: 1px;
  font: 600 .72rem/1.3 var(--display); letter-spacing: .02em; color: var(--ink); background: var(--wash); border: 1px solid var(--line);
}
.ul-n { font: 600 .95rem/1.5 var(--display); color: var(--ink-2); }
.ul-title { display: block; font: 620 1.05rem/1.35 var(--display); }
.ul-sum { display: block; color: var(--ink-2); font-size: 1rem; line-height: 1.45; }
.ul-min { font: 500 .85rem/1.5 var(--display); color: var(--ink-2); text-align: right; white-space: nowrap; }
.ul-video { display: block; color: var(--ink); }
@media (max-width: 560px) {
  .unit-lessons a, .unit-lessons .ul-row { grid-template-columns: 1.8rem 1fr; }
  .ul-min { grid-column: 2; text-align: left; }
  .ul-video { display: inline; margin-left: .5em; }
}

/* Tutor */
.tutor { display: grid; grid-template-columns: 72px 1fr; gap: 20px; align-items: start; background: var(--wash); border-radius: 22px; padding: 26px; }
.tutor-mark { width: 72px; height: 72px; }
.tutor p { margin: 0; max-width: 60ch; }

/* App card */
.appcard {
  display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: center;
  border: 2px solid var(--ink); border-radius: 20px; padding: 18px; background: var(--paper);
}
.appcard-icon { width: 56px; height: 56px; border-radius: 14px; }
.appcard-name { margin: 0; font: 700 1.05rem/1.25 var(--display); }
.appcard-line { margin: .2em 0 0; font-size: 1rem; line-height: 1.4; color: var(--ink-2); }
.appcard-btn { grid-column: 1 / -1; }

/* Store buttons: only the stores the app has; on a phone only the visitor's store, else a quiet line */
.stores { display: flex; flex-wrap: wrap; gap: 8px; }
.stores .store { flex: 1 1 auto; }
.store-note { display: none; margin: 0; font: 560 .92rem/1.4 var(--display); color: var(--ink-2); }
.os-ios .stores.has-appstore .store-play, .os-android .stores.has-play .store-appstore { display: none; }
.os-ios .stores:not(.has-appstore) .store, .os-android .stores:not(.has-play) .store { display: none; }
.os-ios .stores:not(.has-appstore) .store-note-ios, .os-android .stores:not(.has-play) .store-note-android { display: block; }
.os-ios .stores .store-appstore { background: var(--accent); border-color: transparent; color: var(--ink); }
.app-adds { list-style: none; padding: 0; margin: 14px 4px 0; font-size: 1rem; }
.app-adds li { padding: 6px 0 6px 24px; position: relative; border-bottom: 1px solid var(--line); }
.app-adds li::before { content: ""; position: absolute; left: 2px; top: .85em; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.appcard-inline { margin-top: 18px; border-width: 1px; }
.appcard-wide { margin: 48px 0 0; }
@media (min-width: 640px) {
  .appcard-wide, .appcard-inline { grid-template-columns: 56px 1fr auto; }
  .appcard-wide .appcard-btn, .appcard-inline .appcard-btn { grid-column: 3; width: auto; flex-direction: column; }
}

/* Lesson head */
.lesson-head { background: var(--wash); padding: 24px 0 30px; }
.lesson-pos { display: flex; gap: 1.2em; margin: 18px 0 0; font: 560 .95rem/1.3 var(--display); color: var(--ink-2); }
.lesson-pos span + span { padding-left: 1.2em; border-left: 1px solid var(--line); }
.harriet-says { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; max-width: 62ch; margin-top: 6px; }
.says-mark { width: 44px; height: 44px; }
.harriet-says p { margin: 0; font-size: 1.2rem; line-height: 1.5; }
.says-who { display: block; font: 700 .95rem/1.4 var(--display); color: var(--harriet); }

/* Blocks */
.lesson-body > * + * { margin-top: 28px; }
.lesson-body .prose h2:first-child { margin-top: 0; }
.b-head { font: 700 1.25rem/1.2 var(--display); margin: 0 0 .6em; display: flex; align-items: baseline; gap: .6em; }
.b-head-meta { font: 560 .85rem/1 var(--display); color: var(--ink-2); padding: .35em .7em; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); }

.b-figure, .b-compare, .b-audio, .b-steps { margin-left: 0; margin-right: 0; }
.b-figure img { border-radius: var(--radius); background: var(--wash); max-height: 640px; width: auto; margin: 0 auto; }
figcaption { font-size: 1rem; line-height: 1.5; color: var(--ink-2); margin-top: 10px; max-width: 62ch; }
/* The parts named on a figure: one card per part, the name in the interface face, what it does under it. */
.b-figure figcaption:has(.legend) { max-width: none; }
.legend { display: grid; gap: 10px; margin: 16px 0 0; padding: 0; }
@media (min-width: 640px) { .legend { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.legend > div { padding: 12px 16px; background: var(--wash); border-left: 5px solid var(--accent); border-radius: 4px 14px 14px 4px; }
.legend dt { font: 700 1rem/1.3 var(--display); color: var(--ink); }
.legend dd { margin: 3px 0 0; font-size: 1rem; line-height: 1.45; color: var(--ink-2); }

.b-compare-title { font: 700 1.15rem/1.3 var(--display); margin: 0 0 12px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 479px) { .pair { grid-template-columns: 1fr; } }
.side { margin: 0; }
.side img { border-radius: var(--radius); width: 100%; height: auto; }
.side .tag { display: block; font: 700 .95rem/1.3 var(--display); }
.tag-good .tag { color: var(--good); }
.tag-bad .tag { color: var(--bad); }
.tag-good img { box-shadow: 0 0 0 3px var(--good); }
.tag-bad img { box-shadow: 0 0 0 3px var(--bad); }

.b-steps { list-style: none; padding: 0; display: grid; gap: 16px; counter-reset: st; }
@media (min-width: 640px) { .b-steps { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }
.b-steps li { counter-increment: st; }
.b-steps figure { margin: 0; }
.b-steps img { border-radius: var(--radius); }
.b-steps figcaption::before { content: counter(st) ". "; font: 700 1rem var(--display); color: var(--ink); }

.b-video .yt { position: relative; display: block; border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 16/9; }
.b-video .yt img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.yt-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font: 680 1rem/1 var(--display); color: var(--ink); background: var(--accent);
  padding: 1em 1.4em 1em 3em; border-radius: 999px; white-space: nowrap;
}
.yt-play::before { content: ""; position: absolute; left: 1.3em; top: 50%; transform: translateY(-50%); border-left: 13px solid var(--ink); border-top: 8px solid transparent; border-bottom: 8px solid transparent; }
.b-video iframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: var(--radius); display: block; }
.b-video-note { font: 500 .85rem/1.4 var(--display); color: var(--ink-2); margin: 8px 0 0; }

.b-audio { background: var(--wash); border-radius: var(--radius); padding: 16px; }
.b-audio audio { width: 100%; }
.b-audio figcaption { margin-top: 10px; }
.transcript { display: block; font-family: var(--display); color: var(--ink); margin-top: 6px; }

/* Strokes: one cell per beat, in the colours of the app's rhythm figures: bass dark, tone teal, slap brown,
   rest empty. */
.strokes { list-style: none; display: grid; grid-template-columns: repeat(var(--cols, 8), minmax(0, 2.6rem)); gap: 6px; padding: 0; margin: 12px 0 0; }
.stroke {
  width: 100%; aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center;
  font: 760 1.05rem/1 var(--display); border: 2.5px solid var(--ink);
}
.s-bass { background: var(--ink); color: #fff; }
.s-tone { background: #e3f3f0; color: #0f7a6d; border-color: #14897b; }
.s-slap { background: #f6ede4; color: #7a4a1f; border-color: #8b5a2b; }
.s-rest { border: 2px dashed var(--line); }
@media (max-width: 480px) {
  .stroke { font-size: .95rem; border-radius: 8px; }
  .strokes { gap: 4px; grid-template-columns: repeat(var(--cols-s, 8), minmax(0, 2.6rem)); }
  .masthead-row { gap: 1rem; }
  .topnav { gap: .9rem; font-size: .95rem; }
}

.b-callout { border-radius: var(--radius); padding: 18px 20px; border: 2px solid var(--ink); }
.b-callout .prose p:last-child { margin-bottom: 0; }
.b-callout-title { font: 700 1.1rem/1.3 var(--display); margin: 0 0 .4em; }
.k-warning { border-color: #c98a1d; background: #fff6e6; }
.k-tip { border-color: var(--harriet); background: #eaf4f3; }

.b-checklist { list-style: none; padding: 0; }
.b-checklist li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.b-checklist input { width: 22px; height: 22px; accent-color: var(--harriet); margin-top: 4px; flex: none; }

.b-practice { background: var(--wash); border-radius: 22px; padding: 22px 24px; }
.b-practice .prose p:last-child { margin-bottom: 0; }
.rubric { margin: 12px 0 0; padding-left: 1.2em; }

.b-tool { border: 2px solid var(--ink); border-radius: 22px; padding: 22px 24px; }
.b-tool .strokes { margin: 4px 0 16px; }

.b-quiz { border-top: 2px solid var(--ink); padding-top: 22px; }
.q { border: 0; padding: 0; margin: 0 0 28px; }
.q legend { font: 650 1.12rem/1.4 var(--display); margin-bottom: 12px; padding: 0; }
.opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; margin-bottom: 8px; cursor: pointer; font-size: 1.05rem; line-height: 1.45; }
.opt:hover { border-color: var(--ink); }
.opt input { accent-color: var(--harriet); margin-top: 5px; flex: none; }
.opt.is-right { border-color: var(--good); background: #edf7f1; }
.opt.is-wrong { border-color: var(--bad); background: #fbefee; }
.q-check { display: none; margin-top: 4px; }
.js .q-check { display: inline-flex; }
.js .q-answer { display: none; }
.js .q.is-checked .q-answer { display: block; }
.js .q.is-checked .q-answer summary { display: none; }
.q-answer { margin-top: 10px; font-size: 1.02rem; }
.q-answer summary { cursor: pointer; font: 600 .95rem var(--display); }
.q-result { font: 680 1rem/1.4 var(--display); margin: 10px 0 0; }
.q-result:empty { display: none; }

/* In the app: what the app has at this point of the lesson, with the store buttons */
.b-apponly {
  display: grid; grid-template-columns: 44px 1fr; gap: 12px 14px; align-items: start;
  border: 2px dashed var(--ink-2); border-radius: 22px; padding: 18px 20px; background: var(--paper);
}
.b-apponly-icon { width: 44px; height: 44px; border-radius: 12px; }
.b-apponly-tag { margin: 0; font: 700 .8rem/1.3 var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--harriet); }
.b-apponly-text { margin: .15em 0 0; font-size: 1.08rem; line-height: 1.45; }
.b-apponly-stores { grid-column: 1 / -1; }
@media (min-width: 640px) {
  .b-apponly { grid-template-columns: 44px 1fr auto; align-items: center; }
  .b-apponly-stores { grid-column: 3; flex-direction: column; }
}

/* Only the beginning on the web (panel v5 teaser): the rest fades out under a card with the store buttons. Where the
   app is not in the visitor's store (.no-store-here), nothing is covered and a quiet line says where the app is. */
.paywall { position: relative; }
.paywalled {
  max-height: 360px; overflow: hidden; pointer-events: none; user-select: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, rgba(0, 0, 0, .55) 40%, transparent 92%);
  mask-image: linear-gradient(to bottom, #000 0, rgba(0, 0, 0, .55) 40%, transparent 92%);
}
.paywalled > * + * { margin-top: 28px; }
.paywall-card {
  position: relative; z-index: 1; margin-top: -150px;
  display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: center;
  border: 2px solid var(--ink); border-radius: 20px; padding: 20px; background: var(--paper);
  box-shadow: 0 -24px 40px 8px rgba(255, 255, 255, .92), 0 10px 30px rgba(30, 34, 53, .12);
}
.paywall-icon { width: 56px; height: 56px; border-radius: 14px; }
.paywall-title { margin: 0; font: 760 1.22rem/1.25 var(--display); }
.paywall-line { margin: .3em 0 0; font-size: 1rem; line-height: 1.45; color: var(--ink-2); }
.paywall-stores { grid-column: 1 / -1; }
.paywall-quiet { display: none; margin: 0; font: 560 .95rem/1.4 var(--display); color: var(--ink-2); }
.paywall-quiet span { display: none; }
.os-ios .paywall-quiet .pq-ios, .os-android .paywall-quiet .pq-android { display: inline; }
.no-store-here .paywalled { max-height: none; overflow: visible; pointer-events: auto; user-select: auto; -webkit-mask-image: none; mask-image: none; }
.no-store-here .paywall-card { display: none; }
.no-store-here .paywall-quiet { display: block; margin-top: 28px; }
/* With JS (.js on <html>, set in the head): the whole lesson shows first; when the reader scrolls into the covered part,
   site.js adds .is-locked and it closes: the rest shrinks, blurs and fades under the card, which rises into place.
   Without JS the cover above stays as it is. */
.js .paywall:not(.is-locked) .paywalled { max-height: none; overflow: visible; pointer-events: auto; user-select: auto; -webkit-mask-image: none; mask-image: none; }
.js .paywall:not(.is-locked) .paywall-card { display: none; }
.js .paywall .paywalled { position: relative; overflow-anchor: none; -webkit-mask-image: none; mask-image: none; }
.js .paywall .paywalled::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, .6) 35%, var(--paper) 88%);
}
.js .paywall.is-locked .paywalled::after { opacity: 1; }
.js .paywall.is-locked .paywalled > * { filter: blur(2.5px); }
@media (prefers-reduced-motion: no-preference) {
  .js .paywall .paywalled { transition: max-height .8s cubic-bezier(.4, 0, .2, 1); }
  .js .paywall .paywalled::after { transition: opacity .6s ease; }
  .js .paywall .paywalled > * { transition: filter .6s ease; }
  .js .paywall.is-locked .paywall-card { animation: paywall-rise .55s .25s cubic-bezier(.2, .8, .2, 1) both; }
  @keyframes paywall-rise { from { opacity: 0; transform: translateY(40px) scale(.97); } to { opacity: 1; transform: none; } }
}
@media (min-width: 640px) {
  .paywall-card { grid-template-columns: 56px 1fr auto; padding: 22px 24px; }
  .paywall-stores { grid-column: 3; flex-direction: column; }
}

/* Previous / next */
.prevnext { display: grid; gap: 12px; margin-top: 40px; }
@media (min-width: 640px) { .prevnext { grid-template-columns: 1fr 1fr; } }
.pn { display: block; padding: 16px 18px; border: 1.5px solid var(--line); border-radius: 16px; text-decoration: none; }
.pn:hover { border-color: var(--ink); }
.pn-next { text-align: right; }
@media (min-width: 640px) { .pn-next { grid-column: 2; } }
.pn-dir { display: block; font: 560 .85rem/1.3 var(--display); color: var(--ink-2); }
.pn-title { display: block; font: 680 1.1rem/1.3 var(--display); }

/* Lesson side column */
.section-nav { margin-bottom: 22px; }
.section-nav-head { font: 700 1rem/1.3 var(--display); margin: 0 0 10px; }
.section-nav ol { margin: 0; padding: 0 0 0 1.4em; font: 500 .98rem/1.35 var(--display); }
.section-nav li { padding: 5px 0; }
.section-nav a { text-decoration: none; color: var(--ink-2); }
.section-nav a:hover { color: var(--ink); text-decoration: underline; }
.section-nav a[aria-current] { color: var(--ink); font-weight: 700; }
.section-nav li.is-app { color: var(--ink-2); }
.section-nav li.is-app .ul-tag { margin-left: .2em; }

/* Bottom app bar on phones (a bar, never a pop-up) */
.appbar { display: none; }
@media (max-width: 979px) {
  .kind-lesson { padding-bottom: 64px; }
  .appbar {
    display: flex; align-items: center; gap: 10px; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 10;
    background: var(--ink); color: #fff; text-decoration: none; border-radius: 16px; padding: 10px 14px;
    font: 620 .98rem/1.2 var(--display);
  }
  .appbar img { border-radius: 8px; }
  .masthead-app { display: none; }
}

/* Home. Harriet is the memorable thing: her portrait, big, says the welcome. The courses follow how many there are
   (one wide, then 2, 3, 2 x 2, 3 per row) and each one is drawn as its score. */
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: color-mix(in srgb, var(--ink) 85%, #fff); }
.home-hero { padding: 40px 0 0; overflow: hidden; }
.home-hero-grid { display: grid; gap: 8px; align-items: end; }
.home-hero-text { padding-bottom: 8px; }
.home-hero .actions { align-items: center; gap: 12px 18px; }
.home-facts { margin: 0; font: 600 1rem/1.3 var(--display); color: var(--ink-2); }
.home-harriet { position: relative; margin: 0; display: grid; justify-items: center; }
.home-harriet-face { width: min(240px, 62vw); height: auto; position: relative; z-index: 1; margin-bottom: -24px; filter: drop-shadow(0 18px 30px rgb(30 34 53 / 14%)); }
.home-harriet-says {
  position: relative; z-index: 2; max-width: 30ch; margin: 0 0 40px; padding: 16px 20px;
  background: var(--paper); border: 2px solid var(--ink); border-radius: 22px 22px 22px 6px;
  font: 400 1.12rem/1.5 var(--text);
}
.home-harriet-says::before {
  content: ""; position: absolute; top: -12px; left: 50%; width: 20px; height: 20px; margin-left: -10px;
  background: var(--paper); border-left: 2px solid var(--ink); border-top: 2px solid var(--ink); transform: rotate(45deg);
}
@media (min-width: 900px) {
  .home-hero { padding-top: 56px; }
  .home-hero-grid { grid-template-columns: 1.15fr .85fr; gap: 40px; }
  .home-hero-text { padding-bottom: 72px; }
  /* the portrait on the right, her words over its lower left corner */
  .home-harriet { justify-items: end; padding-bottom: 48px; }
  .home-harriet-face { width: 330px; margin: 0 12px 0 0; }
  .home-harriet-says { position: absolute; left: 0; bottom: 28px; margin: 0; max-width: 25ch; }
  .home-harriet-says::before { left: auto; right: 34px; top: auto; bottom: 26px; margin: 0; right: -12px; border: 0; border-right: 2px solid var(--ink); border-top: 2px solid var(--ink); }
}
@media (prefers-reduced-motion: no-preference) {
  .home-harriet-says { animation: says-in .5s .35s cubic-bezier(.2, .8, .2, 1) both; }
  @keyframes says-in { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
}
.home-hero + .wrap { padding-top: 56px; }

.courses { display: grid; gap: 20px; }
.course { position: relative; display: grid; grid-template-rows: auto 1fr; border: 2px solid var(--ink); border-radius: 22px; overflow: hidden; background: var(--paper); }
.course:hover { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 45%, transparent); }
.course-cover img { display: block; width: 100%; aspect-ratio: 2/1; object-fit: cover; }
.course-body { display: flex; flex-direction: column; padding: 18px 20px 20px; border-top: 8px solid var(--accent); }
.course-name { margin: 0; font: 760 1.6rem/1.1 var(--display); }
.course-link { text-decoration: none; color: inherit; }
.course-link::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.course-link:focus-visible { outline: none; }
.course:has(.course-link:focus-visible) { outline: 3px solid var(--harriet); outline-offset: 3px; }
.course-meta { margin: 6px 0 0; color: var(--ink-2); font: 600 1rem/1.3 var(--display); }
.course-line { margin: 4px 0 0; color: var(--ink-2); }
.course-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 18px; }
.course-actions .btn { padding: .8em 1.2em; }
.course-go { margin-top: auto; padding-top: 16px; font: 700 1rem/1.2 var(--display); }
.course-go::after { content: ""; display: inline-block; width: .5em; height: .5em; margin-left: .45em; border-right: 2.5px solid currentColor; border-top: 2.5px solid currentColor; transform: rotate(45deg) translateY(-1px); }
.score-mini { row-gap: 12px; }
.score-mini .bar { flex: 0 1 auto; padding: 0 6px; }
.score-mini .bar-name { display: none; }
.score-mini .notes { gap: 4px; min-height: 14px; }
.score-mini .note { width: 11px; height: 11px; border-width: 2px; }
.score-mini .note.is-app { width: 7px; height: 7px; margin: 2px; }
@media (min-width: 700px) {
  .courses.n-2, .courses.n-3, .courses.n-4, .courses.n-5 { grid-template-columns: repeat(2, 1fr); }
  /* one course: the picture beside the text */
  .courses.n-1 .course { grid-template-columns: 1.1fr 1fr; grid-template-rows: none; }
  .courses.n-1 .course-cover img { height: 100%; aspect-ratio: auto; min-height: 320px; }
  .courses.n-1 .course-body { border-top: 0; border-left: 8px solid var(--accent); padding: 28px 30px; }
  .courses.n-1 .course-name { font-size: 2.2rem; }
}
@media (min-width: 1000px) { .courses.n-3, .courses.n-5 { grid-template-columns: repeat(3, 1fr); } }

.how-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.how-step { display: grid; align-content: start; grid-template-columns: 76px 1fr; column-gap: 16px; align-items: start; padding: 20px; border-radius: 22px; background: var(--wash); }
.how-face { grid-row: 1 / 3; width: 76px; height: 76px; }
.how-title { margin: 4px 0 6px; font: 720 1.2rem/1.2 var(--display); }
.how-n { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; margin-right: .2em; border-radius: 50%; background: var(--ink); color: #fff; font-size: .8em; vertical-align: .1em; }
.how-step p { margin: 0; color: var(--ink-2); line-height: 1.5; }
@media (min-width: 900px) {
  .how-steps { grid-template-columns: repeat(3, 1fr); }
  .how-step { grid-template-columns: 1fr; padding: 24px; }
  .how-face { grid-row: auto; width: 96px; height: 96px; margin-bottom: 10px; }
}

.starts { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
@media (min-width: 640px) { .starts { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .starts { grid-template-columns: repeat(3, 1fr); } }
.starts a { display: grid; grid-template-columns: 112px 1fr; grid-template-rows: auto 1fr; column-gap: 14px; text-decoration: none; }
.starts img { grid-row: 1 / 3; width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 18px; }
@media (min-width: 640px) { .starts a { display: block; } }
.start-title { display: block; font: 680 1.1rem/1.3 var(--display); align-self: end; }
@media (min-width: 640px) { .start-title { margin-top: 10px; } }
.start-meta { display: block; margin-top: 4px; font: 600 .9rem var(--display); color: var(--ink-2); }
.start-meta::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 7px; border-radius: 50%; background: var(--accent); border: 2px solid var(--ink); vertical-align: -1px; }
.starts a:hover .start-title { text-decoration: underline; text-underline-offset: 3px; }

.news { list-style: none; padding: 0; margin: 0; display: grid; gap: 0 32px; border-top: 2px solid var(--ink); }
@media (min-width: 800px) { .news { grid-template-columns: 1fr 1fr; } }
.news a { display: grid; grid-template-columns: 4.2em 1fr; gap: 2px 14px; padding: 14px 0; border-bottom: 1.5px solid var(--line); text-decoration: none; }
.news-day { grid-row: 1 / 3; font: 760 1rem/1.3 var(--display); color: var(--ink); border-left: 6px solid var(--accent); padding-left: 8px; }
.news-title { font: 650 1.05rem/1.3 var(--display); }
.news-course { font: 500 .9rem var(--display); color: var(--ink-2); }
.news a:hover .news-title { text-decoration: underline; text-underline-offset: 3px; }

.meet { display: grid; grid-template-columns: 96px 1fr; gap: 22px; align-items: start; padding: 28px; border: 2px solid var(--ink); border-radius: 26px 26px 26px 6px; }
.meet-face { width: 96px; height: 96px; }
.meet-text p { margin: 0 0 .7em; max-width: 62ch; font-size: 1.1rem; line-height: 1.6; }
.meet-text p:last-child { margin-bottom: 0; }
@media (min-width: 800px) { .meet { grid-template-columns: 140px 1fr; padding: 32px 36px; } .meet-face { width: 140px; height: 140px; } }

.faq { display: grid; gap: 18px; }
.faq-head { display: flex; align-items: center; gap: 14px; }
.faq-head .h2 { margin: 0; }
.faq-face { width: 64px; height: 64px; flex: none; }
.faq-list { border-top: 2px solid var(--ink); }
.faq-item { border-bottom: 1.5px solid var(--line); }
.faq-item summary { position: relative; list-style: none; cursor: pointer; padding: 16px 40px 16px 0; font: 680 1.12rem/1.35 var(--display); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; margin-top: -8px; border-right: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); transform: rotate(45deg); }
.faq-item[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq-item p { margin: 0 0 18px; max-width: 66ch; font-size: 1.08rem; line-height: 1.6; color: var(--ink-2); }
@media (min-width: 900px) { .faq { grid-template-columns: 300px 1fr; gap: 40px; } .faq-head { flex-direction: column; align-items: flex-start; } .faq-face { width: 120px; height: 120px; } }

.apps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.apps a { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; text-decoration: none; font: 600 1rem/1.25 var(--display); border: 1.5px solid var(--line); }
.apps a:hover { border-color: var(--ink); }
.apps img { border-radius: 12px; flex: none; }

/* Footer */
.footer { background: var(--ink); color: #e6e8ef; margin-top: 24px; padding: 48px 0 24px; }
.footer-grid { display: grid; gap: 32px; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.3fr 1fr 1.3fr; } }
.brand-footer .brand-name { color: #fff; }
.footer-note { color: #b9bdcc; font-size: 1rem; max-width: 34ch; }
.footer-head { font: 700 1rem/1.3 var(--display); color: #fff; margin: 0 0 10px; }
.footer-list { list-style: none; padding: 0; margin: 0; font: 500 .95rem/1.3 var(--display); }
.footer-list li { padding: 5px 0; }
.footer-list a { color: #d5d8e2; text-decoration: none; }
.footer-list a:hover { color: #fff; text-decoration: underline; }
.footer-base { margin-top: 36px; padding-top: 18px; border-top: 1px solid #3a3f58; font: 600 .85rem var(--display); color: #9ea3b5; }

@media (prefers-reduced-motion: no-preference) {
  .note { transition: background-color .12s; }
}

/* Panel v6: the other apps per platform (more_apps): a card shows the visitor's platform title and store; a computer (or
   no JS) shows Android first, else iPhone; a section, a list or the nav link with nothing for the platform hides. */
.ma .ma-i { display: none; }
.ma:not(.ma-has-a) .ma-i { display: flex; }
.os-android .ma:not(.ma-has-a), .os-ios .ma:not(.ma-has-i) { display: none; }
.os-ios .ma .ma-a { display: none; }
.os-ios .ma .ma-i { display: flex; }
.footer-list .ma .ma-i { display: none; }
.footer-list .ma:not(.ma-has-a) .ma-i, .os-ios .footer-list .ma .ma-i { display: inline; }
.os-ios .footer-list .ma .ma-a { display: none; }
.os-android .moreapps:not(.has-android), .os-ios .moreapps:not(.has-ios),
.os-android .moreapps-link:not(.has-android), .os-ios .moreapps-link:not(.has-ios) { display: none; }
.apps .ma-letter { width: 48px; height: 48px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--ink); color: #fff; font: 700 1.3rem var(--display); }

/* Panel v6: a lesson that is mostly practice (only its beginning on the web): the phone over the paywall, in the
   curriculum and on its note of the score. */
.phone-icon { width: 30px; height: 30px; display: block; }
.paywall-phone { display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, #fff); border-radius: 14px; }
.ul-practice { display: inline-flex; vertical-align: -3px; margin-left: .3em; }
.ul-phone { width: 17px; height: 17px; }
.note { position: relative; }
.note-phone { position: absolute; width: 13px; height: 13px; right: -9px; top: -11px; background: var(--paper, #fff); border-radius: 3px; }
.score-compact .note-phone { width: 10px; height: 10px; right: -7px; top: -9px; }

/* Tables in lesson texts (the app's Markdown tables) */
.table-wrap { overflow-x: auto; margin: 1em 0 1.2em; max-width: 100%; }
.prose table { border-collapse: collapse; width: 100%; font: 500 .98rem/1.4 var(--display); }
.prose th, .prose td { text-align: left; padding: .55em .8em; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-weight: 700; background: var(--wash); border-bottom: 2px solid var(--ink); white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }

/* One store box per lesson: the first "in the app" point keeps its card, every later one is a quiet line that scrolls
   down to the card at the end of the lesson (#get-app). Store buttons carry a small store mark. */
.store-icon { flex: none; width: 18px; height: 18px; }
.b-apponly-line {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0;
  font: 560 1rem/1.4 var(--display); color: var(--ink-2);
}
.b-apponly-line .apponly-phone { flex: none; width: 20px; height: 20px; color: var(--harriet); }
.b-apponly-line > span { flex: 1 1 14em; }
.to-get-app { font-weight: 700; color: var(--ink); white-space: nowrap; }
.b-quiz .b-apponly-line { margin-top: 16px; }
.b-tool .b-apponly-line { margin-top: 14px; }
.lesson-body > * + .b-apponly-line, .paywalled > * + .b-apponly-line { margin-top: 28px; }
#get-app { scroll-margin-top: 24px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
