:root {
  --bg: #f7f1e8;
  --card: #fffaf2;
  --text: #2b2118;
  --muted: #6b5b4b;
  --primary: #c2562f;
  --primary-dark: #a14524;
  --accent: #e0a03a;
  --line: #e6dccd;
  --radius: 12px;
  --shadow-1: 0 1px 2px rgba(0,0,0,.06);
  --shadow-2: 0 8px 24px rgba(0,0,0,.08);
  --font-head: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--font-body);
}
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-dark); }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; line-height: 1.2; margin: 0 0 16px; }
h1 { font-size: 48px; }
h2 { font-size: 28px; }
p { margin: 0 0 16px; max-width: 70ch; }
mark { background: none; color: var(--primary); border-bottom: 3px solid var(--accent); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

.masthead { border-bottom: 1px solid var(--line); background: var(--card); }
.masthead__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { font-family: var(--font-head); font-weight: 700; font-size: 22px; color: var(--text); text-decoration: none; }
.masthead__nav { display: flex; gap: 24px; font-size: 14px; font-weight: 600; }
.masthead__nav a { color: var(--muted); text-decoration: none; }
.masthead__nav a:hover { color: var(--primary); }

main.wrap { padding-top: 32px; padding-bottom: 64px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 32px;
}

.headword { box-shadow: var(--shadow-2); position: relative; }
.headword__label { font-size: 14px; font-weight: 600; letter-spacing: .04em; color: var(--muted); margin-bottom: 8px; }
.headword h1 { font-size: 36px; color: var(--muted); }
.headword__word { font-family: var(--font-head); font-weight: 700; font-size: 48px; line-height: 1.2; margin: 0 0 12px; word-break: break-word; }
.headword__meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 16px; margin-bottom: 16px; }
.pos { font-style: italic; }
.ipa { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 16px; }
.headword__def { font-size: 22px; line-height: 1.5; max-width: 60ch; }
.headword__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 24px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  border-radius: var(--radius);
  font: 600 16px/1 var(--font-body);
  cursor: pointer;
}
.btn--primary { background: var(--primary); color: #fff; border: 1px solid var(--primary); }
.btn--primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn--ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn[aria-pressed="true"] { border-color: var(--primary); color: var(--primary); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.hint { font-size: 14px; color: var(--muted); margin: 8px 0 0; }

.block { padding: 48px 0 0; }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; margin: 24px 0 0; }
.facts__row { border-top: 1px solid var(--line); padding-top: 12px; }
.facts dt { font-size: 14px; font-weight: 600; color: var(--muted); }
.facts dd { margin: 4px 0 0; }

.table-scroll { overflow-x: auto; }
.forms { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: 16px; }
.forms th, .forms td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.forms th { font-size: 14px; color: var(--muted); }
.forms tr:last-child td { border-bottom: 0; }
.forms td:first-child { font-weight: 600; white-space: nowrap; }

.timeline { list-style: none; margin: 24px 0 0; padding: 0 0 0 24px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 24px 16px; }
.timeline li::before { content: ""; position: absolute; left: -31px; top: 8px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.timeline__when { display: block; font-weight: 600; }
.timeline__text { color: var(--muted); }

.examples { margin: 0; padding-left: 24px; }
.examples li { margin-bottom: 16px; }
.examples__src { font-weight: 600; margin: 0; }
.examples__gloss { color: var(--muted); margin: 4px 0 0; }

.puzzle__grid { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.tile__word { display: block; font-family: var(--font-head); font-size: 22px; font-weight: 700; letter-spacing: .02em; }
.tile__note { display: block; font-size: 14px; color: var(--muted); margin-top: 4px; }

.faq details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq summary { font-weight: 600; cursor: pointer; list-style-position: outside; }
.faq details p { margin: 12px 0 0; }

.talk__form { display: grid; gap: 12px; max-width: 70ch; }
.talk__form input, .talk__form textarea {
  font: 400 16px/1.5 var(--font-body); color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px;
}
.talk__form .btn { justify-self: start; }
.talk__list { margin-top: 24px; max-width: 70ch; }
.talk__list[data-gf-empty]::before { content: "No comments yet. Did STUTTGARTER give away the purple group for you?"; color: var(--muted); font-size: 16px; }
.talk__list[data-gf-off] { display: none; }
.comment { border-top: 1px solid var(--line); padding: 16px 0; }
.comment[data-gf-owner] { border-left: 3px solid var(--primary); padding-left: 12px; }
.comment__meta { font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.comment__meta strong { color: var(--text); }
.owner { display: none; font-weight: 600; color: var(--primary); }
.comment[data-gf-owner] .owner { display: inline; }
.comment__replies { margin-left: 24px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); font: 600 14px var(--font-body); cursor: pointer; min-height: 32px; }

.prose { max-width: 820px; }
.prose h1 { font-size: 36px; }
.prose h2 { font-size: 22px; margin-top: 32px; }
.prose ul { padding-left: 24px; }

.colophon { border-top: 1px solid var(--line); padding: 32px 0; font-size: 14px; color: var(--muted); }
.colophon__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.colophon__row p { margin: 0; }
.colophon nav { display: flex; flex-wrap: wrap; gap: 16px; }
.colophon a { color: var(--muted); }

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .masthead__nav { gap: 16px; }
  .card { padding: 24px 16px; }
  h1, .prose h1 { font-size: 28px; }
  .headword h1 { font-size: 28px; }
  .headword__word { font-size: 36px; }
  .headword__def { font-size: 18px; }
  .headword__actions .btn { flex: 1 1 100%; }
  .facts, .puzzle__grid { grid-template-columns: 1fr; }
  .block { padding-top: 48px; }
}
