/* Hence: one stylesheet, three visual systems.
   .t-hence  = brand pages (index, episode sources, legal, 404); follows prefers-color-scheme
   .t-paper  = Hence Paper, always light (warm paper, serif, red pen, handwriting)
   .t-night  = Hence Night, always dark (near-black, mono, mint glow)                      */

@font-face { font-family: "IBM Plex Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/plex-serif-400.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url(/assets/fonts/plex-serif-400i.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Serif"; font-style: normal; font-weight: 600; font-display: swap; src: url(/assets/fonts/plex-serif-600.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 100 700; font-display: swap; src: url(/assets/fonts/plex-sans-var.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/plex-mono-400.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/fonts/plex-mono-500.woff2) format("woff2"); }
@font-face { font-family: "Caveat"; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/fonts/caveat-500.woff2) format("woff2"); }

:root {
  --serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --hand: "Caveat", "Bradley Hand", "Segoe Print", cursive;
  --gutter: 16px;
  --measure: 40rem;

  /* fixed channel palettes (used on cards everywhere and on the channel pages) */
  --paper-bg: #f3ebdc; --paper-fg: #221e18; --paper-muted: #5f5648; --paper-rule: #d9ccb3; --paper-red: #b3301c;
  --night-bg: #090b0a; --night-panel: #101412; --night-fg: #d6e2db; --night-muted: #8f9d96; --night-rule: #23302a; --night-mint: #5ef0b0;

  /* brand (t-hence) light */
  --bg: #f5f1e8; --fg: #1c1a17; --muted: #5b544a; --rule: #d8cfbf; --accent: #b3301c; --surface: #ece6da;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0c0e0d; --fg: #e3ebe6; --muted: #9aa59f; --rule: #26302b; --accent: #63f0b4; --surface: #141816; }
}
@media (min-width: 640px) { :root { --gutter: 32px; } }
@media (min-width: 1024px) { :root { --gutter: 48px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-size: 1.0625rem; line-height: 1.6; background: var(--bg); color: var(--fg); overflow-wrap: break-word; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
.wrap { width: 100%; max-width: 72rem; margin-inline: auto; padding-inline: var(--gutter); }
.prose { max-width: var(--measure); }
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: var(--gutter); top: 8px; background: var(--bg); color: var(--fg); padding: 6px 10px; z-index: 10; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
mark.ph { background: #ffe066; color: #1a1a1a; padding: 0 0.2em; border-radius: 2px; font-family: var(--mono); font-size: 0.9em; }

/* ---------- top bar + footer (all pages) ---------- */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-weight: 600; font-size: 1.15rem; letter-spacing: 0.01em; }
.brand svg { width: 22px; height: 22px; }
.bar nav { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 0.95rem; }
.bar nav a { text-decoration: none; color: var(--muted); }
.bar nav a:hover, .bar nav a[aria-current="page"] { color: var(--fg); text-decoration: underline; }

.foot { margin-top: 72px; border-top: 1px solid var(--rule); padding-block: 28px 40px; font-size: 0.92rem; color: var(--muted); }
.foot .row { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline; justify-content: space-between; }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.foot a { color: inherit; }
.contact-line { margin: 0; }
.email { font-family: var(--mono); font-size: 0.95em; user-select: all; -webkit-user-select: all; color: var(--fg); }

/* ---------- t-hence: brand index ---------- */
.hero { padding-block: 40px 40px; display: grid; gap: 24px; align-items: start; }
.hero-text { display: grid; gap: 22px; min-width: 0; }
.hero .mark { width: clamp(72px, 18vw, 150px); height: auto; color: var(--accent); }
@media (min-width: 760px) { .hero { grid-template-columns: auto 1fr; gap: 48px; padding-block: 64px 48px; } .hero .mark { margin-top: 10px; } }
.hero h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(2.6rem, 9vw, 4.6rem); letter-spacing: -0.01em; margin: 0; }
.lede { font-family: var(--serif); font-size: clamp(1.15rem, 2.6vw, 1.35rem); line-height: 1.5; max-width: 36rem; margin: 0; }
.disclosure { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0; padding: 10px 14px; border: 1px solid var(--rule); border-radius: 6px; font-size: 0.95rem; max-width: 40rem; }
.disclosure strong { font-family: var(--mono); font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.85rem; color: var(--accent); }

.channels { display: grid; grid-template-columns: 1fr; gap: 20px; margin-block: 16px 8px; }
@media (min-width: 760px) { .channels { grid-template-columns: 1fr 1fr; } }
.channels--one { grid-template-columns: 1fr; max-width: 34rem; }
.card { position: relative; display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 28px 24px 24px; border-radius: 10px; text-decoration: none; }
.card h3 { margin: 0; font-size: clamp(1.7rem, 4.5vw, 2.2rem); }
.card .tagline { margin: 0; font-size: 1.1rem; }
.card .meta { margin: 0; font-size: 0.95rem; }
.card .go { margin-top: auto; padding-top: 8px; font-size: 0.95rem; font-weight: 600; }
.card a.cover { position: absolute; inset: 0; border-radius: inherit; }
.card a.cover:focus-visible { outline-offset: 4px; }

.card--paper { background: var(--paper-bg); color: var(--paper-fg); border: 1px solid var(--paper-rule);
  background-image: linear-gradient(var(--paper-rule) 1px, transparent 1px); background-size: 100% 32px; background-position: 0 23px; }
.card--paper h3 { font-family: var(--serif); font-weight: 600; }
.card--paper h3 em { font-style: normal; color: var(--paper-red); }
.card--paper .tagline { font-family: var(--serif); font-style: italic; }
.card--paper .hand { font-family: var(--hand); font-size: 1.45rem; line-height: 1; color: var(--paper-red); transform: rotate(-2deg); transform-origin: left; }
.card--paper .meta { color: var(--paper-muted); }
.card--paper .go { color: var(--paper-red); }

.card--night { background: var(--night-bg); color: var(--night-fg); border: 1px solid var(--night-rule); font-family: var(--mono);
  background-image: radial-gradient(circle at 85% 0%, rgba(94,240,176,0.10), transparent 55%); }
.card--night h3 { font-family: var(--mono); font-weight: 500; letter-spacing: -0.02em; }
.card--night h3 em { font-style: normal; color: var(--night-mint); text-shadow: 0 0 14px rgba(94,240,176,0.45); }
.card--night .tagline { font-size: 1rem; }
.card--night .readout { font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--night-mint); }
.card--night .meta { color: var(--night-muted); }
.card--night .go { color: var(--night-mint); }

.section { margin-top: 64px; }
.section > h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(1.4rem, 3.5vw, 1.8rem); }
.kicker { display: block; font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.episode-link { display: block; padding: 20px 22px; border: 1px solid var(--rule); border-radius: 10px; text-decoration: none; background: var(--surface); }
.episode-link .q { display: block; font-family: var(--serif); font-size: 1.3rem; line-height: 1.3; margin-top: 4px; }
.episode-link .s { display: block; color: var(--muted); font-size: 0.95rem; margin-top: 8px; }
.episode-link:hover .q { text-decoration: underline; text-underline-offset: 0.18em; }

/* ---------- document pages (episode sources, legal) ---------- */
.doc { padding-top: 32px; }
.doc h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(2rem, 6vw, 3rem); max-width: 22ch; }
.doc h2 { font-family: var(--serif); font-weight: 600; font-size: 1.45rem; margin-top: 2.2em; }
.doc h3 { font-size: 1.05rem; margin-top: 1.6em; }
.doc address { font-style: normal; }
.doc ul, .doc ol { padding-left: 1.25em; }
.doc li { margin-bottom: 0.35em; }
.doc .updated { color: var(--muted); font-size: 0.95rem; }
.draft { margin: 0 0 28px; padding: 12px 16px; border: 2px dashed #c0392b; border-radius: 8px; background: rgba(192,57,43,0.08); font-weight: 600; max-width: var(--measure); }
.draft span { display: block; font-weight: 400; font-size: 0.92rem; }
.toc { margin: 8px 0 32px; padding: 14px 18px; border: 1px solid var(--rule); border-radius: 8px; max-width: var(--measure); font-size: 0.95rem; }
.toc ol { margin: 6px 0 0; }

.claims { list-style: none; padding: 0; margin: 0; counter-reset: claim; }
.claim { counter-increment: claim; padding: 20px 0; border-top: 1px solid var(--rule); max-width: 48rem; }
.claim:last-child { border-bottom: 1px solid var(--rule); }
.claim blockquote { margin: 0 0 10px; font-family: var(--serif); font-size: 1.2rem; line-height: 1.4; }
.claim blockquote::before { content: counter(claim, decimal-leading-zero) "  "; font-family: var(--mono); font-size: 0.8rem; color: var(--accent); vertical-align: 0.2em; white-space: pre; }
.claim dl { display: grid; grid-template-columns: 1fr; gap: 2px 16px; margin: 0; font-size: 0.97rem; }
@media (min-width: 640px) { .claim dl { grid-template-columns: 8.5rem 1fr; } }
.claim dt { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding-top: 0.3em; }
.claim dd { margin: 0 0 8px; min-width: 0; }
.claim dd a, .doc a { overflow-wrap: anywhere; }
.tag { display: inline-block; font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; padding: 1px 7px; border: 1px solid var(--rule); border-radius: 99px; color: var(--muted); white-space: nowrap; }

/* ---------- 404 ---------- */
.lost { padding-block: 72px 24px; display: grid; gap: 20px; justify-items: start; }
.lost .mark { width: 96px; color: var(--accent); }
.lost h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(2rem, 7vw, 3.2rem); margin: 0; }

/* ---------- platform slots (both channel pages) ---------- */
.platforms { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; max-width: 34rem; }
.platform { display: flex; align-items: baseline; gap: 12px; padding: 12px 0; }
.platform .p-name { flex: none; }
.platform .p-lead { flex: 1 1 auto; min-width: 24px; border-bottom: 1px dotted currentColor; opacity: 0.45; transform: translateY(-0.3em); }
.platform .p-state { flex: none; }

/* ---------- t-paper: Hence Paper channel page ---------- */
.t-paper { --bg: var(--paper-bg); --fg: var(--paper-fg); --muted: var(--paper-muted); --rule: var(--paper-rule); --accent: var(--paper-red); --surface: #ece2cf;
  color-scheme: light; background: var(--paper-bg); color: var(--paper-fg);
  background-image: linear-gradient(rgba(120,90,50,0.10) 1px, transparent 1px), linear-gradient(90deg, rgba(179,48,28,0.22) 1px, transparent 1px);
  background-size: 100% 32px, 1px 100%; background-repeat: repeat, no-repeat; background-position: 0 0, max(12px, calc(var(--gutter) - 14px)) 0; }
.t-paper .brand, .t-paper h1, .t-paper h2 { font-family: var(--serif); }
.paper-hero { padding-block: 48px 24px; }
.paper-hero .hand { font-family: var(--hand); font-size: clamp(1.5rem, 4vw, 1.9rem); color: var(--paper-red); margin: 0 0 6px; transform: rotate(-2deg); transform-origin: left; display: inline-block; }
.paper-hero h1 { font-weight: 600; font-size: clamp(2.8rem, 11vw, 5.4rem); letter-spacing: -0.015em; margin: 0; }
.paper-hero h1 em { font-style: normal; color: var(--paper-red); position: relative; white-space: nowrap; }
.paper-hero h1 em::after { content: ""; position: absolute; left: -2%; right: -2%; bottom: 0.04em; height: 0.09em; background: var(--paper-red); border-radius: 99px; transform: rotate(-1.2deg); opacity: 0.85; }
.paper-hero .tagline { font-family: var(--serif); font-style: italic; font-size: clamp(1.25rem, 3.2vw, 1.6rem); margin: 18px 0 0; max-width: 30ch; }
.t-paper .section > h2 { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.t-paper .section > h2 .hand { font-family: var(--hand); font-weight: 500; font-size: 1.35rem; color: var(--paper-red); }
.margin-notes { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; max-width: 40rem; }
.margin-notes li { display: grid; grid-template-columns: 2.2rem 1fr; gap: 12px; align-items: baseline; }
.margin-notes .n { font-family: var(--hand); font-size: 1.6rem; line-height: 1; color: var(--paper-red); }
.t-paper .platform { border-bottom: 1px solid var(--paper-rule); font-family: var(--serif); font-size: 1.15rem; }
.t-paper .platform .p-state.soon { font-family: var(--hand); font-size: 1.45rem; line-height: 1; color: var(--paper-red); transform: rotate(-3deg); }
.t-paper .platform a { color: var(--paper-red); }
.t-paper .disclosure strong { color: var(--paper-red); }
.t-paper .episode-link { background: rgba(255,255,255,0.35); }
.t-paper .foot { border-top-color: var(--paper-rule); }

/* ---------- t-night: Hence Night channel page ---------- */
.t-night { --bg: var(--night-bg); --fg: var(--night-fg); --muted: var(--night-muted); --rule: var(--night-rule); --accent: var(--night-mint); --surface: var(--night-panel);
  color-scheme: dark; background: var(--night-bg); color: var(--night-fg); font-family: var(--mono); font-size: 1rem;
  background-image: radial-gradient(ellipse 60% 40% at 80% -5%, rgba(94,240,176,0.10), transparent 70%),
    linear-gradient(rgba(94,240,176,0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(94,240,176,0.035) 1px, transparent 1px);
  background-size: 100% 100%, 40px 40px, 40px 40px; background-attachment: scroll; }
.t-night .brand { font-family: var(--mono); font-weight: 500; }
.t-night .brand svg { color: var(--night-mint); filter: drop-shadow(0 0 6px rgba(94,240,176,0.6)); }
.night-hero { padding-block: 48px 24px; }
.night-hero .readout { font-size: 0.8rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--night-mint); margin: 0 0 14px; }
.night-hero h1 { font-family: var(--mono); font-weight: 500; font-size: clamp(2.4rem, 10vw, 4.8rem); letter-spacing: -0.04em; margin: 0; line-height: 1.05; }
.night-hero h1 em { font-style: normal; color: var(--night-mint); text-shadow: 0 0 18px rgba(94,240,176,0.55), 0 0 2px rgba(94,240,176,0.8); }
.night-hero .tagline { font-size: clamp(1.05rem, 2.6vw, 1.25rem); margin: 20px 0 0; max-width: 34ch; }
.cursor { display: inline-block; width: 0.55em; height: 1em; background: var(--night-mint); vertical-align: -0.12em; margin-left: 4px; box-shadow: 0 0 10px rgba(94,240,176,0.7); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }
.t-night .section > h2 { font-family: var(--mono); font-weight: 500; font-size: 0.85rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--night-mint); }
.panel { border: 1px solid var(--night-rule); background: rgba(16,20,18,0.85); border-radius: 8px; padding: 18px 20px; max-width: 40rem; }
.stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 12px; max-width: 44rem; }
.stats li { border: 1px solid var(--night-rule); border-radius: 8px; padding: 14px 16px; background: rgba(16,20,18,0.85); min-width: 0; }
.stats .v { display: block; font-size: 1.6rem; font-weight: 500; color: var(--night-mint); text-shadow: 0 0 12px rgba(94,240,176,0.4); }
.stats .k { display: block; font-size: 0.8rem; color: var(--night-muted); margin-top: 4px; }
.t-night .platform { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.08em; }
.t-night .platform .p-state.soon { color: var(--night-muted); }
.t-night .platform .p-state.soon::before { content: "[ "; } .t-night .platform .p-state.soon::after { content: " ]"; }
.t-night .platform a { color: var(--night-mint); }
.t-night .disclosure { font-size: 0.9rem; }
.t-night .episode-link .q { font-family: var(--mono); font-size: 1.1rem; }
.t-night .foot { border-top-color: var(--night-rule); }

@media print { .bar nav, .skip { display: none; } body { background: #fff; color: #000; } }
@media (max-width: 639px) { .t-paper { background-position: 0 0, 6px 0; } }
.colophon { margin: 12px 0 0; }
.brand .mark-svg { width: 22px; height: 22px; }
