/* musilingual.com: the waitlist page, thanks, privacy and terms. (The exercises keep style.css.)
   The system is written up in site/docs/design-system.md; every value below is one of its tokens.
   Paper and ink, as in the videos. Fraunces (SIL OFL 1.1) is the display face: headlines and big
   statements. Edwin (SIL OFL 1.1), the face of the note names in the videos, is the workhorse: text,
   form, labels, and every figure (its figures are tabular). Solfège blue appears only where it means
   what it means in the videos: the cursor band. */

@font-face {
  font-family: "Fraunces";
  src: url("fonts/Fraunces-site.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}
@font-face {
  font-family: "Edwin";
  src: url("fonts/Edwin-text.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Edwin";
  src: url("fonts/Edwin-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  /* colour */
  --paper: #F7F3EA;
  --paper-hi: #FBF8F1;
  --ink: #17161A;
  --soft: #5E5A52;
  --mute: #8E887C;
  --rule: #D9D2C3;
  --blue: #2D55AC;
  --band: rgba(45, 85, 172, 0.16);
  --red: #AE2A14;                 /* the letter-name cursor in the videos; only beside the letter-name still */
  --error: #9A2A17;

  /* type: Utopia fluid scale, 390 px to 1440 px, 1.2 ratio on the phone opening to 1.33 on desktop */
  --display: "Fraunces", "Iowan Old Style", "Palatino", Georgia, serif;
  --text: "Edwin", "Century Schoolbook", "New Century Schoolbook", "Georgia", serif;
  --step--1: clamp(0.8125rem, 0.7893rem + 0.0952vw, 0.875rem);   /* 13 to 14 */
  --step-0: clamp(1.0625rem, 1.039rem + 0.0952vw, 1.125rem);      /* 17 to 18 */
  --step-1: clamp(1.1875rem, 1.141rem + 0.1905vw, 1.3125rem);     /* 19 to 21 */
  --step-2: clamp(1.375rem, 1.282rem + 0.381vw, 1.625rem);        /* 22 to 26 */
  --step-3: clamp(1.6875rem, 1.525rem + 0.6667vw, 2.125rem);      /* 27 to 34 */
  --step-4: clamp(2.125rem, 1.8rem + 1.3333vw, 3rem);             /* 34 to 48 */
  --step-5: clamp(2.625rem, 1.836rem + 3.238vw, 4.75rem);         /* 42 to 76 */
  --step-6: clamp(3.5rem, 2.571rem + 3.81vw, 6rem);               /* 56 to 96 */
  --leading-tight: 1.02;
  --leading-head: 1.12;
  --leading-text: 1.5;
  --measure: 34rem;

  /* space: 4 px base */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-m: clamp(1.5rem, 1.129rem + 1.524vw, 2.5rem);            /* inside a section */
  --space-s: clamp(4rem, 2.886rem + 4.571vw, 7rem);                /* between sections */
  --gutter: 1.25rem;
  --col: 36rem;
  --page: 72rem;

  /* components */
  --tap: 3.375rem;      /* 54 px: field and button */
  --radius: 0.625rem;
  --bar-h: 0.625rem;
  --ease: cubic-bezier(0.45, 0.05, 0.35, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-weight: 400;
  font-size: var(--step-0);
  line-height: var(--leading-text);
  font-variant-numeric: lining-nums tabular-nums;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
h1, h2, h3, p, ul, ol, figure, dl, dd { margin: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; letter-spacing: -0.015em; text-wrap: balance; }
strong, b { font-weight: 700; }
img { display: block; max-width: 100%; height: auto; }
video { display: block; max-width: 100%; height: auto; }
/* inline icons: Lucide line icons (stroke) and the three brand marks (fill), always currentColor */
.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.25em; }
.icon.big { width: 1.75rem; height: 1.75rem; stroke-width: 1.5; }
.icon.brand { fill: currentColor; stroke: none; width: 1.1em; height: 1.1em; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; text-decoration-color: var(--mute); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--band); }

.wrap { width: min(100% - 2 * var(--gutter), var(--col)); margin-inline: auto; }
.sr-only, .hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--paper-hi); padding: 0.5rem 0.75rem; z-index: 5; }

/* ---------- top ---------- */
.top { padding-top: max(1rem, env(safe-area-inset-top)); display: flex; align-items: center; min-height: 3rem; }
.lockup { display: inline-block; }
.lockup img { height: 1.5rem; width: auto; }

/* ---------- hero ---------- */
.hero { padding: clamp(1rem, 0.25rem + 4vw, 4rem) 0 var(--space-s); }
h1 {
  font-size: var(--step-5);
  line-height: var(--leading-tight);
  font-variation-settings: "opsz" 144;
  font-weight: 540;
  letter-spacing: -0.025em;
  word-spacing: 0.06em;
}
h1 span { display: block; }
.sub { margin-top: var(--space-4); font-size: var(--step-1); line-height: 1.4; max-width: var(--measure); text-wrap: pretty; }
.free { margin-top: var(--space-2); font-size: var(--step-1); font-weight: 700; }
.label { display: block; margin-bottom: 0.375rem; font-size: var(--step--1); font-weight: 700; color: var(--ink); }

/* ---------- form ---------- */
.join { margin-top: var(--space-4); }
.field { display: grid; gap: var(--space-2); }
label.vis { font-size: var(--step--1); color: var(--soft); }
input[type="email"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: var(--tap); padding: 0 var(--space-4);
  font: inherit; font-size: max(1rem, var(--step-0)); color: var(--ink);
  background: var(--paper-hi);
  border: 1.5px solid var(--mute); border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input[type="email"]::placeholder { color: var(--soft); opacity: 1; }
input[type="email"]:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
input[type="email"][aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 1px var(--error); }
.btn {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: var(--tap); padding: 0 var(--space-5);
  font: inherit; font-size: var(--step-0); font-weight: 700; letter-spacing: 0.005em;
  color: var(--paper); background: var(--ink);
  border: 0; border-radius: var(--radius); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, transform 0.15s var(--ease);
}
@media (hover: hover) { .btn:hover { background: #2B2A30; } .btn.quiet:hover { background: rgba(23, 22, 26, 0.06); } }
.btn:active { transform: translateY(1px); }
.btn[aria-busy="true"] { cursor: progress; color: rgba(247, 243, 234, 0.6); }
.btn.quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.error { color: var(--error); font-size: var(--step--1); line-height: 1.4; }
.error:empty { display: none; }
.consent { margin-top: var(--space-3); font-size: var(--step--1); line-height: 1.45; color: var(--soft); max-width: var(--measure); }

/* ---------- the honest bar ---------- */
.bar { margin-top: var(--space-5); min-height: 3.5rem; }
.no-js .bar, .bar[aria-hidden="true"] { visibility: hidden; }
.bar-label { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); font-size: var(--step--1); line-height: 1.4; color: var(--soft); }
.bar-label b { color: var(--ink); font-size: var(--step-0); }
.bar-next { white-space: nowrap; }
.track {
  position: relative; margin-top: var(--space-2); height: var(--bar-h);
  background: var(--paper-hi); border: 1px solid var(--mute); border-radius: 999px; overflow: visible;
}
/* ticks every 100: nine thin marks on the track */
.track::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: repeating-linear-gradient(to right, transparent 0, transparent calc(10% - 1px), var(--mute) calc(10% - 1px), var(--mute) 10%);
  background-size: calc(100% + 1px) 100%;
}
.fill {
  position: absolute; left: -1px; top: -1px; bottom: -1px; width: 0; min-width: 6px;
  background: var(--ink); border-radius: 999px;
  transition: width 0.6s var(--ease);
}
.you {
  position: absolute; top: -0.45rem; bottom: -0.45rem; width: 0.85rem; margin-left: -0.425rem; left: 0;
  background: var(--band); border-radius: 3px; opacity: 0; pointer-events: none;
}
.you::after { content: ""; position: absolute; top: 0; bottom: 0; left: calc(50% - 1px); width: 2px; background: var(--blue); }
.you-tag { position: absolute; top: calc(100% + 0.3rem); left: 50%; transform: translateX(-50%); font-size: var(--step--1); color: var(--blue); font-weight: 700; }
.bar.has-you { min-height: 4.75rem; }
.bar.has-you .you { opacity: 1; transition: left 0.6s var(--ease), opacity 0.3s ease 0.3s; }
.bar-full { margin-top: var(--space-2); font-size: var(--step--1); color: var(--soft); }
.preview-tag { display: inline-block; margin-bottom: var(--space-2); padding: 0.05rem 0.5rem; font-size: var(--step--1); color: var(--soft); border: 1px dashed var(--mute); border-radius: 4px; }

/* ---------- after sign-up, in place of the form ---------- */
.joined:focus { outline: none; }
.joined-head { font-size: var(--step-3); line-height: var(--leading-head); }
.plate {
  position: relative; display: inline-block; margin: var(--space-2) 0 0 -0.06em; padding: 0 0.1em;
  font-size: var(--step-6); line-height: 1.05; letter-spacing: -0.01em; font-weight: 400;
}
.plate .no { font-size: 0.5em; vertical-align: 0.55em; margin-right: 0.08em; }
.plate .cursor {
  position: absolute; top: 0.06em; bottom: 0.02em; left: 0; width: 0.44em; opacity: 0;
  background: var(--band); border-radius: 0.06em; pointer-events: none;
}
.plate .cursor::after { content: ""; position: absolute; top: 0; bottom: 0; left: calc(50% - 1px); width: 2px; background: var(--blue); opacity: 0.8; }
/* the one orchestrated moment: the cursor reads the new number once, as in the videos */
.joined.is-new .plate .cursor { animation: plate-read 1.6s var(--ease) 0.2s both; }
@keyframes plate-read {
  0% { left: -0.1em; opacity: 0; }
  12% { opacity: 1; }
  80% { left: calc(100% - 0.34em); opacity: 1; }
  100% { left: calc(100% - 0.34em); opacity: 0; }
}
.place { margin-top: var(--space-2); font-size: var(--step-1); line-height: 1.4; }
.steps { margin-top: var(--space-4); padding-left: 0; list-style: none; max-width: var(--measure); }
.steps li { display: flex; gap: var(--space-3); align-items: flex-start; }
.steps li .icon { margin-top: 0.2em; }
.steps li + li { margin-top: var(--space-2); }
.steps .done { color: var(--soft); }
.steps .done .icon { stroke-width: 2.5; color: var(--ink); }
.steps .to { overflow-wrap: anywhere; }
.check-spam { margin-top: var(--space-2); font-size: var(--step--1); color: var(--soft); }
.share-row { margin-top: var(--space-5); display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); }
.share-note { font-size: var(--step--1); color: var(--soft); }

/* ---------- sections ---------- */
section { padding: var(--space-s) 0; }
section + section { border-top: 1px solid var(--rule); }
.hero { border-top: 0; }
h2 { font-size: var(--step-4); line-height: var(--leading-head); font-variation-settings: "opsz" 96; }
.lead { margin-top: var(--space-4); font-size: var(--step-1); line-height: 1.45; max-width: var(--measure); text-wrap: pretty; }
.body { margin-top: var(--space-4); max-width: var(--measure); text-wrap: pretty; }
.body + .body { margin-top: var(--space-3); }

/* the three outcomes: each line on its own rule, like a staff, with its icon in the margin */
.outcomes { list-style: none; padding: 0; margin-top: var(--space-5); border-top: 1px solid var(--rule); }
.outcomes li { display: grid; grid-template-columns: 1.75rem minmax(0, 1fr); column-gap: var(--space-4); align-items: start; padding: var(--space-4) 0; border-bottom: 1px solid var(--rule); }
.outcomes .icon { margin-top: 0.15em; }
.outcomes h3 { font-size: var(--step-2); line-height: 1.2; font-variation-settings: "opsz" 72; }
.outcomes p { margin-top: var(--space-1); color: var(--soft); max-width: var(--measure); text-wrap: pretty; }
.nudge { margin-top: var(--space-4); font-size: var(--step-1); line-height: 1.4; }
.nudge a { color: var(--ink); font-weight: 700; }

.sub-h { margin-top: var(--space-6); font-family: var(--text); font-weight: 700; font-size: var(--step-0); letter-spacing: 0; }

/* explanation rows: an icon, then the matter */
.rows { list-style: none; padding: 0; margin-top: var(--space-3); max-width: var(--measure); }
.rows li { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr); column-gap: var(--space-3); align-items: start; padding: var(--space-3) 0; border-top: 1px solid var(--rule); }
.rows li:last-child { border-bottom: 1px solid var(--rule); }
.rows .icon { width: 1.5rem; height: 1.5rem; stroke-width: 1.75; margin-top: 0.1em; }
.rows b { display: block; }

/* two names for every note: two real bands from the videos */
.names { margin-top: var(--space-5); display: grid; gap: var(--space-5); }
.names figure { margin: 0; }
.names img { width: 100%; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper-hi); }
.names figcaption { margin-top: var(--space-2); color: var(--soft); max-width: var(--measure); text-wrap: pretty; }
.names figcaption b { display: block; color: var(--ink); }
.k-solfege { color: var(--blue); }
.k-letters { color: var(--red); }

/* the three most-watched posts: text cards (the songs are in copyright, so no notation here) */
.posts { list-style: none; padding: 0; margin-top: var(--space-3); display: grid; gap: var(--space-3); max-width: var(--measure); }
.posts a { display: grid; gap: 0.15rem; padding: var(--space-3); border: 1px solid var(--rule); border-radius: 0.6rem; background: var(--paper-hi); color: var(--soft); text-decoration: none; line-height: 1.3; }
.posts a:hover { border-color: var(--ink); }
.posts b { color: var(--ink); font-size: var(--step-1); }
.posts .plays { color: var(--ink); font-weight: 700; }
.posts .go { display: inline-flex; align-items: center; gap: 0.5em; margin-top: var(--space-1); color: var(--ink); font-weight: 700; min-height: 2.75rem; }
.social { list-style: none; padding: 0; margin-top: var(--space-5); display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }
.social a { display: inline-flex; align-items: center; gap: 0.5em; color: var(--ink); text-decoration: none; font-weight: 700; min-height: 2.75rem; }
.social a:hover { text-decoration: underline; }

.maker { margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--rule); max-width: var(--measure); }
.maker b { display: block; }
.maker span { color: var(--soft); }

/* the product: a phone playing a muted loop of the real video */
.show { margin: var(--space-s) 0 0; }
.phone {
  width: min(17.5rem, 100%); margin: 0 auto; padding: 0.5rem;
  background: var(--ink); border-radius: 2.4rem; box-shadow: 0 1.5rem 3rem -1.5rem rgba(23, 22, 26, 0.45);
}
.phone video { width: 100%; border-radius: 1.95rem; aspect-ratio: 9 / 16; object-fit: cover; background: var(--paper); }
.show figcaption { margin-top: var(--space-4); max-width: var(--measure); text-wrap: pretty; }
.show figcaption .what { margin-top: var(--space-2); color: var(--soft); }

/* the true proof */
.proof .figure { margin-top: var(--space-4); font-size: var(--step-6); line-height: 1; letter-spacing: -0.02em; }
.proof .figure small { display: block; margin-top: var(--space-2); font-size: var(--step-1); letter-spacing: 0; }
.proof .body a { color: var(--ink); }

/* FAQ: plain disclosure, closed by default, works without JS */
.faq { margin-top: var(--space-5); border-top: 1px solid var(--rule); max-width: 40rem; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-4);
  padding: var(--space-4) 0; font-weight: 700; font-size: var(--step-0); line-height: 1.35;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; width: 1em; text-align: center; font-weight: 400; color: var(--soft); transition: transform 0.2s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:focus-visible { outline-offset: 0; }
.faq .a { padding: 0 0 var(--space-4); max-width: var(--measure); color: var(--ink); text-wrap: pretty; }
.faq .a p + p { margin-top: var(--space-2); }

.again h2 { max-width: 28rem; }
.again .join { margin-top: var(--space-5); }
.again .lead { margin-top: var(--space-4); }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--rule); padding: var(--space-5) 0 max(var(--space-6), env(safe-area-inset-bottom)); font-size: var(--step--1); color: var(--soft); }
.foot ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-5); margin-bottom: var(--space-2); }
.foot a { color: var(--ink); }
.foot .social { margin: 0 0 var(--space-4); }
.foot .social a { font-size: var(--step-0); }

/* ---------- wider screens ---------- */
@media (min-width: 34rem) {
  :root { --gutter: 2rem; }
  .field { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
  .field .error { grid-column: 1 / -1; }
}
@media (min-width: 60rem) {
  .top { min-height: 4rem; }
  .top.wrap { width: min(100% - 2 * var(--gutter), var(--page)); }
  .lockup img { height: 1.75rem; }
  /* the hero: the pitch and the form on the left, the phone playing the video on the right */
  .hero .wrap { width: min(100% - 2 * var(--gutter), var(--page)); display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: var(--space-8); align-items: start; }
  .hero h1 { max-width: 12ch; }
  .sub { font-size: var(--step-2); }
  .free { font-size: var(--step-2); }
  .hero .join { max-width: 34rem; }
  .hero .bar { margin-top: var(--space-5); }
  .show { margin-top: 0; justify-self: center; width: 100%; max-width: 24rem; }
  .show .phone { margin-inline: auto; }
  .show figcaption { font-size: var(--step--1); line-height: 1.45; text-align: center; margin-inline: auto; max-width: 20rem; }
  /* the sections: heading in the left column, matter in the right, like a book's margin notes */
  .outline .wrap, .program .wrap, .names-s .wrap, .proof .wrap, .faq-s .wrap, .again .wrap { width: min(100% - 2 * var(--gutter), var(--page)); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: var(--space-8); align-items: start; }
  .outline h2, .program h2, .names-s h2, .proof h2, .faq-s h2, .again h2 { grid-column: 1; grid-row: 1 / span 9; }
  .outline .wrap > *:not(h2), .program .wrap > *:not(h2), .names-s .wrap > *:not(h2), .proof .wrap > *:not(h2), .faq-s .wrap > *:not(h2), .again .wrap > *:not(h2) { grid-column: 2; }
  .outcomes, .faq, .proof .figure { margin-top: 0; }
  .lead, .body:first-of-type { margin-top: 0; }
  .again .lead { margin-top: 0; }
  .proof .figure { font-size: 6rem; }
}
@media (min-width: 80rem) {
  .hero h1 { max-width: 14ch; }
}
/* ---------- plain text pages (thanks, privacy, terms) ---------- */
.page { padding: var(--space-6) 0 var(--space-s); }
.page h1 { font-size: var(--step-4); margin: 0 0 var(--space-4); }
.page h2 { font-size: var(--step-2); font-variation-settings: "opsz" 72; margin: var(--space-6) 0 var(--space-2); }
.page p, .page li { max-width: var(--measure); text-wrap: pretty; }
.page p + p { margin-top: var(--space-3); }
.page ul { padding-left: 1.2rem; margin-top: var(--space-2); }
.page li + li { margin-top: var(--space-1); }
.page .small { font-size: var(--step--1); color: var(--soft); }
.page .plate { margin-top: var(--space-2); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .joined.is-new .plate .cursor { animation: none; }
  .fill, .you, .btn, .faq summary::after { transition: none; }
}
