:root {
  --paper: #f6efe2;
  --card: #fffaf0;
  --ink: #2a2420;
  --muted: #6b6058;
  --line: #e2d6c2;
  --accent: #b5452b;
  --stamp: #2f6f9f;
  --shadow: 0 1px 2px rgba(60, 40, 20, .08), 0 8px 24px rgba(60, 40, 20, .08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1c1916; --card: #26221e; --ink: #efe6d8; --muted: #a89c8e;
    --line: #3a342d; --accent: #e07a5a; --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}
:root[data-theme="dark"] {
  --paper: #1c1916; --card: #26221e; --ink: #efe6d8; --muted: #a89c8e;
  --line: #3a342d; --accent: #e07a5a; --shadow: 0 1px 2px rgba(0,0,0,.4);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 17px/1.6 Inter, system-ui, sans-serif;
}
h1, h2, h3, .card h2 { font-family: Fraunces, Georgia, serif; font-weight: 600; line-height: 1.15; }
a { color: var(--accent); }

.hero, main, footer { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.hero { padding-top: 72px; padding-bottom: 32px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 13px; color: var(--accent); margin: 0; font-weight: 600; }
h1 { font-size: clamp(40px, 8vw, 72px); margin: 8px 0 16px; }
.lede { font-size: 20px; max-width: 42em; color: var(--muted); margin: 0 0 24px; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; }
.toc a {
  text-decoration: none; color: var(--ink); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 999px; font-size: 14px; background: var(--card);
}
.toc a:hover { border-color: var(--accent); }

.postcards { display: grid; gap: 32px; padding: 16px 0 48px; }
.card {
  background: var(--card); border-radius: 6px; box-shadow: var(--shadow);
  border-top: 6px solid var(--c, var(--stamp)); overflow: hidden;
  scroll-margin-top: 16px;
}
.card-head { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 24px 24px 8px; }
.card h2 { font-size: clamp(26px, 4vw, 34px); margin: 0; }
.card .place { color: var(--muted); margin: 4px 0 0; font-style: italic; font-family: Fraunces, Georgia, serif; }
.card { position: relative; }
.stamp {
  position: absolute; top: 22px; right: 24px; width: 104px; height: auto; transform: rotate(3deg);
  filter: drop-shadow(0 2px 4px rgba(60, 40, 20, .18));
}
.card-head, .blurb { padding-right: 152px; }
.blurb { padding: 0 24px; max-width: 46em; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; padding: 0 24px; margin: 8px 0 16px; font-size: 15px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.tabs { display: flex; gap: 4px; padding: 0 24px; border-bottom: 1px solid var(--line); }
.tabs button {
  font: inherit; font-size: 15px; font-weight: 500; background: none; border: 0; color: var(--muted);
  padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--c, var(--accent)); }
.tabs button:disabled { opacity: .45; cursor: default; }
.panel { padding: 20px 24px 24px; }
.panel[hidden] { display: none; }
audio, video { width: 100%; display: block; }
video { background: #000; border-radius: 4px; max-height: 70vh; }
.yt { aspect-ratio: 16 / 9; background: #000; border-radius: 4px; overflow: hidden; }
.yt iframe { width: 100%; height: 100%; border: 0; display: block; }
.score-frame { width: 100%; height: 80vh; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.panel .note { color: var(--muted); font-size: 14px; margin: 8px 0 0; }

.sections { list-style: none; padding: 0; margin: 16px 0 0; }
.sections li { border-top: 1px solid var(--line); }
.sections button {
  all: unset; box-sizing: border-box; cursor: pointer; width: 100%;
  display: grid; grid-template-columns: 52px 1fr; gap: 12px; padding: 8px 4px; font-size: 15px;
}
.sections button:hover, .sections button:focus-visible { background: color-mix(in srgb, var(--c) 8%, transparent); }
.sections .t { font-variant-numeric: tabular-nums; color: var(--muted); }
.sections b { font-weight: 600; }
.sections span.d { color: var(--muted); }
.sections li.now .t, .sections li.now b { color: var(--c, var(--accent)); }

.story, .credits { max-width: 42em; padding-bottom: 32px; }
.story h2, .credits h2 { font-size: 34px; margin: 24px 0 8px; }
.story h3 { font-size: 22px; margin: 28px 0 4px; }
.credits p { font-size: 15px; color: var(--muted); }
.credits .licence { color: var(--ink); }
footer { padding-top: 24px; padding-bottom: 48px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }

@media (max-width: 560px) {
  .card-head, .blurb, .facts, .tabs, .panel { padding-left: 16px; padding-right: 16px; }
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dd { margin-bottom: 6px; }
  .stamp { width: 64px; top: 18px; right: 16px; }
  .card-head { padding-right: 92px; }
  .blurb { padding-right: 16px; }
  .sections button { grid-template-columns: 44px 1fr; }
  .sections span.d { display: block; }
}
.sig { font: italic 400 22px Fraunces, Georgia, serif; margin-top: 24px; }
.sig a { color: inherit; text-decoration: none; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.langs { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--card); }
.langs button { font: 500 13px Inter, system-ui, sans-serif; background: none; border: 0; color: var(--muted); padding: 6px 12px; cursor: pointer; }
.langs button + button { border-left: 1px solid var(--line); }
.langs button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
