/* joel facts — warm paper, deep ink, one terracotta accent. */

:root {
  --bg: #f6f1e8;
  --bg-tint: #efe7d9;
  --surface: #fffdf8;
  --ink: #211b14;
  --ink-soft: #6d6153;
  --ink-faint: #9a8d7c;
  --line: #e2d7c4;
  --accent: #c2410c;
  --accent-ink: #8f2f08;
  --accent-soft: #f7e3d4;
  --truth-bg: #eef2ec;
  --truth-line: #cdd8c8;
  --truth-ink: #2f4632;
  --shadow: 0 1px 2px rgba(64, 45, 20, .06), 0 18px 40px -24px rgba(64, 45, 20, .35);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 18px;
  --wrap: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17120d;
    --bg-tint: #1e1811;
    --surface: #221b14;
    --ink: #f4ece0;
    --ink-soft: #b9a992;
    --ink-faint: #8b7c67;
    --line: #362c21;
    --accent: #ff8b4d;
    --accent-ink: #ffb189;
    --accent-soft: #3a2415;
    --truth-bg: #1c231c;
    --truth-line: #2e3a2e;
    --truth-ink: #cfe0c8;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 22px 50px -26px rgba(0, 0, 0, .8);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background:
    radial-gradient(1200px 520px at 85% -10%, var(--bg-tint), transparent 70%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: 24px;
}

a { color: var(--accent-ink); text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); }
a:hover { text-decoration-color: currentColor; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 10px 0;
  z-index: 50;
}
.skip:focus { left: 0; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -.01em;
}

.wordmark-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-family: var(--serif);
  font-size: 19px;
  font-style: italic;
  box-shadow: var(--shadow);
}

.wordmark-text { font-size: 18px; }

.wordmark-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  padding: 2px 8px;
  border-radius: 999px;
}

.nav { display: flex; gap: 22px; }

.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--ink); border-bottom-color: var(--accent); }

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

.hero {
  padding: 88px 24px 56px;
  text-align: center;
}

.kicker {
  margin: 0 0 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

.hero h1 {
  margin: 0 auto;
  max-width: 20ch;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -.02em;
  text-wrap: balance;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.lede {
  margin: 26px auto 0;
  max-width: 56ch;
  font-size: 1.12rem;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.hero-actions {
  margin-top: 34px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- buttons ---------- */

.btn {
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, background-color .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow);
}
.btn-primary:hover { background: var(--accent-ink); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-ink); }

/* ---------- the fact card ---------- */

.stage { padding: 8px 24px 24px; }

.card {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 34px 26px;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 30%, transparent));
}

.card.is-swapping { animation: swap .34s ease; }

@keyframes swap {
  0% { opacity: 0; transform: translateY(10px) scale(.99); }
  100% { opacity: 1; transform: none; }
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chip {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  padding: 4px 11px;
  border-radius: 999px;
}

.fact-no {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-faint);
}

.claim {
  margin: 22px 0 24px;
  font-family: var(--serif);
  font-size: clamp(1.55rem, 3.4vw, 2.15rem);
  line-height: 1.22;
  letter-spacing: -.015em;
  text-wrap: balance;
}

.truth {
  background: var(--truth-bg);
  border: 1px solid var(--truth-line);
  border-radius: 14px;
  padding: 18px 20px;
}

.truth-label {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--truth-ink);
  opacity: .78;
}

.truth-text {
  margin: 0;
  color: var(--truth-ink);
  font-size: 1.02rem;
}

.card-foot {
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.mildness {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-soft);
}

.mildness-label {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11px;
  font-weight: 700;
}

.meter { display: inline-flex; gap: 4px; }

.meter i {
  width: 16px;
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  transition: background-color .2s ease;
}
.meter i.on { background: var(--accent); }

.mildness-word {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink);
}

.card-actions { display: flex; gap: 10px; }

.hint {
  margin: 18px 0 0;
  font-size: 12.5px;
  color: var(--ink-faint);
  text-align: center;
}

kbd {
  font-family: var(--sans);
  font-size: 11px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 1px 6px;
  background: var(--bg-tint);
  color: var(--ink-soft);
}

/* ---------- stat strip ---------- */

.strip {
  margin: 26px auto 0;
  padding-block: 26px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stat { text-align: center; }

.stat-num {
  display: block;
  font-family: var(--serif);
  font-size: 2.15rem;
  line-height: 1.1;
  color: var(--accent-ink);
}

.stat-cap {
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---------- archive ---------- */

.archive { padding: 72px 24px 24px; }

.section-head { max-width: 62ch; }

.section-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  letter-spacing: -.02em;
}

.section-head p { margin: 10px 0 0; color: var(--ink-soft); }

.filters {
  margin: 26px 0 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 15px;
  cursor: pointer;
}
.filter:hover { border-color: var(--accent); color: var(--accent-ink); }
.filter[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.filter:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 16px;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 18px 16px;
  cursor: pointer;
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.tile:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: var(--shadow);
}
.tile:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

.tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tile-claim {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.12rem;
  line-height: 1.35;
}

.tile-meter { display: inline-flex; gap: 3px; }
.tile-meter i { width: 11px; height: 6px; border-radius: 999px; background: var(--line); }
.tile-meter i.on { background: var(--accent); }

.noscript-note {
  margin-top: 18px;
  padding: 14px 18px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--ink-soft);
}

/* ---------- about ---------- */

.about { padding: 72px 24px 40px; }

.about-cols {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 34px;
}

.about-cols h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
}

.about-cols p { margin: 0; color: var(--ink-soft); }

.quote {
  margin: 42px 0 0;
  padding: 26px 30px;
  border-left: 4px solid var(--accent);
  background: var(--bg-tint);
  border-radius: 0 14px 14px 0;
}

.quote p {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  line-height: 1.35;
}

.quote cite {
  display: block;
  margin-top: 12px;
  font-style: normal;
  font-size: 14px;
  letter-spacing: .04em;
  color: var(--ink-faint);
}

/* ---------- footer ---------- */

.footer {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  background: var(--bg-tint);
}

.footer-inner {
  padding-block: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.footer p { margin: 0; color: var(--ink-soft); font-size: 14.5px; }
.footer-fine { font-size: 12.5px; color: var(--ink-faint); }

/* ---------- small screens ---------- */

@media (max-width: 720px) {
  .hero { padding-top: 56px; }
  .nav { gap: 16px; }
  .nav a { font-size: 14px; }
  .wordmark-tag { display: none; }
  .card { padding: 24px 20px 20px; }
  .strip { grid-template-columns: repeat(2, 1fr); row-gap: 22px; }
  .about-cols { grid-template-columns: 1fr; gap: 24px; }
  .card-foot { align-items: flex-start; }
}
