/* Have we cured cancer yet? — stark editorial: paper, ink, one red. */

:root {
  --paper: #f5f2ea;
  --ink: #151413;
  --muted: #5f5b53;
  --hair: #d6d0c2;
  --rule: #151413;
  --red: #c8102e;
  --bar: #151413;
  --field: #fffdf8;

  --serif-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, ui-serif, serif;
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, ui-serif, serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #12110f;
    --ink: #ece7dc;
    --muted: #a39d90;
    --hair: #2e2b26;
    --rule: #ece7dc;
    --red: #ff4f5e;
    --bar: #ece7dc;
    --field: #1b1a17;
  }
}
:root[data-theme="dark"] {
  --paper: #12110f;
  --ink: #ece7dc;
  --muted: #a39d90;
  --hair: #2e2b26;
  --rule: #ece7dc;
  --red: #ff4f5e;
  --bar: #ece7dc;
  --field: #1b1a17;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(17px, 1.05vw + 12px, 19px);
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--red); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

main, .masthead, .colophon { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }

h1, h2, h3 { font-family: var(--serif-display); font-weight: 700; line-height: 1.1; margin: 0; text-wrap: balance; }
p { margin: 0; }

.kicker, .section-kicker, .meta, .tag, .masthead, .bar-label, .bar-value, .sources, .small, .notes, .who, .figure-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.kicker, .section-kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 400;
}

/* --- masthead --------------------------------------------------------------- */

.masthead {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding-block: 14px 10px;
  border-bottom: 4px double var(--rule);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.masthead-name { color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: 0.08em; text-transform: none; font-size: 0.8rem; }
.masthead-right { text-align: right; }

@media (max-width: 640px) {
  .masthead { grid-template-columns: 1fr; text-align: center; gap: 2px; }
  .masthead-left { display: none; }
  .masthead-right { text-align: center; }
}

/* --- hero ------------------------------------------------------------------- */

.hero {
  padding-block: clamp(40px, 8vw, 96px) clamp(32px, 6vw, 72px);
  border-bottom: 1px solid var(--rule);
  text-align: center;
}
.hero h1 {
  margin-top: 14px;
  font-size: clamp(1.9rem, 4.6vw, 3.6rem);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.01em;
}
.answer {
  font-family: var(--serif-display);
  font-weight: 700;
  font-size: clamp(9rem, 34vw, 25rem);
  line-height: 0.82;
  letter-spacing: -0.045em;
  margin: clamp(12px, 3vw, 32px) 0 clamp(20px, 4vw, 40px);
}
.answer .dot {
  display: inline-block;
  width: 0.16em;
  height: 0.16em;
  margin-left: 0.04em;
  border-radius: 50%;
  background: var(--red);
  vertical-align: baseline;
}
.answer .dot span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.answer-note {
  max-width: 40em;
  margin: 0 auto;
  color: var(--muted);
  font-size: 0.95em;
  text-wrap: pretty;
}
.cite { font-family: var(--mono); font-size: 0.62em; margin-left: 1px; }
.cite a { text-decoration: none; color: var(--red); }

/* --- ledger ----------------------------------------------------------------- */

.ledger { padding-block: clamp(32px, 5vw, 56px); border-bottom: 1px solid var(--rule); }
.figures {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 18px;
  border-top: 1px solid var(--hair);
}
.figure { padding: 20px 24px 20px 0; }
.figure + .figure { border-left: 1px solid var(--hair); padding-left: 24px; }
.figure-value { font-family: var(--serif-display); font-weight: 700; font-size: clamp(2rem, 4.2vw, 3.2rem); line-height: 1; letter-spacing: -0.02em; }
.figure-label { margin-top: 10px; color: var(--muted); line-height: 1.5; text-transform: none; }

@media (max-width: 760px) {
  .figures { grid-template-columns: 1fr; }
  .figure, .figure + .figure { border-left: 0; padding: 18px 0; }
  .figure + .figure { border-top: 1px solid var(--hair); }
}

.bars { margin: 28px 0 0; padding: 24px 0 0; border-top: 1px solid var(--hair); }
.bars figcaption { font-size: 0.95em; margin-bottom: 18px; }
.bar-row {
  display: grid;
  grid-template-columns: minmax(150px, 220px) 1fr auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
}
.bar { display: block; width: 100%; height: 28px; }
.bar-ai { fill: var(--bar); }
.bar-cancer { fill: var(--red); }
.bar-label { color: var(--muted); }
.bar-value { font-weight: 700; min-width: 7.5em; text-align: right; }
.ratio { margin-top: 16px; font-style: italic; color: var(--muted); }
.ratio strong { color: var(--ink); font-style: normal; }

@media (max-width: 640px) {
  .bar-row { grid-template-columns: 1fr auto; gap: 4px 12px; }
  .bar-row .bar { grid-column: 1 / -1; grid-row: 2; }
  .bar-value { min-width: 0; }
}

/* --- section headings ------------------------------------------------------- */

.feed, .good, .act { padding-block: clamp(40px, 6vw, 72px); border-bottom: 1px solid var(--rule); }
.feed > h2, .good > h2, .act > h2 { font-size: clamp(1.9rem, 4.4vw, 3.2rem); letter-spacing: -0.015em; max-width: 18em; }
.dek { margin-top: 12px; max-width: 38em; color: var(--muted); font-style: italic; }

/* --- feed ------------------------------------------------------------------- */

.entries {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 2px solid var(--rule);
}
.entry { padding: 22px 22px 26px 0; border-bottom: 1px solid var(--hair); }
.entry:not(.lead) { border-right: 1px solid var(--hair); padding-left: 22px; }
.entry:not(.lead):nth-child(3n + 1) { border-right: 0; }
.entry:not(.lead):nth-child(3n + 2) { padding-left: 0; }
.entry.lead { grid-column: 1 / -1; padding: 28px 0 32px; border-bottom: 2px solid var(--rule); }
.entry.lead article { display: grid; grid-template-columns: 1.2fr 1fr; column-gap: 40px; align-items: end; }
.entry.lead h3 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
.entry.lead .what { font-size: 1.08em; }
.entry.lead .entry-body > .what:first-child { margin-top: 0; }

.meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--muted); }
.tag { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.62rem; padding: 2px 6px; border: 1px solid currentColor; }
.tag-money { color: var(--red); }
.tag-good { color: var(--ink); }

.entry h3, .good-item h3 { font-size: 1.45rem; margin-top: 10px; letter-spacing: -0.01em; }
.entry h3 a { text-decoration: none; }
.entry h3 a:hover { text-decoration: underline; }
.who { margin-top: 6px; color: var(--muted); text-transform: none; }
.what { margin-top: 12px; }
.cost { margin-top: 10px; font-family: var(--mono); font-size: 0.78rem; font-weight: 700; color: var(--red); }
.quip { margin-top: 12px; font-style: italic; }
.quip::before { content: "\2014\00a0"; }
.sources { margin-top: 14px; color: var(--muted); text-transform: none; }

@media (max-width: 960px) {
  .entries { grid-template-columns: repeat(2, 1fr); }
  .entry:not(.lead), .entry:not(.lead):nth-child(3n + 1), .entry:not(.lead):nth-child(3n + 2) { border-right: 1px solid var(--hair); padding-left: 22px; }
  .entry:not(.lead):nth-child(2n + 1) { border-right: 0; }
  .entry:not(.lead):nth-child(2n) { padding-left: 0; }
}
@media (max-width: 640px) {
  .entries { grid-template-columns: 1fr; }
  .entry:not(.lead), .entry:not(.lead):nth-child(n) { border-right: 0; padding: 20px 0 24px; }
  .entry.lead article { display: block; }
  .entry.lead .what { font-size: 1em; }
  .entry.lead .entry-body > .what:first-child { margin-top: 12px; }
}

/* --- good stuff ------------------------------------------------------------- */

.good-list {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0;
  border-top: 2px solid var(--rule);
}
.good-item { padding: 22px 22px 26px 0; border-bottom: 1px solid var(--hair); }
.good-item + .good-item { padding-left: 22px; border-left: 1px solid var(--hair); }
.why { margin-top: 12px; font-weight: 700; }

@media (max-width: 640px) {
  .good-item + .good-item { padding-left: 0; border-left: 0; }
}

/* --- act -------------------------------------------------------------------- */

.act-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 48px; margin-top: 28px; }
.act h3 { font-size: 1.3rem; margin-bottom: 8px; }
.share { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.share a, .share button, .admin button {
  display: inline-block;
  font: 700 0.72rem/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  padding: 10px 12px;
  cursor: pointer;
}
.share a:hover, .share button:hover, .admin button:hover { background: var(--ink); color: var(--paper); }
.help-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--hair); }
.help-list li { padding: 12px 0; border-bottom: 1px solid var(--hair); }
.help-list a { font-weight: 700; }
.help-list span { display: block; color: var(--muted); font-size: 0.9em; }

@media (max-width: 760px) {
  .act-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* --- colophon --------------------------------------------------------------- */

.colophon { padding-block: 40px 56px; }
.motto { font-family: var(--serif-display); font-size: clamp(1.6rem, 3.6vw, 2.4rem); font-style: italic; text-align: center; padding-bottom: 32px; border-bottom: 4px double var(--rule); }
.colophon-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; padding-block: 32px; }
.colophon h2 { font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); font-weight: 400; margin-bottom: 12px; }
.colophon p + p { margin-top: 12px; }
.notes { padding-left: 1.6em; margin: 0; color: var(--muted); line-height: 1.6; text-transform: none; }
.notes li + li { margin-top: 6px; }
.notes li:target { color: var(--ink); background: color-mix(in srgb, var(--red) 12%, transparent); }
.small { color: var(--muted); text-transform: none; }
.colophon-grid .small { margin-top: 14px; }

@media (max-width: 760px) {
  .colophon-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* --- 404 / admin ------------------------------------------------------------ */

.not-found { padding-block: 120px; text-align: center; }
.not-found h1 { font-size: clamp(2rem, 6vw, 4rem); margin: 12px 0 16px; }

.admin { max-width: 760px; padding-block: 48px 80px; }
.admin h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 10px 0 12px; }
.admin h2 { font-size: 1.3rem; margin: 40px 0 12px; padding-top: 20px; border-top: 1px solid var(--rule); }
.admin label { display: block; font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin: 18px 0 6px; }
.admin input[type="password"], .admin textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 10px 12px;
}
.admin textarea { min-height: 90px; resize: vertical; }
.admin .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.admin .check { display: flex; gap: 8px; align-items: center; font-family: var(--mono); font-size: 0.75rem; color: var(--muted); text-transform: none; letter-spacing: 0; margin: 0; }
.admin button.primary { background: var(--ink); color: var(--paper); }
.admin button.primary:hover { background: var(--red); border-color: var(--red); }
.admin .status { margin-top: 16px; font-family: var(--mono); font-size: 0.8rem; min-height: 1.4em; }
.admin .status.error { color: var(--red); }
.admin ul.list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--hair); }
.admin ul.list li { padding: 10px 0; border-bottom: 1px solid var(--hair); font-size: 0.95em; }
.admin ul.list .small { display: block; }
.admin details { margin-top: 12px; color: var(--muted); }
.admin details ol { margin: 8px 0 0; padding-left: 1.4em; }
