:root {
  --paper: #f6f1e7;
  --ink: #1f1b16;
  --muted: #6b6257;
  --rule: #1f1b16;
  --accent: #9b2c1f;
  --card: #fffdf8;
  --chip: #ece4d4;
  --chip-on: #1f1b16;
  --chip-on-ink: #f6f1e7;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16130f;
    --ink: #ece4d4;
    --muted: #a39887;
    --rule: #ece4d4;
    --accent: #e0806f;
    --card: #1f1b16;
    --chip: #2a251f;
    --chip-on: #ece4d4;
    --chip-on-ink: #16130f;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 18px;
  line-height: 1.55;
  padding: 0 16px;
}
[hidden] { display: none !important; }

.masthead { max-width: 1100px; margin: 0 auto; padding-top: 24px; text-align: center; }
.masthead h1 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 800;
  font-size: clamp(44px, 9vw, 84px);
  letter-spacing: -0.02em;
  margin: 10px 0 0;
  line-height: 1;
}
.masthead h1 a { color: inherit; text-decoration: none; }
.rule { border-top: 3px double var(--rule); }
.dateline { margin: 8px 0; color: var(--muted); font-style: italic; }
nav { display: flex; justify-content: center; gap: 20px; margin-bottom: 10px; flex-wrap: wrap; }

main { max-width: 1100px; margin: 32px auto; }
.center { text-align: center; }
.muted { color: var(--muted); }

.panel { max-width: 520px; margin: 0 auto; }
.panel.wide { max-width: 760px; }
.panel h2, .read h3 { font-family: "Fraunces", Georgia, serif; }
.panel h2 { font-size: 30px; line-height: 1.2; margin: 0 0 12px; }

form { display: grid; gap: 12px; margin-top: 20px; }
label { font-weight: 600; font-size: 15px; }
input[type="email"] {
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  background: var(--card);
  color: var(--ink);
  border-radius: 2px;
}
button { font: inherit; cursor: pointer; }
button.primary {
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 12px 18px;
  font-weight: 600;
  border-radius: 2px;
}
button.primary:disabled { opacity: 0.6; cursor: wait; }
button.link {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.error { color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block;
  padding: 8px 14px;
  background: var(--chip);
  border-radius: 999px;
  font-size: 16px;
  user-select: none;
}
.chip input:checked + span { background: var(--chip-on); color: var(--chip-on-ink); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.preparing { text-align: center; font-style: italic; color: var(--muted); }

.columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}
.read { padding: 0 24px; border-left: 1px solid var(--rule); }
.read:first-child { border-left: none; padding-left: 0; }
.read:last-child { padding-right: 0; }
.kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin: 0;
}
.read h3 { font-size: 28px; line-height: 1.15; margin: 8px 0 4px; }
.read h3 a { color: inherit; text-decoration: none; }
.read h3 a:hover { text-decoration: underline; }
.byline { font-style: italic; color: var(--muted); margin: 0 0 12px; }
.read .why { border-top: 1px solid var(--chip); padding-top: 10px; font-size: 16px; }
.read .meta { font-size: 14px; color: var(--muted); }
.read pre.poem {
  font-family: inherit;
  white-space: pre-wrap;
  font-size: 16px;
  background: var(--card);
  padding: 12px 14px;
}
.read a.go { color: var(--accent); font-weight: 600; }
.skeleton { color: var(--muted); font-style: italic; }

footer { max-width: 1100px; margin: 48px auto 32px; text-align: center; color: var(--muted); font-size: 14px; border-top: 1px solid var(--rule); padding-top: 12px; }

@media (max-width: 820px) {
  .columns { grid-template-columns: 1fr; gap: 28px; }
  .read, .read:first-child, .read:last-child { padding: 0; border-left: none; }
  .read + .read { border-top: 1px solid var(--rule); padding-top: 24px; }
}

/* Admin page */
.masthead h1.small { font-size: clamp(32px, 6vw, 48px); }
nav a { color: inherit; text-underline-offset: 3px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.tile { background: var(--card); border: 1px solid var(--chip); padding: 14px 16px; }
.tile-value { font-family: "Fraunces", Georgia, serif; font-size: 36px; font-weight: 600; line-height: 1.1; margin: 0; font-variant-numeric: tabular-nums; }
.tile-label { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.small-print { font-size: 14px; }
.section-title { font-family: "Fraunces", Georgia, serif; font-size: 22px; margin: 32px 0 8px; }
.admin-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 32px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--chip); vertical-align: top; }
th { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 820px) {
  .admin-grid { grid-template-columns: 1fr; gap: 0; }
}
