/* accent-atlas styles. Semantic tokens only; no hardcoded colors in markup. */
:root {
  --bg: #f6f1e6;
  --surface: #efe7d8;
  --ink: #211a13;
  --muted: #5c5145;
  --line: #d8cdb8;
  --accent: #9c2b1e;
  --accent-ink: #ffffff;
  --dot: #9c2b1e;
  --sea: #e3dac6;
  --land: #fbf8f1;
  --focus: #0f5fd0;
  --topbar-h: 3rem;
  --radius: 10px;
  --serif: "Charis", "Charis SIL", "Gentium Plus", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
[data-theme="dark"] {
  --bg: #171310;
  --surface: #221c16;
  --ink: #ede4d2;
  --muted: #b3a68f;
  --line: #3d342a;
  --accent: #e0684e;
  --accent-ink: #1c100c;
  --dot: #e0684e;
  --sea: #241d15;
  --land: #2b2318;
  --focus: #8ab8ff;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  font-size: 1.0625rem;
}
section { scroll-margin-top: calc(var(--topbar-h) + 0.75rem); }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

/* House topbar: one line, sideways scroll nav, sun/moon icon control. */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 1rem;
  padding: 0 1rem;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.topbar .home { font-weight: 700; text-decoration: none; color: var(--ink); white-space: nowrap; }
.topnav { display: flex; gap: 1rem; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { text-decoration: none; color: var(--muted); }
.topnav a[aria-current="true"] { color: var(--ink); font-weight: 700; }
.topbar .spacer { flex: 1 1 auto; }
.topbar .chip { text-decoration: none; color: var(--ink); white-space: nowrap; }
.icon-btn {
  width: 2.25rem; height: 2.25rem; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex: none;
}
.icon-btn svg { display: block; }
.icon-btn svg[hidden] { display: none; }

.wrap { max-width: 68rem; margin: 0 auto; padding: 0 1.25rem; }
.prose { max-width: 42rem; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); margin: 2.5rem 0 0.75rem; letter-spacing: -0.01em; }
.deck { font-size: 1.2rem; color: var(--muted); max-width: 44rem; margin: 0 0 2rem; }
.kicker { font-family: var(--serif); font-style: italic; color: var(--accent); margin: 3rem 0 0.25rem; }
h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0.25rem 0 0.75rem; }
.lede { color: var(--muted); max-width: 44rem; margin: 0 0 1.5rem; }

/* Instrument: map + hero side by side on desktop, stacked on phone. */
.instrument {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 1.5rem; align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}
@media (max-width: 50rem) { .instrument { grid-template-columns: 1fr; } }
.mapbox { margin: 0; }
.mapbox svg { display: block; width: 100%; height: auto; }
.coast { fill: var(--land); stroke: var(--line); stroke-width: 1.5; }
.tick { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 2; }
.tickdot { fill: var(--muted); }
.dot { cursor: pointer; scroll-margin-top: calc(var(--topbar-h) + 1rem); }
.dot .hit { fill: transparent; }
.dot .pin { fill: var(--bg); stroke: var(--dot); stroke-width: 2.5; }
.dot[aria-current="true"] .pin { fill: var(--dot); }
.dot text { display: none; }
.mapcap { color: var(--muted); font-size: 0.95rem; margin: 0.75rem 0 0; }

.hero { min-width: 0; }
.hero .wordline { font-family: var(--serif); font-size: 1.25rem; margin: 0 0 0.25rem; }
.hero .wordline strong { font-size: 1.5rem; }
.ipa-hero {
  font-family: var(--serif);
  font-size: clamp(3rem, 9vw, 5.5rem);
  line-height: 1.2;
  margin: 0;
  min-height: 1.2em;
  overflow-wrap: anywhere;
}
.ipa-hero .ch { display: inline-block; }
.ipa-hero .ch.in { animation: rise 0.45s ease both; }
.ipa-hero .ch.kept { animation: none; }
@keyframes rise { from { opacity: 0; transform: translateY(0.35em); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ipa-hero .ch.in { animation: none; } }
.speakermeta { color: var(--muted); margin: 0.5rem 0 1rem; }
.player { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.25rem; }
.cellplay {
  font: inherit; font-family: var(--serif); font-size: 1.15rem; white-space: nowrap;
  padding: 0.4rem 0.5rem; min-height: 2.75rem; min-width: 100%;
  border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--ink); cursor: pointer; text-align: left;
}
.cellplay:hover { background: var(--bg); border-color: var(--line); }
.cellplay[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.rowplay {
  font: inherit; font-size: 0.95rem; white-space: nowrap;
  padding: 0.45rem 0.8rem; min-height: 2.75rem;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--ink); cursor: pointer;
}
.rowplay[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.pickhint { color: var(--muted); font-size: 0.95rem; margin: 0 0 1rem; }

.wordswitch { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.25rem; }
.wordswitch button {
  font: inherit; font-family: var(--serif); font-size: 1.05rem;
  padding: 0.4rem 0.9rem; min-height: 2.75rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg); color: var(--ink); cursor: pointer;
}
.wordswitch button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }

.voicelnk { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.btn {
  font: inherit; padding: 0.5rem 1rem; min-height: 2.75rem;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--ink); cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.status { color: var(--muted); min-height: 1.5em; }

/* Share block under the hero. */
.share { margin: 1.5rem 0 0; }
.share-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.share-row .btn { min-width: 3rem; min-height: 3rem; justify-content: center; }

/* Words table. */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.words { border-collapse: collapse; width: 100%; min-width: 44rem; }
table.words caption { text-align: left; padding: 1rem 1rem 0.5rem; color: var(--muted); }
table.words th, table.words td { padding: 0.6rem 0.9rem; text-align: left; border-top: 1px solid var(--line); }
table.words thead th { border-top: 0; font-family: var(--serif); }
table.words td.ipa { font-family: var(--serif); font-size: 1.15rem; white-space: nowrap; }
table.words tbody tr { cursor: pointer; }
table.words tbody tr[aria-current="true"] { background: var(--bg); box-shadow: inset 3px 0 0 var(--accent); }
table.words tbody tr:hover td { background: var(--bg); }

/* Method + sources. */
blockquote.para { font-family: var(--serif); font-size: 1.2rem; border-left: 3px solid var(--accent); margin: 1rem 0; padding: 0.25rem 0 0.25rem 1rem; }
dl.primer { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1rem; margin: 1rem 0; }
dl.primer dt { font-family: var(--serif); font-size: 1.2rem; white-space: nowrap; }
dl.primer dd { margin: 0; color: var(--muted); }
ul.limits { padding-left: 1.25rem; }
ul.limits li { margin: 0.4rem 0; }
.sourcelist { padding-left: 1.25rem; }
.sourcelist li { margin: 0.4rem 0; }
footer.site { border-top: 1px solid var(--line); margin-top: 4rem; padding: 1.5rem 0 3rem; color: var(--muted); font-size: 0.95rem; }
footer.site p { max-width: 44rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--accent); color: var(--accent-ink); padding: 0.5rem 1rem; border-radius: 0 0 8px 8px; z-index: 99; transition: top 0.15s; }
.skip:focus { top: 0; }
@media (max-width: 26rem) {
  .wrap { padding: 0 1rem; }
  .instrument { padding: 1rem; }
  .ipa-hero { font-size: clamp(2.6rem, 15vw, 3.5rem); }
}
