/* Composed vs. Generated: plain CSS, no external fonts or requests. */

:root {
  color-scheme: light dark;
  --bg: #f6f3ee;
  --surface: #fffdf9;
  --surface-2: #f0ebe2;
  --text: #201c17;
  --muted: #625a50;
  --line: #ddd5c8;
  --focus: #2d6a9f;

  /* one colour per source, used across the whole page */
  --m-composed: #9b5a1f;
  --m-composed-bg: #fbf1e3;
  --m-acestep: #2d6a9f;
  --m-yue2: #2f7d4a;
  --m-minimax: #8b3d82;

  --radius: 12px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #13110e;
    --surface: #1c1915;
    --surface-2: #26221c;
    --text: #ede7dd;
    --muted: #a9a094;
    --line: #3a342c;
    --focus: #7db4e6;
    --m-composed: #e3a666;
    --m-composed-bg: #2a2017;
    --m-acestep: #7db4e6;
    --m-yue2: #7cc79a;
    --m-minimax: #d991cf;
  }
}

:root[data-theme="dark"] {
  --bg: #13110e;
  --surface: #1c1915;
  --surface-2: #26221c;
  --text: #ede7dd;
  --muted: #a9a094;
  --line: #3a342c;
  --focus: #7db4e6;
  --m-composed: #e3a666;
  --m-composed-bg: #2a2017;
  --m-acestep: #7db4e6;
  --m-yue2: #7cc79a;
  --m-minimax: #d991cf;
}

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

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

body {
  margin: 0 auto;
  max-width: 1080px;
  padding: 0 16px 48px;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--sans);
  overflow-wrap: break-word;
}

a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); text-underline-offset: 2px; }
a:hover { text-decoration-color: currentColor; }

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

.skip {
  position: absolute; left: -9999px; top: 8px;
  background: var(--surface); padding: 6px 10px; border-radius: 6px;
}
.skip:focus { left: 16px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; }
h1 { font-size: clamp(2rem, 6vw, 3rem); margin: 0.2rem 0 0.8rem; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 4vw, 2rem); margin: 0 0 0.4rem; }
h3 { font-size: 1.15rem; margin: 0 0 0.3rem; }
h4 { font-size: 1rem; margin: 0.15rem 0 0; font-weight: 600; }
h5 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 1rem 0 0.35rem; }
h5:first-child { margin-top: 0.2rem; }

.small { font-size: 0.86rem; color: var(--muted); }

/* ---------------------------------------------------------------- header */
.site-head { padding: 48px 0 24px; }
.eyebrow { margin: 0; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--m-composed); font-weight: 600; }
.lede { font-size: 1.12rem; max-width: 46rem; margin: 0 0 1.4rem; }

.piece-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.piece-nav a {
  display: inline-block; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); text-decoration: none; font-size: 0.92rem;
}
.piece-nav a:hover { border-color: var(--m-composed); }

/* ---------------------------------------------------------------- about */
.about {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin: 8px 0 24px;
}
.sources { margin: 0.6rem 0 1.2rem; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.source { border-top: 3px solid var(--c); padding-top: 8px; }
.source dt { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.source dd { margin: 0.25rem 0 0; font-size: 0.92rem; color: var(--muted); }
.about-notes { display: grid; gap: 4px 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); border-top: 1px solid var(--line); padding-top: 12px; }
.about-notes h3 { font-family: var(--sans); font-size: 0.92rem; margin: 0.4rem 0 0.2rem; }
.about-notes p { margin: 0 0 0.4rem; font-size: 0.92rem; color: var(--muted); }

.dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  background: var(--c, var(--muted)); flex: none;
}

/* ---------------------------------------------------------------- piece */
.piece { padding-top: 40px; margin-top: 24px; border-top: 1px solid var(--line); scroll-margin-top: 8px; }
.piece-head { margin-bottom: 18px; }
.piece-head .subtitle { font-weight: 400; font-style: italic; color: var(--muted); font-size: 0.8em; }
.facts { margin: 0 0 0.6rem; color: var(--muted); font-size: 0.92rem; }
.scene { margin: 0 0 0.5rem; max-width: 46rem; }
.tip {
  margin: 0.6rem 0 0; max-width: 46rem; font-size: 0.92rem;
  padding: 8px 12px; border-radius: 8px; background: var(--surface-2);
}

/* ---------------------------------------------------------------- cards */
.cards {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}
.blind-grid { display: none; }

.take {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--c, var(--muted));
  border-radius: var(--radius);
  padding: 14px 16px 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.take--ref {
  background: var(--m-composed-bg);
  border: 1px solid color-mix(in srgb, var(--m-composed) 35%, var(--line));
  border-left: 6px solid var(--m-composed);
  padding: 18px 20px 14px;
}
.take--ref h4 { font-family: var(--serif); font-size: 1.15rem; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--c, var(--muted));
}
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; }
.meta div { min-width: 0; }
.meta dt { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.meta dd { margin: 0; font-variant-numeric: tabular-nums; font-size: 0.95rem; }

.take-note { margin: 0; font-size: 0.86rem; color: var(--muted); }
.licence {
  margin: 0; font-size: 0.8rem; align-self: flex-start;
  padding: 2px 8px; border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--m-yue2) 50%, var(--line));
}

audio { width: 100%; min-width: 0; margin: 2px 0; }

.card-actions { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 0.82rem; }
.card-actions .dl { color: var(--muted); }

button {
  font: inherit; color: inherit; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px;
}
button:hover { border-color: var(--text); }
.reveal { display: none; font-size: 0.82rem; }

/* ---------------------------------------------------------------- disclosures */
.disclosure { border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 2px; }
.disclosure summary {
  cursor: pointer; font-size: 0.88rem; font-weight: 600; color: var(--c, var(--text));
  list-style-position: outside; width: fit-content;
}
.disclosure[open] summary { margin-bottom: 6px; }
.prompt-body { font-size: 0.88rem; min-width: 0; }
.block-note { margin: 0 0 0.4rem; color: var(--muted); }
.block-link { margin: 0.4rem 0 0; }

pre.code {
  margin: 0; padding: 10px 12px; border-radius: 8px;
  background: var(--surface-2); color: var(--text);
  font: 0.8rem/1.5 var(--mono);
  white-space: pre-wrap; overflow-wrap: anywhere;
  max-width: 100%;
}
pre.code.scroll { white-space: pre; overflow: auto; max-height: 16rem; overflow-wrap: normal; }

.kv { display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); gap: 3px 12px; margin: 0; }
.kv dt { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); overflow-wrap: anywhere; }
.kv dd { margin: 0; overflow-wrap: anywhere; }

.form-table { border-collapse: collapse; width: 100%; }
.form-table td { padding: 4px 8px 4px 0; vertical-align: top; border-bottom: 1px solid var(--line); }
.form-table tr:last-child td { border-bottom: 0; }
.form-table .time { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; width: 3.5rem; }

/* ---------------------------------------------------------------- groups */
.reference { margin-bottom: 14px; }
.blind-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 10px 0 4px; }
.blind-help { display: none; margin: 0; }

.group { margin-top: 26px; }
.group-head { border-left: 4px solid var(--c); padding-left: 12px; margin-bottom: 12px; }
.group-head h3 { margin: 0; color: var(--c); font-family: var(--sans); font-size: 1.05rem; }
.group-head p { margin: 0.1rem 0 0; color: var(--muted); font-size: 0.92rem; }

/* ---------------------------------------------------------------- numbers + observations */
.numbers, .observations { margin-top: 32px; }
.numbers h3, .observations h3 { font-family: var(--sans); font-size: 1.05rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.table-wrap th, .table-wrap td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table-wrap tr:last-child th, .table-wrap tr:last-child td { border-bottom: 0; }
.table-wrap thead th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; }
.table-wrap .n { text-align: right; white-space: nowrap; }
.table-wrap thead th.n { white-space: normal; min-width: 4.2rem; }
.table-wrap tbody th { font-weight: 400; min-width: 8rem; }
.table-wrap tbody th .dot { margin-right: 6px; }
.row-model { font-weight: 600; }
.row-label { display: block; color: var(--muted); padding-left: 16px; font-size: 0.84rem; }
.table-wrap tr.ref { background: var(--m-composed-bg); }
.numbers .small { max-width: 46rem; margin: 8px 0 0; }

.observations ul { margin: 0.4rem 0 0; padding-left: 1.2rem; max-width: 50rem; }
.observations li { margin: 0.3rem 0; }
.observations .small { margin: 0; }

/* ---------------------------------------------------------------- blind mode */
.blind-name { display: none; margin: 0; font-family: var(--serif); font-size: 1.2rem; font-weight: 600; }
.is-blind .groups,
.is-blind .reference,
.is-blind .numbers,
.is-blind .observations { display: none; }
.is-blind .blind-grid { display: grid; margin-top: 12px; }
.is-blind .blind-help { display: block; }
.is-blind .blind-toggle { border-color: var(--text); font-weight: 600; }
.is-blind .take .blind-name { display: block; }
.is-blind .take:not(.revealed) {
  --c: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--line);
  padding: 14px 16px 12px;
}
.is-blind .take:not(.revealed) .take-head,
.is-blind .take:not(.revealed) .meta,
.is-blind .take:not(.revealed) .take-note,
.is-blind .take:not(.revealed) .licence,
.is-blind .take:not(.revealed) .disclosure,
.is-blind .take:not(.revealed) .dl { display: none; }
.is-blind .take:not(.revealed) .reveal { display: inline-block; }

/* ---------------------------------------------------------------- footer */
.site-foot { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); }
.site-foot h2 { font-size: 1.3rem; }
.licence-list { margin: 0.4rem 0 0.8rem; padding-left: 1.2rem; max-width: 50rem; font-size: 0.92rem; }
.licence-list li { margin: 0.25rem 0; }
.noscript { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }

@media (max-width: 520px) {
  .about { padding: 16px; }
  .take--ref { padding: 14px 14px 12px; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .table-wrap th, .table-wrap td { padding: 6px 5px; }
  .table-wrap th:first-child, .table-wrap td:first-child { padding-left: 8px; }
  .table-wrap thead th { font-size: 0.62rem; letter-spacing: 0; }
  .table-wrap thead th.n { min-width: 0; }
  .table-wrap tbody th { min-width: 6.5rem; }
  .row-label { padding-left: 0; }
  .kv dd { margin-bottom: 6px; }
}

@media print {
  audio, .blind-bar, .card-actions { display: none; }
}

/* ---------------------------------------------------------------- link to the method page */
.method-link { margin: -0.6rem 0 1.4rem; font-size: 1.02rem; font-weight: 600; }
.method-link a { color: var(--m-composed); }

/* several composed pieces on one brief: side by side (the grid comes from .cards) */
.reference.cards .take--ref { padding: 16px 18px 12px; }

/* ---------------------------------------------------------------- method page */
.method-page .site-head { padding-bottom: 8px; }
.method-page .site-head h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
.method > section { padding-top: 28px; margin-top: 24px; border-top: 1px solid var(--line); scroll-margin-top: 8px; }
.method p, .method li { max-width: 46rem; }
.method h3 { font-family: var(--sans); font-size: 1.02rem; margin: 1.2rem 0 0.25rem; }
.method code { font: 0.86em var(--mono); background: var(--surface-2); padding: 1px 4px; border-radius: 4px; }
.steps { margin: 0.8rem 0 0; padding-left: 1.6rem; }
.steps > li { margin: 0 0 0.9rem; padding-left: 0.2rem; }
.steps > li::marker { font-weight: 700; color: var(--m-composed); }
.checks { list-style: none; margin: 0.5rem 0 0; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; max-width: 46rem; font-size: 0.92rem; }
.checks li { margin: 0.2rem 0; padding-left: 2.6rem; text-indent: -2.6rem; }
.checks b { display: inline-block; width: 2.6rem; text-indent: 0; font: 600 0.8rem var(--mono); color: var(--muted); }
.shelf {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 4px 18px 12px; margin: 14px 0; max-width: 50rem;
}
.shelf ul { padding-left: 1.2rem; margin: 0.4rem 0; }
.shelf li { margin: 0.25rem 0; }
.caveat {
  margin: 0.8rem 0; padding: 10px 14px; max-width: 46rem;
  border-left: 4px solid var(--m-composed); background: var(--m-composed-bg); border-radius: 8px;
}
.method .table-wrap { max-width: 50rem; margin: 0.6rem 0; }
.method .table-wrap tbody th { min-width: 9rem; }
.back { margin: 0.4rem 0 0; }
