:root {
  --paper: #fafbf7;
  --paper-2: #f0f3ec;
  --ink: #1f2a24;
  --muted: #5b6a61;
  --rule: #d8ded4;
  --overprint: #a8237b;
  --overprint-soft: #f6e4ef;
  --open: #f5c431;
  --forest: #3c7a4e;
  --contour: #b76a2e;
  --warn: #9a3412;
  --warn-bg: #fff1e6;
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --text: "Literata", Georgia, serif;
  --measure: 66ch;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #131916;
    --paper-2: #1b231f;
    --ink: #e6ebe5;
    --muted: #9eaba2;
    --rule: #2d3832;
    --overprint: #e46bb3;
    --overprint-soft: #3a1f30;
    --open: #e2b324;
    --forest: #6fb486;
    --contour: #d08a52;
    --warn: #fdba74;
    --warn-bg: #3a2414;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
}

a { color: inherit; text-decoration-color: var(--overprint); text-underline-offset: 0.18em; }
a:hover { color: var(--overprint); }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--overprint);
  outline-offset: 2px;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

.masthead {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
}

.masthead .contours {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--contour);
  opacity: 0.32;
  pointer-events: none;
}

.masthead .wrap {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-top: 28px;
  padding-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand svg { width: 52px; height: 52px; flex: none; color: var(--overprint); }

.brand-name {
  font-family: var(--display);
  font-stretch: 72%;
  font-weight: 800;
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  line-height: 0.9;
  letter-spacing: -0.01em;
}

.brand:hover { color: var(--ink); }

.dateline {
  flex: none;
  font-family: var(--display);
  font-size: 0.875rem;
  color: var(--muted);
  text-align: right;
}

.sections {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.sections ul {
  display: flex;
  gap: 4px 22px;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 10px 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.95rem;
}

.sections a { text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.sections a[aria-current="page"] { border-bottom-color: var(--overprint); }

.justnow {
  background: var(--open);
  color: #1f2a24;
  font-family: var(--display);
  font-size: 0.95rem;
}

.justnow .wrap { display: flex; flex-wrap: wrap; gap: 2px 12px; padding-top: 8px; padding-bottom: 8px; align-items: baseline; }
.justnow strong { font-weight: 800; white-space: nowrap; }
.justnow a { text-decoration-color: #1f2a24; }
.justnow a:hover { color: #1f2a24; }

.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 48px;
  padding-top: 32px;
  padding-bottom: 64px;
}

@media (max-width: 880px) {
  .page { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}

@media (max-width: 560px) {
  .dateline { display: none; }
  .brand svg { width: 40px; height: 40px; }
  .page { padding-top: 24px; }
}

.kicker {
  font-family: var(--display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--overprint);
  text-decoration: none;
}

.meta {
  font-family: var(--display);
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.lead-img, figure.hero img, .draft-img { display: block; width: 100%; height: auto; aspect-ratio: 20 / 9; object-fit: cover; background: var(--paper-2); }
.lead-img { margin-bottom: 18px; }

figure.hero { margin: 0 0 24px; }
figure.hero figcaption { margin-top: 8px; font-family: var(--display); font-size: 0.85rem; color: var(--muted); }

.draft-img { margin: 10px 0 4px; border: 1px solid var(--rule); }
.image-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 10px 0; font-size: 0.88rem; color: var(--muted); }
.image-bar .fail { color: var(--warn); }
.desk button[disabled] { opacity: 0.45; cursor: not-allowed; }

.list li.has-img { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }
.list .thumb img { display: block; width: 100%; height: auto; aspect-ratio: 20 / 9; object-fit: cover; }

@media (max-width: 560px) {
  .list li.has-img { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}

.lead { padding-bottom: 28px; border-bottom: 1px solid var(--rule); margin-bottom: 8px; }

.lead h2 {
  font-family: var(--display);
  font-stretch: 78%;
  font-weight: 800;
  font-size: clamp(2.1rem, 5.2vw, 3.5rem);
  line-height: 1;
  letter-spacing: -0.01em;
  margin: 8px 0 14px;
  max-width: 22ch;
  text-wrap: balance;
}

.lead h2 a { text-decoration: none; }

.lead .standfirst { font-size: 1.25rem; line-height: 1.5; max-width: 52ch; margin: 0 0 12px; }

.list { list-style: none; margin: 0; padding: 0; }

.list li { padding: 20px 0; border-bottom: 1px solid var(--rule); }

.list h3 {
  font-family: var(--display);
  font-stretch: 85%;
  font-weight: 700;
  font-size: 1.45rem;
  line-height: 1.12;
  margin: 4px 0 6px;
}

.list h3 a { text-decoration: none; }
.list h3, .lead .standfirst { text-wrap: pretty; }
.list p { margin: 0 0 6px; color: var(--muted); max-width: 60ch; }

.empty {
  padding: 32px;
  background: var(--paper-2);
  border-left: 4px solid var(--overprint);
}

.empty h2 { font-family: var(--display); margin: 0 0 8px; font-size: 1.4rem; }
.empty p { margin: 0; max-width: 56ch; }

aside > section { margin-bottom: 36px; }

aside h2 {
  font-family: var(--display);
  font-stretch: 85%;
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0 0 4px;
}

aside .sub { font-family: var(--display); font-size: 0.85rem; color: var(--muted); margin: 0 0 12px; }

.standings { width: 100%; border-collapse: collapse; font-family: var(--display); font-size: 0.92rem; }
.standings td { padding: 7px 0; border-top: 1px solid var(--rule); vertical-align: baseline; }
.standings td.place { width: 2ch; color: var(--muted); }
.standings td.pts { text-align: right; font-variant-numeric: tabular-nums; }
.standings .who { font-weight: 600; }
.standings .where { display: block; color: var(--muted); font-size: 0.8rem; }

.countdown {
  font-family: var(--display);
  font-stretch: 75%;
  font-weight: 800;
  font-size: 2.2rem;
  line-height: 1;
  margin: 2px 0 6px;
}

.controls { list-style: none; margin: 0; padding: 0; counter-reset: control; }

.controls li {
  counter-increment: control;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: start;
  padding: 8px 0;
  font-family: var(--display);
  font-size: 0.95rem;
  line-height: 1.3;
}

.controls li::before {
  content: counter(control);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2.5px solid var(--overprint);
  border-radius: 50%;
  color: var(--overprint);
  font-weight: 700;
  font-size: 0.85rem;
}

.controls a { text-decoration: none; }

article.story { max-width: var(--measure); }

article.story h1 {
  font-family: var(--display);
  font-stretch: 78%;
  font-weight: 800;
  font-size: clamp(2.1rem, 5.5vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 10px 0 16px;
  text-wrap: balance;
}

article.story .standfirst { font-size: 1.3rem; line-height: 1.5; margin: 0 0 16px; }

article.story .meta { padding-bottom: 20px; margin-bottom: 8px; border-bottom: 1px solid var(--rule); }

.body { line-height: 1.7; }
.body p, .body ul, .body ol { margin: 0 0 1.1em; }
.body h3 { font-family: var(--display); font-stretch: 85%; font-size: 1.3rem; margin: 1.6em 0 0.4em; }
.body li { margin-bottom: 0.3em; }
.body li::marker { color: var(--overprint); }

.basis {
  margin-top: 36px;
  padding: 18px 20px;
  background: var(--paper-2);
  font-family: var(--display);
  font-size: 0.9rem;
}

.basis h2 { font-size: 1rem; margin: 0 0 8px; }
.basis ul { margin: 0 0 10px; padding-left: 18px; }
.basis p { margin: 0; color: var(--muted); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; font-family: var(--display); font-size: 0.85rem; }
.tags span { padding: 2px 10px; border: 1px solid var(--rule); border-radius: 999px; color: var(--muted); }

.prose { max-width: var(--measure); }
.prose h1 { font-family: var(--display); font-stretch: 78%; font-size: 2.6rem; line-height: 1.05; margin: 8px 0 16px; }
.prose h2 { font-family: var(--display); font-stretch: 85%; font-size: 1.4rem; margin: 1.8em 0 0.4em; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.crumbs { font-family: var(--display); font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.more-h { font-family: var(--display); font-stretch: 85%; font-size: 1.4rem; margin: 48px 0 8px; }

.page-title { font-family: var(--display); font-stretch: 78%; font-weight: 800; font-size: 2.6rem; margin: 0 0 8px; }

footer.site {
  border-top: 1px solid var(--rule);
  padding: 28px 0 40px;
  font-family: var(--display);
  font-size: 0.875rem;
  color: var(--muted);
}

.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }

footer.site .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

.desk { font-family: var(--display); font-size: 0.95rem; }
.desk-page { padding-top: 28px; padding-bottom: 64px; }
.desk h1 { font-stretch: 78%; font-size: 2.2rem; margin: 0 0 6px; line-height: 1.05; }
.desk h2 { font-stretch: 85%; font-size: 1.25rem; margin: 28px 0 10px; }
.desk .bar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin: 12px 0 20px; }
.desk .note { padding: 10px 14px; background: var(--overprint-soft); border-left: 4px solid var(--overprint); margin: 12px 0; }
.desk table { width: 100%; border-collapse: collapse; }
.desk th, .desk td { text-align: left; padding: 10px 8px 10px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.desk th { font-weight: 600; color: var(--muted); font-size: 0.85rem; }
.desk .num { font-variant-numeric: tabular-nums; }

.btn, .desk button, .desk select {
  font: inherit;
  font-size: 0.9rem;
  padding: 6px 12px;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}

.desk button.primary { background: var(--overprint); border-color: var(--overprint); color: #fff; }
.desk button.quiet { border-color: var(--rule); color: var(--muted); }
.desk form.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; }

.status { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 0.8rem; border: 1px solid var(--rule); }
.status.pending { border-color: var(--open); }
.status.failed, .status.rejected { border-color: var(--warn); color: var(--warn); }
.status.published { border-color: var(--forest); color: var(--forest); }

.bundle { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.bundle li { display: grid; grid-template-columns: 3.2em 1fr; gap: 8px; }
.bundle code { color: var(--overprint); font-weight: 700; font-family: inherit; }

.drafts { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 24px; }

.draft { border: 1px solid var(--rule); padding: 18px; background: var(--paper); }
.draft .warn { background: var(--warn-bg); color: var(--warn); padding: 8px 12px; margin: 10px 0; font-size: 0.88rem; }
.draft .warn ul { margin: 0; padding-left: 18px; }
.draft label { display: block; font-size: 0.8rem; color: var(--muted); margin: 12px 0 4px; }
.draft input, .draft textarea, .draft select {
  width: 100%;
  font: inherit;
  padding: 8px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--paper-2);
  color: var(--ink);
}
.draft input.headline { font-weight: 700; font-size: 1.1rem; }
.draft textarea { font-family: var(--text); line-height: 1.55; }
.draft .actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.draft pre { white-space: pre-wrap; font-size: 0.85rem; color: var(--warn); }

details summary { cursor: pointer; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
