/* Workers: "newsprint brutalism" layer.
   Loaded after every other stylesheet, so it only re-skins: same markup, same features.
   Graph-paper newsprint, sharp cut-out boxes, 2.5px ink rules, hard offset shadows,
   tomato / cobalt / mint / lilac accents, heavy Newsreader headlines + Public Sans text. */

:root, :root[data-theme=light] {
  --paper: #f3efe6;
  --card: #fffdf8;
  --ink: #141414;
  --muted: #555049;
  --line: #141414;
  --soft: #e9e3d6;
  --accent: #141414;
  --accent-hover: #141414;
  --button-text: #141414;
  --tomato: #ff6b4a;
  --cobalt: #3557ff;
  --mint: #7fe0b5;
  --lilac: #c9b6ff;
  --grid: rgba(20, 20, 20, .055);
  --overlay: rgb(20 20 20 / .5);
  --radius: 2px;
  --frame: #141414;
  --shadow-ink: #141414;
  --b: 2.5px solid var(--frame);
  --b2: 2px solid var(--frame);
  --sh: 5px 5px 0 var(--shadow-ink);
  --sh-sm: 3px 3px 0 var(--shadow-ink);
  --display: "Newsreader", Georgia, serif;
  --serif: "Newsreader", Georgia, serif;
  --sans: "Public Sans", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
:root[data-theme=dark] {
  --paper: #161513;
  --card: #262420;
  --ink: #efe9dd;
  --muted: #aca495;
  --line: #3d3a34;
  --soft: #302d28;
  --accent: #efe9dd;
  --accent-hover: #efe9dd;
  --button-text: #141414;
  --frame: #000;
  --shadow-ink: #000;
  --tomato: #ff7b5e;
  --cobalt: #5170ff;
  --mint: #86e2bb;
  --lilac: #cdbcff;
  --grid: rgba(239, 233, 221, .035);
  --overlay: rgb(0 0 0 / .72);
  color-scheme: dark;
}
/* dark: surfaces carry the shape, black ink does the borders + shadows, quiet rules inside */
:root[data-theme=dark] .site-header { background: #1d1b18; border-bottom-color: #000; }
:root[data-theme=dark] .topbar { background: #0b0a09; color: #d9d2c4; border-bottom-color: #000; }
:root[data-theme=dark] .side-index-heading, :root[data-theme=dark] .sidebar-heading, :root[data-theme=dark] .side-colophon,
:root[data-theme=dark] .section-heading, :root[data-theme=dark] .archive-categories { border-color: var(--line); }
:root[data-theme=dark] .side-writer, :root[data-theme=dark] .latest-story { border-bottom-color: var(--line); }
:root[data-theme=dark] .story-image, :root[data-theme=dark] .side-writer img, :root[data-theme=dark] .home-shelf-card img, :root[data-theme=dark] .ticket-image img { filter: brightness(.88) saturate(.95); }
:root[data-theme=dark] .nav-link.is-active, :root[data-theme=dark] .nav-link.is-active:hover { background: var(--tomato); color: #141414; }
:root[data-theme=dark] .nav-link:hover { box-shadow: inset 0 -3px 0 var(--tomato); }
:root[data-theme=dark] .header-subscribe .button, :root[data-theme=dark] .header-subscribe .button:hover { background: var(--tomato); color: #141414; box-shadow: 3px 3px 0 #000; }
:root[data-theme=dark] .icon-button { background: var(--card); color: var(--ink); }
:root[data-theme=dark] .icon-button:hover { color: #141414; }
:root[data-theme=dark] .section-number { background: var(--card); color: var(--ink); }
:root[data-theme=dark] .side-index-heading h2, :root[data-theme=dark] .sidebar-heading h2, :root[data-theme=dark] .side-shelfpick-label { background: var(--ink); color: #141414; }
:root[data-theme=dark] .button { background: var(--card); color: var(--ink); }
:root[data-theme=dark] .button:hover { color: #141414; }
:root[data-theme=dark] .button-primary { background: var(--tomato); color: #141414; }
:root[data-theme=dark] .lead-feature h1 a { background-image: linear-gradient(var(--tomato), var(--tomato)); background-position: 0 96%; }
:root[data-theme=dark] .lead-feature h1 a:hover { color: var(--ink); background-size: 100% 7%; }
:root[data-theme=dark] .card-title a:hover { box-shadow: inset 0 -4px 0 var(--tomato); }
:root[data-theme=dark] .bands { border-color: #000; }
:root[data-theme=dark] .headline-kicker { border-color: #000; }
:root[data-theme=dark] .text-link { color: var(--ink); }
:root[data-theme=dark] .reading-progress { border-bottom-color: #000; }

/* ---------- base ---------- */
body {
  font-family: var(--sans);
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  font-size: 15.5px;
}
h1, h2, h3, h4, .wordmark, .dialog-wordmark, .footer-wordmark { font-family: var(--display); font-weight: 800; letter-spacing: -.035em; }
::selection { background: var(--lilac); color: #141414; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; }
.heading-period, .wordmark-period { color: inherit; }

/* ---------- ticker strip ---------- */
.topbar { background: #141414; color: #f3efe6; border-bottom: var(--b); overflow: hidden; padding: 7px 0; font-family: var(--sans); font-weight: 650; font-size: 11.5px; letter-spacing: .14em; }
:root[data-theme=dark] .topbar { background: #0e0d0c; color: var(--ink); border-bottom-color: var(--frame); }
.topbar-track, .band-track { display: flex; width: max-content; animation: news-ticker 40s linear infinite; }
.topbar-track span { padding: 0 26px; white-space: nowrap; }
.topbar-track span::first-letter { color: var(--tomato); }
.topbar:hover .topbar-track, .band:hover .band-track { animation-play-state: paused; }
@keyframes news-ticker { to { transform: translateX(-50%); } }

/* ---------- header: sticky paper bar ---------- */
.site-header, .site-header.is-scrolled {
  position: sticky; top: 0; left: auto; transform: none;
  width: auto; max-width: none; border-radius: 0;
  background: var(--paper); border: 0; border-bottom: var(--b);
  box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
}
.masthead { height: 64px; width: calc(100% - 48px); max-width: 1280px; margin-inline: auto; padding: 0; }
main.container { padding-top: 34px; }
.wordmark { font-size: 30px; letter-spacing: -.045em; }
.wordmark .wordmark-period, .dialog-wordmark .heading-period, .footer-wordmark .heading-period {
  display: inline-block; width: .3em; height: .3em; margin-left: 2px; vertical-align: baseline;
  background: var(--tomato); border: var(--b2); color: transparent; overflow: hidden; line-height: 0; transform: rotate(45deg);
}
.masthead-subline { font-family: var(--serif); font-style: italic; font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.desktop-nav { gap: 2px; }
.nav-link { height: auto; padding: 6px 11px; border: 0; border-radius: 0; font-family: var(--sans); font-size: 13px; font-weight: 600; text-transform: none; }
.nav-link::before, .nav-link::after, .nav-link.is-active::after { display: none !important; content: none !important; }
.nav-link:hover { color: var(--ink); box-shadow: inset 0 -3px 0 var(--tomato); }
.nav-link.is-active, .nav-link.is-active:hover { color: var(--paper); background: var(--ink); box-shadow: none; }

.icon-button { width: 40px; height: 40px; border: var(--b2); border-radius: 0; background: var(--card); color: var(--ink); margin-right: 6px; transition: transform .12s, box-shadow .12s, background .15s; }
.icon-button:hover { color: #141414; background: var(--mint); transform: translate(-2px, -2px); box-shadow: var(--sh-sm); }

/* ---------- buttons ---------- */
.button {
  min-height: 44px; padding: 10px 18px; border: var(--b); border-radius: 0; box-shadow: var(--sh-sm);
  background: var(--card); color: var(--ink); font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: .02em;
  transition: transform .12s, box-shadow .12s, background .15s;
}
.button:hover { transform: translate(-2px, -2px); box-shadow: var(--sh); background: var(--lilac); color: #141414; }
.button:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--shadow-ink); }
.button-primary, .button-primary:hover { background: var(--tomato); color: #141414; }
.header-subscribe .button { min-height: 40px; padding: 8px 14px; border-radius: 0; background: var(--ink); color: var(--paper); box-shadow: 3px 3px 0 var(--tomato); }
.header-subscribe .button:hover { background: var(--ink); color: var(--paper); box-shadow: 5px 5px 0 var(--tomato); }
.text-link { color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--tomato); text-decoration-thickness: 2.5px; text-underline-offset: 4px; }
.text-link:hover { color: var(--ink); text-decoration-color: var(--cobalt); }

/* ---------- category tags: square stamps ---------- */
.category-labels { gap: 6px; color: var(--ink); font-family: var(--sans); font-size: 10.5px; letter-spacing: .1em; }
.category-labels a {
  display: inline-block; padding: 2px 8px; border: var(--b2); border-radius: 0;
  background: var(--mint); color: #141414; font-weight: 750; transition: transform .12s, box-shadow .12s;
}
.category-labels a[href*="essays"] { background: var(--tomato); }
.category-labels a[href*="notes"] { background: var(--lilac); }
.category-labels a[href*="work"] { background: var(--mint); }
.category-labels a:hover { text-decoration: none; transform: translate(-1px, -1px); box-shadow: 2px 2px 0 var(--shadow-ink); }
.category-dot { display: none; }
.story-meta { font-family: var(--sans); color: var(--muted); }
.story-meta a { color: var(--ink); font-weight: 700; }

/* ---------- images: cut-out frames ---------- */
.image-link { border: var(--b); border-radius: 0; background: var(--soft); box-shadow: var(--sh); transition: transform .15s, box-shadow .15s; }
.image-link:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--shadow-ink); }
.image-link:hover .story-image { transform: none; }

/* ---------- home: lead grid as three boxed columns ---------- */
.lead-grid { gap: 24px; align-items: start; }
.lead-secondary, .latest-sidebar { border: var(--b); border-radius: 0; background: var(--card); box-shadow: var(--sh); padding: 18px; }
.lead-secondary { padding-right: 18px; }
.latest-sidebar { padding-left: 18px; }
.side-index-heading, .sidebar-heading { border-bottom: var(--b); }
.side-index-heading h2, .sidebar-heading h2, .side-shelfpick-label {
  display: inline-block; padding: 3px 8px; background: var(--ink); color: var(--paper);
  font-family: var(--sans); font-size: 10.5px; font-weight: 700; letter-spacing: .12em;
}
.side-index-heading p { font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--muted); }
.side-writer { border-bottom: 1.5px solid color-mix(in srgb, var(--line) 30%, transparent); }
.side-writer img { border: var(--b2); border-radius: 0; background: var(--lilac); }
.side-writer strong { font-family: var(--display); font-weight: 800; font-size: 16px; }
.sidebar-more { font-family: var(--sans); font-weight: 700; color: var(--ink); }
.sidebar-more:hover { color: var(--ink); box-shadow: inset 0 -3px 0 var(--tomato); }
.side-shelfpick-row img { border: var(--b2); border-radius: 0; }
.side-colophon { border-top: var(--b); }
.headline-kicker {
  display: table; margin: 0 auto 14px; padding: 4px 10px; background: var(--tomato); color: #141414; border: var(--b2);
  font-family: var(--sans); font-size: 11px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; transform: rotate(-2deg);
}
.lead-image { border-radius: 0; }
.lead-feature h1 { font-size: clamp(34px, 4vw, 58px); line-height: .98; letter-spacing: -.045em; margin-top: 14px; }
.lead-feature h1 a { background-image: linear-gradient(var(--lilac), var(--lilac)); background-size: 0 35%; background-repeat: no-repeat; background-position: 0 90%; transition: background-size .35s; }
.lead-feature h1 a:hover { color: var(--ink); background-size: 100% 35%; }
.lead-deck { font-family: var(--serif); font-size: 17px; color: var(--muted); }
.latest-story { border-bottom: 1.5px solid color-mix(in srgb, var(--line) 30%, transparent); }
.latest-story { grid-template-columns: 30px minmax(0, 1fr) 78px; }
.latest-rank { font-family: var(--display); font-size: 20px; font-weight: 800; color: var(--tomato); -webkit-text-stroke: 1px var(--ink); }
.latest-story h3 { font-family: var(--display); font-weight: 800; }
.latest-story h3 a:hover { color: var(--ink); box-shadow: inset 0 -3px 0 var(--tomato); }
.latest-image { border-width: 2px; border-radius: 0; box-shadow: 3px 3px 0 var(--shadow-ink); }

/* one straight cobalt ribbon (not the store's crossed pair) */
.bands { position: relative; height: auto; margin: 44px 0 6px; overflow: hidden; border: var(--b); background: var(--cobalt); box-shadow: var(--sh); }
.band-b { display: none; }
.band { position: static; background: none; color: #fff; border: 0; padding: 12px 0; transform: none; }
.band-track { gap: 30px; align-items: center; font-family: var(--display); font-style: italic; font-weight: 700; font-size: clamp(22px, 2.6vw, 32px); letter-spacing: -.02em; animation-duration: 30s; }
.band-track span { white-space: nowrap; }
.band-track b { color: var(--mint); font-style: normal; }

/* ---------- section headings ---------- */
.section-heading { border-bottom: var(--b); padding-bottom: 12px; margin-bottom: 28px; }
.section-heading h2 { font-family: var(--display); font-size: clamp(30px, 3.6vw, 46px); font-weight: 800; letter-spacing: -.045em; text-transform: none; line-height: 1; }
.section-number { display: inline-grid; place-items: center; min-width: 36px; height: 30px; padding: 0 7px; border: var(--b2); background: var(--ink); color: var(--paper); font-family: var(--sans); font-size: 12px; font-weight: 700; }
.category-section:nth-of-type(3n+1) .section-number { box-shadow: 3px 3px 0 var(--tomato); }
.category-section:nth-of-type(3n+2) .section-number { box-shadow: 3px 3px 0 var(--lilac); }
.category-section:nth-of-type(3n) .section-number { box-shadow: 3px 3px 0 var(--mint); }

/* ---------- story cards: clipped newspaper boxes ---------- */
.story-grid { column-gap: 26px; row-gap: 32px; }
.story-card { padding: 10px 10px 18px; border: var(--b); border-radius: 0; background: var(--card); box-shadow: var(--sh); transition: transform .15s, box-shadow .15s; }
.story-card:hover { transform: translate(-3px, -3px); box-shadow: 8px 8px 0 var(--shadow-ink); }
.story-card .image-link { border-width: 2px; border-radius: 0; box-shadow: none; }
.story-card .image-link:hover { transform: none; box-shadow: none; }
.story-card-content { padding: 14px 4px 0; }
.card-title { font-family: var(--display); font-weight: 800; letter-spacing: -.035em; }
.card-title a:hover { color: var(--ink); box-shadow: inset 0 -4px 0 var(--lilac); }
.card-excerpt { font-family: var(--serif); color: var(--muted); font-size: 15px; }

/* ---------- archive / writers / about ---------- */
.archive-header h1, .article-header h1, .about-hero h1, .page-title, .home-empty h1 { font-family: var(--display); font-weight: 800; letter-spacing: -.05em; }
.archive-header h1 { font-size: clamp(46px, 6vw, 84px); line-height: .95; }
.archive-avatar, .author-avatar img, .author-bio img { border: var(--b); border-radius: 0; background: var(--lilac); }
.archive-categories { border-bottom: var(--b); }
.filter-chip { border: var(--b2); border-radius: 0; background: var(--card); font-family: var(--sans); font-size: 12px; font-weight: 700; transition: transform .12s, box-shadow .12s, background .15s; }
.filter-chip:hover { background: var(--mint); color: #141414; transform: translate(-1px, -1px); box-shadow: 2px 2px 0 var(--shadow-ink); }
.filter-chip.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.breadcrumb { font-family: var(--sans); font-weight: 600; }
.breadcrumb a { text-decoration: underline; text-decoration-color: var(--tomato); text-decoration-thickness: 2.5px; text-underline-offset: 3px; }

/* ---------- article page ---------- */
.article-header h1 { font-size: clamp(42px, 5.2vw, 76px); line-height: .98; }
.article-deck { font-family: var(--serif); font-style: italic; font-size: 19px; }
.article-cover { border: var(--b); border-radius: 0; box-shadow: var(--sh); }
.article-body a { text-decoration: underline; text-decoration-color: var(--tomato); text-decoration-thickness: 2.5px; text-underline-offset: 3px; }
.article-body a:hover { text-decoration-color: var(--cobalt); }
.article-body h2 { font-family: var(--display); font-weight: 800; letter-spacing: -.035em; }
.article-body blockquote { border: var(--b); border-left-width: 10px; border-radius: 0; padding: 16px 20px; background: var(--card); box-shadow: var(--sh-sm); }
.article-note nav { border-left: var(--b); }
.article-end, .article-pager { border-color: var(--line); border-width: 2.5px; }
.reading-progress { height: 5px; background: var(--tomato); border-bottom: 2px solid #141414; }

/* ---------- dialogs, toast ---------- */
dialog { border: var(--b); border-radius: 0; background: var(--paper); box-shadow: 8px 8px 0 var(--shadow-ink); }
.search-dialog { border-radius: 0; }
.menu-dialog { border-width: 0 2.5px 0 0; box-shadow: none; }
.drawer-nav a { font-family: var(--display); font-weight: 800; }
.drawer-nav a:hover { color: var(--ink); box-shadow: inset 0 -4px 0 var(--tomato); }
.search-input-wrap { border: var(--b); border-radius: 0; background: var(--card); box-shadow: var(--sh-sm); }
.toast { border: var(--b); border-radius: 0; background: #141414; color: #f3efe6; box-shadow: 4px 4px 0 var(--tomato); font-family: var(--sans); font-weight: 600; }

/* ---------- continue reading + shelf ---------- */
.continue-reading { border: var(--b); border-radius: 0; background: var(--mint); color: #141414; box-shadow: var(--sh); }
.home-shelf { border-top: var(--b); }
.home-shelf-card img { border: var(--b2); border-radius: 0; padding: 0; box-shadow: none; }
.home-shelf-card { filter: drop-shadow(4px 4px 0 #141414); }
.library-cover img { border: var(--b2); border-radius: 0; box-shadow: 3px 3px 0 var(--shadow-ink); }

.footer-minimal { border-top: 0; font-family: var(--sans); font-size: 12.5px; color: var(--ink); }
.footer-minimal a:hover, .footer-minimal button:hover { color: var(--ink); box-shadow: inset 0 -3px 0 var(--tomato); }
.footer-minimal .footer-credit { opacity: 1; padding: 1px 7px; border: var(--b2); background: var(--lilac); color: #141414; }

/* header buttons keep their frame on every screen size */
.site-header .icon-button, .site-header .menu-toggle { border: var(--b2); border-radius: 0; background: var(--card); }

/* ---------- small screens ---------- */
@media (max-width: 1023px) {
  .masthead { height: 58px; width: calc(100% - 32px); }
  .lead-secondary, .latest-sidebar { box-shadow: var(--sh-sm); }
}
@media (max-width: 767px) {
  .topbar { font-size: 10.5px; padding: 6px 0; }
  .masthead { height: auto; min-height: 56px; width: calc(100% - 20px); padding: 6px 0; }
  .masthead-subline { font-size: 11px !important; font-family: var(--serif) !important; font-style: italic; letter-spacing: 0 !important; }
  .icon-button { width: 36px; height: 36px; margin-right: 4px; }
  main.container { padding-top: 22px; }
  .wordmark { font-size: 25px; }
  .lead-secondary, .latest-sidebar { padding: 15px; }
  .story-card { box-shadow: var(--sh-sm); }
  .section-heading h2 { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .topbar-track, .band-track { animation: none; }
  .story-card:hover, .image-link:hover, .button:hover { transform: none; }
}

/* ---------- extras: random button, NEW stamps, dateline, claps, back to top ---------- */
.image-link { position: relative; }
.new-stamp {
  position: absolute; top: 10px; left: 10px; z-index: 2; padding: 3px 9px; border: var(--b2); background: var(--tomato); color: #141414;
  font-family: var(--sans); font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; transform: rotate(-6deg);
  box-shadow: 2px 2px 0 var(--shadow-ink); pointer-events: none;
}
.latest-image .new-stamp { top: 4px; left: 4px; padding: 1px 5px; font-size: 8.5px; }
.topbar-track .dateline { color: var(--mint); }
.topbar-track .dateline::first-letter { color: var(--mint); }
.random-story:hover { background: var(--lilac); }
.random-story:hover .icon { animation: shuffle-spin .5s ease; }
@keyframes shuffle-spin { 50% { transform: rotate(-12deg) scale(1.15); } }

.clap-box { display: flex; align-items: center; gap: 20px; margin: 34px 0 26px; padding: 18px 20px; border: var(--b); background: var(--card); box-shadow: var(--sh); }
.clap-button {
  position: relative; flex: none; display: grid; place-items: center; gap: 2px; width: 82px; height: 82px; border: var(--b); border-radius: 50%;
  background: var(--mint); color: #141414; box-shadow: var(--sh-sm); cursor: pointer; transition: transform .12s, box-shadow .12s, background .2s;
}
.clap-button:hover { transform: translate(-2px, -2px); box-shadow: var(--sh); }
.clap-button:active { transform: translate(2px, 2px) scale(.96); box-shadow: 0 0 0 var(--shadow-ink); }
.clap-button.is-full { background: var(--lilac); cursor: default; }
.clap-emoji { font-size: 30px; line-height: 1; }
.clap-label { font-family: var(--sans); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.clap-button.pop .clap-emoji { animation: clap-pop .35s ease; }
@keyframes clap-pop { 40% { transform: scale(1.35) rotate(-10deg); } }
.clap-bit { position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px; border: 1.5px solid var(--frame); animation: clap-bit .6s ease-out forwards; pointer-events: none; }
@keyframes clap-bit { to { transform: translate(var(--x), var(--y)) rotate(90deg); opacity: 0; } }
.clap-copy strong { display: block; font-family: var(--display); font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.clap-copy p { margin: 4px 0 0; font-family: var(--sans); font-size: 13px; color: var(--muted); }

.to-top {
  position: fixed; left: 16px; bottom: 16px; z-index: 50; width: 50px; height: 50px; padding: 0; border: var(--b); border-radius: 50%;
  background: var(--card); color: var(--ink); box-shadow: var(--sh-sm); cursor: pointer;
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .25s, transform .25s, box-shadow .12s;
}
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { box-shadow: var(--sh); transform: translate(-2px, -2px); }
.to-top svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.to-top .ring-bg { stroke: color-mix(in srgb, var(--ink) 15%, transparent); stroke-width: 3.5; }
.to-top .ring { stroke: var(--tomato); stroke-width: 3.5; stroke-dasharray: 100; stroke-dashoffset: var(--progress, 100); transform: rotate(-90deg); transform-origin: center; }
@media (max-width: 767px) {
  .clap-box { gap: 14px; padding: 14px; }
  .clap-button { width: 68px; height: 68px; }
  .clap-copy strong { font-size: 21px; }
  .to-top { width: 44px; height: 44px; left: 12px; bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .new-stamp { transform: none; }
}

/* end-of-story cards are navigation, not inline links: no underline on every line */
.article-body .article-end-card a, .article-body .article-pager a { text-decoration: none; }
.article-body .article-end-card h3 a:hover, .article-body .article-pager a:hover strong, .article-body .article-end-card a:hover { color: var(--ink); background: none; box-shadow: inset 0 -3px 0 var(--tomato); }

/* ---------- reading roulette ---------- */
.roulette { margin-top: 80px; }
.roulette-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 48px; align-items: center; padding: 40px 44px; border: var(--b); background: var(--cobalt); color: #fff; box-shadow: 8px 8px 0 var(--shadow-ink); position: relative; overflow: hidden; }
.roulette-grid::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.14) 1.4px, transparent 1.4px); background-size: 18px 18px; pointer-events: none; }
.roulette-copy, .roulette-ticket { position: relative; }
.roulette-kicker { display: inline-block; padding: 4px 10px; background: var(--mint); color: #141414; border: var(--b2); border-color: #141414; font-family: var(--sans); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; transform: rotate(-2deg); }
.roulette-copy h2 { margin-top: 16px; font-size: clamp(36px, 4.2vw, 62px); line-height: .98; letter-spacing: -.045em; color: #fff; }
.roulette-copy h2 .heading-period { color: var(--mint); }
.roulette-copy p { margin-top: 14px; max-width: 42ch; font-family: var(--serif); font-size: 17px; line-height: 1.6; color: rgba(255,255,255,.86); }
.roulette-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 26px; }
.roulette-spin { min-height: 54px; padding: 12px 26px; font-size: 16px; border-color: #141414; box-shadow: 5px 5px 0 #141414; }
.roulette-spin .icon { width: 20px; height: 20px; }
.roulette-spin:hover { box-shadow: 7px 7px 0 #141414; }
.roulette-spin[disabled] { cursor: progress; }
.roulette-spin[disabled] .icon { animation: roulette-turn .5s linear infinite; }
@keyframes roulette-turn { to { transform: rotate(360deg); } }
.roulette-hint { font-family: var(--sans); font-size: 13px; color: rgba(255,255,255,.8); }
.roulette-hint kbd { display: inline-grid; place-items: center; min-width: 24px; height: 24px; margin: 0 2px; border: 2px solid #141414; background: #fff; color: #141414; font-family: var(--sans); font-size: 12px; font-weight: 800; box-shadow: 2px 2px 0 #141414; }

.roulette-ticket { display: grid; grid-template-columns: 44% minmax(0, 1fr); border: 2.5px solid #141414; background: var(--card); color: var(--ink); box-shadow: 8px 8px 0 #141414; transform: rotate(1.5deg); transition: transform .3s cubic-bezier(.3,1.5,.5,1); }
.roulette-ticket:hover { transform: rotate(0deg) translateY(-3px); }
.ticket-notch { position: absolute; left: 44%; top: -10px; bottom: -10px; width: 0; border-left: 3px dashed #141414; transform: translateX(-1.5px); z-index: 2; }
.ticket-notch::before, .ticket-notch::after { content: ""; position: absolute; left: -12px; width: 20px; height: 20px; border-radius: 50%; background: var(--cobalt); border: 2.5px solid #141414; }
.ticket-notch::before { top: -2px; } .ticket-notch::after { bottom: -2px; }
.ticket-image { display: block; overflow: hidden; border-right: 0; background: var(--soft); }
.ticket-image img { width: 100%; height: 100%; min-height: 230px; object-fit: cover; display: block; }
.ticket-body { display: flex; flex-direction: column; gap: 8px; padding: 22px 22px 20px 26px; min-width: 0; }
.ticket-category { align-self: flex-start; padding: 2px 8px; border: var(--b2); border-color: #141414; background: var(--mint); color: #141414; font-family: var(--sans); font-size: 10.5px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.ticket-category[data-cat="essays"] { background: var(--tomato); }
.ticket-category[data-cat="notes"] { background: var(--lilac); }
.ticket-body h3 { font-family: var(--display); font-size: clamp(22px, 2.2vw, 30px); line-height: 1.06; letter-spacing: -.035em; }
.ticket-body h3 a:hover { box-shadow: inset 0 -4px 0 var(--lilac); }
.ticket-meta { display: flex; flex-wrap: wrap; gap: 6px; font-family: var(--sans); font-size: 12px; color: var(--muted); }
.ticket-read { margin-top: auto; align-self: flex-start; font-size: 14px; }
.roulette-ticket.is-spinning { animation: ticket-shake .12s linear infinite; }
.roulette-ticket.is-spinning .ticket-body h3 { filter: blur(.6px); opacity: .8; }
.roulette-ticket.is-spinning .ticket-image img { filter: blur(3px) saturate(.6); }
@keyframes ticket-shake { 0%, 100% { transform: rotate(1.5deg) translateY(0); } 50% { transform: rotate(.5deg) translateY(-3px); } }
.roulette-ticket.is-landed { animation: ticket-land .6s cubic-bezier(.3,1.6,.5,1); }
@keyframes ticket-land { 0% { transform: rotate(-3deg) scale(.94); } 60% { transform: rotate(2.5deg) scale(1.03); } 100% { transform: rotate(1.5deg) scale(1); } }

.roulette-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin: 26px 0 0; }
.roulette-stats div { display: flex; flex-direction: column-reverse; gap: 4px; padding: 14px 16px; border: var(--b); background: var(--card); box-shadow: var(--sh-sm); }
.roulette-stats div:nth-child(1) { border-top: 8px solid var(--tomato); }
.roulette-stats div:nth-child(2) { border-top: 8px solid var(--lilac); }
.roulette-stats div:nth-child(3) { border-top: 8px solid var(--mint); }
.roulette-stats div:nth-child(4) { border-top: 8px solid var(--cobalt); }
.roulette-stats dd { margin: 0; font-family: var(--display); font-size: clamp(34px, 3.6vw, 52px); font-weight: 800; letter-spacing: -.05em; line-height: 1; }
.roulette-stats dt { font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
:root[data-theme=dark] .roulette-grid { background: #2a3a8f; }
:root[data-theme=dark] .ticket-notch::before, :root[data-theme=dark] .ticket-notch::after { background: #2a3a8f; }
.site-footer { margin-top: 44px; border-top: var(--b); }
:root[data-theme=dark] .site-footer { border-top-color: var(--line); }

/* ---------- clicking a story: press, then the picture flies into the article ---------- */
@view-transition { navigation: auto; }
.article-cover .story-image { view-transition-name: story-cover; }
.article-header h1 { view-transition-name: story-title; }
.topbar { view-transition-name: ticker; }
.site-header { view-transition-name: masthead; }
::view-transition-group(story-cover), ::view-transition-group(story-title) { animation-duration: .55s; animation-timing-function: cubic-bezier(.2,.8,.2,1); }
::view-transition-old(root) { animation: vt-out .28s ease both; }
::view-transition-new(root) { animation: vt-in .45s cubic-bezier(.2,.8,.2,1) .05s both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-12px) scale(.985); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(26px); } }
.is-pressed, .story-card.is-pressed { transform: translate(3px, 3px) !important; box-shadow: 0 0 0 var(--shadow-ink) !important; transition: transform .08s, box-shadow .08s; }
html.is-leaving main, html.is-leaving .roulette { opacity: 0; transform: translateY(-10px); transition: opacity .2s, transform .2s; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .roulette-ticket, .roulette-ticket:hover { transform: none; }
}
@media (max-width: 900px) {
  .roulette-grid { grid-template-columns: 1fr; gap: 30px; padding: 28px 22px 30px; }
  .roulette-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
}
@media (max-width: 520px) {
  .roulette-ticket { grid-template-columns: 1fr; transform: rotate(.8deg); }
  .ticket-notch { display: none; }
  .ticket-image img { min-height: 0; aspect-ratio: 16 / 10; }
  .roulette-ticket.is-spinning { animation: none; }
}

/* no keyboard on touch screens: the R hint would only confuse */
@media (hover: none) and (pointer: coarse) { .roulette-hint { display: none; } }

/* ---------- sidebar polish: one kind of rule, airy rows, framed avatars (both themes) ---------- */
:root { --rule: 1.5px dashed color-mix(in srgb, var(--ink) 22%, transparent); }
.side-index-heading, .sidebar-heading { border-bottom: var(--b); padding-bottom: 12px; margin-bottom: 14px; }
.side-writer { gap: 14px; margin: 0 -8px; padding: 9px 8px; border: 0 !important; transition: background .15s; }
.side-writer:first-of-type { padding-top: 9px; }
.side-writer + .side-writer { margin-top: 4px; }
.side-writer:hover { background: var(--soft); }
.side-writer img { width: 54px; height: 54px; border: var(--b2); border-radius: 0; box-shadow: 3px 3px 0 var(--shadow-ink); transition: transform .15s, box-shadow .15s; }
.side-writer:nth-of-type(1) img { background: #f6d36b; }
.side-writer:nth-of-type(2) img { background: var(--mint); }
.side-writer:nth-of-type(3) img { background: var(--lilac); }
.side-writer:hover img { transform: translate(-2px, -2px) rotate(-3deg); box-shadow: 5px 5px 0 var(--shadow-ink); }
.side-writer strong { font-family: var(--display); font-size: 18px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.side-writer:hover strong { color: var(--ink); }
.side-writer em { font-family: var(--serif); font-style: italic; font-size: 13.5px; line-height: 1.35; color: var(--muted); }
.sidebar-more {
  justify-content: space-between; margin-top: 16px; padding: 9px 12px; min-height: 0; border: var(--b2); border-top: var(--b2);
  background: var(--card); font-family: var(--sans); font-size: 12px; font-weight: 700; color: var(--ink); text-decoration: none;
  box-shadow: 2px 2px 0 var(--shadow-ink); transition: transform .12s, box-shadow .12s, background .15s;
}
.sidebar-more:hover { text-decoration: none; background: var(--mint); color: #141414; transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--shadow-ink); }
.side-shelfpick { margin-top: 22px; padding-top: 18px; border-top: var(--rule); }
.side-shelfpick-row img { border-radius: 0; box-shadow: 3px 3px 0 var(--shadow-ink); }
.side-shelfpick-text strong { font-family: var(--display); font-size: 15px; font-weight: 800; letter-spacing: -.02em; }
.side-colophon { margin-top: 20px; padding-top: 16px; border-top: var(--rule) !important; }
.side-colophon p { font-family: var(--serif); font-size: 14px; line-height: 1.6; }
.side-colophon-links a { font-family: var(--sans); font-size: 11.5px; font-weight: 700; }
.side-colophon-links a:hover { color: var(--ink); box-shadow: inset 0 -3px 0 var(--tomato); }
.latest-story { border-bottom: var(--rule) !important; }
.latest-story:last-child { border-bottom: 0 !important; }
.latest-sidebar .sidebar-more { margin-top: 12px; }
:root[data-theme=dark] .side-writer:hover { background: #2e2b27; }
:root[data-theme=dark] .sidebar-more { background: #2e2b27; color: var(--ink); }
:root[data-theme=dark] .sidebar-more:hover { color: #141414; }

/* ---------- inner pages: same voice as the homepage (both themes) ---------- */
/* archive list */
.index-month-heading { border-bottom: var(--b) !important; }
.index-month-heading h2, .index-month-heading h3 { display: inline-block; padding: 3px 8px; background: var(--ink); color: var(--paper); font-family: var(--sans); font-size: 11px; letter-spacing: .12em; }
.index-row { border-bottom: var(--rule) !important; }
.index-row-number { font-family: var(--display); font-weight: 800; color: var(--tomato); -webkit-text-stroke: 1px var(--shadow-ink); }
.index-row-title { font-family: var(--display); font-weight: 800; font-size: clamp(22px, 2.2vw, 28px); letter-spacing: -.035em; line-height: 1.1; }
.index-row-title:hover { color: var(--ink); box-shadow: inset 0 -4px 0 var(--lilac); }
.index-row-meta a { color: var(--ink); font-weight: 700; }
/* writers page: framed square portraits on sticker cards */
.writer-card { padding: 22px; border: var(--b); background: var(--card); box-shadow: var(--sh); transition: transform .15s, box-shadow .15s; }
.writer-card:hover { transform: translate(-3px, -3px); box-shadow: 8px 8px 0 var(--shadow-ink); }
.writer-card img { width: 108px; height: 108px; border-radius: 0 !important; border: var(--b); box-shadow: 4px 4px 0 var(--shadow-ink); }
.writer-card:nth-child(1) img { background: #f6d36b; }
.writer-card:nth-child(2) img { background: var(--mint); }
.writer-card:nth-child(3) img { background: var(--lilac); }
.writer-role { display: inline-block; margin-top: 18px; padding: 2px 8px; border: var(--b2); background: var(--soft); font-family: var(--sans); font-size: 11px; font-weight: 700; }
.writer-card h2 { font-family: var(--display); font-weight: 800; letter-spacing: -.04em; }
.writer-card h2 a:hover { color: var(--ink); box-shadow: inset 0 -4px 0 var(--tomato); }
.writer-card > p:not(.writer-role) { font-family: var(--serif); font-size: 15.5px; }
.authors-grid { border-top: 0 !important; gap: 26px !important; }
/* the shelf */
.library-group-heading h2, .library-group-heading h3 { font-family: var(--display); font-weight: 800; letter-spacing: -.04em; font-size: clamp(30px, 3vw, 40px); }
.library-title { font-family: var(--display); font-weight: 800; letter-spacing: -.03em; }
.library-group { border-top: var(--rule) !important; }
/* in-article table of contents */
.article-note { font-family: var(--sans); font-size: 12px; }
.article-note > span { display: inline-block; padding: 2px 7px; background: var(--ink); color: var(--paper); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; font-size: 10px; }
.article-note nav a { font-size: 13px; line-height: 1.35; }
.article-note nav a:hover { color: var(--ink); box-shadow: inset 0 -3px 0 var(--tomato); }
:root[data-theme=dark] .index-month-heading h2, :root[data-theme=dark] .index-month-heading h3, :root[data-theme=dark] .article-note > span { background: var(--ink); color: #141414; }
:root[data-theme=dark] .writer-role { background: #2e2b27; }

/* ---------- critters walking on the page ---------- */
:root { --critter-line: #141414; }
:root[data-theme=dark] { --critter-line: #070707; }
.bands, .roulette-grid { overflow: visible; }
.band { overflow: hidden; }
.site-footer, .latest-sidebar { position: relative; }
.critter-lane { position: absolute; left: 14px; right: 14px; bottom: 100%; height: 0; pointer-events: none; z-index: 5; }
.bands > .critter-lane { bottom: calc(100% + 2px); }
.critter { position: absolute; left: 0; bottom: 0; padding: 0; border: 0; background: none; cursor: pointer; pointer-events: auto; will-change: transform; }
.critter svg { display: block; width: 100%; height: 100%; overflow: visible; transition: transform .2s; }
.critter.is-left svg { transform: scaleX(-1); }
.critter .leg { transform-box: fill-box; transform-origin: 50% 8%; }
.critter.is-walking .leg-a { animation: critter-leg .34s ease-in-out infinite alternate; }
.critter.is-walking .leg-b { animation: critter-leg .34s ease-in-out infinite alternate-reverse; }
.critter.is-walking .bob { animation: critter-bob .34s ease-in-out infinite alternate; }
.critter.is-sitting .bob { transform: translateY(4px); transition: transform .25s; }
.critter.is-sitting .leg { transform: scaleY(.55); transition: transform .25s; }
.critter .c-tail { transform-box: view-box; transform-origin: 16px 30px; }
.critter--cat .c-tail { animation: critter-tail 1.6s ease-in-out infinite alternate; }
.critter--dog .c-tail { transform-origin: 16px 28px; animation: critter-wag .22s ease-in-out infinite alternate; }
.critter.is-hopping svg { animation: critter-hop .5s cubic-bezier(.3,1.6,.5,1); }
.critter.is-left.is-hopping svg { animation-name: critter-hop-left; }
@keyframes critter-leg { from { transform: rotate(-22deg); } to { transform: rotate(22deg); } }
@keyframes critter-bob { to { transform: translateY(-2px); } }
@keyframes critter-tail { to { transform: rotate(-12deg); } }
@keyframes critter-wag { from { transform: rotate(-14deg); } to { transform: rotate(14deg); } }
@keyframes critter-hop { 40% { transform: translateY(-26px) rotate(-6deg); } }
@keyframes critter-hop-left { 0%, 100% { transform: scaleX(-1); } 40% { transform: scaleX(-1) translateY(-26px) rotate(-6deg); } }
.critter-say {
  position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translate(-50%, 6px) scale(.8); opacity: 0;
  padding: 4px 9px; white-space: nowrap; border: 2px solid var(--critter-line); background: var(--card); color: var(--ink);
  font-family: var(--sans); font-size: 12px; font-weight: 800; box-shadow: 2px 2px 0 var(--critter-line); pointer-events: none;
  transition: opacity .18s, transform .25s cubic-bezier(.3,1.6,.5,1);
}
.critter-say::after { content: ""; position: absolute; left: 50%; top: 100%; width: 8px; height: 8px; margin-left: -4px; margin-top: -3px; background: var(--card); border-right: 2px solid var(--critter-line); border-bottom: 2px solid var(--critter-line); transform: rotate(45deg); }
.critter.is-talking .critter-say { opacity: 1; transform: translate(-50%, 0) scale(1); }
:root[data-theme=dark] .critter-say { border-color: #000; box-shadow: 2px 2px 0 #000; }
/* napping cat on the "latest" box */
.critter-nap { position: absolute; right: 22px; bottom: 100%; width: 70px; height: 40px; margin-bottom: -1px; pointer-events: none; }
.critter-nap svg { width: 100%; height: 100%; display: block; overflow: visible; }
.critter-nap .breathe { transform-box: fill-box; transform-origin: 50% 100%; animation: nap-breathe 2.6s ease-in-out infinite; }
.critter-nap .zzz { position: absolute; right: -6px; top: -18px; font-family: var(--display); font-weight: 800; color: var(--muted); }
.critter-nap .zzz i { position: absolute; font-style: normal; opacity: 0; animation: nap-z 3s ease-in-out infinite; }
.critter-nap .zzz i:nth-child(2) { animation-delay: 1s; font-size: 1.2em; }
.critter-nap .zzz i:nth-child(3) { animation-delay: 2s; font-size: 1.45em; }
@keyframes nap-breathe { 50% { transform: scaleY(1.06); } }
@keyframes nap-z { 0% { opacity: 0; transform: translate(0, 0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(14px, -22px); } }
@media (max-width: 767px) {
  .critter { transform-origin: bottom left; }
  .critter-lane { left: 8px; right: 8px; }
  .critter--dog { scale: .85; transform-origin: bottom left; }
}
@media (prefers-reduced-motion: reduce) {
  .critter .c-tail, .critter-nap .breathe, .critter-nap .zzz i { animation: none; }
  .critter-nap .zzz i:last-child { opacity: 1; }
}

/* ---------- read stamps, read meter, confetti ---------- */
.read-stamp {
  position: absolute; top: 10px; right: 10px; z-index: 2; padding: 3px 9px; border: var(--b2); background: var(--mint); color: #141414;
  font-family: var(--sans); font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; transform: rotate(5deg);
  box-shadow: 2px 2px 0 var(--shadow-ink); pointer-events: none;
}
.latest-image .read-stamp { top: auto; bottom: 4px; right: 4px; padding: 1px 5px; font-size: 8.5px; }
.index-row { position: relative; }
.index-row > .read-stamp { top: 22px; right: 0; }
.story-card.is-read .story-image { filter: saturate(.75); }
.read-meter { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: center; gap: 24px; margin-top: 18px; padding: 16px 20px; border: var(--b); background: var(--card); box-shadow: var(--sh-sm); }
.read-meter p { margin: 0; display: grid; gap: 2px; }
.read-meter strong { font-family: var(--display); font-size: 22px; font-weight: 800; letter-spacing: -.03em; }
.read-meter span { font-family: var(--sans); font-size: 12.5px; color: var(--muted); }
.read-meter-bar { height: 22px; border: var(--b2); background: var(--soft); overflow: hidden; }
.read-meter-bar i { display: block; height: 100%; min-width: 0; background: repeating-linear-gradient(-45deg, var(--mint) 0 10px, #6ccfa3 10px 20px); border-right: var(--b2); transition: width .8s cubic-bezier(.2,.8,.2,1); }
.confetti { position: fixed; inset: 0; z-index: 90; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border: 1.5px solid #141414; animation: confetti-fall 2s cubic-bezier(.3,.6,.4,1) forwards; }
@keyframes confetti-fall { to { transform: translate(var(--drift), 105vh) rotate(var(--spin)); } }

/* ---------- bird + parade ---------- */
.critter-bird { position: fixed; left: 0; z-index: 35; width: 54px; height: 36px; padding: 0; border: 0; background: none; cursor: pointer; animation: bird-fly 11s linear forwards; }
.critter-bird svg { width: 100%; height: 100%; display: block; overflow: visible; animation: bird-bob .5s ease-in-out infinite alternate; }
.critter-bird.from-right svg { transform: scaleX(-1); }
.critter-bird.from-right { animation-name: bird-fly-back; }
.critter-bird .wing { transform-box: fill-box; transform-origin: 50% 100%; animation: bird-flap .18s ease-in-out infinite alternate; }
.critter-bird .wing-back { animation-delay: .09s; }
.critter-bird.is-talking .critter-say { opacity: 1; transform: translate(-50%, 0) scale(1); }
@keyframes bird-fly { from { transform: translate(-70px, 0); } 50% { transform: translate(50vw, -22px); } to { transform: translate(calc(100vw + 70px), 8px); } }
@keyframes bird-fly-back { from { transform: translate(calc(100vw + 70px), 0); } 50% { transform: translate(50vw, -22px); } to { transform: translate(-70px, 8px); } }
@keyframes bird-flap { to { transform: scaleY(-.6); } }
@keyframes bird-bob { to { margin-top: 5px; } }
.critter-parade { position: fixed; left: 0; right: 0; bottom: 0; height: 70px; z-index: 60; pointer-events: none; }
.parade-walker { position: absolute; bottom: 4px; left: 0; animation: parade-run 5.4s linear forwards; transform: translateX(-120px); }
@keyframes parade-run { to { transform: translateX(calc(100vw + 120px)); } }
@media (max-width: 767px) {
  .read-meter { grid-template-columns: 1fr; gap: 12px; }
  .critter-bird { width: 44px; height: 30px; }
}
.parade-walker { pointer-events: none !important; }

/* dark-mode touch-ups: readable text on the mint "continue" card, calmer cobalt ribbon */
.continue-reading .continue-kicker, .continue-reading p, .continue-reading [data-continue-percent], .continue-reading h2 { color: #141414 !important; }
.continue-reading .continue-kicker { font-weight: 800; letter-spacing: .14em; }
.continue-reading .icon-button { background: #fffdf8; color: #141414; }
:root[data-theme=dark] .bands { background: #2a3a8f; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- listen bar ---------- */
.listen-bar { display: flex; align-items: center; gap: 14px; max-width: 560px; margin: 22px auto 0; padding: 10px 12px; border: var(--b); background: var(--card); box-shadow: var(--sh-sm); text-align: left; }
.listen-play { flex: none; display: grid; place-items: center; width: 50px; height: 50px; border: var(--b); border-radius: 50%; background: var(--tomato); color: #141414; cursor: pointer; box-shadow: 3px 3px 0 var(--shadow-ink); transition: transform .12s, box-shadow .12s; }
.listen-play:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--shadow-ink); }
.listen-play:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--shadow-ink); }
.listen-play svg, .listen-stop svg { width: 22px; height: 22px; fill: currentColor; }
.listen-play .i-pause, .listen-bar.is-playing .listen-play .i-play { display: none; }
.listen-bar.is-playing .listen-play .i-pause { display: block; }
.listen-bar.is-playing .listen-play { background: var(--mint); animation: listen-pulse 1.6s ease-in-out infinite; }
@keyframes listen-pulse { 50% { box-shadow: 3px 3px 0 var(--shadow-ink), 0 0 0 6px color-mix(in srgb, var(--mint) 35%, transparent); } }
.listen-info { flex: 1; min-width: 0; display: grid; gap: 2px; }
.listen-info strong { font-family: var(--display); font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.listen-info span { font-family: var(--sans); font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.listen-progress { height: 6px; margin-top: 5px; border: 1.5px solid var(--frame); background: var(--soft); }
.listen-progress i { display: block; height: 100%; width: 0; background: var(--tomato); transition: width .4s; }
.listen-speed select { height: 36px; padding: 0 8px; border: var(--b2); border-radius: 0; background: var(--card); color: var(--ink); font-family: var(--sans); font-size: 13px; font-weight: 700; cursor: pointer; }
.listen-stop { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border: var(--b2); background: var(--card); color: var(--ink); cursor: pointer; }
.listen-stop[disabled] { opacity: .4; cursor: default; }
.article-body > .is-speaking { background: color-mix(in srgb, #f6d36b 32%, transparent); box-shadow: -14px 0 0 color-mix(in srgb, #f6d36b 32%, transparent), 14px 0 0 color-mix(in srgb, #f6d36b 32%, transparent); border-left: 4px solid var(--tomato); transition: background .3s; }
:root[data-theme=dark] .article-body > .is-speaking { background: rgba(246, 211, 107, .12); box-shadow: -14px 0 0 rgba(246, 211, 107, .12), 14px 0 0 rgba(246, 211, 107, .12); }

/* ---------- quote cards ---------- */
.quote-pop { position: absolute; z-index: 70; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: var(--b2); background: #141414; color: #f3efe6; font-family: var(--sans); font-size: 13px; font-weight: 700; cursor: pointer; box-shadow: 3px 3px 0 var(--tomato); animation: quote-pop-in .18s ease-out; }
.quote-pop span { color: var(--tomato); font-size: 18px; line-height: 1; }
.quote-pop:hover { box-shadow: 4px 4px 0 var(--tomato); transform: translate(-1px, -1px); }
@keyframes quote-pop-in { from { opacity: 0; transform: translateY(6px); } }
.quote-dialog, .sticker-dialog { width: min(560px, calc(100vw - 24px)); padding: 20px; }
.quote-dialog .dialog-top h2, .sticker-dialog .dialog-top h2 { font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: -.03em; }
.quote-dialog .dialog-top, .sticker-dialog .dialog-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.quote-preview { border: var(--b); background: #f3efe6; box-shadow: var(--sh-sm); }
.quote-preview canvas { display: block; width: 100%; height: auto; }
.quote-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.quote-note { margin-top: 10px; font-family: var(--sans); font-size: 12px; color: var(--muted); }

/* ---------- sticker book ---------- */
.sticker-book-btn { position: relative; }
.sticker-count { position: absolute; top: -8px; right: -8px; min-width: 20px; height: 20px; padding: 0 5px; display: grid; place-items: center; border: 2px solid var(--frame); background: var(--tomato); color: #141414; font-family: var(--sans); font-size: 10.5px; font-weight: 800; line-height: 1; }
.footer-stickers { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.footer-stickers:hover { box-shadow: inset 0 -3px 0 var(--tomato); }
.sticker-dialog { width: min(720px, calc(100vw - 24px)); }
.sticker-progress { display: grid; gap: 8px; padding-bottom: 16px; margin-bottom: 18px; border-bottom: var(--rule); }
.sticker-progress strong { font-family: var(--display); font-size: 22px; font-weight: 800; }
.sticker-progress p { margin: 0; font-family: var(--sans); font-size: 12.5px; color: var(--muted); }
.sticker-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 16px; }
.sticker-slot { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.sticker { display: grid; place-items: center; width: 84px; height: 84px; border: var(--b); border-radius: 24px; background: var(--sticker); font-size: 40px; line-height: 1; box-shadow: 0 0 0 5px #fffdf8, 5px 5px 0 5px var(--shadow-ink); transform: rotate(var(--tilt, 0deg)); transition: transform .2s cubic-bezier(.3,1.6,.5,1); }
.sticker-slot.is-owned:hover .sticker { transform: rotate(0deg) scale(1.08); }
.sticker-slot:not(.is-owned) .sticker { background: var(--soft); border-style: dashed; box-shadow: none; font-family: var(--display); font-weight: 800; font-size: 34px; color: var(--muted); }
.sticker-slot strong { font-family: var(--display); font-size: 15px; font-weight: 800; letter-spacing: -.02em; margin-top: 8px; }
.sticker-slot small { font-family: var(--sans); font-size: 11.5px; line-height: 1.35; color: var(--muted); max-width: 18ch; }
.sticker-slot.is-new .sticker { animation: sticker-slap .7s cubic-bezier(.3,1.6,.5,1); }
@keyframes sticker-slap { 0% { transform: scale(1.8) rotate(-18deg); opacity: 0; } 60% { opacity: 1; } }
:root[data-theme=dark] .sticker { box-shadow: 0 0 0 5px #3a3732, 5px 5px 0 5px #000; }
.sticker--mini { width: 48px; height: 48px; border-radius: 14px; font-size: 24px; box-shadow: 0 0 0 3px #fffdf8, 3px 3px 0 3px var(--shadow-ink); transform: rotate(-6deg); }
.sticker-pop { position: fixed; left: 50%; bottom: 22px; z-index: 95; display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 16px; border: var(--b); background: var(--card); color: var(--ink); box-shadow: var(--sh); transform: translate(-50%, 140%) rotate(-2deg); opacity: 0; transition: transform .45s cubic-bezier(.3,1.5,.5,1), opacity .3s; }
.sticker-pop.is-visible { transform: translate(-50%, 0) rotate(-1deg); opacity: 1; }
.sticker-pop-copy { display: grid; }
.sticker-pop-copy small { font-family: var(--sans); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--tomato); }
.sticker-pop-copy strong { font-family: var(--display); font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.sticker-pop-open { margin-left: 6px; padding: 6px 10px; border: var(--b2); background: var(--mint); color: #141414; font-family: var(--sans); font-size: 12px; font-weight: 800; cursor: pointer; }
@media (max-width: 767px) {
  .listen-bar { gap: 10px; }
  .listen-info strong { font-size: 15px; }
  .sticker-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 10px; }
  .sticker { width: 66px; height: 66px; font-size: 32px; border-radius: 18px; }
  .sticker-pop { left: 12px; right: 12px; transform: translateY(140%); }
  .sticker-pop.is-visible { transform: none; }
}
@media (max-width: 420px) { .listen-speed { display: none; } }
