/* Leo's Black Book — tokens and layout.
   Palette taken from the brand itself: cover black, cream page edges,
   bookmark pink. Dark is the default; [data-theme="light"] is the open page. */

:root {
  --bg: #0b0a0c;
  --surface: #17151a;
  --surface-2: #221f26;
  --ink: #f1e6c8;
  --muted: #a89f8c;
  --accent: #f0527a;
  --accent-ink: #0b0a0c;
  --field: #f1e6c8;
  --field-ink: #0b0a0c;
  --field-muted: #5c5546;
  --field-accent: #b0264d;
  --paper: #f1e6c8;
  --paper-ink: #141216;
  --paper-rule: #cfc3a3;
  --paper-muted: #5c5546;

  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);

  --margin: clamp(20px, 2.2vw, 32px);
  --gap-section: clamp(120px, 14vw, 220px);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --dur-hover: 220ms;
  --dur-reveal: 800ms;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f1e6c8;
  --surface: #e6d9b8;
  --surface-2: #d9cba8;
  --ink: #0b0a0c;
  --muted: #5c5546;
  --accent: #b0264d;
  --accent-ink: #f1e6c8;
  --field: #0b0a0c;
  --field-ink: #f1e6c8;
  --field-muted: #a89f8c;
  --field-accent: #f0527a;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  font-size: var(--step-body);
  line-height: 1.5;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  transition: background-color 300ms ease, color 300ms ease;
}

img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
p a, li a, td a { text-decoration: underline; text-underline-offset: 0.15em; text-decoration-thickness: 1px; }
p a:hover, li a:hover, td a:hover { color: var(--accent); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--accent-ink); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.03em; line-height: 1.02; text-wrap: balance; }
h2 { font-size: var(--step-head); }
h3 { font-size: var(--step-lead); }
p { margin: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.display {
  font-weight: 700;
  font-stretch: 75%;
  letter-spacing: -0.035em;
  line-height: 0.88;
  font-optical-sizing: auto;
}

/* Frame */
.frame { padding-inline: var(--margin); }
.section { padding-block: var(--gap-section) 0; }
.section-head { margin-bottom: clamp(40px, 5vw, 72px); max-width: 22ch; }

/* Buttons: one shape, square corners */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 26px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 600; font-size: var(--step-body);
  transition: transform var(--dur-hover) var(--ease-out), background-color var(--dur-hover) ease;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn:active { transform: translateY(1px) scale(0.99); }

/* Top bar on the hero */
.topbar {
  position: absolute; inset: 0 0 auto 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--margin);
  color: #f1e6c8;
}
.topbar .brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 600; font-size: 1rem; }
.topbar .brand img { width: 30px; height: 30px; image-rendering: pixelated; }
.topbar nav { display: flex; gap: clamp(16px, 2vw, 30px); align-items: center; font-size: 0.95rem; }
.topbar nav a, .topbar nav button { position: relative; opacity: 1; transition: color var(--dur-hover) ease; }
.topbar nav a:hover, .topbar nav button:hover { color: var(--accent); }
.topbar .lights { font-size: 0.95rem; }
.topbar .lights::before { content: ""; display: inline-block; width: 10px; height: 10px; background: var(--accent); margin-right: 8px; vertical-align: 0; transition: transform var(--dur-hover) var(--ease-out); }
.topbar .lights:hover::before { transform: scale(1.3); }
.menu-toggle { display: none; }

/* Hero: film title at the bottom edge */
.hero {
  position: relative; height: 100svh; min-height: 560px; overflow: hidden;
  color: #f1e6c8;
}
.hero picture, .hero img.hero-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%;
}
.hero img.hero-img { transform-origin: 50% 40%; }
@media (prefers-reduced-motion: no-preference) {
  .hero img.hero-img { animation: hero-settle 2.4s var(--ease-out) both; }
  @keyframes hero-settle { from { transform: scale(1.06); } to { transform: scale(1); } }
}
.hero .scrim {
  position: absolute; left: 0; right: 0; bottom: 0; height: 44%;
  background: linear-gradient(to top, rgba(11,10,12,.96) 0%, rgba(11,10,12,.75) 45%, rgba(11,10,12,0) 100%); /* taste-skill-ignore: neutral scrim under text on a photo */
}
.hero .lede {
  position: absolute; left: var(--margin); bottom: calc(var(--title-h, 12vw) + 56px);
  max-width: 40ch; font-size: 1.125rem; line-height: 1.45;
}
.hero .hero-action {
  position: absolute; right: var(--margin); bottom: calc(var(--title-h, 12vw) + 56px);
}
.hero h1 {
  position: absolute; left: var(--margin); right: var(--margin); bottom: 22px;
  margin: 0; white-space: nowrap; text-align: center;
  font-size: 12vw; line-height: 0.82;
  letter-spacing: -0.035em;
}
.hero h1 .line { display: block; }
.hero .tick { position: absolute; left: var(--margin); bottom: 18px; font-size: var(--step-small); color: #cfc3a3; }

/* List: one item per poster line */
.poster-list { margin: 0; padding: 0; list-style: none; }
.poster-list li { margin: 0; }
.poster-list button {
  width: 100%; display: flex; align-items: baseline; justify-content: space-between; gap: 24px;
  text-align: left; padding: 0;
  font-size: clamp(56px, 9.4vw, 150px); line-height: 0.92;
  transition: color var(--dur-hover) ease, transform 400ms var(--ease-out);
}
.poster-list button:hover, .poster-list button[aria-pressed="true"] { color: var(--accent); }
.poster-list button:hover { transform: translateX(10px); }
.poster-list .count { font-size: clamp(1rem, 1.3vw, 1.25rem); font-weight: 500; font-stretch: 100%; letter-spacing: 0; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; line-height: 1; }
.poster-list button:hover .count, .poster-list button[aria-pressed="true"] .count { color: var(--accent); }
.poster-note { margin-top: 40px; color: var(--muted); max-width: 60ch; }

/* The book (live thing) — a real black book, open to two pages */
.book { margin-top: 56px; }
.book .toolbar { display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: end; justify-content: space-between; margin-bottom: 28px; }
.book .tabs { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 1rem; }
.book .tabs button { padding: 6px 0; color: var(--muted); border-bottom: 2px solid transparent; transition: color var(--dur-hover) ease, border-color var(--dur-hover) ease; }
.book .tabs button:hover { color: var(--ink); }
.book .tabs button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.book .tabs-label { display: block; font-size: var(--step-small); color: var(--muted); margin-bottom: 4px; }
.book .search { display: flex; flex-direction: column; gap: 4px; min-width: min(100%, 280px); }
.book .search input { background: var(--surface); color: var(--ink); border: 1px solid var(--surface-2); padding: 10px 12px; min-height: 44px; font: inherit; font-size: 1rem; width: 100%; }
.book .search input::placeholder { color: var(--muted); }

/* Leather cover, pages, gutter, ribbon */
.spread { perspective: 1800px; }
.cover {
  position: relative;
  padding: clamp(10px, 1.6vw, 22px);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,.06), rgba(255,255,255,0) 60%), /* taste-skill-ignore: the book is a physical object (leather, paper, gutter), inside data-ui */
    repeating-radial-gradient(circle at 30% 20%, rgba(255,255,255,.015) 0 2px, rgba(0,0,0,0) 2px 5px), /* taste-skill-ignore: the book is a physical object (leather, paper, gutter), inside data-ui */
    #121014;
  border-radius: 6px 10px 10px 6px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.8), inset 0 0 0 1px rgba(255,255,255,.05); /* taste-skill-ignore: the book is a physical object (leather, paper, gutter), inside data-ui */
}
.pages { display: grid; grid-template-columns: minmax(0, 1fr) 14px minmax(0, 1fr); }
.page {
  position: relative; color: var(--paper-ink);
  background:
    linear-gradient(90deg, rgba(0,0,0,0) 0, rgba(0,0,0,0) calc(100% - 1px)), /* taste-skill-ignore: the book is a physical object (leather, paper, gutter), inside data-ui */
    repeating-linear-gradient(0deg, rgba(0,0,0,0) 0 1px, rgba(0,0,0,.012) 1px 2px), /* taste-skill-ignore: the book is a physical object (leather, paper, gutter), inside data-ui */
    #efe3c4;
  padding: 22px 22px 18px 22px;
  min-height: 560px;
  display: flex; flex-direction: column;
}
/* paper grain */
.page::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.45  0 0 0 0 0.40  0 0 0 0 0.30  0 0 0 .22 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
/* curl into the gutter */
.page.left { border-radius: 4px 0 0 4px; box-shadow: inset -28px 0 40px -30px rgba(60,40,20,.55); } /* taste-skill-ignore: the book is a physical object (leather, paper, gutter), inside data-ui */
.page.right { border-radius: 0 4px 4px 0; box-shadow: inset 28px 0 40px -30px rgba(60,40,20,.55); } /* taste-skill-ignore: the book is a physical object (leather, paper, gutter), inside data-ui */
.gutter { background: linear-gradient(90deg, #d9cba5, #6b5f47 45%, #4a4030 55%, #d9cba5); } /* taste-skill-ignore: the book is a physical object (leather, paper, gutter), inside data-ui */
/* stacked page edges along the bottom and outer sides */
.page.left::after, .page.right::after {
  content: ""; position: absolute; left: 6px; right: 6px; bottom: -7px; height: 7px; pointer-events: none;
  background: repeating-linear-gradient(0deg, #d6c8a3 0 1px, #efe3c4 1px 2px); /* taste-skill-ignore: page-edge texture, inside data-ui */
  border-radius: 0 0 4px 4px;
}
.ribbon {
  position: absolute; top: -6px; left: 50%; margin-left: -7px; width: 14px; height: 58%;
  background: linear-gradient(90deg, #c23c62, var(--accent) 50%, #b8345a); /* taste-skill-ignore: the book is a physical object (leather, paper, gutter), inside data-ui */
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 90%, 0 100%);
  box-shadow: 0 8px 16px -6px rgba(0,0,0,.7); /* taste-skill-ignore: the book is a physical object (leather, paper, gutter), inside data-ui */
}

/* Page furniture */
.page-head, .page-foot { display: flex; justify-content: space-between; gap: 12px; font-size: var(--step-small); color: var(--paper-muted); letter-spacing: .02em; }
.page-head { padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid #c9a7a1; /* taste-skill-ignore: ruled header line, inside data-ui */ }
.page-head [data-page-title] { font-weight: 600; color: var(--paper-ink); text-transform: uppercase; letter-spacing: .08em; }
.page-foot { margin-top: auto; padding-top: 10px; justify-content: center; }
.page.right .page-foot { justify-content: center; }

/* Ruled lines: one entry per line, handwritten in biro */
.lines { list-style: none; margin: 0; padding: 0; flex: 1 0 auto; }
.lines li {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 0 12px; align-items: baseline;
  min-height: 58px; padding: 9px 0 6px;
  border-bottom: 1px solid #b9c2cf; /* taste-skill-ignore: ruled paper, inside data-ui */
  transition: background-color var(--dur-hover) ease;
}
.lines li:hover, .lines li.hit { background: rgba(240,82,122,.08); }
.lines li.blank { grid-template-columns: 1fr; }
.lines .check { position: relative; top: 4px; width: 18px; height: 18px; border: 1.5px solid #1b2a5e; display: inline-block; }
.lines .check[data-s="confirmed"]::after { content: ""; position: absolute; left: 5px; top: -4px; width: 7px; height: 15px; border: solid #1b2a5e; border-width: 0 2.5px 2.5px 0; transform: rotate(38deg); }
.lines .check[data-s="reported"]::after { content: ""; position: absolute; inset: 3px; background: #1b2a5e; clip-path: polygon(0 0, 100% 0, 0 100%); }
.lines .check[data-s="unverified"] { border-style: dashed; }
.lines .check[data-s="speculative"] { border-style: dotted; border-color: #5c5546; }
.lines .hand { font-family: "Caveat", "Bricolage Grotesque", cursive; font-weight: 600; font-size: 1.45rem; line-height: 1.1; color: #1b2a5e; }
.lines .hand .q { display: block; font-weight: 500; font-size: 1.15rem; color: #3a4a7a; margin-top: 2px; }
.lines .meta { font-size: var(--step-small); color: var(--paper-muted); text-align: right; white-space: nowrap; line-height: 1.3; }
.lines .meta b { display: block; color: var(--paper-ink); font-weight: 600; }
.lines .meta a { color: var(--paper-muted); }
.lines .stamp {
  display: inline-block; margin-top: 2px; padding: 1px 6px; font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: #b1264c; border: 1.5px solid #b1264c; border-radius: 3px; transform: rotate(-4deg); opacity: .85;
}
.lines .empty { grid-column: 1 / -1; font-family: "Caveat", cursive; font-size: 1.35rem; color: #3a4a7a; padding: 20px 0; }


/* Index tabs down the left of the cover */
.spread { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: start; }
.index-tabs { display: flex; flex-direction: column; gap: 6px; padding-top: 48px; }
.index-tabs button {
  position: relative; display: flex; align-items: center; justify-content: center; min-height: 92px; width: 58px; padding: 10px 6px;
  background: #e4d6b4; color: #3a3326; border-radius: 6px 0 0 6px; font-size: .85rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  writing-mode: vertical-rl; transform: rotate(180deg); transition: background-color var(--dur-hover) ease, color var(--dur-hover) ease, transform var(--dur-hover) ease;
  box-shadow: inset -3px 0 6px -4px rgba(0,0,0,.5); /* taste-skill-ignore: tab edge, physical book, inside data-ui */
}
.index-tabs button:nth-child(2) { background: #d8c6a0; }
.index-tabs button:nth-child(3) { background: #cdb98f; }
.index-tabs button:nth-child(4) { background: #c2ac80; }
.index-tabs button:nth-child(5) { background: #b89f72; }
.index-tabs button:hover { color: #000; transform: rotate(180deg) translateX(-3px); }
.index-tabs button[aria-current="true"] { background: var(--accent); color: #fff; width: 62px; margin-left: -4px; }
.cover { border-radius: 0 10px 10px 0; }

/* Page edges you can click */
.phone-only { display: none; }
.page .edge { position: absolute; top: 0; bottom: 0; width: 44px; background: transparent; cursor: pointer; z-index: 2; }
.page .edge-left { left: 0; border-radius: 4px 0 0 4px; }
.page .edge-right { right: 0; border-radius: 0 4px 4px 0; }
.page .edge::after { content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity var(--dur-hover) ease; }
.page .edge-left::after { background: linear-gradient(90deg, rgba(60,40,20,.28), rgba(60,40,20,0)); /* taste-skill-ignore: page-curl cue on hover, inside data-ui */ }
.page .edge-right::after { background: linear-gradient(270deg, rgba(60,40,20,.28), rgba(60,40,20,0)); /* taste-skill-ignore: page-curl cue on hover, inside data-ui */ }
.page .edge:hover::after, .page .edge:focus-visible::after { opacity: 1; }
.page .edge[disabled] { cursor: default; }
.page .edge[disabled]::after { display: none; }
.page .edge::before { content: "‹"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 1.6rem; color: #6b5f47; opacity: 0; transition: opacity var(--dur-hover) ease; }
.page .edge-right::before { content: "›"; }
.page .edge:hover::before, .page .edge:focus-visible::before { opacity: .9; }
.page .edge[disabled]::before { display: none; }

/* Section marks: sparklines, gains, tickers, tags, actions */
.lines .lead { font-size: 1.6rem; }
.lines .hand .tick { font-family: "Bricolage Grotesque", sans-serif; font-size: .95rem; letter-spacing: .06em; font-weight: 700; color: #1b2a5e; vertical-align: 2px; }
.lines .hand-small { font-size: 1.1rem; font-weight: 500; color: #3a4a7a; }
.lines .gain { color: #1f7a3a; }
.lines .loss { color: #b1264c; }
.lines .spark polyline { stroke: #1b2a5e; }
.lines .spark.down polyline { stroke: #b1264c; }
.lines .spark.up polyline { stroke: #1f7a3a; }
.lines .meta .act { display: inline-block; margin-top: 4px; padding: 2px 8px; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #fff; background: #1b2a5e; border-radius: 3px; }
.lines .meta .act:hover { background: var(--accent); }
.lines .ntag { display: inline-block; margin: 4px 2px 0 0; padding: 0 6px; font-size: .7rem; border: 1px solid #c9bda0; border-radius: 10px; color: var(--paper-muted); /* taste-skill-ignore: paper tag, inside data-ui */ }
.lines .where { grid-column: 1 / -1; justify-self: end; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); cursor: pointer; margin-top: -4px; }
.lines .where:hover { text-decoration: underline; }
.lines code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; background: rgba(27,42,94,.08); padding: 0 4px; border-radius: 3px; }
.lines em { font-style: normal; color: #b1264c; }
.book .sync { margin-top: 14px; font-size: var(--step-small); color: var(--muted); }
.book .filters { display: flex; flex-wrap: wrap; gap: 20px 32px; }
.book [hidden] { display: none !important; }

/* Turning */
.pager { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 28px; color: var(--muted); font-size: 1rem; flex-wrap: wrap; }
.pager .turn { background: var(--surface); color: var(--ink); min-height: 48px; padding: 0 20px; font-weight: 600; transition: background-color var(--dur-hover) ease, color var(--dur-hover) ease; }
.pager .turn:hover { background: var(--accent); color: #fff; }
.pager .turn[disabled] { opacity: .35; pointer-events: none; }
.book .legend { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 24px; font-size: var(--step-small); color: var(--muted); }
.book .legend span { display: inline-flex; align-items: center; gap: 8px; }
.book .legend .check { position: relative; display: inline-block; width: 16px; height: 16px; border: 1.5px solid var(--ink); }
.book .legend .check[data-s="confirmed"]::after { content: ""; position: absolute; left: 4px; top: -2px; width: 5px; height: 11px; border: solid var(--ink); border-width: 0 2px 2px 0; transform: rotate(38deg); }
.book .legend .check[data-s="reported"]::after { content: ""; position: absolute; inset: 3px; background: var(--ink); clip-path: polygon(0 0, 100% 0, 0 100%); }
.book .legend .check[data-s="unverified"] { border-style: dashed; }
.book .legend .check[data-s="speculative"] { border-style: dotted; border-color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .pages.turning .page { animation: page-turn .45s var(--ease-out); }
  @keyframes page-turn { from { opacity: .4; transform: rotateY(-6deg); } to { opacity: 1; transform: none; } }
}

/* Social strip */
.follow { display: flex; flex-wrap: wrap; gap: 10px 0; align-items: baseline; margin-top: 56px; }
.follow p { margin-right: 28px; color: var(--muted); }
.follow ul { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; margin: 0; padding: 0; font-size: var(--step-lead); font-weight: 600; letter-spacing: -0.02em; }
.follow a { text-decoration: none; transition: color var(--dur-hover) ease; }
.follow a:hover { color: var(--accent); }

/* How it works: run-in column */
.runin { display: grid; grid-template-columns: minmax(0, 30fr) minmax(0, 58fr) minmax(0, 12fr); }
.runin > * { grid-column: 2; }
.runin h2 { margin-bottom: 48px; font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem); }
.stage { margin-bottom: 72px; }
.stage p { font-size: 1.0625rem; line-height: 1.6; color: var(--muted); max-width: 62ch; }
.stage p b { color: var(--ink); font-weight: 600; }
.evidence { margin-top: 20px; }
.evidence img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.evidence figcaption { margin-top: 10px; font-size: var(--step-small); color: var(--muted); }

/* Interface fragments: Discord-like, own conventions */
.ui { background: #2b2d31; color: #dbdee1; padding: 16px 18px; font-size: 0.95rem; line-height: 1.45; border-radius: 0; }
[data-theme="light"] .ui { background: #2b2d31; }
.ui .ui-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.ui .avatar { width: 32px; height: 32px; border-radius: 50%; background: #5b5565; flex: none; }
.ui .avatar.leo { background: #0b0a0c url("../assets/icon-64.png") center/22px no-repeat; }
.ui .name { font-weight: 600; color: #f2f3f5; }
.ui .name.bot::after { content: "APP"; font-size: 10px; background: #5865f2; color: #fff; padding: 1px 5px; border-radius: 3px; margin-left: 6px; vertical-align: 1px; }
.ui .time { color: #949ba4; font-size: 0.8rem; margin-left: 6px; }
.ui .tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 0; }
.ui .tag { background: #3f4147; color: #dbdee1; font-size: 0.8rem; padding: 2px 8px; border-radius: 4px; }
.ui .embed { margin-top: 8px; border-left: 4px solid #f0527a; background: #1e1f22; padding: 10px 12px; }
.ui .embed-title { font-weight: 600; color: #f2f3f5; }
.ui .embed dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 8px 0 0; }
.ui .embed dt { color: #949ba4; }
.ui .embed dd { margin: 0; color: #dbdee1; }
.ui .wire { list-style: none; margin: 0; padding: 0; }
.ui .wire li { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 14px; padding: 8px 0; border-bottom: 1px solid #3f4147; align-items: baseline; } /* taste-skill-ignore: inside data-ui fragment */
.ui .wire li:last-child { border-bottom: 0; }
.ui .wire .kind { color: #ff85a6; font-weight: 600; text-transform: capitalize; }
.ui .wire .date { color: #949ba4; font-size: 0.85rem; white-space: nowrap; }
.ui .wire a { color: #dbdee1; }
.ui .wire a:hover { color: #fff; text-decoration: underline; }
.ui .wire .title-line { color: #dbdee1; }
.ui .wire-foot { margin-top: 10px; color: #949ba4; font-size: 0.85rem; }

/* Showcase: square plate, spare text */
.plate { display: grid; grid-template-columns: 1fr 1fr; min-height: 88svh; background: var(--surface); margin-top: var(--gap-section); }
.plate .photo { padding: 40px; display: flex; align-items: center; }
.plate .photo img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.plate .text { padding: 40px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.plate .tabs { display: flex; gap: 24px; flex-wrap: wrap; font-size: 1.125rem; }
.plate .tabs button { color: var(--muted); padding: 4px 0; border-bottom: 2px solid transparent; transition: color var(--dur-hover) ease, border-color var(--dur-hover) ease; }
.plate .tabs button:hover { color: var(--ink); }
.plate .tabs button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.plate .mid h2 { font-size: clamp(2rem, 1.5rem + 1.6vw, 2.5rem); }
.plate .mid p { margin-top: 48px; max-width: 34ch; color: var(--muted); }
.plate .mid .forum-note { margin-top: 20px; max-width: 34ch; }
.plate .cells { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.plate .cell {
  min-height: 72px; display: flex; align-items: center; justify-content: center; text-align: center;
  font-weight: 600; padding: 0 16px; transition: transform var(--dur-hover) var(--ease-out), background-color var(--dur-hover) ease, color var(--dur-hover) ease;
}
.plate .cell.ink { background: var(--ink); color: var(--bg); }
.plate .cell.ink:hover { background: var(--accent); color: var(--accent-ink); }
.plate .cell.tone { background: var(--surface-2); color: var(--ink); }
.plate .cell.tone:hover { background: var(--ink); color: var(--bg); }
.plate .cell:active { transform: translateY(1px); }

/* CTA: the idea again, inverted */
.cta {
  background: var(--field); color: var(--field-ink);
  min-height: 90svh; margin-top: var(--gap-section);
  position: relative; display: grid; grid-template-rows: 1fr auto; padding: clamp(48px, 7vw, 96px) var(--margin) 40px;
}
.cta h2 { font-size: clamp(3rem, 9.5vw, 10rem); line-height: 0.9; max-width: 15ch; letter-spacing: -0.035em; }
.cta .foot { display: grid; grid-template-columns: repeat(12, 1fr); align-items: end; gap: 20px; margin-top: 40px; }
.cta .foot p { grid-column: 1 / 6; font-size: 1.25rem; line-height: 1.4; color: var(--field-muted); }
.cta .foot p b { color: var(--field-ink); font-weight: 600; }
.cta .foot .btn { grid-column: 10 / 13; min-height: 56px; background: var(--field-accent); color: #f1e6c8; justify-self: stretch; }
.cta .foot .btn:hover { background: var(--field-ink); color: var(--field); }

/* Footer: columns above, wordmark below */
.site-footer {
  background: var(--bg); color: var(--ink);
  min-height: 100svh; display: grid; grid-template-rows: auto 1fr auto;
  padding: 40px var(--margin) 20px;
}
.site-footer .cols { display: grid; grid-template-columns: repeat(12, 1fr); gap: 32px 20px; }
.site-footer .col { grid-column: span 3; }
.site-footer .col ul { list-style: none; margin: 0; padding: 0; font-size: 1rem; line-height: 1.7; color: var(--muted); }
.site-footer .col li:first-child { color: var(--ink); font-weight: 600; }
.site-footer .col a { transition: color var(--dur-hover) ease; }
.site-footer .col a:hover { color: var(--accent); }
.site-footer .wordmark { align-self: end; }
.site-footer .wordmark svg { width: 100%; height: auto; display: block; fill: currentColor; }
.site-footer .legal { font-size: var(--step-small); color: var(--muted); margin-top: 20px; display: flex; flex-wrap: wrap; gap: 6px 24px; justify-content: space-between; }

/* Secondary pages */
.page-hero { position: relative; min-height: 72svh; overflow: hidden; color: #f1e6c8; display: grid; align-items: end; }
.page-hero img.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; }
.page-hero .scrim { position: absolute; left: 0; right: 0; bottom: 0; height: 60%; background: linear-gradient(to top, rgba(11,10,12,.98), rgba(11,10,12,0)); /* taste-skill-ignore: neutral scrim under text on a photo */ }
.page-hero .inner { position: relative; padding: 0 var(--margin) 48px; display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: end; }
.page-hero h1 { font-size: clamp(3rem, 9vw, 9rem); line-height: 0.86; letter-spacing: -0.035em; }
.page-hero .inner p { font-size: var(--step-lead); line-height: 1.35; max-width: 30ch; color: #e6dcc0; }

.forums { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.forum { background: var(--surface); padding: clamp(24px, 3vw, 40px); display: flex; flex-direction: column; gap: 16px; min-height: 280px; transition: background-color var(--dur-hover) ease; }
.forum:hover { background: var(--surface-2); }
.forum h3 { font-size: clamp(1.5rem, 1.1rem + 1.5vw, 2.25rem); }
.forum p { color: var(--muted); }
.forum .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.forum .tags span { background: var(--surface-2); color: var(--ink); padding: 4px 10px; font-size: var(--step-small); }
.forum:hover .tags span { background: var(--bg); }
.forum.wide { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.forum.wide .tags { margin-top: 16px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.two-col .lead { font-size: var(--step-lead); line-height: 1.35; }
.rules { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.rules li { padding: 20px 0; border-top: 2px solid var(--surface-2); font-size: 1.0625rem; line-height: 1.55; color: var(--muted); }
.rules li b { color: var(--ink); font-weight: 600; }
.commands { width: 100%; border-collapse: collapse; }
.commands th, .commands td { text-align: left; padding: 12px 14px 12px 0; border-bottom: 1px solid var(--surface-2); /* taste-skill-ignore: real table */ vertical-align: top; font-size: 1rem; }
.commands th { font-weight: 600; font-size: var(--step-small); }
.commands td:first-child { font-weight: 600; white-space: nowrap; }
.commands td:last-child { color: var(--muted); }

/* Entrances */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity var(--dur-reveal) var(--ease-out), transform var(--dur-reveal) var(--ease-out); transition-delay: var(--d, 0ms); }
[data-reveal].in { opacity: 1; transform: none; }
.no-js [data-reveal], .reveal-off [data-reveal] { opacity: 1; transform: none; transition: none; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}

/* Phone */
@media (max-width: 860px) {
  .runin { grid-template-columns: minmax(0, 1fr); }
  .ui .wire li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .ui .wire .kind { font-size: 0.85rem; }
  .ui .embed dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .ui .embed dt { margin-top: 6px; }
  .runin > * { grid-column: 1; }
  .plate { grid-template-columns: 1fr; min-height: 0; }
  .plate .photo { padding: 16px; }
  .plate .text { padding: 16px 16px 24px; gap: 28px; }
  .plate .cells { grid-template-columns: 1fr; }
  .plate .cell { min-height: 60px; }
  .cta { min-height: 80svh; }
  .cta h2 { font-size: 13vw; max-width: 15ch; }
  .cta .foot { grid-template-columns: 1fr; gap: 24px; }
  .cta .foot p { grid-column: 1; font-size: 1.0625rem; }
  .cta .foot .btn { grid-column: 1; }
  .site-footer .col { grid-column: span 6; }
  .two-col, .forums, .forum.wide, .page-hero .inner { grid-template-columns: 1fr; }
  .page-hero .inner { padding-bottom: 32px; }
  .poster-list button { flex-direction: column; align-items: flex-start; gap: 6px; font-size: 14vw; padding-bottom: 22px; }
  .poster-list .count { font-size: 0.95rem; }
  .pages { grid-template-columns: minmax(0, 1fr); }
  .spread { grid-template-columns: minmax(0, 1fr); }
  .index-tabs { flex-direction: row; padding-top: 0; gap: 4px; overflow-x: auto; }
  .index-tabs button { writing-mode: horizontal-tb; transform: none; min-height: 40px; width: auto; flex: 1 0 auto; border-radius: 6px 6px 0 0; padding: 8px 10px; font-size: .75rem; box-shadow: none; } /* taste-skill-ignore: removes the tab edge shadow on phones */
  .index-tabs button:hover { transform: none; }
  .index-tabs button[aria-current="true"] { width: auto; margin-left: 0; }
  .cover { border-radius: 0 0 8px 8px; }
  .page .edge { width: 32px; }
  .phone-only { display: block; }
  .page.right, .gutter { display: none; }
  .page { min-height: 0; padding: 16px 14px 14px; }
  .page.left { border-radius: 4px; box-shadow: none; } /* taste-skill-ignore: the book is a physical object (leather, paper, gutter), inside data-ui */
  .ribbon { display: none; }
  .lines li { grid-template-columns: 24px minmax(0, 1fr); }
  .lines .meta { grid-column: 2; text-align: left; white-space: normal; }
  .lines .hand { font-size: 1.3rem; }
  .hero .lede { bottom: calc(var(--title-h, 40vw) + 20px); max-width: 60vw; font-size: 0.95rem; }
  .hero .hero-action { bottom: auto; top: 72px; right: var(--margin); min-height: 44px; padding: 0 16px; font-size: 0.95rem; }
  .hero h1 { bottom: 16px; text-align: left; font-size: 19vw; white-space: normal; }
  .hero .tick { display: none; }
  .topbar nav { display: none; }
  .topbar nav.open { display: flex; position: absolute; top: 64px; left: var(--margin); right: var(--margin); flex-direction: column; align-items: flex-start; background: #0b0a0c; padding: 20px; gap: 16px; }
  .menu-toggle { display: inline-flex; font-size: 0.95rem; }
  .follow ul { font-size: 1.125rem; }
}
@media (min-width: 861px) {
  .hero h1 .line { display: inline; }
  .hero h1 .line + .line::before { content: " "; }
}

/* The book sits straight under the hero: tighter lead-in so the pages show on the first scroll */
#book { padding-top: clamp(40px, 6vw, 72px); }
#book .section-head { margin-bottom: 14px; }
.book-intro { max-width: 60ch; margin: 0 0 22px; color: var(--muted); font-size: var(--step-small, .95rem); }
/* Compact toolbar: search first, each filter one scrollable line, so the pages start high */
.book .toolbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); gap: 10px 28px; align-items: end; margin-bottom: 18px; }
.book .toolbar .search { grid-column: 2; grid-row: 1; }
.book .filters { grid-column: 1; grid-row: 1; display: grid; gap: 6px; min-width: 0; }
.book .filters > div { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.book .filters .tabs-label { margin: 0; flex: none; width: 92px; }
.book .filters .tabs { flex-wrap: nowrap; overflow-x: auto; gap: 16px; font-size: .95rem; scrollbar-width: none; white-space: nowrap; min-width: 0; }
.book .filters .tabs::-webkit-scrollbar { display: none; }
.book .filters .tabs button { padding: 4px 0; min-height: 32px; }
.book .filters[hidden] + .search, .book .filters[hidden] ~ .search { grid-column: 1 / -1; max-width: 360px; }
@media (max-width: 720px) {
  .book .toolbar { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .book .toolbar .search { grid-column: 1; grid-row: 1; }
  .book .filters { grid-row: 2; }
  .book .filters .tabs-label { width: auto; }
  .book .filters .tabs button { min-height: 40px; }
  .book .search .tabs-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
