/* Bring It to the Table: ported from design/sample.html. Fonts are self-hosted
   (scripts/build.mjs rewrites the url()s to hashed names). */

@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('/static/fonts/newsreader-latin-opsz-normal.6e4f2958c3.woff2') format('woff2');
}
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url('/static/fonts/newsreader-latin-opsz-italic.5dfcd10d24.woff2') format('woff2');
}
@font-face {
  font-family: 'Special Elite';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/special-elite-latin-400-normal.770493d84c.woff2') format('woff2');
}
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/caveat-latin-700-normal.15f9638095.woff2') format('woff2');
}

:root {
  --paper: #f5f2ec;
  --paper-2: #f0ebe3;
  --card: #fffdf5;
  --ink: #2f4f5c; /* LongTable teal, pushed toward slate */
  --ink-soft: #44687a;
  --text: #253432;
  --stamp: #c4502f; /* LongTable coral, deepened for text contrast */
  --tape: #e9c46a;
  --rule: rgba(47, 79, 92, 0.22);
  --serif: 'Newsreader', Georgia, serif;
  --type: 'Special Elite', 'Courier New', monospace;
  --hand: 'Caveat', cursive;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #14222a;
    --paper-2: #1c2e38;
    --ink: #a9c9d8;
    --ink-soft: #8fb1c2;
    --text: #f5f2ec;
    --stamp: #f08a6a;
    --rule: rgba(169, 201, 216, 0.22);
  }
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 19px/1.6 var(--serif);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .3  0 0 0 0 .25  0 0 0 0 .2  0 0 0 .09 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  overflow-x: hidden;
}
a {
  color: inherit;
}
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}
.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 12px;
  font: 14px var(--type);
  z-index: 60;
}
.skip:focus {
  left: 8px;
}

/* ---------- masthead ---------- */
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font: 13px var(--type);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 18px 0;
  border-bottom: 2px solid var(--ink);
}
.masthead {
  text-decoration: none;
}
.sponsor {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--stamp);
  color: var(--stamp);
  padding: 4px 10px;
  transform: rotate(-2deg);
  font-weight: 700;
  text-decoration: none;
}
.sponsor b {
  letter-spacing: 0.14em;
}

.hero {
  display: grid;
  grid-template-columns: 1.25fr 0.9fr;
  gap: 48px;
  padding: 56px 0 40px;
  align-items: start;
}
.kicker {
  font: 14px var(--type);
  color: var(--stamp);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 14px;
}
.home h1 {
  font: 400 clamp(52px, 9vw, 116px) / 0.9 var(--type);
  color: var(--ink);
  margin: 0 0 26px;
  letter-spacing: -0.03em;
  text-shadow:
    1.5px 0 0 var(--ink-soft),
    -1px 0 0 rgba(68, 104, 122, 0.35); /* ditto smear */
}
.home h1 em {
  font-style: normal;
  display: inline-block;
  background: var(--tape);
  color: #2f4f5c;
  padding: 0 0.12em;
  transform: rotate(-1.5deg);
  text-shadow: none;
}
.lede {
  font-size: clamp(20px, 2.2vw, 25px);
  max-width: 30ch;
  margin: 0 0 20px;
}
.hand {
  font: 700 28px/1 var(--hand);
  color: var(--stamp);
  transform: rotate(-3deg);
  display: inline-block;
}

/* sign-up sheet */
.sheet {
  position: relative;
  background: var(--card);
  color: #2f4f5c;
  padding: 30px 26px 22px;
  border: 1px solid var(--rule);
  box-shadow: 6px 8px 0 var(--ink);
  transform: rotate(1.6deg);
  background-image: repeating-linear-gradient(transparent 0 35px, rgba(47, 79, 92, 0.25) 35px 36px);
  background-position: 0 58px;
}
.sheet::before {
  content: '';
  position: absolute;
  top: -14px;
  left: 50%;
  width: 110px;
  height: 30px;
  margin-left: -55px;
  background: var(--tape);
  opacity: 0.9;
  transform: rotate(-3deg);
}
.sheet h2 {
  font: 400 22px/1 var(--type);
  margin: 0 0 22px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sheet ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sheet li {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 36px;
  font: 700 24px/1 var(--hand);
}
.box {
  width: 20px;
  height: 20px;
  border: 2px solid #2f4f5c;
  display: inline-block;
  position: relative;
  flex: none;
}
.box.on::after {
  content: '✕';
  position: absolute;
  inset: -9px 0 0 2px;
  font: 700 30px/1 var(--hand);
  color: #c4502f;
}
.sheet small {
  display: block;
  margin-top: 12px;
  font: 13px var(--type);
  opacity: 0.75;
}

/* ---------- articles list ---------- */
.section-label {
  display: flex;
  align-items: center;
  gap: 16px;
  font: 400 14px var(--type);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 28px 0 30px;
}
.section-label::after {
  content: '';
  flex: 1;
  border-top: 2px dashed var(--ink);
}

/* Flyers pair up across a 12-column grid, the second of each pair dropped a
   little and tilted the other way, like the sample's two cards. */
.flyers {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 32px;
  row-gap: 96px;
  padding-bottom: 70px;
}
.flyer {
  position: relative;
  display: block;
  text-decoration: none;
  background: var(--paper-2);
  border: 2px solid var(--ink);
  padding: 30px 28px 26px;
  transition:
    transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.3),
    box-shadow 0.35s;
}
.flyer:nth-child(odd) {
  grid-column: 1 / span 6;
  transform: rotate(-1.2deg);
  box-shadow: 8px 8px 0 var(--ink);
}
.flyer:nth-child(even) {
  grid-column: 7 / span 6;
  transform: rotate(1.4deg) translateY(54px);
  box-shadow: -8px 8px 0 var(--stamp);
}
.flyer:nth-child(4n + 3) {
  grid-column: 1 / span 6;
  transform: rotate(0.9deg);
  box-shadow: 8px 8px 0 var(--stamp);
}
.flyer:nth-child(4n) {
  grid-column: 7 / span 6;
  transform: rotate(-1.6deg) translateY(40px);
  box-shadow: -8px 8px 0 var(--ink);
}
.flyer:nth-child(1),
.flyer:nth-child(2) {
  grid-row: 1;
}
.flyer:nth-child(3),
.flyer:nth-child(4) {
  grid-row: 2;
}
.flyer:nth-child(5),
.flyer:nth-child(6) {
  grid-row: 3;
}
.flyer:nth-child(7),
.flyer:nth-child(8) {
  grid-row: 4;
}
.flyer:nth-child(9),
.flyer:nth-child(10) {
  grid-row: 5;
}
.flyer:hover,
.flyer:focus-visible {
  transform: rotate(0) translateY(-4px);
  z-index: 2;
}
.flyer:nth-child(even):hover,
.flyer:nth-child(even):focus-visible {
  transform: rotate(0) translateY(46px);
}
.flyer .no {
  font: 14px var(--type);
  color: var(--stamp);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.flyer h3 {
  font: 400 clamp(26px, 3.2vw, 40px) / 1.04 var(--type);
  color: var(--ink);
  margin: 10px 0 14px;
  letter-spacing: -0.02em;
}
.flyer p {
  margin: 0 0 18px;
  max-width: 46ch;
}
.meta {
  font: 13px var(--type);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.read {
  position: absolute;
  right: 18px;
  bottom: -16px;
  background: #c4502f;
  color: #fff;
  font: 14px var(--type);
  padding: 6px 12px;
  transform: rotate(-3deg);
  letter-spacing: 0.08em;
}
.more {
  margin: 10px 0 60px;
  text-align: right;
}

/* ---------- article view ---------- */
.post {
  padding: 40px 0 80px;
}
.back {
  font: 14px var(--type);
  color: var(--ink);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 2px solid var(--ink);
}
.post-grid {
  display: grid;
  grid-template-columns: 210px minmax(0, 680px);
  gap: 56px;
  margin-top: 34px;
}
.post-aside {
  font: 14px/1.5 var(--type);
  color: var(--ink);
  border-top: 4px solid var(--ink);
  padding-top: 12px;
  align-self: start;
  position: sticky;
  top: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.post-aside .hand {
  display: block;
  margin-top: 18px;
  font-size: 26px;
  line-height: 1.05;
  text-transform: none;
  letter-spacing: 0;
}
.post h1 {
  font: 400 clamp(38px, 6vw, 68px) / 0.98 var(--type);
  color: var(--ink);
  margin: 0 0 30px;
  letter-spacing: -0.025em;
}
.post-body h2 {
  font: 400 26px/1.2 var(--type);
  color: var(--ink);
  margin: 38px 0 8px;
}
.post-body h3 {
  font: 400 21px/1.25 var(--type);
  color: var(--ink);
  margin: 28px 0 6px;
}
.post-body p {
  margin: 0 0 1.1em;
}
.post-body > p:first-of-type::first-letter {
  font: 400 4.2em/0.8 var(--type);
  float: left;
  color: var(--stamp);
  padding: 6px 10px 0 0;
}
.post-body a {
  text-decoration-color: var(--stamp);
  text-underline-offset: 3px;
}
.post-body blockquote {
  margin: 30px 0;
  padding: 6px 0 6px 22px;
  border-left: 6px solid var(--stamp);
  font-size: 1.3em;
  font-style: italic;
  color: var(--ink);
}
.post-body blockquote p {
  margin: 0;
}
.post-body img {
  max-width: 100%;
  height: auto;
  border: 2px solid var(--ink);
}
.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.9em;
}
.post-body th,
.post-body td {
  border: 1px solid var(--rule);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
.post-body th {
  font: 14px var(--type);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink);
}
.checklist {
  list-style: none;
  margin: 20px 0;
  background: var(--card);
  color: #2f4f5c;
  border: 1px solid var(--rule);
  padding: 14px 20px;
  box-shadow: 5px 5px 0 var(--ink);
}
.checklist li {
  padding: 6px 0 6px 34px;
  position: relative;
  border-bottom: 1px dashed var(--rule);
}
.checklist li:last-child {
  border: 0;
}
.checklist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 11px;
  width: 18px;
  height: 18px;
  border: 2px solid #2f4f5c;
}
.callout {
  margin: 26px 0;
  padding: 16px 20px;
  border: 2px dashed var(--stamp);
  background: var(--paper-2);
}
.callout p:last-child {
  margin: 0;
}
.cta {
  margin: 48px 0 30px;
  padding: 22px 24px;
  border: 3px double var(--stamp);
  transform: rotate(-0.6deg);
}
.cta-kicker {
  font: 13px var(--type);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--stamp);
  margin: 0 0 6px;
}
.cta-link {
  font: 15px var(--type);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}
.related h2 {
  font: 400 20px var(--type);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.related ul {
  padding-left: 1.1em;
}
.related li {
  margin: 0 0 8px;
}

/* ---------- archive and plain pages ---------- */
.archive,
.page {
  padding: 48px 0 80px;
  max-width: 820px;
}
.page-title {
  font: 400 clamp(40px, 6vw, 72px) / 0.96 var(--type);
  color: var(--ink);
  margin: 0 0 24px;
  letter-spacing: -0.025em;
}
.page-body h2 {
  font: 400 26px/1.2 var(--type);
  color: var(--ink);
  margin: 34px 0 8px;
}
.archive .lede {
  max-width: none;
}
.archive-list {
  list-style: none;
  padding: 0;
  margin: 30px 0 0;
}
.archive-list li {
  border-top: 2px dashed var(--rule);
}
.archive-list a {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 4px 20px;
  padding: 18px 0;
  text-decoration: none;
}
.archive-date {
  font: 14px var(--type);
  color: var(--stamp);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  grid-row: span 2;
  padding-top: 6px;
}
.archive-title {
  font: 400 26px/1.15 var(--type);
  color: var(--ink);
}
.archive-list a:hover .archive-title,
.archive-list a:focus-visible .archive-title {
  text-decoration: underline;
  text-decoration-color: var(--stamp);
}

/* ---------- footer ---------- */
.foot {
  border-top: 2px solid var(--ink);
  padding: 26px 0 50px;
  font: 13px/1.6 var(--type);
  color: var(--ink);
  letter-spacing: 0.04em;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.stamp {
  display: inline-block;
  border: 3px double var(--stamp);
  color: var(--stamp);
  padding: 6px 14px;
  transform: rotate(-4deg);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-decoration: none;
}
.foot-pitch {
  margin: 14px 0 0;
  max-width: 46ch;
}
.foot-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-transform: uppercase;
}
.foot-note {
  flex-basis: 100%;
  margin: 10px 0 0;
}

/* ---------- consent banner (src/static/js/analytics.js) ---------- */
.consent {
  position: fixed;
  inset: auto 0 0;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1.5rem;
  padding: 0.9rem 20px;
  background: var(--card);
  color: #253432;
  border-top: 2px solid var(--ink);
  font-size: 16px;
}
/* An author `display` beats the browser's own [hidden] rule, so restate it.
   Without this line the banner shows on every page for every visitor. */
.consent[hidden] {
  display: none;
}
.consent-text {
  margin: 0;
  max-width: 42rem;
}
.consent-actions {
  display: flex;
  gap: 0.75rem;
}
.btn {
  font: 14px var(--type);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: #2f4f5c;
  color: #fff;
  border: 0;
  padding: 10px 18px;
  cursor: pointer;
}
.consent-open {
  scroll-padding-bottom: 12rem;
}
.consent-open body {
  padding-bottom: 12rem;
}

/* ---------- scroll choreography: things move to pull your eye ---------- */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .sheet {
      animation:
        drop 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.2) both 0.15s,
        sheet-away linear both;
      animation-timeline: auto, view();
      animation-range:
        normal,
        exit 0% exit 100%;
    }
    @keyframes sheet-away {
      to {
        translate: 30px -90px;
        rotate: 7deg;
      }
    }
    .home h1 em {
      animation: tape-away linear both;
      animation-timeline: view();
      animation-range: exit 0% exit 100%;
    }
    @keyframes tape-away {
      to {
        translate: 40px -30px;
        rotate: 6deg;
      }
    }
    .section-label::after {
      transform-origin: left;
      animation: draw linear both;
      animation-timeline: view();
      animation-range: entry 20% cover 45%;
    }
    @keyframes draw {
      from {
        transform: scaleX(0);
      }
    }
    .flyer:nth-child(odd) {
      animation: in-left linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 40%;
    }
    .flyer:nth-child(even) {
      animation: in-right linear both;
      animation-timeline: view();
      animation-range: entry 10% cover 45%;
    }
    @keyframes in-left {
      from {
        translate: -140px 30px;
        rotate: -9deg;
        opacity: 0;
      }
    }
    @keyframes in-right {
      from {
        translate: 140px 60px;
        rotate: 9deg;
        opacity: 0;
      }
    }
    .read {
      animation: slap linear both;
      animation-timeline: view();
      animation-range: cover 25% cover 50%;
    }
    @keyframes slap {
      from {
        scale: 2.4;
        rotate: 12deg;
        opacity: 0;
      }
    }
    .post-body h2 {
      animation: nudge linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 80%;
    }
    @keyframes nudge {
      from {
        translate: -40px 0;
        opacity: 0;
      }
    }
    .post-body blockquote {
      animation: swing linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 40%;
    }
    @keyframes swing {
      from {
        translate: -70px 0;
        rotate: -3deg;
        opacity: 0;
      }
    }
    .checklist {
      animation: land linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 35%;
    }
    @keyframes land {
      from {
        translate: 60px 30px;
        rotate: 3deg;
        opacity: 0;
      }
    }
    .post-aside .hand {
      animation: wobble linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 60%;
    }
    @keyframes wobble {
      from {
        rotate: -14deg;
        scale: 0.7;
        opacity: 0;
      }
      60% {
        rotate: 4deg;
      }
    }
    .foot .stamp {
      animation: slap linear both;
      animation-timeline: view();
      animation-range: entry 20% cover 40%;
    }
  }
  .top .sponsor {
    animation: thud 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.6) both 0.7s;
  }
  /* Entrance motion never hides content: a renderer whose animation clock
     doesn't run (crawlers, some previews) still shows the sheet and stamp. */
  @keyframes drop {
    from {
      transform: translateY(-40px) rotate(-6deg);
    }
  }
  @keyframes thud {
    from {
      transform: scale(2) rotate(8deg);
    }
  }
}

@media (max-width: 820px) {
  body {
    font-size: 18px;
  }
  .hero {
    grid-template-columns: 1fr;
    gap: 34px;
    padding-top: 36px;
  }
  .flyers {
    row-gap: 40px;
  }
  .flyer:nth-child(n) {
    grid-column: 1 / -1;
    grid-row: auto;
    transform: none;
  }
  .flyer:nth-child(even) {
    transform: rotate(0.8deg);
  }
  .flyer:nth-child(even):hover,
  .flyer:nth-child(even):focus-visible {
    transform: rotate(0) translateY(-4px);
  }
  .post-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .post-aside {
    position: static;
  }
  .top {
    font-size: 11px;
  }
  .archive-list a {
    grid-template-columns: 1fr;
  }
  .archive-date {
    grid-row: auto;
  }
}
