@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/fraunces-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/fraunces-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/newsreader-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/newsreader-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/outfit-latin.woff2") format("woff2");
}

:root {
  --paper: #f3efe6;
  --paper-2: #e7e1d4;
  --ink: #1a1714;
  --ink-soft: #5c534b;
  --rule: rgba(26, 23, 20, 0.16);
  --accent: #0f5e59;
  --rust: #9c3412;
  --rust-ink: #fff7f2;
  --chip: transparent;
  --shadow: 0 24px 50px rgba(48, 32, 16, 0.08);
  --serif: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
  --text: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #12110f;
  --paper-2: #1d1b17;
  --ink: #f3ece2;
  --ink-soft: #c9bfb2;
  --rule: rgba(243, 236, 226, 0.16);
  --accent: #8fd9d1;
  --rust: #e58a64;
  --rust-ink: #1a100c;
  --shadow: 0 24px 50px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(15, 94, 89, 0.08), transparent 50%),
    var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.125rem;
  line-height: 1.5;
  font-weight: 430;
}
:root[data-theme="dark"] body {
  background:
    radial-gradient(900px 420px at 90% -10%, rgba(143, 217, 209, 0.08), transparent 45%),
    var(--paper);
}
img, svg { max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--paper); }

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.55rem 0.8rem;
  z-index: 5;
}
.skip:focus { top: 1rem; }

.site {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding-bottom: 4rem;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.hp {
  position: absolute;
  left: -10000px;
  height: 0;
  overflow: hidden;
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding: 1.25rem 0 0.9rem;
}
.wordmark {
  font-family: var(--serif);
  font-weight: 560;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  letter-spacing: -0.04em;
  line-height: 0.88;
  text-decoration: none;
}
.credit {
  display: inline-block;
  margin-top: 0.45rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
}
.tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}
.theme, .text-button, .admin-actions button, .stack button, .sub button, .vote {
  min-height: 44px;
  border: 1px solid var(--ink);
  background: transparent;
  padding: 0.45rem 0.85rem;
  font-family: var(--sans);
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.theme { border-radius: 999px; }
.text-button { background: none; border: 0; text-decoration: underline; padding-inline: 0; }

.shelf-nav {
  display: flex;
  gap: 0.85rem;
  overflow-x: auto;
  padding: 0.7rem 0 0.85rem;
  border-bottom: 3px solid var(--ink);
  scrollbar-width: none;
}
.shelf-nav::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  text-decoration: none;
  font-family: var(--sans);
  font-size: 0.92rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid transparent;
}
.chip[aria-current="page"] { border-bottom-color: var(--ink); }
.count { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.issue, .desk-label {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0.85rem 0 0;
}
.kicker {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.45rem;
}
h1, h2, h3, .rank-name, .wordmark {
  font-family: var(--serif);
  font-weight: 560;
  letter-spacing: -0.03em;
}
h1 { font-size: clamp(2.6rem, 7vw, 5.4rem); line-height: 0.95; margin: 0 0 0.6rem; }
h2 { font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1; margin: 0 0 0.45rem; }
h3 { font-size: 1.7rem; line-height: 1.05; margin: 0.35rem 0; }
.dek, .description { font-size: 1.2rem; max-width: 42rem; }
.dek { margin-top: 0; color: var(--ink-soft); }
.by { margin: 0.2rem 0 0; font-style: italic; }

.hero, section { margin-top: 2.6rem; }
.hero-note, .bot-note {
  display: grid;
  gap: 0.8rem;
  margin: 1.4rem 0 1.6rem;
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.hero-note p, .bot-note p { margin: 0; max-width: 36rem; }

.sub {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.sub input[type="email"], .stack input, .stack textarea, .stack select, .filter-label + input, .add-bot input {
  min-height: 44px;
  border: 1px solid var(--rule);
  background: transparent;
  padding: 0.55rem 0.7rem;
  border-radius: 0;
  font-size: 1rem;
}
.sub input[type="email"] { min-width: min(100%, 16rem); flex: 1; }
.sub button, .add {
  background: var(--rust);
  color: var(--rust-ink);
  border: 0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.55rem 0.95rem;
  font-family: var(--sans);
  cursor: pointer;
}
.sub-compact input[type="email"] { min-width: 12rem; flex: 0 1 14rem; }

.picks {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 78vw);
  gap: 0.9rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.4rem;
}
.picks > article { scroll-snap-align: start; }
.cover-link, .card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}
.art {
  position: relative;
  overflow: hidden;
  background: var(--paper-2);
  aspect-ratio: 4 / 5;
}
.card .art { aspect-ratio: 16 / 10; }
.art img, .art svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.art svg { position: absolute; inset: 0; }
.art::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 58%;
  background: linear-gradient(to top, rgba(12, 9, 7, 0.78), transparent);
}
.card .art::after { display: none; }
.art-copy {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 1rem 1rem 1.05rem;
  color: #f6f1e8;
}
.art-copy .kicker { color: #f0d7c4; }
.art-copy h2 { font-size: clamp(1.8rem, 3vw, 3rem); margin: 0; }
.hook {
  margin: 0.75rem 0 0;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cover .hook { padding: 0.15rem 0.1rem 0; }

.recent {
  display: grid;
  gap: 1.4rem;
}
.card { border-top: 1px solid var(--rule); padding-top: 0.9rem; }

.rank { list-style: none; margin: 1.2rem 0 0; padding: 0; }
.rank a {
  display: grid;
  grid-template-columns: auto 64px minmax(0, 1fr) auto;
  gap: 0.75rem 0.85rem;
  align-items: center;
  padding: 0.95rem 0;
  border-top: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
}
.rank li:last-child a { border-bottom: 1px solid var(--rule); }
.rank-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.35rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.rank-art { width: 64px; height: 64px; display: block; }
.rank-art svg, .rank-art img { width: 64px; height: 64px; object-fit: cover; display: block; }
.rank-copy { display: flex; flex-direction: column; min-width: 0; }
.rank-kicker {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.rank-name { font-size: 1.45rem; line-height: 1.05; }
.rank-hook {
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rank-score {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-variant-numeric: tabular-nums;
}

.bot-hero {
  display: grid;
  gap: 1.2rem;
}
.art-large { aspect-ratio: 4 / 5; max-height: 720px; }
.badges { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.badge {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--rule);
  padding: 0.25rem 0.45rem;
}
.actions, .admin-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; align-items: center; }
.added, .meta { color: var(--ink-soft); }
.score-block { max-width: 40rem; }
.score-block h2 span { color: var(--ink-soft); font-size: 0.55em; }
.meter-row { margin: 1rem 0; }
.meter-label, .meter-row p { display: flex; justify-content: space-between; gap: 1rem; }
.meter-row p { color: var(--ink-soft); margin: 0.35rem 0 0; font-size: 1rem; }
.meter { height: 4px; background: var(--paper-2); margin-top: 0.35rem; }
.meter span { display: block; height: 100%; background: var(--accent); }
.sources { padding-left: 1.1rem; }
.sources li { margin: 0.4rem 0; }
.sources a { text-underline-offset: 0.15em; }

.foot {
  display: grid;
  gap: 1.4rem;
  margin-top: 4rem;
  padding-top: 1.4rem;
  border-top: 3px solid var(--ink);
}
.disclaimer, .colophon { color: var(--ink-soft); font-size: 1rem; }
.banner {
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--rule);
  margin: 1rem 0;
}
.banner-ok { border-color: var(--accent); }
.banner-err { border-color: var(--rust); }
.empty { color: var(--ink-soft); }

.prose { max-width: 42rem; }
.stack { display: grid; gap: 0.45rem; max-width: 40rem; }
.stack label, .filter-label { font-family: var(--sans); font-size: 0.85rem; letter-spacing: 0.04em; }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.row input { flex: 1; min-width: min(100%, 16rem); }
.desk h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
.admin-list { display: grid; gap: 0.8rem; margin-top: 1rem; }
.admin-bot {
  border-top: 1px solid var(--rule);
  padding: 0.9rem 0;
}
.admin-bot header { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.admin-bot h2 { font-size: 1.6rem; margin: 0; }
.admin-bot h2 a { text-decoration: none; }
.admin-bot p { margin: 0.25rem 0; }
.filter-label { display: block; margin-top: 1.2rem; }
#filter, .add-bot input { width: min(100%, 36rem); }

code { font-family: "Outfit", ui-monospace, monospace; font-size: 0.92em; }

@media (min-width: 720px) {
  .site { width: min(1180px, calc(100% - 3.5rem)); }
  .recent { grid-template-columns: 1fr 1fr; }
  .rank a { grid-template-columns: 3.2rem 84px minmax(0, 1fr) auto; gap: 1rem 1.2rem; }
  .rank-art, .rank-art svg, .rank-art img { width: 84px; height: 84px; }
  .bot-hero { grid-template-columns: 1.1fr 0.9fr; align-items: start; }
  .art-large { aspect-ratio: 4 / 5; }
  .hero-note { grid-template-columns: 1.2fr 1fr; align-items: center; }
  .foot { grid-template-columns: 1.2fr 0.8fr; }
  .disclaimer, .colophon { grid-column: 1 / -1; }
}

@media (min-width: 1040px) {
  .picks-spread {
    grid-auto-flow: row;
    grid-auto-columns: unset;
    grid-template-columns: 1.15fr 1fr 1fr;
    overflow: visible;
    gap: 1.25rem;
  }
  .picks-spread > article:first-child { grid-column: span 2; }
  .picks-spread > article:first-child .art { aspect-ratio: 16 / 10; }
  .recent { grid-template-columns: 1fr 1fr 1fr; }
  .hero, section { margin-top: 4.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .picks { scroll-snap-type: none; }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
