/* Clefhop's public pages (home, pricing, FAQ, support, privacy, terms, and the sign-in forms that
   share the marketing layout). Everything is scoped to .mk-body so the signed-in app keeps its own
   look. The brief, and what each critique pass changed, is docs/DESIGN.md.

   The idea: a pencil on a practice sheet. The page is pencil yellow with graphite-navy ink; the
   note is the pink of the eraser; the dark appearance is a piano (ebony black, ivory white,
   the same yellow). A notehead is the page's punctuation: it ends the headings and starts each
   question. */

@font-face {
  font-family: "Young Serif";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/YoungSerif-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, 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: "Young Serif";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/YoungSerif-latin.woff2") format("woff2");
  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;
}

.mk-body {
  /* Materials, not roles. */
  --pencil: #ffd83d; --graphite: #12183a; --eraser: #e8266f; --eraser-deep: #b3124b;
  --ebony: #0d0d0f; --ivory: #f6f3ea;

  --paper: #fff9de; --paper-2: #fff0b0; --card: #fffcee;
  --ink: #12183a; --ink-2: #363c6b; --muted: #54587d;
  --line: rgba(18, 24, 58, 0.16); --line-2: rgba(18, 24, 58, 0.34);
  --accent: var(--eraser); --accent-deep: var(--eraser-deep); --accent-ink: #ffffff; --accent-soft: #ffd9e6;
  --ok: #0f9d6a; --ok-text: #0b7a52; --ok-soft: #d6f7e8; --warn: #e39a00; --warn-soft: #fff0c9; --bad: #e23d2e; --bad-text: #b3261b; --bad-soft: #fde0dd;
  --staff-ink: #12183a;
  /* The field: the masthead, the hero, the closing band. */
  --ground: var(--pencil); --ground-ink: #12183a; --ground-ink-2: #2a3060; --ground-line: rgba(18, 24, 58, 0.2);
  --rule: #12183a;
  /* Buttons: graphite with a pencil-yellow word. */
  --btn: #12183a; --btn-ink: #ffd83d; --btn-hover: #2a3060;
  /* The stage carved out of the page: the grown-ups' band. */
  --pit: #12183a; --pit-ink: #fff3cf; --pit-ink-2: #d9d3b4;
  --display: "Young Serif", "Iowan Old Style", Georgia, serif;
  --ui: "Baloo 2", Nunito, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-hop: cubic-bezier(0.34, 1.56, 0.64, 1);
  color-scheme: light;
  background-color: var(--paper);
  min-height: 100vh; display: flex; flex-direction: column;
  color: var(--ink);
}
@media (prefers-color-scheme: dark) {
  .mk-body {
    --paper: #0d0d0f; --paper-2: #1a1a1e; --card: #fffcee;
    --ink: #f6f3ea; --ink-2: #d8d3c4; --muted: #aaa69d;
    --line: rgba(255, 243, 207, 0.16); --line-2: rgba(255, 243, 207, 0.36);
    --accent: #ff6b9d; --accent-deep: #ff8db3; --accent-ink: #0d0d0f; --accent-soft: #2a1822;
    --ground: #0d0d0f; --ground-ink: #f6f3ea; --ground-ink-2: #d8d3c4; --ground-line: rgba(255, 216, 61, 0.3);
    --rule: #ffd83d; --staff-ink: #f6f3ea;
    --btn: #ffd83d; --btn-ink: #12183a; --btn-hover: #ffe680;
    --pit: #ffd83d; --pit-ink: #12183a; --pit-ink-2: #2a3060;
    color-scheme: dark;
  }
}

/* A sheet is paper in either appearance: the live drill, the pass, the heat map, the keys. */
.mk-body .stage, .mk-body .price-card, .mk-body .heat-demo, .mk-body .key, .mk-body .card {
  --card: #fffcee; --paper: #fff9de; --paper-2: #fff0b0;
  --ink: #12183a; --ink-2: #363c6b; --muted: #54587d; --staff-ink: #12183a;
  --line: rgba(18, 24, 58, 0.16); --line-2: rgba(18, 24, 58, 0.34);
  --accent: #e8266f; --accent-deep: #b3124b; --accent-ink: #ffffff; --accent-soft: #ffd9e6;
  --btn: #12183a; --btn-ink: #ffd83d; --btn-hover: #2a3060; --rule: #12183a;
  --ok: #0f9d6a; --ok-text: #0b7a52; --ok-soft: #d6f7e8;
  color: var(--ink);
}

.mk-body ::selection { background: var(--eraser); color: #fff; }
.mk-body > main { flex: 1; }
.mk-wrap { width: min(1120px, 100% - 2.4rem); margin: 0 auto; }

/* Type: Young Serif for what is said, Nunito for what is read. */
.mk-body h1, .mk-body h2, .mk-body h3 { font-family: var(--display); font-weight: 400; letter-spacing: -0.015em; text-wrap: balance; }
.mk-body h1 { font-size: clamp(2.5rem, 1rem + 5.4vw, 5.4rem); line-height: 0.98; letter-spacing: -0.025em; margin: 0 0 1.2rem; }
.mk-body h2 { font-size: clamp(2rem, 1.2rem + 3vw, 3.5rem); line-height: 1.02; letter-spacing: -0.02em; margin: 0 0 1.2rem; }
.mk-body h3 { line-height: 1.15; }
.hl { color: var(--accent-deep); }
/* The notehead ends the heading, the way a period would. It leans the way the mark's notes do. */
.noted::after { content: ""; display: inline-block; width: 0.3em; height: 0.22em; margin-left: 0.1em; border-radius: 50%; background: var(--accent); transform: rotate(-20deg); }
.ground .noted::after { background: var(--eraser); }
@media (prefers-color-scheme: dark) { .ground .noted::after { background: var(--accent); } }
.eyebrow { font-size: 0.82rem; font-weight: 800; letter-spacing: 0.04em; color: var(--muted); margin: 0 0 0.8rem; }
.lead { font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem); line-height: 1.5; color: var(--ink-2); max-width: 33rem; }
.ground .lead { color: var(--ground-ink-2); }

/* The staff divider between the home page's sections (pages/_staff_rule): kept, in the new inks. */
.staff-rule { --k: 1; position: relative; margin-bottom: calc(-22px * var(--k)); }
button.staff-rule { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
@media (max-width: 560px) { .staff-rule { --k: 0.8; } }
@media (max-width: 360px) { .staff-rule { --k: 0.68; } }
.staff-rule::after { content: ""; position: absolute; right: 0; top: calc(20px * var(--k)); width: 2px; height: calc(49px * var(--k)); background: var(--ink); }
.rule-staff { display: block; height: calc(var(--h) * var(--k) * 1px); overflow: hidden; }
.rule-staff > g { transform: scale(var(--k)); }
.rule-staff .rule-line { stroke: var(--ink); stroke-opacity: 0.55; stroke-width: 1; shape-rendering: crispEdges; }
.rule-staff .clef { font-family: var(--music); fill: var(--ink); }
.rule-staff .n { --d: calc(var(--i) * 110ms); }
.rule-staff .head { fill: var(--ink); transition: fill 0.3s var(--ease) var(--d); }
.rule-staff .stem { stroke: var(--ink); stroke-width: 1.7; transition: stroke 0.3s var(--ease) var(--d); }
.rule-staff .ledger { stroke: var(--ink); stroke-width: 1.4; }
.rule-staff .bar { stroke: var(--ink); stroke-opacity: 0.55; stroke-width: 1.4; }
.rule-staff .rule-name { font-family: var(--display); font-size: 22px; fill: var(--accent-deep); opacity: 0; transition: opacity 0.35s var(--ease) var(--d); }
@keyframes rule-hop { 0%, 100% { transform: none; } 45% { transform: translateY(-7px); } }
.staff-rule.named .rule-name { opacity: 1; }
.staff-rule.named .head { fill: var(--accent); } .staff-rule.named .stem { stroke: var(--accent); }
.staff-rule.named .n { animation: rule-hop 0.5s var(--ease) var(--d) both; }
@media (hover: hover) and (pointer: fine) {
  .staff-rule:hover .rule-name { opacity: 1; }
  .staff-rule:hover .head { fill: var(--accent); } .staff-rule:hover .stem { stroke: var(--accent); }
  .staff-rule:hover .n { animation: rule-hop 0.5s var(--ease) var(--d) both; }
}
@media (prefers-reduced-motion: reduce) { .rule-staff .head, .rule-staff .stem, .rule-staff .rule-name { transition: none; } .staff-rule .n, .staff-rule:hover .n, .staff-rule.named .n { animation: none; } }

/* Masthead: the field's own color, so on the home page it is one surface with the hero. */
.mk-header { background: var(--ground); color: var(--ground-ink); position: sticky; top: 0; z-index: 20; border-bottom: 2px solid var(--rule); }
.mk-header .mk-wrap { display: flex; align-items: center; gap: 1.2rem; height: 4.2rem; }
.mk-brand { color: var(--ground-ink); }
.mk-brand .brand-name { font-family: var(--display); font-weight: 400; font-size: 1.6rem; letter-spacing: -0.02em; }
.mk-brand:hover { text-decoration: none; }
.mk-nav { display: flex; gap: 0.1rem; margin-left: 0.8rem; }
.mk-nav a { position: relative; padding: 0.5rem 0.8rem; color: var(--ground-ink); font-weight: 800; font-size: 0.98rem; }
/* The page you are on is marked by a notehead under its word. */
.mk-nav a[aria-current]::after { content: ""; position: absolute; left: 50%; bottom: 0.1rem; width: 0.55rem; height: 0.4rem; margin-left: -0.28rem; border-radius: 50%; background: var(--eraser); transform: rotate(-20deg); }
@media (prefers-color-scheme: dark) { .mk-nav a[aria-current]::after { background: var(--pencil); } }
@media (hover: hover) and (pointer: fine) { .mk-nav a:hover { text-decoration: underline; text-underline-offset: 0.3em; text-decoration-thickness: 2px; } }
.mk-actions { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }
.mk-actions .btn-ghost { border-color: transparent; background: transparent; color: var(--ground-ink); }
@media (hover: hover) and (pointer: fine) { .mk-actions .btn-ghost:hover { background: transparent; text-decoration: underline; text-underline-offset: 0.3em; border-color: transparent; color: var(--ground-ink); } }
@media (max-width: 860px) { .mk-nav .mk-wide { display: none; } .mk-nav { margin-left: 0; } }
@media (max-width: 560px) {
  .mk-header .mk-wrap { flex-wrap: wrap; height: auto; padding: .5rem 0 .2rem; row-gap: .1rem; }
  .mk-nav { order: 3; width: 100%; gap: .2rem; margin: 0 0 0 -.8rem; }
  .mk-nav a { min-height: 2.5rem; display: inline-flex; align-items: center; }
}

/* Buttons */
.mk-body .btn { font-family: var(--ui); font-weight: 800; border-width: 2px; }
.mk-body .btn-primary { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); transition: transform 0.25s var(--ease-hop), background 0.2s var(--ease); }
@media (hover: hover) and (pointer: fine) { .mk-body .btn-primary:hover { background: var(--btn-hover); border-color: var(--btn-hover); color: var(--btn-ink); transform: translateY(-2px); } }
.mk-body .btn-ghost { background: transparent; border-color: var(--ink); color: var(--ink); }
.mk-body .ground .btn-ghost { border-color: var(--ground-ink); color: var(--ground-ink); }
@media (hover: hover) and (pointer: fine) { .mk-body .btn-ghost:hover, .mk-body .ground .btn-ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); } .mk-body .ground .btn-ghost:hover { background: var(--ground-ink); color: var(--ground); border-color: var(--ground-ink); } }
.mk-body .stage .btn-ghost { border-color: var(--ink); color: var(--ink); }

/* ---- Hero --------------------------------------------------------------- */
.ground { background: var(--ground); color: var(--ground-ink); }
.hero { position: relative; overflow: hidden; padding: clamp(2.4rem, 5vw, 4.4rem) 0 0; border-bottom: 2px solid var(--rule); }
/* Big staves run behind the headline: five lines, a gap, five lines. */
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(to bottom, var(--ground-line) 0 1px, transparent 1px 30px, var(--ground-line) 30px 31px, transparent 31px 61px, var(--ground-line) 61px 62px, transparent 62px 92px, var(--ground-line) 92px 93px, transparent 93px 123px, var(--ground-line) 123px 124px, transparent 124px 300px);
  background-size: 100% 300px; background-position: 0 2.2rem; }
.hero > * { position: relative; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 4vw, 4rem); align-items: start; padding-bottom: 3.6rem; }
.hero-grid > * { min-width: 0; }
.hero h1 { font-size: clamp(2.3rem, 0.4rem + 6.2vw, 6.6rem); margin-bottom: clamp(1.4rem, 3vw, 2.4rem); }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 0; }
  .hero-copy { display: contents; }
  .hero-grid > .stage { order: 1; margin: .4rem 0 1.6rem; }
  .hero-copy > .measures { order: 2; }
}
.hero-cta { display: flex; gap: 0.7rem; flex-wrap: wrap; margin: 1.5rem 0 0.9rem; }
.hero-early { margin: 0 0 1.6rem; font-size: 0.98rem; color: var(--ground-ink-2); }
.hero-early a { font-weight: 800; color: var(--ground-ink); text-decoration: underline; text-underline-offset: .2em; }
/* The facts, as the measures of a bar: a barline between each. */
.measures { margin: 0; display: grid; grid-template-columns: repeat(4, auto); justify-content: start; padding: 0.9rem 0 0.2rem; border-top: 2px solid var(--ground-ink); }
.measures > div { min-width: 0; padding: 0 clamp(0.8rem, 2vw, 1.6rem); border-left: 2px solid var(--ground-ink); }
.measures > div:first-child { padding-left: 0; border-left: 0; }
.measures dt { white-space: nowrap; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.04em; color: var(--ground-ink-2); order: 2; }
.measures dd { margin: 0; order: 1; font-family: var(--display); font-size: clamp(1.7rem, 3vw, 2.5rem); line-height: 1; color: var(--ground-ink); }
.measures > div { display: flex; flex-direction: column; gap: 0.2rem; }
.measures dd small { display: none; }
@media (max-width: 560px) { .measures { grid-template-columns: repeat(2, 1fr); gap: 1rem 0; } .measures > div { padding: 0 0.8rem; } .measures > div:nth-child(odd) { padding-left: 0; border-left: 0; } }

/* The live drill: a sheet on the desk. */
.stage { margin: 0; padding: 1.1rem 1.2rem 1.2rem; border: 2px solid var(--rule); border-radius: 18px; background: var(--card); box-shadow: 8px 8px 0 -1px var(--rule); }
@media (prefers-color-scheme: dark) { .stage { border-color: #12183a; box-shadow: 8px 8px 0 -1px #ffd83d; } }
.stage-cap { font-size: 0.82rem; font-weight: 800; letter-spacing: 0.03em; color: var(--muted); display: flex; align-items: center; gap: 0.45rem; margin-bottom: 0.5rem; }
.stage-cap .dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--ok); animation: pulse 1.2s infinite; }
.stage-staff .staff { width: 100%; height: auto; }
.stage-pad { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.4rem; margin: 0.7rem 0; }
.stage-note { font-size: 0.9rem; color: var(--muted); margin: 0; }
.demo .stage-cap { justify-content: flex-start; } .demo-count { margin-left: auto; color: var(--ink); }
.demo-stage { min-height: 15rem; padding: 0.6rem; border-radius: 12px; box-shadow: none; border-color: var(--line); background: #ffffff; } .demo-stage .staff-box { max-width: 320px; }
.demo .note-btn { height: 3.5rem; font-family: var(--ui); font-size: 1.5rem; border-radius: 12px; border-color: var(--line-2); }
@media (hover: hover) and (pointer: fine) { .demo .note-btn:hover { border-color: var(--accent); } }
@media (max-width: 560px) { .demo .note-btn { height: 3rem; font-size: 1.25rem; } }
.demo-tabs { margin: .6rem 0 .4rem; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .3rem; }
.demo-tabs .input-tab:disabled { opacity: .4; cursor: default; }
.demo-tabs .input-tab { justify-content: center; padding: .35rem .3rem; }
@media (max-width: 560px), (min-width: 901px) and (max-width: 1140px) {
  .demo-tabs .input-tab { flex-direction: column; gap: .15rem; min-height: 3.3rem; padding: .3rem .1rem; border-radius: 12px; font-size: .74rem; }
  .demo-tabs .input-tab .ico { width: 1.3em; height: 1.3em; }
}
.demo-listen { margin-top: .6rem; }
.demo .note-btn:disabled { opacity: .4; cursor: default; }
.demo-done { text-align: center; padding: 1rem; } .demo-done-title { font-family: var(--display); font-size: 1.9rem; line-height: 1.05; margin-bottom: .4rem; } .demo-done p { margin-bottom: .8rem; color: var(--ink-2); text-wrap: balance; }
.demo-done-actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }
.demo.is-done .stage-note { display: none; }
.note-line { display: flex; flex-direction: column; gap: .05rem; }

/* The hop: a pink note leaps from note to note along a staff, the way the mark's does. */
.runway { display: block; width: 100%; height: max(84px, 9.04vw); overflow: visible; }
.runway .r-line { stroke: var(--ground-ink); stroke-opacity: 0.6; stroke-width: 1.2; shape-rendering: crispEdges; }
.runway .r-head, .runway .r-stem { fill: var(--ground-ink); stroke: var(--ground-ink); }
.runway .r-stem { fill: none; stroke-width: 2; }
.runway .r-arc { fill: none; stroke: var(--eraser); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 0.5 7; }
@media (prefers-color-scheme: dark) { .runway .r-arc { stroke: var(--pencil); } .runway .r-hopper { fill: var(--pencil); stroke: var(--pencil); } }
.runway .r-hopper { fill: var(--eraser); stroke: var(--eraser); }

/* ---- Sections ----------------------------------------------------------- */
.mk-band { padding: clamp(2.6rem, 6vw, 5rem) 0; }
.sec-head { max-width: 34rem; }
.sec-head.wide { max-width: 46rem; }
.sect-p { color: var(--ink-2); max-width: 40rem; font-size: 1.08rem; line-height: 1.6; }

/* How: five ways to answer, drawn as five piano keys. The black keys sit on the seams. */
.keys { list-style: none; margin: 2.2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 4px; counter-reset: none; }
.key { position: relative; background: var(--card); border: 2px solid #12183a; border-radius: 0 0 16px 16px; padding: 5.2rem 1rem 1.5rem; min-width: 0; }
@media (prefers-color-scheme: dark) { .key { border-color: #12183a; } }
.key:not(:last-child)::after { content: ""; position: absolute; top: -2px; right: -1.1rem; width: 2.2rem; height: 4.1rem; background: #12183a; border-radius: 0 0 6px 6px; z-index: 2; }
.key .way-ico { background: none; position: absolute; top: 1.2rem; left: 1rem; display: inline-flex; width: 2.5rem; height: 2.5rem; align-items: center; justify-content: center; color: var(--ink); }
.key .way-ico svg { width: 1.9rem; height: 1.9rem; }
.key h3 { font-size: 1.4rem; margin: 0 0 0.35rem; color: var(--ink); }
.key p { margin: 0; color: var(--ink-2); font-size: 0.92rem; line-height: 1.5; }
@media (max-width: 1240px) {
  .keys { grid-template-columns: 1fr; gap: 4px 0; }
  .key { border-radius: 0 16px 16px 0; padding: 1.1rem 1.2rem 1.2rem 4.6rem; }
  .key .way-ico { top: 1rem; left: 1.1rem; }
  .key:not(:last-child)::after { top: auto; bottom: -1.1rem; right: auto; left: -2px; width: 3.4rem; height: 2.2rem; border-radius: 0 6px 6px 0; }
  .key:last-child { }
}

/* The course, as the contents page of a method book: a double barline between units. */
.contents { list-style: none; margin: 2.2rem 0 0; padding: 0; border-bottom: 4px double var(--rule); }
.unit { display: grid; grid-template-columns: minmax(0, 18rem) minmax(0, 1fr); gap: 0.8rem 2.4rem; padding: 1.4rem 0 1.5rem; border-top: 4px double var(--rule); }
.unit-head .u-n { display: block; font-size: 0.82rem; font-weight: 800; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 0.2rem; }
.unit-head h3 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem); margin: 0; }
.unit-levels { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2rem; align-content: start; }
.unit-level { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr) auto; gap: 0.6rem; align-items: baseline; padding: 0.5rem 0; border-bottom: 1px solid var(--line); font-weight: 700; }
.unit-level .track-n { font-family: var(--display); font-weight: 400; font-size: 1.15rem; color: var(--accent-deep); }
.unit-level .track-meta { font-size: 0.82rem; font-weight: 600; white-space: nowrap; color: var(--muted); }
@media (max-width: 860px) { .unit { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .unit-levels { grid-template-columns: 1fr; } }

/* For grown-ups: a dark stage in the light page, a lit one in the dark. */
.pit { background: var(--pit); color: var(--pit-ink); margin-top: 2.6rem; }
.pit h2 { color: var(--pit-ink); }
.pit .sect-p { color: var(--pit-ink-2); }
.pit .noted::after { background: var(--eraser); }
@media (prefers-color-scheme: dark) { .pit .noted::after { background: var(--eraser-deep); } }
.pit .btn-primary { background: var(--pit-ink); border-color: var(--pit-ink); color: var(--pit); }
.pit-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(2rem, 4vw, 4rem); align-items: center; }
@media (max-width: 960px) { .pit-grid { grid-template-columns: 1fr; } }
.heat-demo { border: 2px solid #12183a; border-radius: 18px; padding: 1.1rem 1.2rem 1rem; background: var(--card); box-shadow: 8px 8px 0 -1px var(--eraser); }
.heat-demo .ref-name { font-size: 1.1rem; font-family: var(--ui); } .heat-demo .stage-cap { margin-bottom: 0.8rem; }
.pit .heat-row.on { grid-template-columns: repeat(9, minmax(0, 1fr)); gap: .4rem; }
.pit .heat-row .ref-note { padding: .4rem .1rem .5rem; }
.pit .heat-demo .stage-note { margin-top: .9rem; }
.pit .heat-demo.in .ref-note { transition: background-color 0.5s var(--ease) var(--d, 0s), border-color 0.5s var(--ease) var(--d, 0s); }
.pit .heat-demo.in .staff .head, .pit .heat-demo.in .staff .stem { transition: fill 0.5s var(--ease) var(--d, 0s), stroke 0.5s var(--ease) var(--d, 0s); }
.pit .heat-demo.in .ref-name small, .pit .heat-demo.in .heat-verdict { transition: opacity 0.4s var(--ease) var(--d, 0s); }
.pit .heat-demo .heat-verdict { --d: 1.8s; }
.pit .heat-demo.reveal:not(.in) .ref-note { background-color: var(--card); }
.pit .heat-demo.reveal:not(.in) .staff .head { fill: var(--staff-ink); }
.pit .heat-demo.reveal:not(.in) .staff .stem { stroke: var(--staff-ink); }
.pit .heat-demo.reveal:not(.in) .ref-name small, .pit .heat-demo.reveal:not(.in) .heat-verdict { opacity: 0; }
@media (max-width: 1100px) { .pit .heat-row.on { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; } }

/* The closing band and the pricing page. */
.closing { border-top: 2px solid var(--rule); }
.closing-grid, .pricing-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 27rem); gap: clamp(2rem, 4vw, 3.4rem); align-items: center; }
.pricing-grid { align-items: start; }
@media (max-width: 860px) { .closing-grid { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .pricing-grid { grid-template-columns: 1fr; gap: 0; }
  .pricing-claim { display: contents; }
  .pricing-grid > .price-card { order: 1; margin-top: 0.6rem; }
  .pricing-claim > .pricing-free { order: 2; margin-top: 2.6rem; }
}
.closing-cta { display: flex; gap: 0.7rem; flex-wrap: wrap; }
@media (max-width: 520px) { .hero-cta, .closing-cta { display: grid; } .hero-cta .btn, .closing-cta .btn { width: 100%; } }
@media (min-width: 521px) { .hero-cta, .closing-cta { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: fit-content; max-width: 100%; } }
.pricing-claim { max-width: 640px; } .pricing-claim h1 { font-size: clamp(2.4rem, 1rem + 4.4vw, 4.6rem); }
.pricing-free { max-width: 34rem; margin-top: 2.2rem; padding-top: 1rem; border-top: 2px solid var(--ink); }
.mk-body .pricing-free h2 { font-size: 1.5rem; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 0.8rem; }
.pricing-free .pass-list { margin-bottom: 0; }
.mk-body .price-card { align-self: start; border: 2px solid #12183a; border-radius: 18px; background: var(--card); box-shadow: 8px 8px 0 -1px #12183a; }
@media (prefers-color-scheme: dark) { .mk-body .price-card { box-shadow: 8px 8px 0 -1px #ffd83d; } }
.mk-body .price-card .eyebrow { margin-bottom: .5rem; }
.mk-body .pass-price b { font-family: var(--display); font-weight: 400; }
.hero-cta .btn-lg, .closing-cta .btn-lg { height: 3.2rem; }

/* The reference pages (FAQ, Support, Privacy, Terms): the heading holds still on the left. */
.ref-grid { display: grid; grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); gap: 2rem clamp(2rem, 5vw, 5rem); align-items: start; }
.ref-head { position: sticky; top: 6rem; }
.ref-head h1 { font-size: clamp(2.4rem, 1.2rem + 2.6vw, 3.7rem); margin-bottom: 1rem; }
.ref-head .lead { font-size: 1.06rem; margin-bottom: 0; }
.faq-toc { display: flex; flex-direction: column; gap: .2rem; margin-top: 1.2rem; padding-top: 1rem; border-top: 2px solid var(--ink); }
.faq-toc a { display: inline-flex; align-items: center; min-height: 2.5rem; font-weight: 800; color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .faq-toc a:hover { color: var(--accent-deep); } }
.faq-body section + section { margin-top: 2.6rem; }
.mk-body .rule-head { font-size: 1.7rem; line-height: 1.15; margin: 0 0 .2rem; }
.faq-body .qa { padding: 1.2rem 0 1.25rem; border-bottom: 1px solid var(--line-2); }
.faq-body .qa h3 { margin: 0 0 .45rem; font-size: 1.35rem; line-height: 1.2; text-wrap: balance; }
/* A notehead starts each question. */
.faq-body .qa h3::before { content: ""; display: inline-block; width: 0.5em; height: 0.36em; margin-right: 0.4em; border-radius: 50%; background: var(--accent); transform: rotate(-20deg); vertical-align: 0.08em; }
.faq-body .qa p { margin: 0; color: var(--ink-2); max-width: 40rem; font-size: 1.04rem; line-height: 1.62; }
.legal h3 { margin: 1.6rem 0 .45rem; padding-top: 1.1rem; border-top: 1px solid var(--line-2); font-size: 1.4rem; line-height: 1.2; text-wrap: balance; }
.legal h3:first-child { margin-top: 0; padding-top: .9rem; border-top: 2px solid var(--ink); }
.legal p { color: var(--ink-2); max-width: 40rem; font-size: 1.04rem; line-height: 1.62; }
@media (max-width: 860px) { .ref-grid { grid-template-columns: 1fr; } .ref-head { position: static; } .faq-toc { flex-direction: row; flex-wrap: wrap; gap: .2rem 1.2rem; } }
@media (max-width: 560px) { .faq-toc { flex-direction: column; gap: 0; } }

/* Footer: closes on the masthead's own rule. */
.mk-footer { padding: 0 0 2.6rem; font-size: 0.95rem; color: var(--muted); }
.foot-row { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; }
.mk-footer .foot-row { border-top: 2px solid var(--rule); padding-top: 1.2rem; }
.foot-brand { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 800; color: var(--ink); }
.mk-footer nav { display: flex; gap: 1rem; flex-wrap: wrap; } .mk-footer nav a { color: var(--ink); font-weight: 700; }
.foot-copy { font-size: 0.85rem; }
.mk-footer a { color: var(--ink); text-decoration: underline; text-underline-offset: .18em; }
.mk-footer nav a { text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .mk-footer nav a:hover { text-decoration: underline; } }

/* Reveal on scroll: a settle and a rise, or nothing under reduced motion. */
.mk-body .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.mk-body .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .mk-body .reveal { opacity: 1; transform: none; transition: none; } }

/* Pass 2: a key goes down under a finger, and its black neighbors stay put. */
.key { transition: transform 0.25s var(--ease-hop), box-shadow 0.25s var(--ease-hop); }
@media (hover: hover) and (pointer: fine) { .key:hover { transform: translateY(5px); box-shadow: inset 0 -10px 0 -4px var(--accent-soft); } }
/* Pass 3: the notehead leaps once as its heading arrives, and lands where a period would. */
@keyframes notehop { 0% { transform: translateY(-0.9em) rotate(-20deg); opacity: 0; } 55% { transform: translateY(0.06em) rotate(-20deg); opacity: 1; } 100% { transform: rotate(-20deg); } }
.sec-head.in .noted::after, .hero .noted::after { animation: notehop 0.7s var(--ease-hop) 0.2s both; }
@media (prefers-reduced-motion: reduce) { .sec-head.in .noted::after, .hero .noted::after { animation: none; } }

/* The hop plays a tune when tapped (public/js/hop-tune.js): the strip is one button, and a label
   names the tune and the letters while it sounds. */
.runway-play { position: relative; z-index: 3; display: block; width: 100%; padding: 0; margin: 0; border: 0; background: none; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; border-radius: 0; }
.runway-play:focus-visible { outline: 3px solid var(--ground-ink); outline-offset: -3px; }
.runway .r-head { transition: fill 0.2s var(--ease); }
.runway .r-head.lit { fill: var(--eraser); }
@media (prefers-color-scheme: dark) { .runway .r-head.lit { fill: var(--pencil); } }
.hero .runway-say { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(max(84px, 9.04vw) + 0.7rem); display: flex; align-items: center; gap: 0.5rem 0.9rem; flex-wrap: wrap; justify-content: center; width: max-content; max-width: calc(100% - 2.4rem); padding: 0.45rem 0.5rem 0.45rem 1rem; border-radius: 999px; background: var(--ground-ink); color: var(--ground); font-weight: 800; z-index: 2; }
.runway-say[hidden] { display: none; }
.runway-say .say-name { font-family: var(--display); font-weight: 400; font-size: 1.05rem; }
.runway-say .say-notes { display: inline-flex; gap: 0.2rem 0.6rem; flex-wrap: wrap; font-size: 0.95rem; }
.runway-say .say-notes .keep { display: inline-flex; gap: 0.3rem; }
.runway-say .say-notes b { font-weight: 800; padding: 0 0.1rem; border-bottom: 3px solid transparent; }
.runway-say .say-notes b.on { border-bottom-color: var(--eraser); }
@media (prefers-color-scheme: dark) { .runway-say .say-notes b.on { border-bottom-color: var(--eraser-deep); } }
.say-mute { font: inherit; font-size: 0.82rem; font-weight: 800; min-height: 2rem; padding: 0 0.8rem; border-radius: 999px; border: 2px solid currentColor; background: transparent; color: inherit; cursor: pointer; }
@media (max-width: 560px) { .hero .runway-say { border-radius: 18px; } }
