/* shh. — one stylesheet. Tokens first, then type, then layout, then screens. */

@font-face {
  font-family: 'Literata';
  src: url('/fonts/literata-latin-opsz-normal.woff2') format('woff2');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Literata';
  src: url('/fonts/literata-latin-opsz-italic.woff2') format('woff2');
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('/fonts/instrument-serif-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('/fonts/instrument-serif-latin-400-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: #f5f0e8;
  --leaf: #fbf8f2;
  --ink: #1d1a16;
  --ink-soft: #574f45;
  --ink-faint: #7d7366;
  --hairline: rgba(29, 26, 22, 0.12);
  --hairline-strong: rgba(29, 26, 22, 0.22);
  --accent: #6e2233;
  --scrim: rgba(245, 240, 232, 0.86);

  /* Literata reads; Instrument Serif announces. */
  --serif: 'Literata', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --display: 'Instrument Serif', 'Didot', 'Bodoni 72', Georgia, serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;

  --read-size: 1.1875rem;
  --measure: 34em;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='day']) {
    --paper: #13110f;
    --leaf: #1b1815;
    --ink: #eae3d7;
    --ink-soft: #b3aa9c;
    --ink-faint: #877d70;
    --hairline: rgba(234, 227, 215, 0.12);
    --hairline-strong: rgba(234, 227, 215, 0.22);
    --accent: #d08a95;
    --scrim: rgba(19, 17, 15, 0.86);
    color-scheme: dark;
  }
}
:root[data-theme='night'] {
  --paper: #13110f;
  --leaf: #1b1815;
  --ink: #eae3d7;
  --ink-soft: #b3aa9c;
  --ink-faint: #877d70;
  --hairline: rgba(234, 227, 215, 0.12);
  --hairline-strong: rgba(234, 227, 215, 0.22);
  --accent: #d08a95;
  --scrim: rgba(19, 17, 15, 0.86);
  color-scheme: dark;
}

:root[data-size='s'] { --read-size: 1.0625rem; }
:root[data-size='l'] { --read-size: 1.375rem; }
@media (min-width: 48rem) {
  :root { --read-size: 1.25rem; }
  :root[data-size='s'] { --read-size: 1.125rem; }
  :root[data-size='l'] { --read-size: 1.4375rem; }
}

*, *::before, *::after { box-sizing: border-box; }

/* `hidden` always wins over component display rules. */
[hidden] { display: none !important; }

html {
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--read-size);
  line-height: 1.62;
  font-optical-sizing: auto;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; text-decoration-color: var(--hairline-strong); }
a:hover { text-decoration-color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-weight: 400; margin: 0; }

p { margin: 0; }

img, svg { display: block; max-width: 100%; }

/* ------------------------------------------------------------------ primitives */

.wordmark {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.5rem;
  font-weight: 450;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
  line-height: 1;
}
.wordmark span, .wordmark .dot { color: var(--accent); }
.wordmark { display: inline-flex; align-items: center; }
.wordmark .mark { height: 1.45em; width: auto; flex: none; margin-right: 0.2em; }
.wordmark .mark-night { display: none; }
/* At night the mark's lips stay oxblood and the period lifts to a brighter oxblood (docs/DESIGN.md, Mark). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='day']) .wordmark .mark-day { display: none; }
  :root:not([data-theme='day']) .wordmark .mark-night { display: block; }
  :root:not([data-theme='day']) .wordmark .dot { color: #a73a52; }
}
:root[data-theme='night'] .wordmark .mark-day { display: none; }
:root[data-theme='night'] .wordmark .mark-night { display: block; }
:root[data-theme='night'] .wordmark .dot { color: #a73a52; }

.label {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.fine {
  font-family: var(--sans);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.btn,
button.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 3rem;
  padding: 0 1.75rem;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s var(--ease), opacity 0.15s var(--ease);
}
.btn:hover { opacity: 0.88; }
.btn:active { transform: scale(0.985); }

.btn-quiet,
button.btn-quiet {
  appearance: none;
  background: none;
  border: 0;
  padding: 0.75rem 0.25rem;
  min-height: 3rem;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink-soft);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--hairline-strong);
  text-underline-offset: 0.25em;
}
.btn-quiet:hover { color: var(--ink); text-decoration-color: var(--accent); }

input[type='text'],
input[type='email'],
input[type='number'],
input[inputmode='numeric'],
textarea {
  width: 100%;
  appearance: none;
  border: 1px solid var(--hairline-strong);
  border-radius: 0.75rem;
  background: var(--leaf);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.4;
  padding: 0.85rem 1rem;
  transition: border-color 0.15s var(--ease);
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--ink-faint); font-style: italic; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Arrivals: text fades in; nothing slides. */
@keyframes arrive { from { opacity: 0; } to { opacity: 1; } }
.arrive { animation: arrive 0.26s var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ------------------------------------------------------------------ site shell */

.site {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem var(--gutter);
  max-width: 72rem;
  width: 100%;
  margin: 0 auto;
}
.site-head nav a {
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--ink-soft);
  text-decoration: none;
}
.site-head nav a:hover { color: var(--ink); }

.column {
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.site-foot {
  margin-top: auto;
  padding: 3rem var(--gutter) 2.5rem;
  max-width: 72rem;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.site-foot a { color: inherit; text-decoration: none; }
.site-foot a:hover { color: var(--ink); }

/* ------------------------------------------------------------------ landing */

.hero {
  padding-top: clamp(3rem, 11vh, 7.5rem);
  padding-bottom: 2.5rem;
}
.hero h1 {
  font-style: italic;
  font-weight: 380;
  font-size: clamp(2.6rem, 8.5vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.022em;
  margin-bottom: 1.25rem;
}
.hero .lede {
  color: var(--ink-soft);
  font-size: 1.1875rem;
  line-height: 1.55;
  max-width: 28em;
}

.sample {
  margin-top: 1.5rem;
  padding: 2.25rem 0 2.5rem;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.sample-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1.25rem;
}
.sample-page p + p { margin-top: 1em; }
.sample-page p:first-child::first-letter,
.dropcap::first-letter {
  float: left;
  font-size: 3.35em;
  line-height: 0.82;
  padding: 0.07em 0.09em 0 0;
  font-weight: 400;
  color: var(--ink);
}
.sample.is-live .is-waiting { opacity: 0; }
.sample-choices { margin-top: 1.75rem; transition: opacity 0.18s var(--ease); }
.sample-choices.is-leaving { opacity: 0; pointer-events: none; }
.sample .choices li:last-child { border-bottom: 0; }
.sample-after { margin-top: 2rem; display: flex; flex-direction: column; align-items: flex-start; gap: 0.85rem; }

.stories {
  padding: 3.5rem 0 1rem;
}
.stories h2 { margin-bottom: 1.25rem; }
.story-list { list-style: none; margin: 0; padding: 0; }
.story-list li { border-top: 1px solid var(--hairline); }
.story-list li:last-child { border-bottom: 1px solid var(--hairline); }
.story-list a {
  display: block;
  padding: 1.25rem 0;
  text-decoration: none;
}
.story-title { font-size: 1.375rem; font-style: italic; line-height: 1.25; }
.story-logline { color: var(--ink-soft); font-size: 1.0625rem; line-height: 1.5; margin-top: 0.35rem; }
.story-tags { margin-top: 0.55rem; }

.promise {
  padding: 2.5rem 0 0;
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

/* ------------------------------------------------------------------ age gate */

dialog.gate {
  border: 1px solid var(--hairline);
  border-radius: 1.25rem;
  background: var(--leaf);
  color: var(--ink);
  padding: 2.5rem 2rem 2rem;
  width: min(24rem, calc(100vw - 2.5rem));
  text-align: center;
  box-shadow: 0 30px 80px -30px rgba(29, 26, 22, 0.35);
}
dialog.gate::backdrop { background: var(--scrim); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
dialog.gate[open] { animation: arrive 0.24s var(--ease) both; }
.gate-q { font-style: italic; font-size: 1.75rem; line-height: 1.2; margin-bottom: 1.75rem; }
.gate .btn { width: 100%; }
.gate .btn-quiet { margin-top: 0.5rem; }
.gate-no { margin-top: 0.75rem; }

/* ------------------------------------------------------------------ begin */

.begin { padding-top: clamp(2rem, 8vh, 5rem); padding-bottom: 3rem; }
.begin h1 { font-style: italic; font-size: clamp(2rem, 6vw, 2.75rem); line-height: 1.1; margin-bottom: 0.5rem; }
.begin .chosen-logline { color: var(--ink-soft); }
.field { margin: 2.25rem 0 0; border: 0; padding: 0; min-width: 0; }
.field legend { padding: 0; }
.field legend, .field > label { display: block; margin-bottom: 0.85rem; }
/* Choices on the setup page look like the decision rows she meets two taps later. */
.options { display: grid; gap: 0; border-top: 1px solid var(--hairline); }
.option {
  position: relative;
  display: block;
  border-bottom: 1px solid var(--hairline);
  padding: 1rem 0 1rem 1.6rem;
  cursor: pointer;
}
.option input {
  appearance: none;
  position: absolute;
  left: 0;
  top: 1.45rem;
  width: 0.55rem;
  height: 0.55rem;
  margin: 0;
  border-radius: 50%;
  border: 1px solid var(--ink-soft);
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.option input:checked { background: var(--accent); border-color: var(--accent); }
.option input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.option-title { display: block; font-size: 1.125rem; font-style: italic; color: var(--ink-soft); transition: color 0.15s var(--ease); }
.option:has(input:checked) .option-title, .option:hover .option-title { color: var(--ink); }
.begin .field .label, .begin .field legend.label {
  font-family: var(--serif);
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
  font-size: 1.1875rem;
  font-weight: 400;
  color: var(--ink);
}
.option-note { display: block; font-family: var(--sans); font-size: 0.9375rem; color: var(--ink-soft); margin-top: 0.15rem; line-height: 1.45; }
.begin-actions { margin-top: 2.5rem; display: flex; flex-direction: column; align-items: flex-start; gap: 0.85rem; }

/* ------------------------------------------------------------------ reader */

.reader { min-height: 100dvh; padding-bottom: 6rem; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem var(--gutter);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid transparent;
}
.topbar .wordmark { font-size: 1.25rem; justify-self: start; }
.topbar-title { justify-self: center; font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); white-space: nowrap; }
@media (max-width: 47.99rem) { .topbar-name { display: none; } }
.topbar-actions { justify-self: end; display: flex; align-items: center; gap: 0.25rem; }
.topbar-actions button, .aa summary {
  appearance: none;
  background: none;
  border: 0;
  min-height: 2.75rem;
  min-width: 2.75rem;
  padding: 0 0.6rem;
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 0.5rem;
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.aa summary::-webkit-details-marker { display: none; }
.topbar-actions button:hover, .aa summary:hover { color: var(--ink); }
.aa { position: relative; }
.aa-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  width: min(18rem, calc(100vw - 2rem));
  background: var(--leaf);
  border: 1px solid var(--hairline);
  border-radius: 1rem;
  padding: 1.1rem;
  box-shadow: 0 20px 50px -24px rgba(29, 26, 22, 0.35);
  font-family: var(--sans);
  font-size: 0.9375rem;
  animation: arrive 0.18s var(--ease) both;
}
.aa-row + .aa-row { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--hairline); }
.aa-row .label { display: block; margin-bottom: 0.5rem; }
.seg { display: flex; gap: 0.25rem; background: var(--paper); border-radius: 0.6rem; padding: 0.2rem; }
.seg button {
  flex: 1;
  appearance: none;
  border: 0;
  background: none;
  min-height: 2.25rem;
  border-radius: 0.45rem;
  color: var(--ink-soft);
  font: inherit;
  cursor: pointer;
}
.seg button[aria-pressed='true'] { background: var(--leaf); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.aa-heat label { display: flex; align-items: center; gap: 0.5rem; min-height: 2.25rem; cursor: pointer; }
.aa-heat input { accent-color: var(--accent); }
.aa-links a { display: block; padding: 0.4rem 0; color: var(--ink-soft); text-decoration: none; }
.aa-links a:hover { color: var(--ink); }

.story {
  padding-top: clamp(2rem, 7vh, 4.5rem);
}
.chapter + .chapter { margin-top: 4.5rem; }
.chapter-head { text-align: center; margin-bottom: 2.5rem; }
.chapter-num { margin-bottom: 0.6rem; }
.chapter-title { font-style: italic; font-weight: 380; font-size: clamp(1.75rem, 5.5vw, 2.4rem); line-height: 1.12; letter-spacing: -0.012em; }

.story p { hanging-punctuation: first; }
.story .passage p + p, .story > .chapter > p + p { margin-top: 1em; }
.story .passage { margin-top: 1em; }
.story p.move {
  margin: 1.6em 0;
  padding-top: 1.1em;
  position: relative;
  font-style: italic;
  color: var(--ink-soft);
}
.story p.move::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 2.5rem;
  border-top: 1px solid var(--hairline-strong);
}
.sample .move {
  margin: 1.6em 0 1em;
  padding-top: 1.1em;
  position: relative;
  font-style: italic;
  color: var(--ink-soft);
}
.sample .move::before { content: ''; position: absolute; top: 0; left: 0; width: 2.5rem; border-top: 1px solid var(--hairline-strong); }
.sample-page .sample-continuation p + p, .sample-page > p + p { margin-top: 1em; }

.caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  vertical-align: -0.15em;
  margin-left: 0.14em;
  border-radius: 1px;
  background: var(--ink-soft);
  animation: breathe 1.8s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { opacity: 0.15; } 50% { opacity: 0.7; } }

.notice {
  margin: 2em 0;
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--hairline-strong);
  border-radius: 1rem;
  background: var(--leaf);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
}

.controls { margin-top: 2.25rem; min-height: 6rem; }
.controls.is-busy { min-height: 6rem; }

.turn { display: flex; justify-content: center; margin: 1rem 0 0.5rem; }
.btn-page {
  appearance: none;
  border: 1px solid var(--hairline-strong);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  min-height: 3rem;
  padding: 0 1.6rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.125rem;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.btn-page:hover { border-color: var(--ink); background: var(--leaf); }

.prompt {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-soft);
  margin-bottom: 0.4rem;
}
@media (hover: hover) {
  .choice::after { opacity: 0; }
  .choice:hover::after, .choice:focus-visible::after { opacity: 1; }
}
.choices { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hairline); }
.choices li { border-bottom: 1px solid var(--hairline); }
.choice {
  appearance: none;
  width: 100%;
  min-height: 3.25rem;
  text-align: left;
  background: none;
  border: 0;
  padding: 0.9rem 2rem 0.9rem 0;
  font-family: var(--serif);
  font-size: var(--read-size);
  line-height: 1.4;
  color: var(--ink);
  cursor: pointer;
  position: relative;
  transition: color 0.15s var(--ease), padding-left 0.2s var(--ease);
}
.choice::after {
  content: '→';
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--ink-faint);
  transition: color 0.15s var(--ease), right 0.2s var(--ease);
}
.choice:hover { padding-left: 0.35rem; }
.choice:hover::after { color: var(--accent); right: 0; }

.own { margin-top: 0.75rem; text-align: center; }
.own-form { text-align: left; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 0.75rem; margin-top: 0.5rem; }
/* Her words look the way they will be set once sent: italic, soft ink. */
.own-form textarea {
  resize: none;
  min-height: 4.5rem;
  border: 0;
  border-bottom: 1px solid var(--hairline-strong);
  border-radius: 0;
  background: transparent;
  padding: 0.5rem 0;
  font-style: italic;
  color: var(--ink-soft);
  font-size: var(--read-size);
}
.own-form textarea:focus { border-bottom-color: var(--accent); }
.own-form .btn { min-height: 2.5rem; padding: 0 1.25rem; }

.chapter-end, .the-end { text-align: center; padding: 1.5rem 0 1rem; display: flex; flex-direction: column; align-items: center; gap: 0.6rem; }
.ornament { font-size: 1.5rem; color: var(--ink-faint); letter-spacing: 0.3em; margin-bottom: 0.75rem; }
.next-title { font-style: italic; font-size: 1.5rem; margin-bottom: 1rem; }
.the-end-title { font-style: italic; font-size: clamp(2.25rem, 7vw, 3rem); line-height: 1.1; margin-bottom: 0.5rem; }

.newer {
  position: fixed;
  left: 50%;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 6;
  appearance: none;
  border: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ink-soft);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 1.05rem;
  cursor: pointer;
  animation: arrive 0.2s var(--ease) both;
}
.newer[hidden] { display: none; }
.sentinel { height: 1px; }

.decoy { max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: 3rem var(--gutter); font-family: var(--sans); font-size: 1rem; color: var(--ink); }
.decoy h1 { font-family: var(--sans); font-size: 1.25rem; font-weight: 600; margin-bottom: 1rem; }
.decoy ol { padding-left: 1.25rem; line-height: 1.9; color: var(--ink-soft); }
.decoy[hidden], .reader[hidden] { display: none; }

/* ------------------------------------------------------------------ simple pages: door, signin, memory, legal */

.page { padding-top: clamp(2.5rem, 9vh, 6rem); padding-bottom: 3rem; }
.page h1 { font-style: italic; font-weight: 380; font-size: clamp(2rem, 6vw, 2.75rem); line-height: 1.12; letter-spacing: -0.012em; margin-bottom: 1rem; }
.page .lede { color: var(--ink-soft); margin-bottom: 2rem; }
.page form { display: grid; gap: 0.85rem; margin-top: 1.5rem; }
.page form .btn { justify-self: start; }
.page h2 { font-size: 1.25rem; font-style: italic; margin: 2.5rem 0 0.75rem; }
.page p + p { margin-top: 1em; }

.code-input { font-family: var(--sans); font-size: 1.75rem; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }

.memory-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hairline); }
.memory-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.85rem 0; border-bottom: 1px solid var(--hairline); }
.memory-list form { margin: 0; display: block; }
.memory-list button { appearance: none; background: none; border: 0; font-family: var(--sans); font-size: 0.875rem; color: var(--ink-soft); cursor: pointer; text-decoration: underline; text-decoration-color: var(--hairline-strong); text-underline-offset: 0.25em; padding: 0.5rem 0; }
.memory-list button:hover { color: var(--accent); }
.danger { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--hairline); }

.legal p, .legal li { font-size: 1.0625rem; color: var(--ink); }
.legal ul { padding-left: 1.2rem; }


/* ------------------------------------------------------------------ finish (design review) */

.hero h1, .page h1, .gate-q, .the-end-title, .chapter-title, .begin h1, .next-title, .title-page-title { text-wrap: balance; }
.lede, .story p, .sample-page p, .story-logline { text-wrap: pretty; }

.lede.resume { font-size: 1.0625rem; margin-top: 1.5rem; }
.lede.resume a { text-decoration-color: var(--hairline-strong); }

.page h1 em { font-style: normal; }
.page form + .fine { margin-top: 1.25rem; }
.page .back { display: inline-block; margin-bottom: 1.25rem; }
.danger summary { list-style: none; cursor: pointer; }
.danger summary::-webkit-details-marker { display: none; }
.memory-list button { min-height: 2.75rem; padding: 0 0.25rem; }

.decoy .decoy-close { font-size: 0.8125rem; color: var(--ink-faint); text-decoration: none; margin-top: 2rem; }

.recap {
  max-width: 28em;
  margin: -0.25rem auto 1.25rem;
  font-style: italic;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink-soft);
}
.chapter-end .fine { margin-top: -0.5rem; margin-bottom: 0.5rem; }

/* The title page: the moment the book becomes hers. Shown on arrival, then gone, without script. */
.title-page {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: var(--gutter);
  background: var(--paper);
  text-align: center;
  pointer-events: none;
  animation: title-page 2.6s var(--ease) forwards;
}
.title-page-title { font-style: italic; font-weight: 380; font-size: clamp(2.4rem, 9vw, 4rem); line-height: 1.05; letter-spacing: -0.02em; }
.title-page-for { font-style: italic; color: var(--ink-soft); font-size: 1.125rem; }
.title-page > * { animation: arrive 0.9s var(--ease) both; }
.title-page-for { animation-delay: 0.35s; }
@keyframes title-page { 0%, 62% { opacity: 1; visibility: visible; } 100% { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .title-page { display: none; } }

.link-button { appearance: none; background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; text-decoration-color: var(--hairline-strong); text-underline-offset: 0.2em; }
.link-button:hover { text-decoration-color: var(--accent); }
.resend { margin-top: 1rem; }
.form-error { color: var(--accent); }
.gate-no { min-height: 0; }

/* While the next page is being written: three soft dots, then a line in words after a moment. */
.writing { display: flex; align-items: center; gap: 0.85rem; margin: 1.1em 0 0.5em; min-height: 1.6em; color: var(--ink-soft); }
.writing .dots { display: inline-flex; gap: 6px; }
.writing .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-soft); opacity: 0.18; animation: writing-dot 1.35s ease-in-out infinite; }
.writing .dots i:nth-child(2) { animation-delay: 0.18s; }
.writing .dots i:nth-child(3) { animation-delay: 0.36s; }
@keyframes writing-dot { 0%, 80%, 100% { opacity: 0.18; transform: translateY(0); } 40% { opacity: 0.9; transform: translateY(-2px); } }
.writing-hint { font-style: italic; font-size: 0.95em; opacity: 0; transition: opacity 0.7s var(--ease); }
.writing-hint::after { content: '…'; }
.writing.is-slow .writing-hint { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .writing .dots i { animation: none; opacity: 0.5; } }

/* ------------------------------------------------------------------ type: titles in Instrument Serif */

.wordmark,
.hero h1,
.page h1,
.begin h1,
.chapter-title,
.title-page-title,
.the-end-title,
.gate-q,
.next-title,
.story-title {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: -0.005em;
}
.wordmark { font-size: 1.7rem; }
.topbar .wordmark { font-size: 1.45rem; }
.hero h1 { font-size: clamp(3.1rem, 11vw, 5.4rem); line-height: 0.98; }
.page h1, .begin h1 { font-size: clamp(2.4rem, 7.5vw, 3.4rem); line-height: 1.04; }
.chapter-title { font-size: clamp(2.2rem, 7vw, 3rem); line-height: 1.06; }
.title-page-title { font-size: clamp(3rem, 12vw, 5rem); }
.the-end-title { font-size: clamp(2.8rem, 9vw, 3.8rem); }
.gate-q { font-size: 2.15rem; line-height: 1.1; }
.next-title { font-size: 1.85rem; }
.story-title { font-size: 1.7rem; line-height: 1.15; }

/* Clarity: secondary prose is brighter, and setup notes stay in the reading face. */
.hero .lede, .chosen-logline, .story-logline, .lede { color: color-mix(in srgb, var(--ink) 80%, var(--paper)); }
.option-note { font-family: var(--serif); font-size: 1rem; color: color-mix(in srgb, var(--ink) 72%, var(--paper)); }
.option-title { font-size: 1.15rem; }
.writing-quiet { justify-content: center; margin: 1.5rem 0; }

/* Page turns: room below so a new page can always start at the top; a quiet mark between pages. */
.reader { padding-bottom: 4rem; }
.page-break { width: 2.5rem; margin: 2.4em auto 2em; border-top: 1px solid var(--hairline-strong); }
.keep-reading { font-size: 1rem; min-height: 2.75rem; }
.decision + .turn { margin-top: 1.25rem; }
.resume-mark {
  font-family: var(--sans);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
  transition: opacity 1.2s var(--ease);
}
.resume-mark.is-fading { opacity: 0; }

/* ------------------------------------------------------------------ for writers */
.write .how { padding-left: 1.2rem; margin: 0 0 1.25rem; }
.write .how li { margin: 0.6em 0; line-height: 1.55; color: color-mix(in srgb, var(--ink) 85%, var(--paper)); }
.write .honest { margin-bottom: 2rem; }
.write form { gap: 0.6rem; }
.write form .label { margin-top: 0.9rem; }
.write textarea { resize: vertical; }
.optional { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink-faint); margin-left: 0.35rem; }
.write form .btn { margin-top: 1.25rem; }
.consent { display: flex; gap: 0.7rem; align-items: flex-start; margin-top: 1.1rem; font-family: var(--sans); font-size: 0.9375rem; line-height: 1.5; color: var(--ink-soft); cursor: pointer; }
.consent input { margin-top: 0.25rem; accent-color: var(--accent); width: 1.05rem; height: 1.05rem; flex: none; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }
.application { padding: 1rem 0; border-top: 1px solid var(--hairline); }
.application h2 { font-size: 1.25rem; margin: 0 0 0.25rem; }
.page form .btn-quiet { justify-self: start; }

/* /dev/evals: blind A/B reading of narrator eval runs (development only). */
.eval { width: min(100% - 2 * var(--gutter), 76rem); margin-inline: auto; }
.eval h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); }
.eval-context { margin: 0.5rem 0 1.5rem; color: var(--ink-soft); }
.eval-context summary { cursor: pointer; font-family: var(--sans); font-size: 0.85rem; }
.eval-context .eval-prose { margin-top: 0.75rem; max-width: var(--measure); }
.eval-pages { display: grid; gap: 2rem; grid-template-columns: 1fr; margin: 1rem 0 1.5rem; }
@media (min-width: 900px) { .eval-pages { grid-template-columns: 1fr 1fr; } }
.eval-page { border-top: 1px solid var(--hairline-strong); padding-top: 0.75rem; }
.eval-page h2 { font-family: var(--display); font-style: italic; margin: 0 0 0.75rem; }
.eval-prose p { font-size: var(--read-size); line-height: 1.62; }
.eval-prose p + p { margin-top: 0.9em; }
.eval-q { border: 0; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; align-items: center; }
.eval-q legend { font-weight: 500; margin-bottom: 0.4rem; width: 100%; }
.eval-q label { display: inline-flex; gap: 0.4rem; align-items: center; cursor: pointer; }
.eval-runs { list-style: none; padding: 0; display: grid; gap: 0.6rem; }
.eval-table { overflow-x: auto; margin: 1rem 0; }
.eval-table table { border-collapse: collapse; font-family: var(--sans); font-size: 0.85rem; }
.eval-table th, .eval-table td { text-align: left; padding: 0.45rem 0.7rem; border-bottom: 1px solid var(--hairline); white-space: nowrap; }
.eval-table th { color: var(--ink-soft); font-weight: 500; }
