/* DhakaBassist design system.
 *
 * Colours, type scale and spacing are taken from the supplied design. Bootstrap
 * supplies the grid and a few utilities; everything that carries the brand is
 * defined here so a component looks the same wherever it appears.
 */

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

:root {
  /* Surfaces */
  --ink: #211f1d;
  --ink-hover: #000;
  --parchment: #f1e9d2;
  --cream: #f8f3e6;
  --panel: #fbf8ef;

  /* Lines, from strongest to faintest */
  --line-strong: #211f1d;
  --line: #ddd3ba;
  --line-soft: #eae2cb;
  --line-field: #bfb394;
  --line-muted: #c9be9f;
  --track: #e3d8bc;
  --track-admin: #eae2cb;
  --highlight: #e6dcc1;
  --highlight-strong: #ede4cc;

  /* Text */
  --text: #211f1d;
  --text-muted: #5e5a53;
  --text-faint: #a39a84;

  /* Feedback */
  --ok: #3f6b3a;
  --ok-bg: #e4e9d6;
  --err: #9b3b2e;
  --err-bg: #f3e1d6;

  /* Type */
  /* The Noto faces carry only Bengali glyphs (see their unicode-range), so
     Latin text keeps the brand fonts and Bangla falls through to them. */
  --font-display: "Fraunces", "Noto Serif Bengali", Georgia, "Times New Roman", serif;
  /* Bangla headings use the sans; prices, numbers and the rest keep the serif. */
  --font-heading-bn: "Fraunces", "Noto Sans Bengali", Georgia, "Times New Roman", serif;
  --font-body: "Atkinson Hyperlegible", "Noto Sans Bengali", system-ui, -apple-system,
    "Segoe UI", sans-serif;
  --font-mono: ui-monospace, Menlo, Consolas, monospace;

  /* Layout */
  --shell: 1200px;
  --gutter: 32px;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-xs: 4px;

  /* Motion. Short and linear-ish: the brief asks for calm, not flourish. */
  --ease: cubic-bezier(0.2, 0, 0.2, 1);
  --fast: 0.15s;
  --slow: 0.3s;
}

/* ------------------------------------------------------------------ fonts */

@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-var.b65477430776.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fonts/atkinson-400-latin.d444e1815a3a.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fonts/atkinson-400-latin-ext.bedd1a793e82.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fonts/atkinson-700-latin.c6b471cbb2b9.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fonts/atkinson-700-latin-ext.c23ae1f7f708.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Real italics, so the browser never slants the upright face itself. */
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fonts/atkinson-400i-latin.66d79cf044cb.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("../fonts/atkinson-400i-latin-ext.d79d2ee558b4.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Bangla. Fraunces and Atkinson have no Bengali glyphs; the browser only
   downloads these when a page contains Bangla text. */
@font-face {
  font-family: "Noto Serif Bengali";
  src: url("../fonts/noto-serif-bengali-var.3ed1b30d3123.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6,
    U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC,
    U+A8F1, U+11DF0-11DF1;
}

@font-face {
  font-family: "Noto Sans Bengali";
  src: url("../fonts/noto-sans-bengali-var.a330372ad815.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6,
    U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC,
    U+A8F1, U+11DF0-11DF1;
}

/* ------------------------------------------------------------------- base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--parchment);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  font-variation-settings: "SOFT" 30;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.01em;
}

/* Bengali letters hang vowel signs above and below the line, so they need
   more leading than Latin, and negative tracking breaks up conjuncts. */
:lang(bn) body,
body:lang(bn) {
  line-height: 1.7;
}

:lang(bn) h1,
:lang(bn) h2,
:lang(bn) h3,
:lang(bn) h4 {
  font-family: var(--font-heading-bn);
  line-height: 1.35;
  letter-spacing: 0;
}

p {
  margin: 0;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--fast) var(--ease);
}

a:hover {
  color: var(--ink-hover);
}

img,
svg,
video {
  max-width: 100%;
}

img {
  height: auto;
}

button,
input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 2px;
}

.on-dark :focus-visible {
  outline-color: var(--parchment);
}

/* Visible only to assistive technology until focused. */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--ink);
  color: var(--parchment);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 700;
  transition: top var(--fast) var(--ease);
}

.skip-link:focus {
  top: 12px;
  color: var(--parchment);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ----------------------------------------------------------------- layout */

.shell {
  max-width: var(--shell);
  margin: 0 auto;
  padding-inline: var(--gutter);
  width: 100%;
}

.shell--narrow {
  max-width: 860px;
}

.shell--wide {
  max-width: 1320px;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--parchment);
}

.page__main {
  flex: 1;
}

.section {
  padding-block: 72px;
}

.section--tight {
  padding-block: 56px;
}

.section--loose {
  padding-block: 80px;
}

.section--ink {
  background: var(--ink);
  color: var(--parchment);
}

.section--ruled {
  border-top: 1px solid var(--line);
}

/* The gap is declared on the stack itself, not as a margin on its children.
 * `--stack-gap` inherits, so a child that is itself a stack would otherwise
 * resolve the parent's margin against its own value. */
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--stack-gap, 16px);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--cluster-gap, 12px);
}

.split {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}

/* Two columns that collapse on their own content width, not a breakpoint. */
.duo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 56px;
  align-items: center;
}

.duo--start {
  align-items: start;
}

.duo--tight {
  gap: 48px;
}

/* ---------------------------------------------------------------- display */

.eyebrow {
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0;
}

.section--ink .eyebrow {
  color: inherit;
  opacity: 0.75;
}

.display-1 {
  font-size: clamp(40px, 5.2vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.display-2 {
  font-size: clamp(36px, 4.6vw, 56px);
  line-height: 1.05;
  text-wrap: balance;
}

.display-3 {
  font-size: clamp(30px, 3.4vw, 40px);
  line-height: 1.1;
}

.display-4 {
  font-size: clamp(26px, 2.6vw, 34px);
  line-height: 1.15;
}

.lede {
  font-size: 19px;
  line-height: 1.6;
  max-width: 54ch;
  text-wrap: pretty;
}

.prose {
  font-size: 18px;
  line-height: 1.75;
  max-width: 70ch;
}

.prose > * + * {
  margin-top: 18px;
}

.prose h2 {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  margin-top: 32px;
}

.prose h3 {
  font-size: 21px;
  font-weight: 600;
  margin-top: 26px;
}

.prose ul,
.prose ol {
  padding-left: 24px;
}

.prose li + li {
  margin-top: 8px;
}

.prose figure {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-inline: 0;
}

.prose figcaption,
.figure-caption {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 12px;
}

.prose img {
  display: block;
  border-radius: var(--radius-sm);
}

.prose audio {
  width: 100%;
}

/* A link to a media library file downloads it; the arrow says so up front. */
.prose .file-link::before {
  content: "↓ ";
  font-weight: 700;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--cream);
  padding: 2px 5px;
  border-radius: var(--radius-xs);
}

.muted {
  color: var(--text-muted);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  font-size: 15px;
  color: var(--text-muted);
}

.price {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1;
  font-size: clamp(40px, 5vw, 56px);
}

.price--sm {
  font-size: 44px;
}

/* A course on offer: the regular price struck through beside today's. */
.price-row {
  --cluster-gap: 10px;
  align-items: baseline;
}

.price__was {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--text-muted);
  text-decoration-thickness: 2px;
}

.price__countdown {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.price__offer {
  font-size: 16px;
  line-height: 1.5;
}

/* The five-line stave rule used as a section divider. */
.stave {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stave span {
  height: 1px;
  background: var(--ink);
  display: block;
}

.stave span:nth-child(2) { opacity: 0.55; }
.stave span:nth-child(3) { opacity: 0.4; }
.stave span:nth-child(4) { opacity: 0.28; }
.stave span:nth-child(5) { opacity: 0.16; }

/* --------------------------------------------------------------- controls */

.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--parchment);
  --btn-border: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1.5px solid var(--btn-border);
  border-radius: var(--radius-sm);
  padding: 13px 22px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease),
    border-color var(--fast) var(--ease);
}

.btn:hover {
  --btn-bg: var(--ink-hover);
  --btn-border: var(--ink-hover);
  color: var(--parchment);
}

.btn--outline {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
}

.btn--outline:hover {
  --btn-bg: var(--ink);
  --btn-fg: var(--parchment);
}

/* The primary button on an ink surface. */
.btn--light {
  --btn-bg: var(--parchment);
  --btn-fg: var(--ink);
  --btn-border: var(--parchment);
}

.btn--light:hover {
  --btn-bg: var(--cream);
  --btn-border: var(--cream);
  color: var(--ink);
}

.btn--sm {
  padding: 9px 15px;
  font-size: 14px;
}

.btn--md {
  padding: 11px 18px;
  font-size: 15px;
}

.btn--block {
  width: 100%;
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
}

/* A button that reads as a link. */
.btn-link {
  background: none;
  border: 0;
  padding: 0;
  font-size: 16px;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.btn-link--sm {
  font-size: 14px;
}

.chip {
  border: 1px solid var(--line-muted);
  border-radius: var(--radius-xs);
  padding: 4px 9px;
  font-size: 13px;
  color: var(--text-muted);
  background: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 14px;
  background: none;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}

.pill[aria-pressed="true"],
.pill.is-active {
  background: var(--ink);
  color: var(--parchment);
}

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: var(--radius-xs);
  background: var(--ink);
  color: var(--parchment);
  border: 1px solid var(--ink);
}

.badge--light {
  background: var(--parchment);
  color: var(--ink);
  border-color: var(--parchment);
}

.badge--status {
  border-radius: 999px;
  letter-spacing: 0;
  white-space: nowrap;
}

.badge--complete {
  background: var(--ink);
  color: var(--parchment);
  border-color: var(--ink);
}

.badge--current {
  background: var(--parchment);
  color: var(--ink);
  border-color: var(--ink);
}

.badge--locked {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--line-muted);
}

.badge--ok {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: var(--ok);
}

.badge--err {
  background: var(--err-bg);
  color: var(--err);
  border-color: var(--err);
}

.badge--neutral {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--text-faint);
}

/* ------------------------------------------------------------ pagination */

.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
}

.pager__pages {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.pager__page,
.pager__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}

a.pager__page:hover,
a.pager__step:hover {
  border-color: var(--ink);
}

.pager__page.is-current {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--parchment);
}

.pager__step.is-disabled {
  color: var(--text-faint);
  border-color: var(--line-soft);
}

.pager__gap {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
  color: var(--text-muted);
}

/* On a phone the page numbers drop to their own row under Previous / Next. */
@media (max-width: 575.98px) {
  .pager__pages {
    order: 3;
    width: 100%;
    justify-content: center;
  }
}

/* ------------------------------------------------------------- file tags */

/* A file's type as a small tag, in the panel's library and on downloads. */
.file-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 32px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--panel);
  border: 1px solid var(--line-muted);
  border-radius: var(--radius-xs);
}

.file-tag--audio {
  color: var(--ok);
  background: var(--ok-bg);
  border-color: var(--ok);
}

.file-tag--image {
  color: var(--ink);
  background: var(--highlight);
  border-color: var(--line-field);
}

/* ------------------------------------------------------------------ cards */

.panel {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}

.panel--framed {
  border-color: var(--ink);
}

.panel--flush {
  padding: 0;
}

/* The call to action closing a lesson: start the quiz, or mark it complete. */
.panel--cta {
  margin-top: 12px;
  background: transparent;
  align-items: center;
  padding: 24px 26px;
}

.panel__cta-title {
  font-size: 22px;
  font-weight: 600;
}

.panel__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.panel__title {
  font-size: 16px;
  font-weight: 700;
}

.panel__foot {
  padding: 10px 20px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-muted);
}

/* A grid whose 1px gaps read as hairline rules. */
.grid-rule {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.grid-rule > * {
  background: var(--panel);
}

.grid-rule--ink {
  background: rgba(241, 233, 210, 0.25);
  border-color: rgba(241, 233, 210, 0.25);
  border-radius: 0;
}

.grid-rule--ink > * {
  background: var(--ink);
}

.grid-rule--facts {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border-radius: 0;
}

.grid-rule--facts > * {
  background: var(--parchment);
}

.fact {
  padding: 18px 20px;
}

.fact__key {
  font-size: 13px;
  color: var(--text-muted);
}

.fact__value {
  font-size: 17px;
  font-weight: 700;
}

/* -------------------------------------------------------------- home hero */

/* The words lead and the circle of fifths follows. While the two columns are
   stacked the picture stays small and centred, so the calls to action sit
   near the top of a phone screen instead of below a full-width image. */
.hero {
  padding-block: 32px 48px;
}

.hero__body {
  max-width: 58ch;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-muted);
}

.hero__actions {
  margin-top: 6px;
}

.hero__facts {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  font-size: 15px;
  color: var(--text-muted);
}

.hero__facts li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero__facts .tick__mark {
  margin-top: 0;
  color: var(--ink);
}

.hero__art {
  width: 100%;
  max-width: 300px;
  justify-self: center;
}

@media (min-width: 576px) {
  .hero__art {
    max-width: 400px;
  }
}

@media (min-width: 768px) {
  .hero {
    padding-block: 56px 64px;
  }
}

@media (min-width: 992px) {
  .hero {
    padding-block: 72px 64px;
  }

  .hero__art {
    max-width: 520px;
    justify-self: end;
  }
}

/* A section's eyebrow and heading, with an optional link on the right. */
.section-head {
  margin-bottom: 28px;
}

.section-head__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

@media (min-width: 768px) {
  .section-head {
    margin-bottom: 36px;
  }
}

/* -------------------------------------------------------- why this course */

/* Eight short benefits on the hairline grid: one per row on a phone, two
   from 576px, four from 992px. The cards are ink, so the 1px gaps read as
   faint parchment rules, and each carries a tick in a parchment disc. */
.benefits {
  list-style: none;
  margin: 0;
  padding: 0;
  grid-template-columns: 1fr;
  background: color-mix(in srgb, var(--parchment) 20%, var(--ink));
  border-color: var(--ink);
  box-shadow: 8px 8px 0 var(--highlight);
}

.benefit {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  font-size: 16px;
  line-height: 1.45;
  background: var(--ink);
  color: var(--parchment);
  transition: background var(--fast) var(--ease);
}

.benefit:hover {
  background: color-mix(in srgb, var(--parchment) 8%, var(--ink));
}

.benefit__mark {
  flex: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--parchment);
  color: var(--ink);
}

.benefit__mark .tick__mark {
  margin-top: 0;
}

@media (min-width: 576px) {
  .benefits {
    grid-template-columns: repeat(2, 1fr);
  }

  .benefit {
    gap: 16px;
    padding: 18px 20px;
    font-size: 17px;
  }
}

@media (min-width: 768px) {
  .benefits {
    box-shadow: 12px 12px 0 var(--highlight);
  }
}

@media (min-width: 992px) {
  .benefits {
    grid-template-columns: repeat(4, 1fr);
  }

  .benefit {
    flex-direction: column;
    align-items: flex-start;
    padding: 26px 22px 30px;
  }
}

/* ------------------------------------------------------- free module offer */

.free-intro__body {
  max-width: 54ch;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* The free module itself, set on ink so it is the one dark object on the
   page section: the thing to click. A stave runs across the top edge. */
.free-card {
  position: relative;
  background: var(--ink);
  color: var(--parchment);
  border-radius: var(--radius);
  padding: 44px 24px 26px;
  box-shadow: 8px 8px 0 var(--highlight);
  overflow: hidden;
}

.free-card::before {
  content: "";
  position: absolute;
  inset: 16px 24px auto;
  height: 13px;
  background: repeating-linear-gradient(
    to bottom,
    color-mix(in srgb, var(--parchment) 22%, transparent) 0 1px,
    transparent 1px 3px
  );
}

.free-card__head {
  --cluster-gap: 10px;
  justify-content: space-between;
}

.free-card__meta {
  font-size: 14px;
  opacity: 0.8;
}

/* Every free module, one per row between faint stave-like rules. */
.free-card__modules {
  list-style: none;
  margin: 0;
  padding: 0;
}

.free-card__module {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-block: 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--parchment) 22%, transparent);
}

.free-card__module:first-child {
  border-top: 1px solid color-mix(in srgb, var(--parchment) 22%, transparent);
}

.free-card__number {
  min-width: 2ch;
  font-family: var(--font-display);
  font-size: clamp(44px, 5vw, 60px);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.02em;
}

.free-card__kicker {
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.8;
}

.free-card__title {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.2vw, 26px);
  font-weight: 500;
  line-height: 1.2;
}

.free-card__note {
  font-size: 15px;
  text-align: center;
  opacity: 0.85;
}

.free-card__note a {
  color: inherit;
  text-underline-offset: 3px;
}

@media (min-width: 768px) {
  .free-card {
    padding: 52px 36px 32px;
    box-shadow: 12px 12px 0 var(--highlight);
  }

  .free-card::before {
    inset-inline: 36px;
  }
}

/* ------------------------------------------------- audience and community */

.audience {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Each line opens on a note head, tilted as it would sit on a stave. */
.audience__item {
  position: relative;
  padding: 16px 0 16px 34px;
  font-size: 17px;
  line-height: 1.5;
}

.audience__item::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 24px;
  width: 13px;
  height: 9px;
  border-radius: 50%;
  background: var(--ink);
  transform: rotate(-20deg);
}

.community {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: 8px 8px 0 var(--highlight);
}

.community__icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--parchment);
}

.community__body {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .community {
    padding: 40px 36px;
    box-shadow: 12px 12px 0 var(--highlight);
  }
}

/* The course Discord invite: an ink card so it stands apart from the
   parchment around it. Stacks on phones; text and button sit side by side
   where there is room (the dashboard). `--compact` keeps the button on its
   own row, for the narrow course-page sidebar. */
.discord-card {
  display: grid;
  gap: 16px;
  background: var(--ink);
  color: var(--parchment);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: 8px 8px 0 var(--highlight);
}

.discord-card__icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--parchment);
  color: var(--ink);
}

.discord-card__text {
  display: grid;
  gap: 6px;
}

.discord-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.2;
}

.discord-card__body {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  opacity: 0.85;
}

.discord-card__action {
  min-height: 48px;
}

@media (min-width: 768px) {
  .discord-card {
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 22px;
    padding: 26px 28px;
    box-shadow: 12px 12px 0 var(--highlight);
  }

  .discord-card--compact {
    grid-template-columns: auto 1fr;
    padding: 22px 20px;
    box-shadow: 6px 6px 0 var(--highlight);
  }

  .discord-card--compact .discord-card__action {
    grid-column: 1 / -1;
  }
}

/* ------------------------------------------------------------ closing call */

.ready {
  align-items: center;
  text-align: center;
}

.ready__lede {
  max-width: 52ch;
  font-size: 19px;
  line-height: 1.6;
  opacity: 0.85;
}

.ready__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 520px;
}

.ready__input {
  min-height: 50px;
  padding: 13px 16px;
  font-size: 17px;
  color: var(--parchment);
  background: color-mix(in srgb, var(--parchment) 8%, transparent);
  border: 1.5px solid color-mix(in srgb, var(--parchment) 45%, transparent);
  border-radius: var(--radius-sm);
  transition: border-color var(--fast) var(--ease);
}

.ready__input::placeholder {
  color: color-mix(in srgb, var(--parchment) 55%, transparent);
}

.ready__input:hover,
.ready__input:focus {
  border-color: var(--parchment);
}

.ready__note {
  font-size: 15px;
  opacity: 0.8;
}

.ready__note a {
  color: inherit;
  text-underline-offset: 3px;
  white-space: nowrap;
}

@media (min-width: 576px) {
  .ready__form {
    flex-direction: row;
  }

  .ready__input {
    flex: 1;
  }
}

/* ------------------------------------------------------------------- list */

/* The repeating curriculum / FAQ / table pattern: a strong top rule, then
   a soft rule under every row. */
.ruled {
  border-top: 1px solid var(--line-strong);
}

.ruled > * {
  border-bottom: 1px solid var(--line);
}

.ruled--columns {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  column-gap: 32px;
}

.module-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Number and title share a baseline, so a row without a summary still lines
   up. Rows are tighter on a phone, where all nine stack in one column. */
.module-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 18px 8px 20px 0;
  text-align: left;
}

.module-row__head {
  --cluster-gap: 10px;
}

.module-row__number {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
  width: 40px;
  flex: none;
}

@media (min-width: 768px) {
  .module-row {
    gap: 18px;
    padding: 26px 8px 30px 0;
  }

  .module-row__number {
    font-size: 30px;
    width: 44px;
  }
}

.module-row__title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
}

.module-row__body {
  font-size: 15px;
  line-height: 1.55;
  text-wrap: pretty;
}

/* --------------------------------------------------------------- disclose */

.disclose > summary {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 20px 0;
  cursor: pointer;
  list-style: none;
}

.disclose > summary::-webkit-details-marker {
  display: none;
}

.disclose--faq > summary {
  grid-template-columns: 1fr auto;
  padding: 22px 0;
  font-size: 19px;
  font-weight: 700;
}

.disclose__sign {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 300;
  flex: none;
  line-height: 1;
}

.disclose[open] .disclose__sign .is-closed,
.disclose:not([open]) .disclose__sign .is-open {
  display: none;
}

.disclose__panel {
  padding: 0 0 22px 68px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.disclose--faq .disclose__panel {
  padding: 0 0 22px;
  font-size: 17px;
  line-height: 1.6;
  max-width: 68ch;
}

/* Browsers that support it animate the open/close; others just snap. */
@media (prefers-reduced-motion: no-preference) {
  .disclose__panel {
    animation: disclose var(--slow) var(--ease);
  }
}

@keyframes disclose {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.bullet {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 16px;
}

.bullet::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
  flex: none;
}

.tick {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 16px;
}

.tick__mark {
  flex: none;
  margin-top: 5px;
}

/* ------------------------------------------------------------------ media */

.media {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--ink);
}

.media--square {
  aspect-ratio: 1 / 1;
}

.media--portrait {
  aspect-ratio: 4 / 5;
}

.media--wide {
  aspect-ratio: 16 / 9;
}

.media--three-two {
  aspect-ratio: 3 / 2;
}

.media img,
.media video,
.media iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: 0;
}

/* Portraits cropped wider than tall keep the face in frame. */
.media--face img {
  object-position: 50% 25%;
}

.media__overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.play {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--parchment);
  border: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform var(--fast) var(--ease);
}

.play:hover {
  transform: scale(1.06);
}

.play--sm {
  width: 42px;
  height: 42px;
}

.player-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--parchment);
  font-size: 13px;
  background: linear-gradient(transparent, rgba(33, 31, 29, 0.75));
}

.audio-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--cream);
}

/* Course page: who wrote the course. Photo above the text on phones. */
.author-card {
  display: grid;
  gap: 20px;
  align-items: start;
  padding-top: 32px;
  border-top: 1px solid var(--line-muted);
}

@media (min-width: 576px) {
  .author-card {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 28px;
  }
}

.author-card__photo {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 50%;
  background: var(--ink);
}

@media (min-width: 768px) {
  .author-card__photo {
    width: 160px;
    height: 160px;
  }
}

/* Home page: the instructor. A landscape crop while the photo sits above the
   text, so it does not fill the screen; the full portrait beside it. */
.instructor__photo {
  width: 100%;
  max-width: 440px;
  aspect-ratio: 4 / 3;
}

@media (min-width: 992px) {
  .instructor__photo {
    aspect-ratio: 4 / 5;
  }
}

/* ------------------------------------------------------------------ meter */

.meter {
  height: 8px;
  background: var(--track);
  border-radius: 4px;
  overflow: hidden;
}

.meter--sm {
  height: 6px;
  border-radius: 3px;
}

.meter--xs {
  height: 4px;
  border-radius: 2px;
}

.meter__fill {
  height: 100%;
  background: var(--ink);
  border-radius: inherit;
  display: block;
  transition: width var(--slow) var(--ease);
}

.meter--light {
  background: rgba(241, 233, 210, 0.3);
}

.meter--light .meter__fill {
  background: var(--parchment);
}

/* ------------------------------------------------------------------ forms */

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 15px;
  font-weight: 700;
}

.field__input,
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field textarea,
.field select {
  background: var(--cream);
  border: 1px solid var(--line-field);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  font-size: 16px;
  font-weight: 400;
  color: var(--text);
  width: 100%;
  transition: border-color var(--fast) var(--ease);
}

.field textarea {
  resize: vertical;
  min-height: 120px;
}

.field__input:hover,
.field input:hover,
.field textarea:hover {
  border-color: var(--ink);
}

.field__help {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
}

.field__error {
  font-size: 14px;
  font-weight: 400;
  color: var(--err);
}

/* `.field.` so this outranks `.field input[type="…"]` above. */
.field--invalid .field__input,
.field.field--invalid input,
.field.field--invalid textarea {
  border-color: var(--err);
}

/* Registration: a line under "Confirm password" that fills as the student
 * types, then turns green with a tick when both passwords agree. site.js sets
 * the state classes on `.pw-confirm` and `--pw-fill` (0 to 1) for the line. */
.pw-confirm {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pw-match {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 30px;
}

.pw-match[hidden] {
  display: none;
}

.pw-match__track {
  display: block;
  height: 3px;
  border-radius: 3px;
  background: var(--line-soft);
  overflow: hidden;
}

.pw-match__bar {
  display: block;
  height: 100%;
  background: var(--text-faint);
  transform: scaleX(var(--pw-fill, 0));
  transform-origin: left center;
}

.pw-match__note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-muted);
}

.pw-match__tick {
  display: none;
  flex: none;
}

.pw-match__tick path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.pw-confirm.is-match input {
  border-color: var(--ok);
}

.pw-confirm.is-match .pw-match__bar {
  background: var(--ok);
}

.pw-confirm.is-match .pw-match__note {
  color: var(--ok);
  font-weight: 700;
}

.pw-confirm.is-match .pw-match__tick {
  display: block;
}

.pw-confirm.is-match .pw-match__tick path {
  stroke-dashoffset: 0;
}

.pw-confirm.is-mismatch .pw-match__bar {
  background: var(--err);
}

.pw-confirm.is-mismatch .pw-match__note {
  color: var(--err);
}

/* The password rules under "Password": a dot while untested, a green tick
 * once met, a red cross once the student has left the field without it. */
.pw-checklist {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
  color: var(--text-muted);
}

.pw-checklist__item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pw-checklist__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 16px;
  height: 16px;
}

.pw-checklist__mark::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-field);
}

.pw-checklist__tick,
.pw-checklist__cross {
  display: none;
}

.pw-checklist__tick path {
  stroke-dasharray: 1;
}

.pw-checklist__item.is-met {
  color: var(--ok);
}

.pw-checklist__item.is-failed {
  color: var(--err);
}

.pw-checklist__item.is-met .pw-checklist__mark::before,
.pw-checklist__item.is-failed .pw-checklist__mark::before {
  display: none;
}

.pw-checklist__item.is-met .pw-checklist__tick,
.pw-checklist__item.is-failed .pw-checklist__cross {
  display: block;
}

@media (prefers-reduced-motion: no-preference) {
  .pw-checklist__item {
    transition: color var(--slow) var(--ease);
  }

  .pw-checklist__item.is-met .pw-checklist__tick {
    animation: pw-tick-in var(--slow) var(--ease);
  }

  .pw-checklist__item.is-met .pw-checklist__tick path {
    animation: pw-tick-draw 0.4s var(--ease) 0.1s backwards;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .pw-match__bar {
    transition: transform var(--slow) var(--ease), background-color var(--slow) var(--ease);
  }

  .pw-confirm.is-match .pw-match__tick {
    animation: pw-tick-in var(--slow) var(--ease);
  }

  /* The tick goes from display: none to shown, which a transition cannot
     follow, so the stroke draws with keyframes instead. */
  .pw-confirm.is-match .pw-match__tick path {
    animation: pw-tick-draw 0.4s var(--ease) 0.1s backwards;
  }
}

@keyframes pw-tick-draw {
  from {
    stroke-dashoffset: 1;
  }
}

@keyframes pw-tick-in {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* The anti-spam sum: a small panel so it reads as one quick step, not one
   more text field. */
.captcha {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.captcha__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.captcha__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.captcha__sum {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.captcha__input {
  width: 5.5rem;
  min-height: 52px;
  padding: 8px 10px;
  background: var(--cream);
  border: 1px solid var(--line-field);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  transition: border-color var(--fast) var(--ease);
}

.captcha__input:hover,
.captcha__input:focus {
  border-color: var(--ink);
}

.captcha__input::placeholder {
  color: var(--text-faint);
}

.captcha--invalid .captcha__input {
  border-color: var(--err);
}

.check {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 15px;
  font-weight: 400;
}

.check input {
  accent-color: var(--ink);
  width: 16px;
  height: 16px;
  flex: none;
}

.form-note {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* A segmented two-up toggle, used for log in / create account. */
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.segmented a {
  padding: 11px;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}

.segmented a[aria-current="page"] {
  background: var(--ink);
  color: var(--parchment);
}

/* Radio cards for the payment methods. */
.option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line-muted);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}

.option:hover {
  background: var(--cream);
}

.option__radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  display: grid;
  place-items: center;
  flex: none;
}

.option__radio::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: transparent;
  transition: background var(--fast) var(--ease);
}

.option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option:has(input:checked) {
  border: 1.5px solid var(--ink);
  background: var(--cream);
}

.option:has(input:checked) .option__radio::after {
  background: var(--ink);
}

.option:has(input:focus-visible) {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.option__label {
  font-size: 17px;
  font-weight: 700;
}

.option__hint {
  font-size: 14px;
  color: var(--text-muted);
}

/* --------------------------------------------------------------- messages */

.flash {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ink);
  background: var(--cream);
  font-size: 16px;
}

.flash--success {
  border-color: var(--ok);
  background: var(--ok-bg);
  color: var(--ok);
}

.flash--error {
  border-color: var(--err);
  background: var(--err-bg);
  color: var(--err);
}

/* ------------------------------------------------------- site chrome */

.masthead {
  border-bottom: 1px solid var(--line);
  background: var(--parchment);
  position: sticky;
  top: 0;
  z-index: 20;
}

.masthead__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-block: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex: none;
}

.brand__mark {
  width: 38px;
  height: 38px;
  display: block;
}

.brand__word {
  height: 26px;
  display: block;
}

.nav {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  font-size: 16px;
  flex: 1;
}

.nav a {
  text-decoration: none;
  border-bottom: 1.5px solid transparent;
  padding: 4px 0;
  transition: border-color var(--fast) var(--ease);
}

.nav a:hover,
.nav a[aria-current="page"] {
  border-bottom-color: var(--ink);
}

.masthead__actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: none;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 4px;
  font-size: 15px;
  color: var(--ink);
  text-underline-offset: 3px;
}

.avatar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line-muted);
  border-radius: 999px;
  padding: 4px 14px 4px 4px;
  font-size: 15px;
  text-decoration: none;
  transition: border-color var(--fast) var(--ease);
}

.avatar-link:hover {
  border-color: var(--ink);
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--parchment);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  flex: none;
}

.avatar--lg {
  width: 32px;
  height: 32px;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-muted);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  margin-left: auto;
}

.breadcrumbs {
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
}

.breadcrumbs li::after {
  content: "/";
  margin-left: 8px;
  color: var(--text-faint);
}

.breadcrumbs li:last-child::after {
  content: none;
}

.breadcrumbs a {
  color: var(--text-muted);
}

.site-footer {
  background: var(--ink);
  color: var(--parchment);
}

.site-footer a {
  color: var(--parchment);
}

.site-footer__inner {
  /* padding-block only: the gutter comes from `.shell`, and a `padding`
     shorthand here would cancel it. */
  padding-block: 56px 40px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.site-footer__cols {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}

.site-footer__links {
  display: flex;
  gap: 56px;
  flex-wrap: wrap;
  font-size: 15px;
}

.site-footer__group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.site-footer__label {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
}

.site-footer__base {
  border-top: 1px solid rgba(241, 233, 210, 0.25);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  opacity: 0.8;
}

/* A quiet developer credit under the copyright row. The link keeps a 44px
   tap target without making the text any bigger. */
.site-footer__credit {
  margin: -32px 0 -12px;
  font-size: 12px;
  opacity: 0.6;
}

.site-footer__credit a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --------------------------------------------------------------- learning */

.learn {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.learn__aside {
  flex: 1 1 260px;
  max-width: 300px;
  border-right: 1px solid var(--line);
  padding: 32px 28px 32px 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-self: flex-start;
  position: sticky;
  top: 90px;
}

.learn__main {
  flex: 999 1 480px;
  min-width: 0;
  padding: 32px 0 72px 40px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  max-width: 880px;
}

.module-nav {
  display: flex;
  flex-direction: column;
}

.module-nav a,
.module-nav span.module-nav__item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  line-height: 1.3;
  text-decoration: none;
  transition: background var(--fast) var(--ease);
}

.module-nav a:hover {
  background: var(--cream);
}

.module-nav__item.is-current,
.module-nav a.is-current {
  background: var(--highlight);
}

.module-nav__item.is-locked {
  opacity: 0.55;
}

.module-nav__dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--ink);
}

.module-nav__dot.is-done {
  background: var(--ink);
}

.module-nav__number {
  color: var(--text-muted);
  margin-right: 6px;
}

.tabs {
  display: flex;
  gap: 28px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.tabs button,
.tabs a {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 0 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}

.tabs [aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.quiz-dots {
  display: flex;
  gap: 6px;
}

.quiz-dots span {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: var(--track);
}

.quiz-dots span.is-done {
  background: var(--ink);
}

.quiz-dots span.is-current {
  background: var(--line-field);
}

.answer {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  text-align: left;
  padding: 18px 20px;
  border-radius: var(--radius);
  font-size: 18px;
  cursor: pointer;
  background: var(--cream);
  border: 1.5px solid var(--line-muted);
  color: var(--ink);
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}

.answer:hover {
  border-color: var(--ink);
}

.answer__letter {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  flex: none;
}

.answer__text {
  flex: 1;
}

.answer__note {
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.answer.is-correct {
  background: var(--ok-bg);
  border-color: var(--ok);
  cursor: default;
}

.answer.is-wrong {
  background: var(--err-bg);
  border-color: var(--err);
  color: var(--err);
  cursor: default;
}

/* The rule goes on the answer text alone. `text-decoration` on the button
   would be drawn through every descendant, including the "Try again" label,
   and a child cannot opt out of an ancestor's decoration. */
.answer.is-wrong .answer__text {
  text-decoration: line-through;
}

/* Quiz text is Markdown, so it can carry audio and diagrams from the
   media library wherever the administrator links them. */
.quiz-count {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--text-muted);
}

.quiz-question {
  font-family: var(--font-display);
  font-size: clamp(26px, 2.6vw, 34px);
  line-height: 1.2;
  text-wrap: pretty;
}

.quiz-question > * + *,
.quiz-feedback > * + * {
  margin-top: 16px;
}

.quiz-question img {
  display: block;
  width: 100%;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.quiz-question audio,
.quiz-feedback audio,
.answer-option audio {
  display: block;
  width: 100%;
}

/* The explanation shares a row with the Next button, so a diagram here
   stays small rather than pushing the button off screen. */
.quiz-feedback img {
  display: block;
  max-width: 100%;
  max-height: 200px;
  width: auto;
  border-radius: var(--radius-sm);
}

.answer-option {
  display: grid;
  gap: 8px;
}

.answer__text img {
  display: inline-block;
  max-height: 96px;
  max-width: 100%;
  vertical-align: middle;
}

.quiz-score {
  font-family: var(--font-display);
  font-size: 80px;
  font-weight: 400;
  line-height: 1;
}

/* ------------------------------------------------------------- utilities */

.u-center {
  text-align: center;
}

/* Keeps a button its own width inside a column `.stack`. */
.u-self-center {
  align-self: center;
}

.u-self-start {
  align-self: flex-start;
}

.u-sticky {
  position: sticky;
  top: 96px;
}

.u-gap-6 { --stack-gap: 6px; }
.u-gap-8 { --stack-gap: 8px; }
.u-gap-10 { --stack-gap: 10px; }
.u-gap-12 { --stack-gap: 12px; }
.u-gap-14 { --stack-gap: 14px; }
.u-gap-16 { --stack-gap: 16px; }
.u-gap-18 { --stack-gap: 18px; }
.u-gap-20 { --stack-gap: 20px; }
.u-gap-22 { --stack-gap: 22px; }
.u-gap-24 { --stack-gap: 24px; }
.u-gap-26 { --stack-gap: 26px; }
.u-gap-28 { --stack-gap: 28px; }
.u-gap-36 { --stack-gap: 36px; }
.u-gap-40 { --stack-gap: 40px; }

.u-fs-13 { font-size: 13px; }
.u-fs-14 { font-size: 14px; }
.u-fs-15 { font-size: 15px; }
.u-fs-16 { font-size: 16px; }
.u-fs-17 { font-size: 17px; }
.u-fs-18 { font-size: 18px; }
.u-fs-19 { font-size: 19px; }
.u-bold { font-weight: 700; }
.u-serif { font-family: var(--font-display); }
.u-mono { font-family: var(--font-mono); }
.u-nowrap { white-space: nowrap; }

/* Sections fade in as they arrive.
 *
 * The hidden state keys off `.is-armed`, which the script adds only as it
 * starts observing an element. Nothing can be left invisible by a script
 * that failed to load or threw before that point. */
@media (prefers-reduced-motion: no-preference) {
  .reveal.is-armed {
    opacity: 0;
    transform: translateY(14px);
  }

  .reveal.is-armed.is-visible {
    opacity: 1;
    transform: none;
    transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
  }
}

/* --------------------------------------------------------- small screens */

/* The lesson's two columns need roughly 260 + 480 + the inner padding before
   they stop fitting; below that the module list moves above the lesson. */
@media (max-width: 860px) {
  .learn__aside {
    position: static;
    max-width: none;
    flex-basis: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 24px 0;
  }

  .learn__main {
    padding: 28px 0 56px;
    flex-basis: 100%;
  }
}

@media (max-width: 768px) {
  :root {
    --gutter: 20px;
  }

  .section {
    padding-block: 48px;
  }

  .section--loose,
  .section--tight {
    padding-block: 48px;
  }

  .duo,
  .duo--tight {
    gap: 36px;
  }

  .masthead {
    position: static;
  }

  .masthead__inner {
    flex-wrap: wrap;
    gap: 14px;
  }

  .nav-toggle {
    display: block;
  }

  .nav {
    display: none;
    flex-direction: column;
    gap: 2px;
    flex-basis: 100%;
    order: 3;
  }

  .nav.is-open {
    display: flex;
  }

  .nav a {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
  }

  /* Sit beside the menu button when they fit, drop to their own row when
     they do not — which is what "Log in" plus "Enroll" needs at 375px. */
  .masthead__actions {
    order: 4;
    flex: 1 1 auto;
    justify-content: flex-end;
    gap: 10px;
  }

  .masthead__actions:has(.btn + .btn),
  .masthead__actions:has(.btn-link + .btn) {
    flex-basis: 100%;
  }

  .masthead__actions:has(.btn-link + .btn) .btn {
    flex: 1;
  }

  /* A pair of stacked calls to action reads as one block, not two ragged
     buttons of different widths. */
  .cluster > .btn {
    flex: 1 1 auto;
  }

  .site-footer__links {
    gap: 28px;
  }

  .u-sticky {
    position: static;
  }

  .disclose > summary {
    grid-template-columns: 40px 1fr auto;
    gap: 12px;
  }

  /* FAQ rows have no number column; keep the question full width. */
  .disclose--faq > summary {
    grid-template-columns: 1fr auto;
  }

  .disclose__panel {
    padding-left: 52px;
  }

  .prose,
  .lede {
    font-size: 17px;
  }

  .answer {
    font-size: 17px;
    padding: 16px;
  }

  .panel {
    padding: 22px;
  }
}

@media print {
  .masthead,
  .site-footer,
  .nav-toggle,
  .skip-link {
    display: none;
  }

  body {
    background: #fff;
  }
}

/* -------------------------------------------------------------- downloads */

/* One card a row on a phone, two from tablets, three on wide screens. */
.download-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 768px) {
  .download-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .download-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.download-grid > li {
  display: flex;
}

.download-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  min-width: 0;
  padding: 24px;
}

.download-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* A free download's usual price, struck through beside its Free badge. */
.download-card__price {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.download-card__title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.download-card__meta {
  gap: 4px 16px;
}

.download-card__text {
  font-size: 16px;
  line-height: 1.6;
}

/* Pinned to the bottom, so buttons line up across a row of cards. */
.download-card__action {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}

.download-filters {
  --cluster-gap: 8px;
}

/* Tap-sized filter pills. */
.download-filters .pill {
  min-height: 44px;
}
