/* The guide pages: long reading pages in the app's colours, with diagrams and sound demos. */
:root {
  --bg: #0b0907;
  --panel: #15110c;
  --brass: #d9b76c;
  --ivory: #f1eadb;
  --text: #d8cfbd;
  --muted: #a89f8d;
  --line: rgba(217, 183, 108, 0.22);
  --good: #8fc79a;
  --bad: #e2725b;
  --serif: 'Bodoni 72', Didot, 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --sans: 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body { margin: 0; line-height: 1.7; font-size: 1.04rem; }
a { color: var(--brass); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 3px; }
b, strong { color: var(--ivory); font-weight: 600; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 68rem; margin: 0 auto; padding: 22px 24px; }
.brand { font-family: var(--serif); font-size: 1.2rem; color: var(--ivory); text-decoration: none; white-space: nowrap; }
.brand em { color: var(--brass); }
.top nav { display: flex; align-items: center; gap: 20px; font-size: 0.92rem; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a:hover { color: var(--ivory); }
.top nav .try, .button { display: inline-block; padding: 0.62em 1.25em; border-radius: 999px; background: linear-gradient(#e6c57c, #b8944a); color: #1b150c !important; font-weight: 600; text-decoration: none; white-space: nowrap; }
.button:hover, .top nav .try:hover { filter: brightness(1.07); }

.article { max-width: 44rem; margin: 0 auto; padding: 28px 24px 72px; }
.crumbs { font-size: 0.82rem; color: var(--muted); margin-bottom: 30px; }
.crumbs a { color: var(--muted); }
.crumbs span { opacity: 0.5; margin: 0 4px; }
.eyebrow { font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--brass); margin: 0 0 12px; }
h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(2.2rem, 7vw, 3.4rem); line-height: 1.06; color: var(--ivory); margin: 0 0 20px; text-wrap: balance; }
h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.55rem, 4.5vw, 2rem); line-height: 1.15; color: var(--ivory); margin: 0 0 14px; text-wrap: balance; }
h3 { font-size: 1.08rem; color: var(--ivory); margin: 28px 0 6px; }
p, ul, ol { margin: 0 0 16px; }
ul, ol { padding-left: 1.25em; }
li { margin-bottom: 8px; }
.standfirst { font-size: 1.22rem; line-height: 1.55; color: var(--ivory); }
.meta { font-size: 0.84rem; color: var(--muted); margin-bottom: 32px; }
.meta a { color: var(--muted); }
.article > section { margin-top: 56px; scroll-margin-top: 20px; }

.short { margin-top: 0 !important; padding: 22px 26px; border: 1px solid var(--line); border-left: 3px solid var(--brass); border-radius: 4px 12px 12px 4px; background: var(--panel); }
.short h2, .toc h2 { font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--brass); margin-bottom: 12px; }
.short ul { margin: 0; }
.short li:last-child { margin-bottom: 0; }
.toc { margin-top: 30px; padding-bottom: 6px; }
.toc ol { columns: 2; column-gap: 36px; font-size: 0.95rem; padding-left: 1.4em; }
.toc li { break-inside: avoid; margin-bottom: 6px; }
.toc a { color: var(--text); text-decoration-color: var(--line); }
.toc a:hover { color: var(--brass); }

/* pictures */
figure { margin: 28px 0; padding: 22px 22px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
figure svg { display: block; width: 100%; height: auto; }
/* a drawing with labels keeps a readable size on a phone and scrolls sideways instead of shrinking */
figure .draw { overflow-x: auto; }
figure .draw svg { min-width: 560px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stats div { padding: 18px 8px; border: 1px solid var(--line); border-radius: 12px; text-align: center; }
.stats b { display: block; font-family: var(--serif); font-weight: 500; font-size: 1.55rem; line-height: 1.2; color: var(--brass); white-space: nowrap; }
.stats span { display: block; margin-top: 6px; font-size: 0.86rem; font-weight: 600; color: var(--ivory); }
.stats small { display: block; font-size: 0.76rem; line-height: 1.4; color: var(--muted); }
.ladder { list-style: none; padding: 0; margin: 0; }
.ladder li { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 10px 0 10px 16px; margin: 0 0 6px; border-left: 5px solid var(--brass); border-radius: 3px; }
.ladder li.good { border-color: var(--good); }
.ladder li.bad { border-color: var(--bad); }
.ladder em { font-style: normal; font-size: 0.8rem; font-weight: 600; color: var(--brass); text-align: right; }
.ladder .good em { color: var(--good); }
.ladder .bad em { color: var(--bad); }
.ladder span { grid-column: 1 / -1; font-size: 0.86rem; color: var(--muted); }
.stairs { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; align-items: end; }
.stairs li { margin: 0; padding: 12px 8px; min-height: calc(120px + var(--k) * 34px); border: 1px solid rgba(217, 183, 108, 0.45); border-radius: 8px; background: rgba(217, 183, 108, calc(0.08 + var(--k) * 0.07)); text-align: center; }
.stairs em { display: block; font-style: normal; font-size: 0.8rem; font-weight: 600; color: var(--brass); }
.stairs b { display: block; font-size: 0.9rem; line-height: 1.25; margin: 4px 0 6px; }
.stairs span { display: block; font-size: 0.76rem; line-height: 1.35; color: var(--muted); }
.bars { list-style: none; padding: 0; margin: 0; }
.bars li { display: grid; grid-template-columns: 6.2em 1fr 2.6em; align-items: center; gap: 10px; margin: 0 0 7px; font-size: 0.86rem; }
.bars span { color: var(--text); white-space: nowrap; }
.bars i { display: block; height: 16px; width: var(--w); border-radius: 3px; background: linear-gradient(90deg, #8f7438, var(--brass)); }
.bars b { font-weight: 600; text-align: right; }
figcaption { margin-top: 14px; font-size: 0.88rem; line-height: 1.5; color: var(--muted); }
figcaption b { color: var(--ivory); }
svg text { font-family: var(--sans); fill: var(--muted); }
svg .lbl { fill: var(--ivory); font-weight: 600; }
svg .brass { fill: var(--brass); }

/* notes in the margin of the argument */
.note, .warn { margin: 24px 0; padding: 16px 20px; border-radius: 12px; font-size: 0.97rem; }
.note { background: rgba(217, 183, 108, 0.08); border: 1px solid var(--line); }
.warn { background: rgba(226, 114, 91, 0.08); border: 1px solid rgba(226, 114, 91, 0.35); }
.note > :last-child, .warn > :last-child { margin-bottom: 0; }
.note > b:first-child, .warn > b:first-child { display: block; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 4px; }
.note > b:first-child { color: var(--brass); }
.warn > b:first-child { color: var(--bad); }

table { width: 100%; border-collapse: collapse; margin: 22px 0; font-size: 0.94rem; }
th, td { text-align: left; vertical-align: top; padding: 11px 14px 11px 0; border-bottom: 1px solid rgba(217, 183, 108, 0.16); }
th { color: var(--muted); font-weight: 500; font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; }
td:first-child { color: var(--ivory); }
.scroll { overflow-x: auto; }

/* numbered steps */
.steps { list-style: none; padding: 0; counter-reset: step; }
.steps > li { position: relative; padding: 0 0 18px 54px; counter-increment: step; margin: 0; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--brass); color: var(--brass); font-family: var(--serif); font-size: 1.1rem; display: grid; place-items: center; }
.steps > li:not(:last-child)::after { content: ''; position: absolute; left: 18px; top: 42px; bottom: 4px; width: 1px; background: var(--line); }
.steps > li > b:first-child { display: block; }

/* sound demos (built by guide.js) */
.demo { margin: 28px 0; padding: 22px; border: 1px solid var(--brass); border-radius: 14px; background: linear-gradient(180deg, rgba(217, 183, 108, 0.1), rgba(217, 183, 108, 0.02)); }
.demo h3 { margin: 0 0 4px; font-family: var(--serif); font-weight: 500; font-size: 1.3rem; }
.demo > p { font-size: 0.94rem; color: var(--text); margin-bottom: 14px; }
.demo canvas { display: block; width: 100%; height: 96px; border-radius: 8px; background: #0e0b08; }
.demo .row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.demo button { font: inherit; font-size: 0.92rem; padding: 0.55em 1.05em; border-radius: 999px; border: 1px solid var(--line); background: #1a150f; color: var(--ivory); cursor: pointer; }
.demo button:hover { border-color: var(--brass); }
.demo button[aria-pressed='true'] { background: linear-gradient(#e6c57c, #b8944a); color: #1b150c; border-color: transparent; font-weight: 600; }
.demo .read { margin-top: 12px; font-size: 0.92rem; color: var(--muted); min-height: 1.6em; }
.demo .read b { color: var(--brass); }
.demo label { display: block; margin-top: 14px; font-size: 0.86rem; color: var(--muted); }
.demo input[type='range'] { width: 100%; accent-color: var(--brass); margin-top: 6px; }
.demo .hint { font-size: 0.8rem; color: var(--muted); margin: 10px 0 0; }

.cta { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 56px 0 0; padding: 28px 30px; border-radius: 16px; border: 1px solid var(--line); background: radial-gradient(120% 140% at 0% 0%, rgba(217, 183, 108, 0.16), transparent 60%), var(--panel); }
.cta h2 { font-size: 1.5rem; margin-bottom: 6px; }
.cta p { margin: 0; font-size: 0.96rem; }
.cta .button { flex: none; }

.faq details { border-top: 1px solid rgba(217, 183, 108, 0.16); }
.faq details:last-child { border-bottom: 1px solid rgba(217, 183, 108, 0.16); }
.faq summary { cursor: pointer; padding: 16px 28px 16px 0; color: var(--ivory); font-weight: 600; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 4px; top: 12px; font-size: 1.4rem; font-weight: 400; color: var(--brass); }
.faq details[open] summary::after { content: '−'; }
.faq details div { padding: 0 0 18px; }
.faq details div > :last-child { margin-bottom: 0; }
.sources { font-size: 0.9rem; color: var(--muted); }
.sources h2 { font-size: 1.25rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 8px; }
.card { display: block; padding: 22px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
.card:hover { border-color: var(--brass); transform: translateY(-2px); }
.card span { font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--brass); }
.card b { display: block; font-family: var(--serif); font-weight: 500; font-size: 1.3rem; line-height: 1.2; margin: 8px 0; text-wrap: balance; }
.card p { margin: 0; font-size: 0.9rem; line-height: 1.55; color: var(--muted); }
.index { max-width: 68rem; }
.index h1, .index .standfirst { max-width: 44rem; }
.index .cards { margin-top: 40px; }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; max-width: 68rem; margin: 0 auto; padding: 24px 24px 44px; border-top: 1px solid rgba(217, 183, 108, 0.16); font-size: 0.82rem; color: var(--muted); }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot a { color: var(--muted); }

@media (max-width: 640px) {
  body { font-size: 1rem; }
  .top { padding: 16px 18px; }
  .top nav { gap: 14px; }
  .top nav a:not(.try) { display: none; }
  .article { padding: 16px 18px 56px; }
  .toc ol { columns: 1; }
  figure { padding: 14px 12px 12px; margin-left: -6px; margin-right: -6px; }
  .demo { padding: 16px; margin-left: -6px; margin-right: -6px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .ladder li { grid-template-columns: 1fr; }
  .ladder em { text-align: left; }
  .stairs { grid-template-columns: 1fr; }
  .stairs li { min-height: 0; text-align: left; display: grid; grid-template-columns: 6.5em 1fr; gap: 0 10px; padding: 10px 12px; }
  .stairs em { grid-row: span 2; align-self: center; }
  .stairs b { margin: 0; }
  .cta { flex-direction: column; align-items: flex-start; padding: 24px 22px; }
  .steps > li { padding-left: 48px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .card { transition: none; } }
