/* Tokens from the Unpopular Culture design system (Bone = light, Blackout = dark). */
:root {
  --surface: #f4f0eb;
  --surface-raised: #e6ddd7;
  --ink: #0e0b0b;
  --ink-muted: #5c504c;
  --blood-text: #a8100b;
  --hairline: #cbbfba;

  --blood-on-plate: #ff6a5c;
  --blood: #b3120c;
  --blood-bright: #d81e14;
  --paper: #f4f0eb;
  --plate: #000000;
  --on-plate: #ffffff;
  --on-blood: #ffffff;
  --on-plate-muted: #b0a4a0;

  --display: "Bebas Neue", "Oswald", Impact, sans-serif;
  --sans: Barlow, "Helvetica Neue", Arial, sans-serif;
  --cond: "Barlow Condensed", "Arial Narrow", sans-serif;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 40px;
  --space-6: 64px;

  --radius-sm: 4px;
  --radius-plate: 18px;

  --wrap: 54rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #0e0b0b;
    --surface-raised: #1c1414;
    --ink: #f4f0eb;
    --ink-muted: #b0a4a0;
    --blood-text: #ff6a5c;
    --hairline: #3a2c2a;
    color-scheme: dark;
  }
}

/* The masthead is a Bone poster in both themes, so it pins the Bone inks. */
.on-paper {
  --surface: #f4f0eb;
  --surface-raised: #e6ddd7;
  --ink: #0e0b0b;
  --ink-muted: #5c504c;
  --blood-text: #a8100b;
  --hairline: #cbbfba;
  color-scheme: light;
  background: var(--paper);
  color: var(--ink);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--space-4); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font: 400 16px/24px var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--space-3); }
@media (min-width: 40rem) { .wrap { padding: 0 var(--space-4); } }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: -999px; top: var(--space-2); background: var(--plate); color: var(--on-plate); padding: var(--space-2) var(--space-3); z-index: 10; }
.skip:focus { left: var(--space-2); }

.label {
  font: 600 14px/16px var(--cond);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.caption {
  font: 600 11px/14px var(--cond);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---------- Masthead ---------- */

.masthead {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-bottom: 3px solid var(--plate);
}
/* Splatter takes the top and right; type anchors bottom-left. */
.masthead::before {
  content: "";
  position: absolute; inset: 0 0 0 auto; z-index: -1;
  width: min(62%, 34rem);
  background: url("../img/splatter-texture.jpg") right top / cover no-repeat;
  mix-blend-mode: multiply;
  -webkit-mask-image: linear-gradient(to left, #000 35%, transparent 100%);
          mask-image: linear-gradient(to left, #000 35%, transparent 100%);
}
@media (max-width: 40rem) {
  .masthead::before {
    inset: 0 0 auto auto;
    width: 85%;
    height: 170px;
    background-position: right 30%;
    -webkit-mask-image: radial-gradient(ellipse at top right, #000 25%, transparent 72%);
            mask-image: radial-gradient(ellipse at top right, #000 25%, transparent 72%);
  }
}

.masthead__bar {
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-3);
  padding: var(--space-3) 0;
  color: var(--ink-muted);
}
.masthead__bar a { text-decoration: none; }
.masthead__bar a:hover { text-decoration: underline; color: var(--ink); }

.masthead__body { padding: var(--space-6) 0 var(--space-5); }

.masthead__title { margin: 0; font-weight: 400; }
.plate {
  display: inline-block;
  background: var(--plate);
  color: var(--on-plate);
  border-radius: var(--radius-plate);
}
.masthead__quiet {
  font: 400 clamp(28px, 6vw, 44px)/0.95 var(--display);
  letter-spacing: 0.02em;
  padding: 0.22em 0.4em 0.12em;
}
.masthead__loud {
  display: block;
  margin-top: var(--space-2);
  font: 400 clamp(84px, 22vw, 168px)/0.9 var(--display);
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.masthead__loud em { font-style: normal; color: var(--blood-bright); }

.masthead__dek {
  max-width: 32rem;
  margin: var(--space-4) 0 0;
  font: 400 18px/27px var(--sans);
}
.masthead__by { margin: var(--space-3) 0 0; color: var(--ink-muted); }

/* ---------- Controls ---------- */

.controls { padding: var(--space-5) 0 var(--space-2); }
.controls__row { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.search {
  flex: 1 1 16rem; display: flex; align-items: center; gap: var(--space-2);
  border: 2px solid var(--ink); background: var(--surface); padding: 0 12px;
  color: var(--ink-muted);
}
.search:focus-within { outline: 3px solid var(--ink); outline-offset: 2px; }
.search input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink);
  font: 400 16px/24px var(--sans); padding: 10px 0; outline: none;
}
.search input::placeholder { color: var(--ink-muted); }

.sort select, .btn {
  font: 700 15px/1 var(--cond); letter-spacing: 0.14em; text-transform: uppercase;
  border: 2px solid var(--ink); border-radius: 0;
  padding: 12px 14px; cursor: pointer;
}
.sort select { background: var(--surface); color: var(--ink); }
.btn { background: var(--plate); border-color: var(--plate); color: var(--on-plate); }
.btn:hover { background: var(--blood); border-color: var(--blood); color: var(--on-blood); }
@media (prefers-color-scheme: dark) {
  .btn { border-color: var(--ink); }
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--space-3); }
.tag {
  font: 600 13px/1 var(--cond); letter-spacing: 0.14em; text-transform: uppercase;
  padding: 7px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--ink-muted); background: transparent; color: var(--ink);
  cursor: pointer;
}
.tag:hover { border-color: var(--ink); }
.tag[aria-pressed="true"] { background: var(--blood); border-color: var(--blood); color: var(--on-blood); }

.count { margin: var(--space-3) 0 0; color: var(--ink-muted); }

/* ---------- Quotes ---------- */

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

.quote {
  border-top: 1px solid var(--hairline);
  padding: var(--space-5) 0;
  transition: background-color 0.4s ease, box-shadow 0.4s ease;
}
.quote:first-child { border-top: 0; }
.quote.is-highlighted { background: var(--surface-raised); box-shadow: 0 0 0 var(--space-3) var(--surface-raised); }

/* Stack: kicker → headline → attribution, space-2 apart. */
.quote__kicker { margin: 0; color: var(--ink-muted); }
.quote__date { color: var(--blood-text); }
.quote__venue:not(:empty)::before { content: " \00b7  "; color: var(--ink-muted); }

.quote__text { margin: var(--space-2) 0 0; }
.quote__text p {
  margin: 0;
  font: 400 clamp(34px, 6.4vw, 56px)/0.95 var(--display);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-wrap: pretty;
}
.quote.is-long .quote__text p { font-size: clamp(28px, 4.8vw, 42px); }
.quote__text p::before { content: "\201C"; color: var(--blood); margin-right: 0.04em; }
.quote__text p::after { content: "\201D"; }

.quote__by { margin: var(--space-2) 0 0; }
.quote__speaker { color: var(--ink); font-weight: 700; }
.quote__role { color: var(--ink-muted); }
.quote__role:not(:empty)::before { content: ", "; }

.quote__context { margin: var(--space-4) 0 0; max-width: 40rem; }

.quote__aftermath {
  margin: var(--space-3) 0 0; max-width: 40rem;
  background: var(--surface-raised);
  padding: 12px var(--space-3);
}
.quote__aftermath strong { display: block; margin-bottom: var(--space-1); color: var(--ink-muted); }

.quote__foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 12px var(--space-4); margin-top: var(--space-4);
}
.quote__tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.quote__tags button {
  font: 600 11px/14px var(--cond); letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink); background: var(--surface-raised);
  border: 0; border-radius: var(--radius-sm); padding: 5px 8px; cursor: pointer;
}
.quote__tags button:hover { background: var(--blood); color: var(--on-blood); }

.quote__actions { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); color: var(--ink-muted); }
.quote__sources a, .quote__link { color: var(--ink); }

.empty { padding: var(--space-6) 0; font: 700 22px/28px var(--sans); color: var(--ink-muted); }

/* ---------- Footer ---------- */

.footer {
  margin-top: var(--space-5);
  background: var(--plate);
  color: var(--on-plate);
  padding: var(--space-5) 0 var(--space-6);
}
@media (prefers-color-scheme: dark) {
  .footer { border-top: 1px solid var(--hairline); }
}
.footer a { text-decoration-color: var(--blood-on-plate); }
.footer a:hover { color: var(--blood-on-plate); }
.footer :focus-visible { outline-color: var(--on-plate); }
.footer__mark {
  display: block;
  font: 400 44px/0.95 var(--display);
  letter-spacing: 0.02em;
  text-decoration: none;
  margin-bottom: var(--space-3);
}
.footer p { max-width: 38rem; margin: 0 0 12px; }
.footer__hosts { color: var(--on-plate-muted); }
