/* The blog: the index of articles, and each article with its sounds and drills (blog.js). Articles run in a reading
   column; components and the header sit wider. Everything reads without JavaScript: components show their first
   figure and caption, and figures are drawn complete. */

.article main, .blog main { overflow-x: clip; }

/* Reading progress: a hairline of ink under the header that fills as you read (scroll-driven, no script). */
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .article .site-head::after {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      bottom: -1px;
      height: 2px;
      background: var(--ink);
      transform-origin: 0 50%;
      transform: scaleX(0);
      animation: read-progress linear both;
      animation-timeline: scroll(root);
    }
  }
}
@keyframes read-progress { to { transform: scaleX(1); } }

/* ---- The article grid: a text column inside a wider one, inside the page's gutters. The text column has a definite
   width, so a narrow screen gives it all the room before the wide column's sides get any. */
.post {
  --measure: 41rem;
  --aside: 9rem;
  display: grid;
  grid-template-columns:
    [full-start] minmax(var(--gutter), 1fr)
    [wide-start] minmax(0, var(--aside))
    [text-start] min(var(--measure), 100% - 2 * var(--gutter))
    [text-end] minmax(0, var(--aside))
    [wide-end] minmax(var(--gutter), 1fr)
    [full-end];
}
.post > * { grid-column: text; }
.post > .post-head, .post > .post-foot { grid-column: wide; }
.post-body { grid-column: full; display: grid; grid-template-columns: subgrid; align-content: start; }
.post-body > * { grid-column: text; min-width: 0; }
.post-body > .x { grid-column: wide; }

/* ---- Header: title and dek beside the article's figure, inking itself as the page opens. */
.post-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(190px, 25vw, 300px);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding: clamp(32px, 6vw, 72px) 0 clamp(24px, 3.5vw, 40px);
}
.post-intro { display: grid; gap: 14px; }
.crumbs { font-size: 15px; font-weight: 600; }
.crumbs a { color: var(--ink-text); text-decoration: none; }
.crumbs a::before { content: "← "; }
.crumbs a:hover { text-decoration: underline; }
.post-head h1 { font-size: clamp(40px, 5.4vw, 64px); line-height: 1.03; letter-spacing: -0.024em; font-weight: 540; }
.dek { font-size: clamp(19px, 1.75vw, 22px); line-height: 1.5; color: var(--muted); }
.post-meta { font-size: 15px; color: var(--muted); }
.post-plate {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 28px;
  box-shadow: var(--shadow-lift);
}
.post-plate::after { content: ""; position: absolute; inset: 9px; border: 1px solid var(--rule); border-radius: 20px; pointer-events: none; opacity: 0.7; }
.post-fig { width: 88%; height: 88%; }
.post-fig path { fill: none; stroke: var(--ink); stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 760px) {
  .post-head { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .post-plate { order: -1; width: min(176px, 48vw); border-radius: 22px; }
  .post-plate::after { border-radius: 15px; inset: 7px; }
}

/* ---- Contents */
.toc { border-block: 1px solid var(--rule); padding: 18px 0 20px; margin-bottom: 40px; }
.toc p { font: 700 13px/1 var(--body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.toc ol { margin: 0; padding-left: 1.4em; display: grid; gap: 7px; font-size: 16px; line-height: 1.4; }
.toc li::marker { color: var(--pencil); font-variant-numeric: tabular-nums; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--ink-text); text-decoration: underline; }

/* ---- Prose */
.post-body > p, .post-body > ul, .post-body > ol, .post-body > blockquote, .post-body > .table-wrap { margin: 0 0 1.2em; }
.post-body > p, .post-body > ul > li, .post-body > ol > li { font-size: 18px; line-height: 1.72; }
@media (max-width: 560px) { .post-body > p, .post-body > ul > li, .post-body > ol > li { font-size: 17px; } }
.post-body > h2 { font-size: clamp(28px, 3.3vw, 36px); line-height: 1.12; margin: 1.5em 0 0.55em; scroll-margin-top: 90px; }
.post-body > h3 { font: 650 20px/1.35 var(--body); letter-spacing: 0; margin: 1.2em 0 0.45em; scroll-margin-top: 90px; }
.post-body > ul, .post-body > ol { padding-left: 1.3em; display: grid; gap: 8px; }
.post-body > ul > li, .post-body > ol > li { padding-left: 0.2em; }
.post-body > ul > li::marker, .post-body > ol > li::marker { color: var(--ink-text); }
.post-body strong { font-weight: 650; }
.post-body a { overflow-wrap: anywhere; }
.post-body > blockquote { border-left: 2px solid var(--ink); padding: 2px 0 2px 20px; }
.post-body > blockquote p { font: italic 420 21px/1.55 var(--display); color: var(--text); }
.post-body code { font: 500 0.88em/1 ui-monospace, "SF Mono", Menlo, monospace; background: var(--ink-wash); color: var(--ink-text); padding: 0.15em 0.4em; border-radius: 6px; }
.ratio { font-family: var(--display); font-weight: 600; font-variant-numeric: lining-nums; white-space: nowrap; }
.post-body .table-wrap th[scope="row"] { font-weight: 600; }
.post-body .table-wrap td.num { font-variant-numeric: tabular-nums; }

/* ---- Components: sheets wider than the text, each a figure with a caption. */
.x {
  margin: 1.4em 0 2.2em;
  display: grid;
  gap: 18px;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 28px;
  padding: clamp(18px, 3vw, 30px);
  box-shadow: var(--shadow);
  min-width: 0;
}
.x figcaption { color: var(--muted); font-size: 15px; line-height: 1.55; }
.glyph path { fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.glyph .dial-rim, .glyph .dial-ticks { fill: none; stroke: var(--rule); stroke-width: 1.3; }
.glyph .dial-hub { fill: var(--ink); }
.x .hear small, .x .hear .sr { font-weight: 500; opacity: 0.75; }

/* ::listen */
.x-stage {
  display: grid;
  grid-template-columns: clamp(132px, 20vw, 196px) minmax(0, 1fr);
  grid-template-areas: "glyph readout" "glyph keys";
  gap: 14px clamp(18px, 3vw, 32px);
  align-items: center;
}
.x-glyph { grid-area: glyph; aspect-ratio: 1; background: var(--paper); border-radius: 22px; display: grid; place-items: center; }
.x-glyph-fig { width: 82%; height: 82%; grid-area: 1 / 1; }
.x-readout { grid-area: readout; display: grid; gap: 8px; min-width: 0; align-self: end; }
.x-name { font: 560 clamp(23px, 2.5vw, 29px)/1.15 var(--display); text-wrap: balance; }
.x-ratio { color: var(--ink-text); font-variant-numeric: lining-nums tabular-nums; margin-left: 4px; white-space: nowrap; }
.x-explain { color: var(--muted); font-size: 16px; line-height: 1.5; min-height: 1.5em; }
.keys { grid-area: keys; width: 100%; max-width: 560px; height: auto; align-self: start; }
.keys .kw { fill: var(--sheet); stroke: var(--pencil); stroke-width: 0.45; transition: fill 160ms ease; }
.keys .kb { fill: var(--text); stroke: var(--text); stroke-width: 0.45; transition: fill 160ms ease; }
.keys .kw.on { fill: color-mix(in srgb, var(--ink) 34%, var(--sheet)); }
.keys .kb.on { fill: var(--ink); stroke: var(--ink); }
.keys text { font: 600 4px var(--body); fill: var(--muted); pointer-events: none; }
.x-sounds { display: flex; flex-wrap: wrap; gap: 8px; }
.x-sound[aria-pressed="true"] { box-shadow: inset 0 0 0 1.5px var(--ink); }
.x-sound small { margin-left: 2px; }
@media (max-width: 560px) {
  .x-stage { grid-template-columns: 104px minmax(0, 1fr); grid-template-areas: "glyph readout" "keys keys"; }
  .x-glyph { border-radius: 16px; }
  .x-explain { font-size: 15px; }
}

/* ::quiz (the shared tiles, trail and result come from styles.css) */
.q-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; }
.q-title { font: 560 clamp(23px, 2.4vw, 28px)/1.2 var(--display); }
.q-count { color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }
.q-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.q-note { color: var(--muted); }
.x-quiz .tiles.many { grid-template-columns: repeat(auto-fill, minmax(min(100%, 132px), 1fr)); }
.x-quiz .tiles.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.x-quiz .tiles.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 560px) { .x-quiz .tiles.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.x-quiz .tile { padding: 18px 10px 16px; }
.x-quiz .tile-fig { width: 72px; height: 72px; }
.x-quiz.words .tile-fig { width: 52px; height: 52px; }
.tile .glyph path { stroke: var(--pencil); transition: stroke 300ms ease; }
.tile.is-right .glyph path { stroke: var(--ink); stroke-width: 1.6; }
.result-fig.glyph.ink path { stroke: var(--ink); stroke-width: 1.5; }
.result-fig.glyph.pencil path { stroke: var(--pencil); stroke-dasharray: 2.4 2.2; }

/* ::figures */
.fig-row { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 10px; }
.fig-item {
  display: grid;
  justify-items: center;
  gap: 6px;
  width: 100%;
  padding: 16px 6px 14px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: var(--paper);
  cursor: pointer;
  transition: border-color 160ms ease, transform 120ms ease, box-shadow 200ms ease;
}
.fig-item:not(:disabled):hover { border-color: var(--ink); }
.fig-item:not(:disabled):active { transform: scale(0.97); }
.fig-item:disabled { cursor: default; }
.fig-row-fig { width: 64px; height: 64px; }
.fig-ratio { font-size: 21px; line-height: 1; color: var(--ink-text); }
.fig-name { font-size: 13px; line-height: 1.3; color: var(--muted); text-align: center; }
@media (prefers-reduced-motion: no-preference) { .fig-item.is-playing { animation: sounding 1.1s ease-out infinite; } }

/* ::scales */
.sc-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.sc-row { display: grid; grid-template-columns: minmax(150px, 196px) minmax(0, 1fr); grid-template-areas: "play notes" ". steps"; gap: 6px 18px; align-items: center; }
.sc-play { grid-area: play; justify-self: stretch; justify-content: flex-start; }
.sc-play small { display: block; font-size: 12px; }
.sc-notes { grid-area: notes; list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; }
.sc-notes li { display: grid; justify-items: center; gap: 3px; padding: 9px 2px 8px; border-radius: 11px; background: var(--paper); transition: background-color 150ms ease, color 150ms ease, transform 150ms ease; }
.sc-notes b { font: 600 18px/1 var(--display); font-variant-numeric: lining-nums; }
.sc-notes span { font-size: 12px; line-height: 1; color: var(--muted); }
.sc-notes li.alt { background: var(--ink-wash); }
.sc-notes li.alt span { color: var(--ink-text); font-weight: 700; }
.sc-notes li.on { background: var(--ink); color: var(--on-ink); transform: translateY(-2px); }
.sc-notes li.on span { color: inherit; }
.sc-steps { grid-area: steps; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; margin: 0; }
.sc-row.n6 .sc-steps { padding-inline: calc(100% / 12); }
.sc-row.n7 .sc-steps { padding-inline: calc(100% / 14); }
.sc-row.n8 .sc-steps { padding-inline: calc(100% / 16); }
.sc-row.n13 .sc-steps { padding-inline: calc(100% / 26); }
.st { font-style: normal; font-size: 12px; font-weight: 700; color: var(--pencil); text-align: center; border-top: 2px solid var(--rule); padding-top: 3px; }
.st.w { color: var(--muted); border-color: var(--pencil); }
.st.w3 { color: var(--ink-text); border-color: var(--ink); }
@media (max-width: 640px) {
  .sc-row { grid-template-columns: minmax(0, 1fr); grid-template-areas: "play" "notes" "steps"; }
  .sc-play { justify-self: start; }
  .sc-notes b { font-size: 15px; }
  .sc-notes span { font-size: 11px; }
}

/* ::cents */
.cents-line { width: 100%; max-width: 600px; height: auto; justify-self: center; }
.cl-name, .cl-label { font: 600 12.5px var(--body); fill: var(--muted); }
.cl-label { font-size: 12px; }
.cl-tick { stroke: var(--rule); stroke-width: 1; }
.cl-bar { stroke-width: 7; stroke-linecap: round; }
.cl-bar.wide { stroke: var(--ink); }
.cl-bar.narrow { stroke: var(--verdigris); }
.cl-dot { fill: var(--sheet); stroke: var(--text); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; }

/* ::plate and ::beats */
.x-plate, .x-beats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(18px, 4vw, 44px); }
.x-plate figcaption, .x-beats figcaption, .x-beats noscript { grid-column: 1 / -1; }
.x-plate .plate, .x-beats .plate { box-shadow: none; border-radius: 24px; }
.x-plate .plate::after, .x-beats .plate::after { border-radius: 16px; }
.x-plate .plate > svg { inset: 6%; width: 88%; height: 88%; }
.x-plate .plate-fig path { stroke-width: 2.1; }
.x-beats .plate-fig path { stroke-width: 1.2; }
.x-plate-panel, .x-beats-panel { display: grid; gap: 16px; align-content: center; min-width: 0; }
.x-plate-name { font: 560 clamp(24px, 2.6vw, 30px)/1.2 var(--display); }
.x-plate-text, .x-beats-read { color: var(--muted); font-size: 16px; line-height: 1.55; }
.x-beats-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 700px) {
  .x-plate, .x-beats { grid-template-columns: minmax(0, 1fr); }
  .x-plate .plate, .x-beats .plate { width: min(100%, 420px); justify-self: center; }
}

/* ::app */
.x-app { grid-template-columns: 52px minmax(0, 1fr); align-items: start; gap: 18px; background: var(--ink-wash); border-color: transparent; box-shadow: none; }
.x-app .mark { width: 52px; height: 52px; }
.x-app-copy { display: grid; gap: 8px; }
.x-app-kicker { font: 700 13px/1.3 var(--body); letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-text); }
.x-app-title { font: 560 clamp(22px, 2.3vw, 26px)/1.25 var(--display); text-wrap: balance; }
.x-app-text { color: var(--muted); font-size: 16px; margin-bottom: 8px; }
.x-app .soon { background: var(--sheet); }
@media (max-width: 480px) { .x-app { grid-template-columns: minmax(0, 1fr); } }

/* ---- After the article */
.post-foot { margin-top: 48px; display: grid; gap: 48px; }
.post-by { max-width: 41rem; justify-self: center; width: 100%; color: var(--muted); font-size: 15px; line-height: 1.6; border-top: 1px solid var(--rule); padding-top: 18px; }
.more { display: grid; gap: 20px; }
.more h2 { font-size: clamp(28px, 3vw, 34px); }

/* ---- The index */
.blog-page { max-width: var(--wide); margin: 0 auto; padding: clamp(36px, 6vw, 80px) var(--gutter) 0; display: grid; gap: clamp(28px, 4vw, 44px); }
.blog-head { max-width: 46rem; display: grid; gap: 14px; }
.blog-head .kicker { font: 600 16px/1.3 var(--body); color: var(--ink-text); }
.blog-head h1 { font-size: clamp(44px, 6.2vw, 78px); line-height: 1; letter-spacing: -0.028em; font-weight: 520; }
.blog-head .lead { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.6; color: var(--muted); }
.lead-card { grid-template-columns: minmax(0, 1fr); }
.card.big a { grid-template-columns: minmax(0, 1fr) clamp(150px, 22vw, 250px); grid-template-areas: "meta fig" "title fig" "text fig" "try fig"; column-gap: clamp(20px, 4vw, 56px); align-content: center; padding: clamp(24px, 3.5vw, 40px); }
.card.big .card-fig { grid-area: fig; width: 100%; height: auto; aspect-ratio: 1; margin: 0; align-self: center; }
.card.big .card-fig path { stroke-width: 1.1; }
.card.big .card-meta { grid-area: meta; }
.card.big .card-title { grid-area: title; font-size: clamp(30px, 3.4vw, 42px); }
.card.big .card-text { grid-area: text; font-size: 18px; max-width: 36rem; }
.card.big .card-try { grid-area: try; }
@media (max-width: 640px) {
  .card.big a { grid-template-columns: minmax(0, 1fr); grid-template-areas: "fig" "meta" "title" "text" "try"; }
  .card.big .card-fig { width: 120px; }
}
.feed-note { color: var(--muted); font-size: 15px; }
