/* NineBrains system pages (privacy, terms, support) and the /s/ story page.
   Same paper, ink and type pair as the landing page; hairlines over cards. */
:root {
  --pg: #F7F2E8; --pg-raised: #FFFCF5; --pg-sunken: #EFE8DA; --pg-ink: #231C27; --pg-ink-2: #625764; --pg-dim: #7d6878;
  --pg-line: rgba(35, 28, 39, 0.14); --pg-line-2: rgba(35, 28, 39, 0.26); --pg-shadow: rgba(35, 28, 39, 0.16);
  --accent: #C8401F; --accent-hover: #B13716; --accent-ink: #FFF8EE; --focus: #C8401F;
  --s-body: #E3A32B;
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Source Sans 3", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --gut: clamp(20px, 3.6vw, 48px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) and (max-width: 0px) {
  :root:not([data-theme="light"]) {
    --pg: #120d13; --pg-raised: #1d1620; --pg-sunken: #0c080d; --pg-ink: #F5EEE6; --pg-ink-2: #bcaeb7; --pg-dim: #a8979f;
    --pg-line: rgba(245, 238, 230, 0.13); --pg-line-2: rgba(245, 238, 230, 0.24); --pg-shadow: rgba(0, 0, 0, 0.5);
    --accent: #D2492A; --accent-hover: #DF5A3B; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --pg: #120d13; --pg-raised: #1d1620; --pg-sunken: #0c080d; --pg-ink: #F5EEE6; --pg-ink-2: #bcaeb7; --pg-dim: #a8979f;
  --pg-line: rgba(245, 238, 230, 0.13); --pg-line-2: rgba(245, 238, 230, 0.24); --pg-shadow: rgba(0, 0, 0, 0.5);
  --accent: #D2492A; --accent-hover: #DF5A3B; color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--pg); color: var(--pg-ink); font: 400 17px/1.65 var(--sans); -webkit-font-smoothing: antialiased; padding: 16px 16px 0; overflow-x: hidden; }
@media (min-width: 900px) { body { padding: 24px 24px 0; } }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { text-wrap: balance; margin: 0; font-weight: 400; }
p { margin: 0; }
img { max-width: 100%; }

.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px var(--gut) 0; max-width: 1680px; margin-inline: auto; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.brand svg { width: 26px; height: 26px; display: block; }
.brand span { font: 500 22px/1 var(--display); font-variation-settings: "opsz" 48, "SOFT" 100, "WONK" 1; letter-spacing: -0.01em; }
.top .back { font-size: 15px; color: var(--pg-ink-2); text-decoration: none; }
.top .back:hover { color: var(--pg-ink); }

.pill { display: inline-flex; align-items: center; justify-content: center; gap: 10px; white-space: nowrap; border-radius: 999px; text-decoration: none; font: 600 16px/1 var(--sans); padding: 15px 24px; border: 0; cursor: pointer; transition: transform 0.2s ease, background-color 0.2s ease; }
.pill.solid { background: var(--accent); color: var(--accent-ink); }
.pill.solid:hover { background: var(--accent-hover); transform: translateY(-1px); }
.pill.small { padding: 10px 16px; font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .pill, .pill:hover { transition: none; transform: none; } }

/* ---------------- a legal or support document */
.doc { max-width: 760px; margin: clamp(56px, 8vw, 104px) auto 0; padding-inline: var(--gut); }
.kicker { font: 600 12.5px/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--pg-ink-2); margin-bottom: 18px; }
.doc h1 { font: 400 clamp(40px, 6vw, 64px)/1.02 var(--display); letter-spacing: -0.025em; font-variation-settings: "opsz" 144, "SOFT" 50; }
.doc h1 em { font-style: italic; color: var(--pg-dim); font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1; }
.doc .lede { color: var(--pg-ink-2); font-size: 19px; margin-top: 20px; max-width: 56ch; }
.draft { margin-top: 28px; padding: 14px 0; border-top: 1px solid var(--pg-line-2); border-bottom: 1px solid var(--pg-line-2); font-size: 15px; color: var(--pg-ink); }
.draft b { font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 12.5px; margin-right: 8px; }
.meta { margin-top: 14px; font-size: 14px; color: var(--pg-ink-2); }
.doc h2 { font: 400 28px/1.15 var(--display); letter-spacing: -0.015em; font-variation-settings: "opsz" 72, "SOFT" 50; margin: 52px 0 14px; scroll-margin-top: 20px; }
.doc h3 { font: 600 17px/1.4 var(--sans); margin: 26px 0 6px; }
.doc p + p { margin-top: 12px; }
.doc p, .doc li { color: var(--pg-ink-2); }
.doc strong { color: var(--pg-ink); font-weight: 600; }
.doc ul, .doc ol { padding-left: 1.2em; margin: 10px 0 0; display: grid; gap: 6px; }
.todo { background: color-mix(in srgb, var(--s-body) 26%, transparent); color: var(--pg-ink); padding: 0 4px; border-radius: 3px; font-size: 0.92em; }
.rows { margin: 24px 0 0; border-top: 1px solid var(--pg-line); }
.rows > div { display: grid; grid-template-columns: minmax(0, 12rem) minmax(0, 1fr); gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--pg-line); }
.rows dt { font: 600 16px/1.45 var(--sans); color: var(--pg-ink); }
.rows dd { margin: 0; color: var(--pg-ink-2); font-size: 16px; line-height: 1.55; }
.rows dd + dd { margin-top: 4px; }
.tbl { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 15px; }
.tbl th, .tbl td { text-align: left; vertical-align: top; padding: 12px 14px 12px 0; border-bottom: 1px solid var(--pg-line); }
.tbl th { font: 600 12.5px/1.3 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--pg-ink-2); border-bottom-color: var(--pg-line-2); }
.tbl td { color: var(--pg-ink-2); }
.tbl td:first-child { color: var(--pg-ink); font-weight: 600; }
.tbl-wrap { overflow-x: auto; }
.contact { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.toc { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 15px; }
.toc a { color: var(--pg-ink-2); }
@media (max-width: 560px) {
  .rows > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .tbl thead { display: none; }
  .tbl tr { display: grid; padding: 12px 0; border-bottom: 1px solid var(--pg-line); }
  .tbl td { border: 0; padding: 2px 0; }
}

/* ---------------- footer */
.foot { max-width: calc(1680px - 2 * var(--gut)); margin: clamp(72px, 8vw, 112px) auto 0; padding: 30px 0 44px; border-top: 1px solid var(--pg-line); display: grid; grid-template-columns: auto 1fr; gap: 16px 40px; align-items: center; color: var(--pg-ink-2); font-size: 14px; }
.foot-wrap { padding-inline: var(--gut); }
.foot .brand span { font-size: 20px; }
.foot .brand svg { width: 24px; height: 24px; }
.foot nav { display: flex; gap: 24px; justify-self: end; }
.foot nav a { text-decoration: none; color: var(--pg-ink); }
.foot nav a:hover { text-decoration: underline; }
.foot .fine { grid-column: 1 / -1; display: grid; gap: 4px; font-size: 13px; line-height: 1.5; }
@media (max-width: 640px) { .foot { grid-template-columns: minmax(0, 1fr); } .foot nav { justify-self: start; } }

/* ---------------- /s/<id>: one story */
.story-page { max-width: 1080px; margin: clamp(28px, 5vw, 64px) auto 0; padding-inline: var(--gut); display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: clamp(28px, 6vw, 80px); align-items: start; }
.player { position: relative; aspect-ratio: 9 / 16; width: 100%; border-radius: 22px; overflow: hidden; background: var(--pg-sunken); box-shadow: 0 0 0 1px var(--pg-line), 0 30px 60px -40px var(--pg-shadow); isolation: isolate; }
.player img.poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform-origin: 50% 42%; }
@media (prefers-reduced-motion: no-preference) { .player img.poster { animation: drift 14s ease-in-out infinite alternate; } @keyframes drift { from { transform: scale(1); } to { transform: scale(1.06); } } }
.player .cap { position: absolute; left: 50%; top: 53%; transform: translateX(-50%); white-space: nowrap; font: 800 clamp(18px, 4.6vw, 22px)/1.2 var(--sans); color: #231C27; padding: 3px 12px 5px; border-radius: 10px; background: rgba(255, 252, 245, 0.94); box-shadow: 0 2px 10px rgba(35, 28, 39, 0.16); }
.player .cap b { color: #C8401F; font-weight: 800; }
.player .play { position: absolute; left: 50%; top: 74%; transform: translate(-50%, -50%); width: 72px; height: 72px; border-radius: 50%; border: 0; cursor: pointer; background: rgba(35, 28, 39, 0.82); display: grid; place-items: center; }
.player .play::before { content: ""; border-left: 20px solid #FFF8EE; border-top: 12px solid transparent; border-bottom: 12px solid transparent; margin-left: 6px; }
.player .play:focus-visible { outline: 3px solid #FFF8EE; outline-offset: 3px; }
.player .tag { position: absolute; left: 14px; bottom: 14px; font: 700 12px/1 var(--sans); color: #231C27; background: rgba(255, 252, 245, 0.9); padding: 7px 10px; border-radius: 999px; }
.player .gate { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center; padding: 28px; background: rgba(247, 242, 232, 0.94); color: #231C27; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.player .gate[hidden] { display: none; }
.player.gated .gate { opacity: 1; pointer-events: auto; }
.player .gate p { font: 400 26px/1.15 var(--display); font-variation-settings: "opsz" 72, "SOFT" 50; max-width: 14ch; }
.player .gate span { font-size: 15px; color: #625764; max-width: 28ch; }
.player .gate .pill { background: #C8401F; color: #FFF8EE; }
@media (prefers-reduced-motion: reduce) { .player .gate { transition: none; } }
.s-pill { display: inline-flex; align-items: center; gap: 8px; font: 700 13px/1 var(--sans); padding: 7px 12px 7px 9px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--pg-line-2); }
.s-pill i { width: 12px; height: 12px; border-radius: 50%; background: var(--s-body); }
.s-pill span { color: var(--pg-ink-2); font-weight: 600; }
.story-page h1 { font: 400 clamp(38px, 5vw, 58px)/1.04 var(--display); letter-spacing: -0.025em; font-variation-settings: "opsz" 144, "SOFT" 50; margin: 18px 0 14px; }
.story-page .hook { font-size: 19px; color: var(--pg-ink-2); max-width: 40ch; }
.open { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 10px; }
/* "Soon" pill (Google Play): reads as a pill, behaves as plain text */
.pill.later { cursor: default; color: var(--pg-ink); box-shadow: inset 0 0 0 1px var(--pg-line-2); }
.pill .tag { font: 600 10.5px/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; padding: 5px 7px 4px; border-radius: 999px; background: var(--pg-line); }
@media (max-width: 420px) { .open .pill { flex: 1 1 100%; } }
.aha { margin-top: 48px; border-top: 1px solid var(--pg-line); padding-top: 24px; }
.aha h2 { font: 400 24px/1.2 var(--display); font-variation-settings: "opsz" 48, "SOFT" 50; margin-bottom: 12px; }
.aha ol { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; color: var(--pg-ink-2); }
.aha .src { margin-top: 18px; font-size: 14px; color: var(--pg-ink-2); display: grid; gap: 6px; }
.tx { margin-top: 28px; border-top: 1px solid var(--pg-line); border-bottom: 1px solid var(--pg-line); }
.tx summary { cursor: pointer; padding: 16px 0; font: 600 16px/1.3 var(--sans); list-style: none; }
.tx summary::-webkit-details-marker { display: none; }
.tx summary::after { content: " +"; color: var(--pg-ink-2); }
.tx[open] summary::after { content: " \2212"; }
.tx p { color: var(--pg-ink-2); padding-bottom: 18px; font-size: 16px; }
.next { margin-top: 44px; }
.next h2 { font: 600 12.5px/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--pg-ink-2); margin-bottom: 16px; }
.next ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.next a { text-decoration: none; display: grid; gap: 8px; }
.next img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; box-shadow: 0 0 0 0.75px var(--pg-line-2); }
.next span { font: 400 16px/1.25 var(--display); font-variation-settings: "opsz" 24, "SOFT" 50; }
@media (max-width: 760px) {
  .story-page { grid-template-columns: minmax(0, 1fr); }
  .player { max-width: 420px; margin-inline: auto; }
}
