/* ───────────── Stories — palette taken from the sunset photo ─────────────
   golden hour (light): sky-cream paper, shirt-navy ink, sunset accents, field-green details
   dusk (dark):         night-navy paper, cream ink, gold accents, lit-grass details
   Each story can override --accent / --ember / --glow with colours sampled from its cover. */

:root {
  --paper: #f8f2e4;
  --paper-2: #efe5cf;
  --ink: #1c2a42;
  --ink-2: #44506a;
  --ink-3: #5f6a80;
  --line: #e2d6bd;
  --sun: #f2b54a;          /* the sun itself — decorative only */
  --accent: #e8862f;       /* sunset — fills, drop cap, play button */
  --ember: #a84a1a;        /* sunset, deepened so small text is readable */
  --accent-soft: #fbe3b8;  /* highlighter / inline code */
  --grass: #4f6b35;
  --grass-soft: #e3ead2;
  --glow: 232 134 47;      /* sky glow at the top of the page (r g b) */
  --glow-alpha: .16;
  --code-bg: #16213a;
  --code-bar: #1f2c48;
  --code-ink: #e9e3d6;
  --shadow: 0 1px 2px rgb(28 42 66 / .06), 0 10px 32px rgb(28 42 66 / .10);

  --serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --display: 'Fraunces', 'Newsreader', Georgia, serif;
  --script: 'Caveat', 'Segoe Print', cursive;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;

  --measure: 680px;
  --gutter: clamp(18px, 5vw, 32px);
  --text: clamp(1.125rem, 1.03rem + 0.35vw, 1.3rem); /* 18px phone → ~21px laptop */
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #101828; --paper-2: #18233a; --ink: #f3ead8; --ink-2: #c3cad6; --ink-3: #8e99ad; --line: #26324a;
    --sun: #f7c56a; --accent: #f4a352; --ember: #f4a352; --accent-soft: #3a3030; --grass: #9dbb6a; --grass-soft: #22301f;
    --glow-alpha: .14; --code-bg: #0a1120; --code-bar: #131c30;
    --shadow: 0 1px 2px rgb(0 0 0 / .35), 0 10px 32px rgb(0 0 0 / .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #101828; --paper-2: #18233a; --ink: #f3ead8; --ink-2: #c3cad6; --ink-3: #8e99ad; --line: #26324a;
  --sun: #f7c56a; --accent: #f4a352; --ember: #f4a352; --accent-soft: #3a3030; --grass: #9dbb6a; --grass-soft: #22301f;
  --glow-alpha: .14; --code-bg: #0a1120; --code-bar: #131c30;
  --shadow: 0 1px 2px rgb(0 0 0 / .35), 0 10px 32px rgb(0 0 0 / .4);
  color-scheme: dark;
}

/* per-story tint (set on <body> by the build from the cover photo) */
.tinted { --accent: var(--tint-fill); --ember: var(--tint-l); --glow: var(--tint-glow); }
.tinted .to { color: var(--accent); } /* large handwriting can stay vivid */
:root[data-theme="dark"] .tinted { --accent: var(--tint-d); --ember: var(--tint-d); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tinted { --accent: var(--tint-d); --ember: var(--tint-d); }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--paper);
  /* a soft sky glow at the top, like light just above a horizon */
  background-image: radial-gradient(ellipse 130% 55% at 50% -12%, rgb(var(--glow) / var(--glow-alpha)), transparent 72%);
  background-repeat: no-repeat;
  color: var(--ink);
  font: 400 var(--text)/1.72 var(--serif);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .5s ease, color .5s ease;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--ember); text-decoration-color: color-mix(in srgb, var(--ember) 45%, transparent); text-underline-offset: .18em; text-decoration-thickness: 1.5px; transition: color .2s, text-decoration-color .2s; }
a:hover { color: var(--ink); text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent-soft); color: var(--ink); }

/* the horizon: sunset fading into the field */
.horizon {
  height: 2px; border: 0; margin: 0;
  background: linear-gradient(90deg, transparent, var(--accent) 18%, var(--sun) 50%, var(--grass) 82%, transparent);
  opacity: .75;
}

/* ───────────── top bar ───────────── */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px var(--gutter);
  padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid transparent;
  font: 500 .82rem/1 var(--mono);
  letter-spacing: .01em;
  transition: border-color .3s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.crumb { text-decoration: none; color: var(--ink-2); padding: 8px 0; }
.crumb:hover { color: var(--ember); }

/* sunrise / sunset toggle: the sun sinks below the horizon and the moon rises */
.theme {
  border: 1px solid var(--line); background: transparent; color: var(--ink-2);
  width: 42px; height: 42px; border-radius: 50%; cursor: pointer; padding: 0;
  display: grid; place-items: center; transition: border-color .2s, background .2s;
}
.theme:hover { border-color: var(--accent); background: var(--paper-2); }
.theme svg { width: 26px; height: 26px; overflow: visible; }
.theme .sun, .theme .moon { transition: transform .7s cubic-bezier(.5, 0, .2, 1), opacity .5s ease; }
.theme .sun { fill: var(--accent); }
.theme .rays { stroke: var(--accent); stroke-width: 1.4; stroke-linecap: round; }
.theme .moon { fill: var(--sun); transform: translateY(14px); opacity: 0; }
.theme .ground { stroke: var(--grass); stroke-width: 1.6; stroke-linecap: round; }
:root[data-theme="dark"] .theme .sun { transform: translateY(14px); opacity: 0; }
:root[data-theme="dark"] .theme .moon { transform: none; opacity: 1; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .sun { transform: translateY(14px); opacity: 0; }
  :root:not([data-theme="light"]) .theme .moon { transform: none; opacity: 1; }
}

/* ───────────── grid page ───────────── */
.profile {
  max-width: 935px; margin: 0 auto;
  display: flex; gap: clamp(20px, 5vw, 56px); align-items: center;
  padding: clamp(28px, 6vw, 60px) var(--gutter) clamp(26px, 5vw, 46px);
}
.avatar {
  width: clamp(84px, 18vw, 156px); height: clamp(84px, 18vw, 156px);
  border-radius: 50%; object-fit: cover; flex: none;
  /* story ring in the photo's own colours */
  padding: 4px;
  background: conic-gradient(from 210deg, var(--accent), var(--sun), var(--grass), #23334d, var(--accent));
  box-shadow: inset 0 0 0 3px var(--paper);
}
.profile h1 { font: 600 clamp(1.6rem, 1.2rem + 2vw, 2.4rem)/1.1 var(--display); margin: 0; letter-spacing: -.01em; color: var(--ink); }
.hand { font: 700 clamp(1.35rem, 1.15rem + 1vw, 1.75rem)/1.2 var(--script); color: var(--ember); margin: .25em 0 .35em; transform: rotate(-1.2deg); transform-origin: left; }
.intro { margin: 0 0 .6em; color: var(--ink-2); font-size: .95em; line-height: 1.55; max-width: 46ch; }
.count { margin: 0; font: .8rem/1.4 var(--mono); color: var(--ink-3); }
.count strong { color: var(--grass); }
.count a { color: var(--ink-2); }
@media (max-width: 560px) {
  .profile { align-items: flex-start; gap: 18px; }
  .intro { font-size: .9em; }
}

.grid-horizon { max-width: 935px; margin: 0 auto clamp(3px, 1.2vw, 14px); }
.grid {
  list-style: none; margin: 0 auto; padding: 0 var(--gutter);
  max-width: 935px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(3px, 1.2vw, 14px);
}
@media (max-width: 560px) { .grid { padding-left: 0; padding-right: 0; } }
.grid a {
  position: relative; display: block; aspect-ratio: 1; overflow: hidden;
  background: rgb(var(--tile, 200 190 170)); border-radius: clamp(0px, .6vw, 8px);
}
.grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.2, .7, .2, 1), opacity .7s ease, filter .7s ease; }
/* tiles start as their photo's own colour, then the photo fades in */
.js .grid img { opacity: 0; filter: blur(8px); animation: tile-reveal .7s 3s forwards; } /* safety net if JS never runs */
@keyframes tile-reveal { to { opacity: 1; filter: none; } }
.js .grid img.loaded { opacity: 1; filter: none; }
.grid a:hover img { transform: scale(1.045); }
.tile-info {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px;
  padding: 12px; color: #fff;
  background: linear-gradient(to top, rgb(16 24 40 / .78), rgb(16 24 40 / 0) 62%);
  opacity: 0; transition: opacity .25s ease;
}
.tile-info em { font: 700 1.2rem/1 var(--script); font-style: normal; color: #ffd08a; }
.tile-info strong { font: 600 1rem/1.2 var(--display); }
.tile-info small { font: .68rem/1.3 var(--mono); opacity: .85; }
.grid a:hover .tile-info, .grid a:focus-visible .tile-info { opacity: 1; }
@media (hover: none) { .tile-info { display: none; } } /* phones: pure grid, like Instagram */
.is-draft::after { content: 'draft'; position: absolute; top: 8px; left: 8px; font: 600 .65rem/1 var(--mono); background: var(--ember); color: #fff; padding: 4px 6px; border-radius: 4px; }
:root[data-theme="dark"] .is-draft::after { color: #101828; }
.text-thumb {
  display: grid; place-items: center; width: 100%; height: 100%; padding: 12%;
  font: 600 clamp(.8rem, .6rem + 1vw, 1.2rem)/1.25 var(--display); text-align: center;
  background: var(--accent-soft); color: var(--ink);
}
.empty { text-align: center; color: var(--ink-3); font-style: italic; padding: 3em 0; }

/* ───────────── story page ───────────── */
.measure { max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

.hero { max-width: 1100px; margin: clamp(0px, 2vw, 20px) auto 0; padding: 0 clamp(0px, 3vw, 32px); }
.hero img { width: 100%; max-height: min(78vh, 820px); object-fit: cover; border-radius: clamp(0px, 1vw, 14px); box-shadow: var(--shadow); }

.story-head { padding: clamp(28px, 6vw, 56px) 0 clamp(12px, 3vw, 24px); }
.to {
  font: 700 clamp(1.6rem, 1.3rem + 1.4vw, 2.3rem)/1 var(--script); color: var(--ember);
  margin: 0 0 .35em; transform: rotate(-2deg); transform-origin: left bottom;
}
.story-head h1 {
  font: 600 clamp(2.1rem, 1.5rem + 3vw, 3.6rem)/1.06 var(--display);
  letter-spacing: -.02em; margin: 0 0 .4em; text-wrap: balance;
  font-variation-settings: 'SOFT' 50, 'WONK' 1;
}
.meta { margin: 0; font: .78rem/1.4 var(--mono); color: var(--ink-3); display: flex; gap: .6em; flex-wrap: wrap; text-transform: lowercase; }
.draft-badge { display: inline-block; font: 600 .7rem/1 var(--mono); background: var(--ember); color: var(--paper); padding: 5px 8px; border-radius: 4px; margin: 0 0 1.2em; }

.prose { padding-bottom: 1em; }
:where(.prose) :where(p, ul, ol, h2, h3) { margin: 0; }
.prose > * + * { margin-top: 1.15em; }
.prose p { hyphens: auto; -webkit-hyphens: auto; }
.prose > :is(h2, h3) { margin-top: 2em; }
.prose > :is(h2, h3) + * { margin-top: .5em; }
.prose > p:first-child + * { clear: left; } /* a one-line opener never lets the drop cap spill */
.prose > p:first-child::first-letter {
  float: left; font: 600 3.5em/0.8 var(--display); margin: .1em .1em 0 0; color: var(--accent);
}
.prose h2, .prose h3 { font-family: var(--display); line-height: 1.2; letter-spacing: -.01em; text-wrap: balance; }
.prose h2 { font-size: 1.55em; font-weight: 600; }
.prose h3 { font-size: 1.2em; font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose li::marker { color: var(--grass); }
.prose strong { font-weight: 600; }
.prose mark { background: var(--accent-soft); color: inherit; padding: 0 .15em; border-radius: 3px; }

/* --- = a short horizon with the sun sitting on it */
.prose hr { border: 0; height: 2px; width: min(220px, 50%); margin: 2.6em auto; position: relative; overflow: visible;
  background: linear-gradient(90deg, transparent, var(--accent) 25%, var(--grass) 75%, transparent); }
.prose hr::after { content: ''; position: absolute; left: 50%; top: -7px; width: 14px; height: 7px; translate: -50% 0;
  border-radius: 14px 14px 0 0; background: var(--sun); }

/* quotes = pull quotes, set large */
.prose blockquote {
  margin: 1.8em 0; padding: 0 0 0 1.1em;
  border-left: 3px solid var(--accent);
  font: italic 400 1.28em/1.45 var(--serif); color: var(--ink);
  font-synthesis: none; /* the handwritten Hindi font has no italic: keep it upright instead of slanting it */
}
.prose blockquote p + p { margin-top: .6em; }

/* ───────────── quotes, poems & shayari: a diary page taped into the story ─────────────
   Every blockquote in every story. On light cream paper in both themes, ruled like a notebook,
   with a strip of washi tape. The verse in Hindi stays in Kalam; everything else on the page
   (translations, English quotes) is handwritten in Caveat. stories.js adds the motion:
   the page settles in, each line writes itself, and a dated margin note appears. */
.prose blockquote {
  --paper-ink: #1c2a42;
  margin: 2.4em .2em; border: 0; border-radius: 4px; position: relative;
  padding: 1.5em 1.5em 1.3em;
  background-color: #fbf6ea; color: var(--paper-ink);
  background-image: repeating-linear-gradient(to bottom, transparent 0 1.74em, #e6dcc6 1.74em calc(1.74em + 1px));
  box-shadow: 0 1px 2px rgb(0 0 0 / .12), 0 14px 30px -10px rgb(0 0 0 / .35);
  transform: rotate(-.8deg);
}
.prose blockquote:nth-of-type(even) { transform: rotate(.7deg); } /* pages never sit perfectly straight */
.prose blockquote::before { /* washi tape */
  content: ''; position: absolute; top: -12px; left: 50%; width: 90px; height: 24px;
  transform: translateX(-50%) rotate(2deg); border-radius: 2px; opacity: .8;
  background: color-mix(in srgb, var(--accent) 45%, #fff 30%);
}
.prose blockquote p:not(.hi):not(.cite) { font: 500 1.3em/1.32 var(--script); font-style: normal; color: #2c3e66; }
.prose blockquote .hi { color: var(--paper-ink); }
.prose blockquote .cite { color: #5f6a80 !important; }
.prose blockquote .margin-note {
  position: absolute; right: 1.1em; bottom: .55em; display: flex; align-items: center; gap: .3em;
  font: 700 .95em/1 var(--script); color: #a84a1a; transform: rotate(-5deg);
}
.prose blockquote .margin-note svg { width: 1.05em; height: 1.05em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.prose blockquote:has(.margin-note) { padding-bottom: 2.1em; }
.prose blockquote .ln { display: inline-block; }
@media (max-width: 600px) { /* phones: a little more room so verses wrap less */
  .prose blockquote { margin-inline: 0; padding: 1.35em 1.05em 1.2em; }
  .prose blockquote .hi { font-size: .9em; word-spacing: .24em; }
}

/* motion, only once the script has prepared the quote (so without JS everything simply shows).
   Hidden instantly; the timings live on .shown so they only apply on the way in. */
.prose blockquote.diary-q { opacity: 0; transform: translateY(40px) rotate(-6deg); }
.prose blockquote.diary-q::before { opacity: 0; transform: translateX(-50%) rotate(2deg) scale(1.4); }
.prose blockquote.diary-q .ln { clip-path: inset(-25% 100% -25% 0); }
.prose blockquote.diary-q .margin-note, .prose blockquote.diary-q .cite { opacity: 0; }
.prose blockquote.diary-q.shown { opacity: 1; transform: rotate(-.8deg); transition: opacity .9s ease, transform 1.2s cubic-bezier(.2, .8, .25, 1.15); }
.prose blockquote.diary-q.shown:nth-of-type(even) { transform: rotate(.7deg); }
.prose blockquote.diary-q.shown::before { opacity: .8; transform: translateX(-50%) rotate(2deg) scale(1); transition: opacity .4s ease .9s, transform .5s cubic-bezier(.3, 1.4, .5, 1) .9s; }
.prose blockquote.diary-q.shown .ln { clip-path: inset(-25% 0 -25% 0); transition: clip-path var(--dur, 1.2s) cubic-bezier(.45, .05, .55, .95) calc(var(--t) * 1s + .9s); }
.prose blockquote.diary-q.shown .margin-note, .prose blockquote.diary-q.shown .cite { opacity: 1; transition: opacity .8s ease calc(var(--end, 3s) + .9s); }
@media (prefers-reduced-motion: reduce) {
  .prose blockquote.diary-q, .prose blockquote.diary-q::before, .prose blockquote.diary-q .ln,
  .prose blockquote.diary-q .margin-note, .prose blockquote.diary-q .cite { transition: none; }
}
.prose .hi { word-spacing: .32em; line-height: 1.75; } /* Hindi verses: roomier gaps between words */

/* images & local video */
.media { margin: 2em 0; }
.media img, .media video { border-radius: 10px; box-shadow: var(--shadow); width: 100%; }
@media (min-width: 900px) {
  .prose > .media { margin-left: -60px; margin-right: -60px; }
}
.chapter .prose > .media { margin-left: 0; margin-right: 0; } /* frames layout: photos stay inside the text column */
.media figcaption { font: .78rem/1.5 var(--mono); color: var(--ink-3); margin-top: .7em; text-align: center; }

/* inline code: a highlighter mark, not a grey box */
.prose :not(pre) > code {
  font: .82em/1 var(--mono); padding: .15em .4em; border-radius: 5px;
  background: var(--accent-soft); color: var(--ink);
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}

/* code blocks: little navy terminal windows */
.code {
  margin: 2em 0; border-radius: 12px; overflow: hidden;
  background: var(--code-bg); color: var(--code-ink); box-shadow: var(--shadow);
  font-size: .78em;
}
@media (min-width: 900px) { .prose > .code { margin-left: -40px; margin-right: -40px; } }
.code figcaption {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 14px; background: var(--code-bar);
  font: 500 .8rem/1 var(--mono); color: #93a0b8;
}
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: #e8862f; }
.dots i:nth-child(2) { background: #f2b54a; }
.dots i:nth-child(3) { background: #7d984e; }
.code .label { flex: 1; }
.copy {
  font: 500 .72rem/1 var(--mono); color: #93a0b8; background: transparent;
  border: 1px solid #34425f; border-radius: 6px; padding: 6px 9px; cursor: pointer;
}
.copy:hover { color: #fff; border-color: #5a6886; }
.copy.done { color: #b5d48c; border-color: #7d984e; }
.code pre { margin: 0; padding: 16px 18px 18px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.code code { font: 400 1em/1.65 var(--mono); tab-size: 2; }

/* highlight.js tokens — sunset & field on navy */
.hljs-comment, .hljs-quote { color: #77839b; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-built_in { color: #f4a352; }
.hljs-string, .hljs-attr-value, .hljs-regexp, .hljs-addition { color: #b5d48c; }
.hljs-number, .hljs-symbol, .hljs-bullet { color: #f7c56a; }
.hljs-title, .hljs-section, .hljs-function .hljs-title { color: #8fc1ec; }
.hljs-attr, .hljs-attribute, .hljs-variable, .hljs-template-variable, .hljs-type, .hljs-params { color: #e2b8d9; }
.hljs-meta, .hljs-deletion { color: #f28b82; }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 600; }

/* YouTube: light thumbnail until tapped (fast pages, nothing loads from YouTube until play) */
.yt { margin: 2em 0; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #0a1120; box-shadow: var(--shadow); }
.story-head + .yt { margin-top: .4em; }
.yt button { all: unset; cursor: pointer; position: relative; display: block; width: 100%; height: 100%; }
.yt button:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.yt img { width: 100%; height: 100%; object-fit: cover; opacity: .86; transition: opacity .3s, transform .6s; }
.yt button:hover img { opacity: 1; transform: scale(1.02); }
.play {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  width: 74px; height: 74px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 8px rgb(255 255 255 / .18), 0 8px 28px rgb(0 0 0 / .35);
  transition: transform .25s ease, box-shadow .25s ease;
}
.play::after { content: ''; position: absolute; left: 29px; top: 23px; border-style: solid; border-width: 14px 0 14px 22px; border-color: transparent transparent transparent #fff; }
.yt button:hover .play { transform: scale(1.08); box-shadow: 0 0 0 12px rgb(255 255 255 / .22), 0 8px 28px rgb(0 0 0 / .35); }
.yt iframe { width: 100%; height: 100%; border: 0; display: block; }

.sign { font: 700 clamp(1.6rem, 1.3rem + 1vw, 2.1rem)/1 var(--script); color: var(--grass); margin: 1.4em 0 0; transform: rotate(-2deg); }

/* prev / next */
.more {
  max-width: calc(var(--measure) + 2 * var(--gutter)); margin: clamp(48px, 8vw, 80px) auto 0; padding: 0 var(--gutter);
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.more-card {
  display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--ink);
  padding: 10px; border: 1px solid var(--line); border-radius: 12px; transition: border-color .2s, background .2s;
}
.more-card:hover { border-color: var(--accent); background: var(--paper-2); color: var(--ink); }
.more-card.newer { flex-direction: row-reverse; text-align: right; }
.more-card img, .more-card .text-thumb { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; flex: none; font-size: .55rem; padding: 6px; }
.more-card img { padding: 0; background: rgb(var(--tile, 200 190 170)); }
.more-card small { display: block; font: .7rem/1.4 var(--mono); color: var(--ink-3); }
.more-card strong { font: 600 1rem/1.25 var(--display); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 560px) {
  .more { grid-template-columns: 1fr; }
  .more-card.newer { flex-direction: row; text-align: left; }
}

.foot {
  margin-top: clamp(56px, 10vw, 100px); padding: 0 var(--gutter) max(36px, env(safe-area-inset-bottom));
  text-align: center; font: .75rem/1.8 var(--mono); color: var(--ink-3);
}
.foot .horizon { max-width: 935px; margin: 0 auto 26px; }
.foot p { margin: 0; }
.foot a { color: var(--ink-2); }

.lost { padding-top: 12vh; text-align: center; }
.lost .hand { transform: rotate(-2deg); transform-origin: center; }
.lost h1 { font: 600 clamp(2rem, 1.5rem + 3vw, 3.2rem)/1.1 var(--display); margin: .2em 0 .6em; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .grid img { opacity: 1; filter: none; }
}
@media print {
  .topbar, .more, .foot, .yt, .copy { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
}

/* ───────────── reading progress: a thin horizon filling across the top bar ───────────── */
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none; }
.progress i {
  display: block; height: 100%; transform-origin: left; transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, var(--accent), var(--sun), var(--grass));
}

/* ───────────── devanagari & quote citations ───────────── */
:root { --serif: 'Newsreader', 'Kalam', 'Nirmala UI', 'Iowan Old Style', Georgia, serif; }
.prose blockquote .cite { font: 400 .62em/1.4 var(--mono); font-style: normal; color: var(--ink-3); margin-top: .9em; letter-spacing: .01em; }

/* ───────────── layout: frames — the carousel, told while you scroll ───────────── */
.story-frames .story-head { padding-bottom: clamp(20px, 4vw, 40px); }
.frames {
  --stage-top: 70px;
  max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 80px);
  align-items: start;
}
.frames-stage {
  position: sticky; top: var(--stage-top);
  height: calc(100vh - var(--stage-top) - 24px); height: calc(100svh - var(--stage-top) - 24px);
  display: flex; align-items: center; justify-content: center;
}
.stage {
  position: relative; width: 100%;
  aspect-ratio: 3 / 4; max-height: 100%; max-width: calc((100svh - var(--stage-top) - 24px) * .75);
  border-radius: 16px; overflow: hidden; box-shadow: var(--shadow);
  background: rgb(var(--tile, 120 120 120));
}
.stage img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% var(--focus, 50%);
  opacity: 0; transform: scale(1.035);
  transition: opacity 1.4s ease, transform 9s cubic-bezier(.2, .6, .2, 1);
}
.stage img.on { opacity: 1; transform: scale(1); }
.stage img.last { transition-duration: 2.8s, 9s; } /* the slow fade out of the frame */
.frame-dots {
  position: absolute; left: 0; right: 0; bottom: 14px; margin: 0; padding: 0; list-style: none;
  display: flex; justify-content: center; gap: 7px; z-index: 2;
}
.frame-dots a {
  display: block; width: 7px; height: 7px; border-radius: 50%;
  background: rgb(255 255 255 / .55); box-shadow: 0 0 4px rgb(0 0 0 / .35);
  transition: background .3s, transform .3s;
}
.frame-dots a[aria-current="true"] { background: #fff; transform: scale(1.3); }
.frame-dots li { padding: 6px 2px; } /* bigger tap target */
.frame-count {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  font: 500 .72rem/1 var(--mono); color: #fff; background: rgb(16 24 40 / .55);
  padding: 6px 9px; border-radius: 99px; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}

.frames-text { max-width: 620px; }
.chapter { padding: 16vh 0 14vh; min-height: 85vh; scroll-margin-top: var(--stage-top); }
.chapter:first-child { padding-top: 10vh; }
.chapter:last-child { min-height: 100vh; }
.chapter h2 { font: 600 clamp(1.7rem, 1.3rem + 1.6vw, 2.4rem)/1.1 var(--display); letter-spacing: -.015em; margin: .15em 0 .8em; }
.chapter-no { margin: 0; font: 500 .74rem/1 var(--mono); color: var(--ember); text-transform: lowercase; letter-spacing: .04em; }
.chapter .prose > p:first-child::first-letter { float: none; font: inherit; color: inherit; margin: 0; }
.chapter:first-child .prose > p:first-child { font: italic 400 1.35em/1.4 var(--serif); color: var(--ink); }
.chapter .prose blockquote { font-size: 1.12em; }
.frame-inline { display: none; margin: 0 0 1.4em; }
.frame-inline img { border-radius: 12px; box-shadow: var(--shadow); width: 100%; }
.no-js-frames .frame-inline, html:not(.js) .frame-inline { display: block; }
html:not(.js) .frames { display: block; max-width: calc(var(--measure) + 2 * var(--gutter)); }
html:not(.js) .frames-stage { display: none; }

/* photoFit: whole — the photo is never cropped: the frame takes the photo's own shape, and on
   phones a soft blurred copy of the same photo fills the space beside it */
.stage.whole { aspect-ratio: var(--ratio); max-width: calc((100svh - var(--stage-top) - 24px) * var(--ratio-n)); }
.stage.whole img { object-fit: contain; object-position: 50% 50%; }
.stage.whole::before {
  content: ''; position: absolute; inset: -40px;
  background: var(--bg) center / cover no-repeat;
  filter: blur(26px) brightness(.5) saturate(1.15);
}

/* phones & small tablets: the photo pins to the top as a strip, the words scroll beneath it */
@media (max-width: 899px) {
  .frames { --stage-top: 58px; display: block; padding: 0; }
  .frames-stage {
    height: auto; z-index: 5; display: block;
    background: var(--paper);
    padding: 0 0 2px;
  }
  .stage {
    aspect-ratio: auto; max-width: none; height: 42vh; height: 42svh;
    border-radius: 0 0 18px 18px; box-shadow: 0 12px 24px -12px rgb(16 24 40 / .35);
  }
  .stage img { object-position: 50% var(--focus, 74%); } /* photoFocus: in post.md moves this */
  .stage.whole { aspect-ratio: auto; max-width: none; height: 50vh; height: 50svh; }
  .stage.whole img { object-position: 50% 50%; }
  .frames:has(.stage.whole) .chapter { scroll-margin-top: calc(var(--stage-top) + 50svh); }
  .frames-text { max-width: none; padding: 0 var(--gutter); }
  .chapter { padding: 9vh 0 10vh; min-height: 70vh; scroll-margin-top: calc(var(--stage-top) + 42svh); }
  .chapter:first-child { padding-top: 5vh; }
  .chapter:last-child { min-height: 70vh; }
}

/* the ending: three lines, one at a time */
.finale {
  max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: 4vh var(--gutter) 2vh;
  text-align: center;
}
.finale .horizon { max-width: 320px; margin: 0 auto 2.4em; }
.finale p { margin: 0; font: italic 400 clamp(1.4rem, 1.1rem + 1.4vw, 2.1rem)/1.5 var(--serif); }
.finale p:nth-of-type(3) { margin-top: .6em; color: var(--ember); }
.finale .sign { font: 700 clamp(1.6rem, 1.3rem + 1vw, 2.1rem)/1 var(--script); font-style: normal; color: var(--grass); margin-top: 1.4em; display: inline-block; }
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 1.1s ease, transform 1.1s ease; transition-delay: calc(var(--d, 0) * .55s); animation: tile-reveal .6s 6s forwards; }
.js .reveal.seen { opacity: 1; transform: none; }
.js .finale .sign.reveal.seen { transform: rotate(-2deg); }

@media (prefers-reduced-motion: reduce) {
  .stage img { transition: none; transform: none; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ───────────── "before you go: who's reading?" ───────────── */
.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; }
.reader-card {
  max-width: 520px; margin: clamp(40px, 7vw, 72px) auto 0; padding: 0 var(--gutter);
}
.reader-card[hidden] { display: none; }
.rc-form {
  position: relative; padding: clamp(22px, 4vw, 32px); border-radius: 18px;
  background: var(--paper-2); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.rc-form::before { /* a little horizon across the top of the card */
  content: ''; position: absolute; left: 24px; right: 24px; top: -1px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--sun), var(--grass), transparent);
}
.rc-hand { margin: 0; font: 700 1.5rem/1 var(--script); color: var(--ember); transform: rotate(-2deg); transform-origin: left; }
.rc-form h2 { margin: .15em 0 .7em; font: 600 clamp(1.5rem, 1.2rem + 1vw, 1.9rem)/1.1 var(--display); letter-spacing: -.01em; }
.rc-form fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.rc-option {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper);
  font-size: .95em; line-height: 1.35; transition: border-color .2s, background .2s, transform .2s;
}
.rc-option:hover { border-color: var(--accent); }
.rc-option.named span { font: 700 1.3rem/1 var(--script); color: var(--ink); }
.rc-option input { appearance: none; -webkit-appearance: none; flex: none; width: 18px; height: 18px; margin: 0; border-radius: 50%; border: 2px solid var(--ink-3); display: grid; place-items: center; transition: border-color .2s; }
.rc-option input::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); transform: scale(0); transition: transform .2s; }
.rc-option input:checked { border-color: var(--accent); }
.rc-option input:checked::after { transform: scale(1); }
.rc-option:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--paper)); }
.rc-option input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.rc-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.rc-actions { display: flex; align-items: center; gap: 16px; margin-top: 18px; flex-wrap: wrap; }
.rc-send {
  font: 600 .95rem/1 var(--serif); padding: 12px 20px; border-radius: 99px; cursor: pointer;
  border: 0; background: var(--ink); color: var(--paper); transition: opacity .2s, transform .2s;
}
.rc-send:hover:not(:disabled) { transform: translateY(-1px); }
.rc-send:disabled { opacity: .35; cursor: default; }
.rc-skip { font: 500 .78rem/1 var(--mono); background: none; border: 0; color: var(--ink-3); cursor: pointer; padding: 8px 2px; text-decoration: underline; text-underline-offset: 3px; }
.rc-skip:hover { color: var(--ink); }
.rc-status { margin: 12px 0 0; font: .78rem/1.4 var(--mono); color: var(--ember); min-height: 1em; }
.rc-status:empty { display: none; }
.rc-note { margin: 14px 0 0; font: .7rem/1.55 var(--mono); color: var(--ink-3); }
.rc-done { text-align: center; padding: 8px 0; }
.rc-done .rc-hand { transform: rotate(-2deg); transform-origin: center; font-size: 1.9rem; }
.rc-done p:last-child { margin: .6em 0 0; color: var(--ink-2); font-style: italic; }

/* optional "name" + "where did we meet?" under "Someone who knows you" */
.rc-more { display: grid; gap: 6px; padding: 4px 4px 10px 44px; }
.rc-more[hidden] { display: none; }
.rc-more label { font: 500 .74rem/1.3 var(--mono); color: var(--ink-2); margin-top: 6px; }
.rc-more label span { color: var(--ink-3); }
.rc-more input {
  font: 400 1rem/1.3 var(--serif); color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%;
}
.rc-more input::placeholder { color: var(--ink-3); font-style: italic; }
.rc-more input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.rc-done { text-align: center; padding: 10px 0 4px; }
.rc-done .rc-send { margin-top: 18px; }

/* ───────────── the diary dialog ───────────── */
dialog.diary {
  border: 0; padding: 0; background: transparent; color: var(--ink);
  width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto;
  overscroll-behavior: contain;
}
dialog.diary::backdrop {
  background: rgb(16 24 40 / .55);
  backdrop-filter: blur(6px) saturate(.9); -webkit-backdrop-filter: blur(6px) saturate(.9);
}
dialog.diary[open] { animation: diary-in .55s cubic-bezier(.2, .8, .2, 1); }
dialog.diary[open]::backdrop { animation: diary-fade .55s ease; }
dialog.diary.closing { animation: diary-out .35s ease forwards; }
dialog.diary.closing::backdrop { animation: diary-fade .35s ease reverse forwards; }
@keyframes diary-in { from { opacity: 0; transform: translateY(18px) rotate(-.6deg) scale(.98); } }
@keyframes diary-out { to { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes diary-fade { from { opacity: 0; } }

.diary-paper {
  background: var(--paper); border-radius: 18px;
  padding: clamp(24px, 5vw, 38px);
  /* faint ruled lines, like a page in a notebook */
  background-image: repeating-linear-gradient(to bottom, transparent 0 31px, color-mix(in srgb, var(--line) 55%, transparent) 31px 32px);
  background-position: 0 14px;
}
.diary-paper::before { left: 32px; right: 32px; }
.diary-paper h2 { font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.25rem); margin-bottom: .55em; }
.diary-lede { margin: 0 0 .8em; font-size: 1.02rem; line-height: 1.6; color: var(--ink-2); }
.diary-paper .horizon { margin: 1.3em 0 1.1em; }
.diary-paper h3 { margin: 0 0 .7em; font: 600 1.15rem/1.2 var(--display); }
.diary-paper .rc-option { background: color-mix(in srgb, var(--paper-2) 70%, var(--paper)); }
@media (max-width: 480px) {
  .diary-paper { border-radius: 16px; }
  .rc-more { padding-left: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  dialog.diary[open], dialog.diary.closing, dialog.diary[open]::backdrop { animation: none; }
}

/* tap targets: the dots stay small, but the touchable area around each is 24px */
.frame-dots { gap: 0; bottom: 6px; }
.frame-dots li { padding: 0; }
.frame-dots a {
  width: 24px; height: 24px; background: none; box-shadow: none; border-radius: 50%;
  display: grid; place-items: center; transform: none;
}
.frame-dots a::after {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: rgb(255 255 255 / .55); box-shadow: 0 0 4px rgb(0 0 0 / .35); transition: background .3s, transform .3s;
}
.frame-dots a[aria-current="true"] { background: none; transform: none; }
.frame-dots a[aria-current="true"]::after { background: #fff; transform: scale(1.3); }
.crumb { padding: 12px 0; }

/* page transitions: the story photo carries over from the card or grid tile (where supported) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .45s; }
::view-transition-group(*) { animation-duration: .6s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* ---------- pages kept behind a password ---------- */
.rc-lock { flex: none; width: 15px; height: 15px; margin-left: auto; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; color: var(--ink-3); }
.shake { animation: shake .4s cubic-bezier(.36, .07, .19, .97); }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }


.tile-lock { position: absolute; top: 8px; right: 8px; z-index: 2; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: rgb(16 24 40 / .55); backdrop-filter: blur(6px); }
.tile-lock .rc-lock { margin: 0; width: 13px; height: 13px; color: #fff; }

.lock-page main { padding-top: clamp(28px, 8vh, 90px); }
.lock-form { position: relative; text-align: left; max-width: 520px; margin: 0 auto; border: 1px solid var(--line); box-shadow: 0 24px 60px -30px rgb(16 24 40 / .35); }
.lock-form .lock-title { margin: .2em 0 .5em; font: 600 clamp(1.6rem, 1.25rem + 1.6vw, 2.2rem)/1.15 var(--display); letter-spacing: -.01em; }
.lock-form fieldset { border: 0; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.lock-label { display: block; margin: 18px 0 6px; font: 500 .74rem/1.3 var(--mono); color: var(--ink-2); }
.lock-row { display: flex; gap: 10px; flex-wrap: wrap; }
.lock-row input {
  flex: 1 1 200px; min-width: 0; font: 400 1rem/1.3 var(--serif); color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 99px; padding: 11px 16px;
}
.lock-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
@media (prefers-reduced-motion: reduce) { .shake { animation: none; } }
.lockbox .lock-form { border: 0; box-shadow: none; max-width: none; }
.lock-cancel { display: inline-block; margin-top: 14px; }
.lock-form .rc-note { margin-top: 16px; }


/* ───────────── a whispered line: something they said, written large ─────────────
   In a post:  <figure class="whisper"><p class="whisper-line" lang="mr">…</p><figcaption>meaning</figcaption></figure>
   Big handwriting in sunset ink on a soft glow; stories.js writes it in, underlines it, then shows the meaning. */
.whisper { position: relative; isolation: isolate; margin: 2.6em 0; padding: 1.4em 0 1.2em; text-align: center; }
.whisper::before {
  content: ''; position: absolute; inset: -6% 4%; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, rgb(var(--glow) / .26), rgb(var(--glow) / .08) 60%, transparent);
  filter: blur(6px);
}
.whisper-line {
  position: relative; display: inline-block; margin: 0; padding: 0 .1em .12em;
  font: 700 clamp(2.1rem, 1.6rem + 2.6vw, 3.1rem)/1.35 'Kalam', var(--serif);
  color: var(--ember); word-spacing: .18em; transform: rotate(-2deg);
}
.whisper-line::after { /* a hand-drawn sunset underline */
  content: ''; position: absolute; left: 4%; right: 4%; bottom: .02em; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--sun), var(--grass));
}
.whisper figcaption { margin-top: .5em; font: 500 1.45em/1.3 var(--script); color: var(--ink-2); }
.whisper figcaption::after { /* a tiny heart, for the forehead kiss */
  content: ''; display: inline-block; width: .8em; height: .8em; margin-left: .35em; vertical-align: -.05em;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.6-7.5-10.2A4.3 4.3 0 0 1 12 8a4.3 4.3 0 0 1 7.5 2.8C19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.6-7.5-10.2A4.3 4.3 0 0 1 12 8a4.3 4.3 0 0 1 7.5 2.8C19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* motion (only once the script prepares it; hidden instantly, timings apply on the way in) */
.whisper.w-anim .whisper-line { clip-path: inset(-40% 100% -40% 0); }
.whisper.w-anim .whisper-line::after { transform: scaleX(0); transform-origin: left; }
.whisper.w-anim figcaption { opacity: 0; transform: translateY(6px); }
.whisper.w-anim::before { opacity: 0; }
.whisper.w-anim.shown::before { opacity: 1; transition: opacity 1.4s ease; }
.whisper.w-anim.shown .whisper-line { clip-path: inset(-40% 0 -40% 0); transition: clip-path 2s cubic-bezier(.45, .05, .55, .95) .3s; }
.whisper.w-anim.shown .whisper-line::after { transform: scaleX(1); transition: transform 1s cubic-bezier(.6, .1, .3, 1) 2.2s; }
.whisper.w-anim.shown figcaption { opacity: 1; transform: none; transition: opacity .9s ease 3s, transform .9s ease 3s; }


/* ───────────── the "who's reading?" box as a card that slides up (never blocks the page) ───────────── */
dialog.diary.sheet {
  position: fixed; inset: auto 0 max(12px, env(safe-area-inset-bottom)) 0; margin: 0 auto; z-index: 60;
  max-height: min(76dvh, 720px); border-radius: 18px;
  box-shadow: 0 30px 70px -20px rgb(16 24 40 / .55), 0 0 0 1px var(--line);
}
dialog.diary.sheet[open] { animation: sheet-in .55s cubic-bezier(.2, .8, .2, 1); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(48px); } }

/* ───────────── top bar: share next to the theme switch ───────────── */
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.share {
  border: 1px solid var(--line); background: transparent; color: var(--ink-2);
  width: 42px; height: 42px; border-radius: 50%; cursor: pointer; padding: 0;
  display: grid; place-items: center; transition: border-color .2s, background .2s, color .2s;
}
.share:hover { border-color: var(--accent); background: var(--paper-2); color: var(--ink); }
.share svg { width: 19px; height: 19px; }
.toast {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 80; transform: translateX(-50%);
  background: var(--ink); color: var(--paper); font: 500 .85rem/1 var(--mono); padding: 12px 16px; border-radius: 99px;
  box-shadow: var(--shadow); transition: opacity .4s ease, transform .4s ease;
}
.toast.gone { opacity: 0; transform: translate(-50%, 8px); }

/* ───────────── read next ───────────── */
.read-next { max-width: calc(var(--measure) + 2 * var(--gutter)); margin: clamp(48px, 8vw, 80px) auto 0; padding: 0 var(--gutter); }
.read-next .rc-hand { margin-bottom: .4em; }
.next-card {
  display: grid; grid-template-columns: clamp(96px, 26vw, 170px) 1fr; gap: clamp(14px, 3vw, 24px); align-items: center;
  padding: 12px; border-radius: 18px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); text-decoration: none;
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.next-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.next-card img, .next-card .text-thumb { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: rgb(var(--tile, 200 190 170)); }
.next-body { display: grid; gap: 4px; min-width: 0; }
.next-body small { font: .72rem/1.3 var(--mono); color: var(--ink-3); }
.next-body strong { font: 600 clamp(1.15rem, 1rem + .7vw, 1.5rem)/1.2 var(--display); }
.next-body em { font-style: italic; color: var(--ink-2); font-size: .98rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.next-go { margin-top: 4px; font: 600 .9rem/1 var(--serif); color: var(--ember); }
.all-link { display: inline-block; margin-top: 14px; font: .8rem/1 var(--mono); color: var(--ink-3); padding: 8px 0; }

/* ───────────── get new stories by email ───────────── */
.subscribe {
  max-width: calc(var(--measure) + 2 * var(--gutter)); margin: clamp(48px, 8vw, 80px) auto clamp(24px, 5vw, 48px);
  padding: 0 var(--gutter); text-align: center;
}
.subscribe h2 { margin: .1em 0 .7em; font: 600 clamp(1.4rem, 1.15rem + 1vw, 1.8rem)/1.15 var(--display); }
.subscribe .rc-hand { transform-origin: center; }
.sub-form { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; max-width: 460px; margin: 0 auto; }
.sub-form input[type="email"] {
  flex: 1 1 220px; min-width: 0; min-height: 46px; font: 400 1rem/1.3 var(--serif); color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 99px; padding: 0 18px;
}
.sub-form input[type="email"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.sub-form .rc-send { min-height: 46px; }
.subscribe .rc-status { text-align: center; }
.subscribe .rc-note { max-width: 420px; margin: 14px auto 0; }
@media (prefers-reduced-motion: reduce) { dialog.diary.sheet[open] { animation: none; } }

/* the slide-up card stays small: the essentials, scrollable, with a close button */
.sheet-x { display: none; }
dialog.diary.sheet .sheet-x {
  display: grid; place-items: center; position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper);
  color: var(--ink-2); font: 400 1.5rem/1 var(--serif); cursor: pointer;
}
dialog.diary.sheet .diary-paper { position: relative; }
dialog.diary.sheet .diary-lede + .diary-lede, dialog.diary.sheet .diary-paper > .horizon { display: none; }
@media (max-width: 600px) {
  dialog.diary.sheet { max-height: 62dvh; }
  dialog.diary.sheet .diary-paper { padding: 20px 18px; }
  dialog.diary.sheet .diary-paper h2 { font-size: 1.5rem; padding-right: 36px; }
  dialog.diary.sheet .diary-lede { font-size: .95rem; }
}
