/* Cliffhanger: an illustrated storybook. Engraved greens, cream paper and a pink ribbon by day; a lamp-lit green night by night. */

:root {
  --paper: #f1e8d0;
  --paper-2: #e7dcbd;
  --card: #f8f2e1;
  --ink: #1f2a1f;
  --ink-2: #44503f;
  --ink-3: #5c6352;
  --line: #cdbf9b;
  --rule: #2f4a33;
  --accent: #2b5233;
  --accent-ink: #f8f2e1;
  --forest: #22432a;
  --forest-ink: #f1e8d0;
  --sage: #8fb27e;
  --mint: #dde8c8;
  --rose: #e8a9ad;
  --rose-ink: #8e3b46;
  --ribbon-ink: #2a1a1d;
  --gilt: #9a7428;
  --focus: #a33a4a;
  --good: #2f6b3a;
  --bad: #a2302b;
  --code: #1d3021;
  --code-ink: #e9e4cc;
  --foot: #22402a;
  --foot-ink: #dfe0c8;
  --shadow: 0 1px 0 rgba(40, 50, 20, .05), 0 14px 30px -20px rgba(30, 50, 25, .45);
  --grain: .07;
  --display: 'IM Fell English', 'Iowan Old Style', Georgia, serif;
  --sc: 'IM Fell English SC', 'IM Fell English', Georgia, serif;
  --serif: 'Libre Caslon Text', Georgia, 'Times New Roman', serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --read-size: 20px;
  --nav-h: 66px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #131a15;
    --paper-2: #18211a;
    --card: #1d271f;
    --ink: #ece4cc;
    --ink-2: #c3bea6;
    --ink-3: #a3a28b;
    --line: #34423a;
    --rule: #7fa36f;
    --accent: #a8cc92;
    --accent-ink: #132015;
    --forest: #2b4f32;
    --forest-ink: #f1e8d0;
    --sage: #6f9a62;
    --mint: #243327;
    --rose: #e8a9ad;
    --rose-ink: #f0a9ae;
    --gilt: #d4b467;
    --focus: #f0a9ae;
    --good: #8fc287;
    --bad: #f08a80;
    --code: #0d140f;
    --code-ink: #e6dfc8;
    --foot: #1a2b1e;
    --foot-ink: #d9dcc4;
    --shadow: 0 1px 0 rgba(0, 0, 0, .25), 0 16px 34px -20px rgba(0, 0, 0, .85);
    --grain: .05;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #131a15;
  --paper-2: #18211a;
  --card: #1d271f;
  --ink: #ece4cc;
  --ink-2: #c3bea6;
  --ink-3: #a3a28b;
  --line: #34423a;
  --rule: #7fa36f;
  --accent: #a8cc92;
  --accent-ink: #132015;
  --forest: #2b4f32;
  --forest-ink: #f1e8d0;
  --sage: #6f9a62;
  --mint: #243327;
  --rose: #e8a9ad;
  --rose-ink: #f0a9ae;
  --gilt: #d4b467;
  --focus: #f0a9ae;
  --good: #8fc287;
  --bad: #f08a80;
  --code: #0d140f;
  --code-ink: #e6dfc8;
  --foot: #1a2b1e;
  --foot-ink: #d9dcc4;
  --shadow: 0 1px 0 rgba(0, 0, 0, .25), 0 16px 34px -20px rgba(0, 0, 0, .85);
  --grain: .05;
  color-scheme: dark;
}

/* ------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; background: var(--paper); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.62 var(--serif);
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  position: relative;
}
/* a faint paper grain over everything, never blocking clicks */
body::before {
  content: ''; position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .25 0 0 0 0 .22 0 0 0 0 .12 0 0 0 1.4 -.35'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.06; margin: 0 0 .4em; letter-spacing: 0; color: var(--ink); }
h2 { font-size: clamp(2.2rem, 4.6vw, 3.1rem); }
h3 { font-size: 1.55rem; }
p { margin: 0 0 1em; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
::selection { background: color-mix(in srgb, var(--rose) 55%, transparent); }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 28px; }
.wrap.narrow { max-width: 840px; }
.faint { color: var(--ink-3); }
.center { text-align: center; }

/* the pink ribbon banner that heads every section */
.kicker {
  display: inline-block;
  font: 400 1.08rem/1 var(--sc);
  letter-spacing: .07em;
  color: var(--ribbon-ink);
  background: var(--rose);
  padding: .48em 1.5em .44em;
  margin: 0 0 1em;
  clip-path: polygon(0 0, 100% 0, calc(100% - .62em) 50%, 100% 100%, 0 100%, .62em 50%);
}
.sub { color: var(--ink-2); max-width: 46em; font-size: 1.05rem; }

/* section titles carry a small engraved flourish */
.block h2::after, .deploy-main > h2::after {
  content: ''; display: block; width: 210px; max-width: 70%; height: 16px; margin-top: .3em;
  background: var(--rule);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 210 16'%3E%3Cpath d='M0 8h80M130 8h80' stroke='%23000' stroke-width='1.4'/%3E%3Cpath d='M105 1l7 7-7 7-7-7z'/%3E%3Ccircle cx='89' cy='8' r='2.4'/%3E%3Ccircle cx='121' cy='8' r='2.4'/%3E%3Cpath d='M0 11.5h60M150 11.5h60' stroke='%23000' stroke-width='.7'/%3E%3C/svg%3E") left center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 210 16'%3E%3Cpath d='M0 8h80M130 8h80' stroke='%23000' stroke-width='1.4'/%3E%3Cpath d='M105 1l7 7-7 7-7-7z'/%3E%3Ccircle cx='89' cy='8' r='2.4'/%3E%3Ccircle cx='121' cy='8' r='2.4'/%3E%3Cpath d='M0 11.5h60M150 11.5h60' stroke='%23000' stroke-width='.7'/%3E%3C/svg%3E") left center / contain no-repeat;
}
.block .vote h2::after { display: none; }

/* ------------------------------------------------------------ framed panels: a double rule with star corners */
.frame, .card, .vote, .step {
  position: relative;
  background: var(--card);
  border: 1.5px solid var(--rule);
  border-radius: 3px;
  box-shadow: inset 0 0 0 5px var(--card), inset 0 0 0 6px color-mix(in srgb, var(--rule) 55%, transparent), var(--shadow);
}
.frame::after, .card::after, .vote::after, .step::after {
  content: ''; position: absolute; inset: -7px; pointer-events: none;
  background: var(--rule);
  --star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M7 0l1.9 5.1L14 7l-5.1 1.9L7 14l-1.9-5.1L0 7l5.1-1.9z'/%3E%3C/svg%3E");
  -webkit-mask: var(--star) 0 0 / 14px no-repeat, var(--star) 100% 0 / 14px no-repeat, var(--star) 0 100% / 14px no-repeat, var(--star) 100% 100% / 14px no-repeat;
  mask: var(--star) 0 0 / 14px no-repeat, var(--star) 100% 0 / 14px no-repeat, var(--star) 0 100% / 14px no-repeat, var(--star) 100% 100% / 14px no-repeat;
}

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  border: 1.5px solid var(--rule);
  border-radius: 4px;
  background: var(--card); color: var(--ink);
  font: 400 1.14rem/1 var(--sc); letter-spacing: .03em;
  text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s, box-shadow .15s;
  white-space: nowrap;
  box-shadow: 0 2px 0 color-mix(in srgb, var(--rule) 35%, transparent);
}
.btn:hover { background: var(--mint); text-decoration: none; }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn.primary {
  background: var(--forest); border-color: var(--forest); color: var(--forest-ink);
  box-shadow: inset 0 0 0 3px var(--forest), inset 0 0 0 4px color-mix(in srgb, var(--forest-ink) 45%, transparent), 0 2px 0 color-mix(in srgb, var(--forest) 60%, #000);
}
.btn.primary:hover { background: color-mix(in srgb, var(--forest) 86%, #000); border-color: color-mix(in srgb, var(--forest) 86%, #000); box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--forest) 86%, #000), inset 0 0 0 4px color-mix(in srgb, var(--forest-ink) 45%, transparent); }
.btn.big { min-height: 54px; padding: 0 28px; font-size: 1.28rem; }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 1.05rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn[hidden] { display: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.pill {
  display: inline-flex; align-items: center; min-height: 30px; padding: 0 14px;
  border: 1.5px solid var(--rule); border-radius: 999px; background: var(--mint);
  font: 400 1rem/1 var(--sc); letter-spacing: .06em; color: var(--ink);
  white-space: nowrap;
}
.pill.small { min-height: 24px; padding: 0 10px; font-size: .92rem; background: var(--rose); border-color: var(--rose); color: var(--ribbon-ink); }
.erc8004-badge {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border: 1.5px solid var(--rule); border-radius: 999px; background: var(--mint); color: var(--ink);
  font: 400 1rem/1 var(--sc); letter-spacing: .05em; text-decoration: none; white-space: nowrap;
}
.erc8004-badge::before { content: '✦'; color: var(--accent); font-size: .8em; }
.erc8004-badge:hover { background: var(--card); text-decoration: none; }

/* ------------------------------------------------------------ top nav */
.topnav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 93%, transparent);
  backdrop-filter: saturate(1.1) blur(10px);
  -webkit-backdrop-filter: saturate(1.1) blur(10px);
  border-bottom: 4px double var(--rule);
}
.topnav .wrap { display: flex; align-items: center; gap: 22px; min-height: var(--nav-h); }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font: 400 1.7rem/1 var(--display); color: var(--ink); text-decoration: none;
  min-height: 44px;
}
.brand:hover { text-decoration: none; }
.navlinks { display: flex; gap: 2px; margin-left: auto; }
.navlinks a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  color: var(--ink-2); text-decoration: none; font: 400 1.16rem/1 var(--sc); letter-spacing: .03em;
}
.navlinks a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rose); text-decoration-thickness: 3px; text-underline-offset: 7px; }
.navlinks:empty { display: none; }
.topnav .navlinks:empty + .btn { margin-left: auto; }

/* ------------------------------------------------------------ hero: the engraved plate, the title page and the book */
.hero { padding: 26px 0 40px; }
.plate { margin: 0; padding: 7px; }
.plate img { width: 100%; height: 270px; object-fit: cover; object-position: 50% 44%; outline: 1px solid color-mix(in srgb, var(--rule) 70%, transparent); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.28fr) minmax(0, .72fr); gap: 56px; align-items: start; margin-top: 34px; }
.hero h1 { font-size: clamp(2.8rem, 5.6vw, 4.5rem); line-height: 1; margin-bottom: .32em; }
.hero h1 em { color: var(--accent); font-style: italic; display: inline-block; }
.lede { font-size: 1.12rem; color: var(--ink-2); max-width: 34em; }
.lede b { color: var(--ink); font-weight: 700; }

.cover {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  width: 100%; max-width: 318px; justify-self: center; margin-top: -96px;
  padding: 24px 24px 22px 32px;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .05) 0 1px, transparent 1px 4px),
    linear-gradient(160deg, #2e5935, #22432a 60%, #1a3520);
  color: #f1e8d0;
  border-radius: 3px 10px 10px 3px;
  box-shadow: inset 8px 0 0 rgba(0, 0, 0, .22), inset 10px 0 0 rgba(255, 255, 255, .05), 0 2px 0 rgba(0, 0, 0, .12), 0 30px 50px -24px rgba(15, 35, 15, .7);
  text-decoration: none;
  transition: transform .25s ease, box-shadow .25s ease;
}
.cover::before {
  content: ''; position: absolute; inset: 11px 11px 11px 19px;
  border: 3px double rgba(232, 214, 160, .55); border-radius: 2px 7px 7px 2px; pointer-events: none;
}
.cover:hover { transform: translateY(-4px) rotate(-.4deg); text-decoration: none; }
.cover:focus-visible { outline-color: var(--focus); }
.cover-ribbon {
  position: absolute; top: -6px; right: 30px; z-index: 2; width: 22px; height: 64px;
  background: linear-gradient(90deg, #d98d93, #eeb2b6 50%, #d98d93);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .25);
}
.cover-art {
  position: relative; width: 100%; height: 168px; object-fit: cover; object-position: 50% 52%;
  margin-top: 8px; border-radius: 120px 120px 3px 3px;
  border: 3px solid #efe4c6; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25);
}
.cover-kicker { font: 400 .98rem/1 var(--sc); letter-spacing: .14em; color: #e8d6a0; margin-top: 18px; }
.cover-title { font: 400 2.3rem/1 var(--display); margin: 10px 0 0; max-width: 9em; text-wrap: balance; }
.cover-orn { color: #eeb2b6; font-size: 1.3rem; line-height: 1; margin: 10px 0 8px; }
.cover-premise { font: italic 400 .86rem/1.5 var(--serif); color: rgba(241, 232, 208, .88); display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.cover-foot { font: 400 .95rem/1 var(--sc); letter-spacing: .1em; color: #e8d6a0; margin-top: 14px; }

/* the stats as a row of round medallions */
.stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px;
  margin-top: 54px; padding-top: 34px; border-top: 4px double var(--rule);
}
.stat { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.stat b {
  display: grid; place-items: center; width: 132px; height: 132px; border-radius: 50%;
  background: var(--forest); color: var(--forest-ink);
  font: 400 1.85rem/1 var(--display); font-variant-numeric: lining-nums; white-space: nowrap;
  box-shadow: inset 0 0 0 6px var(--forest), inset 0 0 0 7.5px color-mix(in srgb, var(--forest-ink) 55%, transparent), 0 0 0 4px var(--paper), 0 0 0 5.5px var(--rule);
}
.stat span { font: 400 1.08rem/1.2 var(--sc); color: var(--ink-2); letter-spacing: .03em; }

/* ------------------------------------------------------------ sections */
.block { padding: 84px 0; }
.block.alt { background: var(--paper-2); border-top: 4px double color-mix(in srgb, var(--rule) 45%, transparent); border-bottom: 4px double color-mix(in srgb, var(--rule) 45%, transparent); }
.card { padding: 26px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-top: 28px; }

.facts { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 14px; }
.facts li { position: relative; padding-left: 28px; color: var(--ink-2); }
.facts li::before { content: '❧'; position: absolute; left: 0; top: -.05em; color: var(--accent); font-size: 1.15em; }
.facts b { color: var(--ink); font-weight: 700; }
.facts.card { margin: 0; padding: 28px 26px; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; margin-top: 34px; }
.step { padding: 30px 26px 30px; text-align: center; }
.step-art {
  width: 156px; height: 156px; border-radius: 50%; margin: 0 auto; object-fit: cover;
  box-shadow: 0 0 0 4px var(--card), 0 0 0 5.5px var(--rule);
}
.step .num {
  position: relative; display: inline-block; margin: -16px 0 14px;
  font: 400 1.15rem/1 var(--sc); letter-spacing: .1em; color: var(--ribbon-ink); background: var(--rose);
  padding: .42em 1.4em .38em;
  clip-path: polygon(0 0, 100% 0, calc(100% - .55em) 50%, 100% 100%, 0 100%, .55em 50%);
}
.step h3 { margin-bottom: .45em; }
.step p { color: var(--ink-2); margin: 0; text-align: left; }

pre {
  margin: 0; padding: 22px 24px; overflow-x: auto;
  background: var(--code); color: var(--code-ink);
  border-radius: 3px; font: 13px/1.65 var(--mono);
  box-shadow: inset 0 0 0 5px var(--code), inset 0 0 0 6px rgba(201, 220, 174, .35), 0 0 0 3px var(--paper-2), 0 0 0 4.5px var(--rule);
}
pre .c { color: #a9c48f; }
pre .host { color: #f0b3b7; }

.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font: 400 1rem/1.2 var(--sc); letter-spacing: .05em; color: var(--ink-3); }
.field input {
  min-height: 44px; padding: 0 14px; border: 1.5px solid color-mix(in srgb, var(--rule) 60%, transparent); border-radius: 4px;
  background: var(--paper); color: var(--ink);
}
.field input:focus-visible { border-color: var(--rule); }
.addr { font: 13px/1.5 var(--mono); word-break: break-all; color: var(--ink); }

/* ------------------------------------------------------------ contents */
.toc { list-style: none; margin: 28px 0 0; padding: 0; border-top: 4px double var(--rule); }
.toc > li { border-bottom: 1px dashed color-mix(in srgb, var(--rule) 55%, transparent); }
.toc > li.faint { padding: 18px 0; }
.toc-row {
  display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 18px; align-items: baseline;
  padding: 18px 10px; color: var(--ink); text-decoration: none; border-radius: 3px;
  transition: background .15s;
}
.toc-row:hover { background: color-mix(in srgb, var(--mint) 70%, transparent); text-decoration: none; }
.toc-n { font: 400 1.75rem/1 var(--display); color: var(--accent); text-align: right; }
.toc-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.toc-title { font: 400 1.6rem/1.12 var(--display); }
.toc-twist { font-style: italic; font-size: .95rem; color: var(--ink-2); }
.toc-meta { font: 400 1.02rem/1.2 var(--sc); color: var(--ink-3); white-space: nowrap; }
.read-mark { color: var(--good); }

/* ------------------------------------------------------------ the vote */
.vote { padding: 34px 34px 30px; }
.vote.is-example { border-style: dashed; }
.vote-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.vote-title, .vote h2 { font-size: clamp(2.2rem, 4.6vw, 3rem); margin-bottom: .15em; }
.vote-sub { color: var(--ink-2); margin: 8px 0 24px; }
.vote .clock {
  display: inline-flex; flex-direction: column; align-items: flex-end; gap: 4px;
  font: 400 1rem/1 var(--sc); letter-spacing: .06em; color: var(--ink-3);
}
.vote .clock b { font: 400 2rem/1 var(--display); letter-spacing: 0; color: var(--accent); font-variant-numeric: tabular-nums lining-nums; }
.twists { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.twist {
  display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 18px;
  padding: 18px 20px 18px 16px; border: 1px solid color-mix(in srgb, var(--rule) 45%, transparent); border-radius: 3px; background: var(--paper);
  transition: border-color .2s;
}
.twist.lead { border-color: var(--rule); box-shadow: inset 0 0 0 1px var(--rule); background: color-mix(in srgb, var(--mint) 55%, var(--paper)); }
.twist.rejected { opacity: .55; }
.letter {
  width: 54px; height: 54px; border-radius: 50%; margin-top: 2px;
  display: grid; place-items: center;
  background: var(--forest); color: var(--forest-ink);
  font: 400 1.65rem/1 var(--sc); padding-bottom: 3px;
  box-shadow: inset 0 0 0 3.5px var(--forest), inset 0 0 0 4.5px color-mix(in srgb, var(--forest-ink) 55%, transparent), 0 0 0 3px var(--paper), 0 0 0 4.5px var(--rule);
}
.twist.lead .letter { box-shadow: inset 0 0 0 3.5px var(--forest), inset 0 0 0 4.5px color-mix(in srgb, var(--forest-ink) 55%, transparent), 0 0 0 3px var(--rose), 0 0 0 4.5px var(--rule); }
.t-text { font: 400 1.38rem/1.3 var(--display); margin: 2px 0 10px; color: var(--ink); }
.t-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: .92rem; color: var(--ink-3); }
.t-meta b { color: var(--ink); font-weight: 700; }
.bar { height: 10px; margin-top: 10px; border: 1px solid color-mix(in srgb, var(--rule) 60%, transparent); border-radius: 1px; background: var(--card); overflow: hidden; }
.bar i { display: block; height: 100%; background: repeating-linear-gradient(-45deg, var(--accent) 0 2px, color-mix(in srgb, var(--accent) 55%, var(--card)) 2px 4px); transition: width .4s ease; }
.twist.lead .bar i { background: repeating-linear-gradient(-45deg, var(--rose-ink) 0 2px, var(--rose) 2px 4px); }
.t-actions { margin-top: 14px; }
.backer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.backer input {
  flex: 1 1 140px; min-width: 0; min-height: 44px; padding: 0 14px;
  border: 1.5px solid color-mix(in srgb, var(--rule) 60%, transparent); border-radius: 4px; background: var(--card); font-variant-numeric: tabular-nums;
}
.chip {
  min-height: 40px; min-width: 52px; padding: 0 12px;
  border: 1.5px solid color-mix(in srgb, var(--rule) 60%, transparent); border-radius: 999px; background: transparent; cursor: pointer; font: 400 1rem/1 var(--sc);
}
.chip:hover { border-color: var(--rule); background: var(--mint); }
.backer .status { flex-basis: 100%; }
.status { margin: 8px 0 0; font-size: .92rem; color: var(--ink-2); min-height: 0; }
.status:empty { display: none; }
.status.err { color: var(--bad); }
.good { color: var(--good); }
.vote-total { margin: 18px 0 0; font-size: .92rem; color: var(--ink-3); }

/* ------------------------------------------------------------ footer: a green hillside */
.site-foot { position: relative; margin-top: 46px; background: var(--foot); color: var(--foot-ink); padding: 44px 0 56px; font-size: .9rem; }
.site-foot::before {
  content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 44px; background: var(--foot);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 44' preserveAspectRatio='none'%3E%3Cpath d='M0 30C40 20 70 14 110 18S180 32 230 26 310 6 360 8 430 24 470 22 560 24 600 30V44H0z'/%3E%3C/svg%3E") bottom / 600px 44px repeat-x;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 44' preserveAspectRatio='none'%3E%3Cpath d='M0 30C40 20 70 14 110 18S180 32 230 26 310 6 360 8 430 24 470 22 560 24 600 30V44H0z'/%3E%3C/svg%3E") bottom / 600px 44px repeat-x;
}
.site-foot p { max-width: 62em; }
.site-foot a { color: #f2b9bd; }
.site-foot :focus-visible { outline-color: #f2b9bd; }
.foot-brand { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--foot-ink); font: 400 1.12rem/1.2 var(--sc); letter-spacing: .03em; }
.foot-brand img { border-radius: 50%; }
.foot-brand a { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; min-width: 40px; }
.site-foot.slim { padding: 30px 0 44px; margin-top: 70px; }

/* ------------------------------------------------------------ the reader */
body.reading { background: var(--paper); }
.readbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: saturate(1.1) blur(10px);
  -webkit-backdrop-filter: saturate(1.1) blur(10px);
  border-bottom: 4px double var(--rule);
}
.readbar-in { display: flex; align-items: center; gap: 10px; max-width: 1160px; margin: 0 auto; padding: 6px 16px; min-height: 58px; }
.brand.small { font-size: 1.4rem; gap: 8px; }
.where {
  flex: 1 1 auto; min-width: 0; text-align: center;
  font: italic 400 1.15rem/1.2 var(--display); color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  border: 0; border-radius: 4px; background: transparent; color: var(--ink); cursor: pointer;
}
.icon-btn:hover { background: var(--mint); }
.icon-btn[aria-expanded="true"] { background: var(--mint); box-shadow: inset 0 0 0 1.5px var(--rule); }
.aa { font: 400 1.4rem/1 var(--display); }
.progress { height: 3px; background: transparent; margin-bottom: -3px; position: relative; top: 4px; }
.progress i { display: block; height: 100%; width: 0; background: var(--rose-ink); transition: width .12s linear; }
.prefs {
  position: absolute; right: max(16px, calc((100vw - 1160px) / 2 + 16px)); top: calc(100% + 10px);
  width: min(330px, calc(100vw - 32px));
  background: var(--card); border: 1.5px solid var(--rule); border-radius: 3px;
  box-shadow: inset 0 0 0 4px var(--card), inset 0 0 0 5px color-mix(in srgb, var(--rule) 55%, transparent), var(--shadow);
  padding: 16px 18px; display: grid; gap: 12px;
}
.prefs[hidden] { display: none; }
.prefs-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font: 400 1.08rem/1.2 var(--sc); color: var(--ink-2); }
.seg { display: inline-flex; border: 1.5px solid color-mix(in srgb, var(--rule) 60%, transparent); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button {
  min-height: 40px; min-width: 52px; padding: 0 12px; border: 0; border-radius: 999px;
  background: transparent; cursor: pointer; font: 400 1.05rem/1 var(--sc);
}
.seg button:hover { background: var(--mint); }
.seg button[aria-pressed="true"] { background: var(--forest); color: var(--forest-ink); }

.page { padding: 0 20px 40px; }
.example-note {
  max-width: 36rem; margin: 24px auto 0; padding: 10px 16px;
  border: 1.5px dashed var(--rose-ink); border-radius: 3px; background: color-mix(in srgb, var(--rose) 18%, transparent);
  font-size: .92rem; color: var(--ink-2); text-align: center;
}
.example-note[hidden] { display: none; }
.chapter { font-size: var(--read-size); max-width: 33.5em; margin: 0 auto; padding-top: 2em; }
/* an engraved headpiece over each chapter, in the manner of an old storybook */
.ch-head::before {
  content: ''; display: block; height: 7em; max-height: 150px; margin: 0 0 1.5em;
  background: url("img/banner.jpg") 50% 46% / cover no-repeat;
  border: 1.5px solid var(--rule); border-radius: 3px;
  box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 5px color-mix(in srgb, var(--rule) 60%, transparent);
}
.ch-head { text-align: center; margin-bottom: 2em; }
.ch-num {
  display: inline-block; font: 400 .9em/1 var(--sc); letter-spacing: .1em; color: var(--ribbon-ink); background: var(--rose);
  padding: .42em 1.5em .38em; margin: 0 0 1em;
  clip-path: polygon(0 0, 100% 0, calc(100% - .6em) 50%, 100% 100%, 0 100%, .6em 50%);
}
.ch-title { font-size: 2.5em; line-height: 1.04; margin: 0 0 .4em; text-wrap: balance; }
.ch-meta { font: 400 .82em/1.3 var(--sc); color: var(--ink-3); margin: 0; letter-spacing: .04em; }
.twist-note {
  margin: 0 auto 2.4em; padding: 1em .5em; max-width: 28em;
  border-top: 4px double color-mix(in srgb, var(--rule) 55%, transparent); border-bottom: 4px double color-mix(in srgb, var(--rule) 55%, transparent);
  text-align: center; font-size: .84em;
}
.tn-label { display: block; font: 400 .98em/1.25 var(--sc); letter-spacing: .05em; color: var(--ink-3); margin-bottom: .5em; }
.twist-note q { display: block; font: italic 400 1.34em/1.35 var(--display); color: var(--ink); quotes: '“' '”'; }
.tn-burn { display: block; margin-top: .6em; font-size: .86em; color: var(--rose-ink); }

.prose { font-family: var(--serif); line-height: 1.78; color: var(--ink); hyphens: manual; overflow-wrap: break-word; }
.prose p { margin: 0; }
.prose p + p { text-indent: 1.5em; }
.prose > p:first-child::first-letter {
  float: left; font-family: var(--display); font-weight: 400; font-style: normal;
  font-size: 4.5em; line-height: .86; padding: .1em .13em .05em; margin: .08em .14em 0 0;
  color: var(--forest-ink); background: var(--forest); border-radius: 2px;
}
.prose > p:first-child::first-line { font-variant-caps: small-caps; letter-spacing: .03em; }
.prose p.scene { text-indent: 0; text-align: center; margin: 1.3em 0; color: var(--rose-ink); font-size: 1.2em; letter-spacing: .4em; }
.prose p.scene + p { text-indent: 0; }
.prose em { font-style: italic; }
.ch-fin { display: flex; align-items: center; justify-content: center; gap: .6em; color: var(--accent); font-size: 1.5em; margin: 1.4em 0 0; }
.ch-fin::before, .ch-fin::after { content: ''; width: 4em; height: 0; border-top: 4px double color-mix(in srgb, var(--rule) 60%, transparent); }

.chapter-end { max-width: 780px; margin: 44px auto 0; }
.end-vote { margin-bottom: 36px; }
.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 10px; }
.pager-link {
  display: flex; flex-direction: column; gap: 6px; min-height: 64px; justify-content: center;
  padding: 14px 20px; border: 1.5px solid var(--rule); border-radius: 3px; background: var(--card);
  box-shadow: inset 0 0 0 4px var(--card), inset 0 0 0 5px color-mix(in srgb, var(--rule) 45%, transparent);
  color: var(--ink); text-decoration: none; transition: background .15s, transform .15s;
}
.pager-link:hover { background: var(--mint); box-shadow: inset 0 0 0 4px var(--mint), inset 0 0 0 5px color-mix(in srgb, var(--rule) 45%, transparent); text-decoration: none; }
.pager-link small { font: 400 1rem/1 var(--sc); letter-spacing: .06em; color: var(--ink-3); }
.pager-link span { font: 400 1.32rem/1.2 var(--display); }
.pager-link.next { text-align: right; grid-column: 2; }

/* ------------------------------------------------------------ deploy page */
.wrap.deploy-main { max-width: 740px; padding-top: 48px; padding-bottom: 64px; }
.deploy-main > h2 { margin-bottom: 14px; }
.deploy-main pre { margin-top: 16px; white-space: pre-wrap; word-break: break-all; }
.deploy-main .card h3 { margin-bottom: .2em; }
/* ------------------------------------------------------------ for AI agents, questions */
.agent-facts { max-width: 46em; margin: 4px 0 0; }
.agent-facts code { font: .86em/1.4 var(--mono); color: var(--ink); background: color-mix(in srgb, var(--mint) 70%, transparent); padding: .1em .35em; border-radius: 3px; overflow-wrap: anywhere; }
.agent-facts a { overflow-wrap: anywhere; }
.faq { margin: 28px 0 0; border-top: 4px double var(--rule); }
.faq > div { padding: 22px 0 22px 34px; border-bottom: 1px dashed color-mix(in srgb, var(--rule) 55%, transparent); position: relative; }
.faq > div::before { content: '❦'; position: absolute; left: 2px; top: 22px; color: var(--rose-ink); font-size: 1.25rem; line-height: 1.2; }
.faq dt { font: 400 1.55rem/1.2 var(--display); color: var(--ink); margin: 0 0 .35em; }
.faq dd { margin: 0; color: var(--ink-2); }

.deploy-main .field label { font: 400 .98rem/1.45 var(--serif); letter-spacing: 0; color: var(--ink-2); }
.deploy-main .card + .card { margin-top: 26px; }

/* at night the engraved plates are dimmed a little so they don't glare */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .plate img, :root:not([data-theme="light"]) .ch-head::before, :root:not([data-theme="light"]) .step-art { filter: brightness(.86) saturate(.92); }
}
:root[data-theme="dark"] .plate img, :root[data-theme="dark"] .ch-head::before, :root[data-theme="dark"] .step-art { filter: brightness(.86) saturate(.92); }

/* ------------------------------------------------------------ responsive */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .cover { max-width: 300px; margin-top: 0; }
  .steps, .grid2 { grid-template-columns: 1fr; }
  .steps { max-width: 520px; }
  .plate img { height: 230px; }
}
@media (max-width: 640px) {
  :root { --nav-h: 108px; --read-size: 18px; }
  body { font-size: 16.5px; }
  .wrap { padding: 0 16px; }
  .topnav .wrap { flex-wrap: wrap; gap: 0 12px; min-height: 0; padding-top: 6px; }
  .topnav .btn { margin-left: auto; }
  .navlinks { order: 3; width: 100%; margin: 0 -8px; justify-content: space-between; border-top: 1px solid color-mix(in srgb, var(--rule) 35%, transparent); }
  .navlinks a { padding: 0 8px; }
  .brand { font-size: 1.5rem; }
  .hero { padding: 16px 0 28px; }
  .plate { padding: 5px; }
  .plate img { height: 170px; object-position: 62% 40%; }
  .hero-grid { margin-top: 24px; }
  .hero h1 { font-size: 2.75rem; }
  .lede { font-size: 1.05rem; }
  .actions .btn.big { flex: 1 1 100%; }
  .cover { max-width: 280px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 12px; margin-top: 44px; padding-top: 28px; }
  .stat b { width: 112px; height: 112px; font-size: 1.6rem; }
  .stat span { font-size: 1rem; }
  .block { padding: 60px 0; }
  .kicker { font-size: 1rem; }
  .card, .facts.card { padding: 20px 18px; }
  .vote { padding: 24px 16px 22px; }
  .vote .clock { align-items: flex-start; }
  .twist { grid-template-columns: 42px minmax(0, 1fr); gap: 12px; padding: 14px 12px; }
  .letter { width: 42px; height: 42px; font-size: 1.35rem; }
  .t-text { font-size: 1.24rem; }
  .t-actions .btn { width: 100%; }
  .backer .btn.primary { flex: 1 1 100%; }
  .toc-row { grid-template-columns: 44px minmax(0, 1fr); gap: 4px 12px; padding: 16px 4px; }
  .toc-meta { grid-column: 2; white-space: normal; }
  .toc-n { font-size: 1.45rem; }
  .toc-title { font-size: 1.42rem; }
  .step { padding: 26px 20px; }
  .step-art { width: 132px; height: 132px; }
  pre { padding: 16px; font-size: 12px; }
  .faq > div { padding-left: 28px; }
  .faq dt { font-size: 1.38rem; }
  .readbar-in { padding: 6px 8px; gap: 4px; }
  .brand.small span { display: none; }
  .brand.small { padding: 0 8px; min-width: 44px; justify-content: center; }
  .readbar .btn.small { padding: 0 12px; }
  .where { font-size: 1.02rem; text-align: left; }
  .page { padding: 0 18px 32px; }
  .chapter { padding-top: 1.4em; }
  .ch-head::before { height: 5.6em; margin-bottom: 1.3em; }
  .ch-title { font-size: 2.1em; }
  .pager { grid-template-columns: 1fr; }
  .pager-link.next { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .cover:hover { transform: none; }
}
