/* ═══════════════════════════════════════════════════════════════
   shorette.com — "night into day" experiment
   White page, the Dovedale night at the top, a spine of time
   running through the register and the seedbed.
   ═══════════════════════════════════════════════════════════════ */

@font-face {
  font-family: "IM Fell English";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/imfell/imfell.woff2") format("woff2");
}
@font-face {
  font-family: "IM Fell English";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/imfell/imfell-italic.woff2") format("woff2");
}
@font-face {
  font-family: "IM Fell English SC";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/imfell/imfell-sc.woff2") format("woff2");
}
@font-face {
  font-family: "Zeyada";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/zeyada/zeyada.woff2") format("woff2");
}
@font-face {
  font-family: "Academica";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/academica/Academica-Book.otf") format("opentype");
}
@font-face {
  font-family: "Caveat";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/caveat/caveat.woff2") format("woff2");
}
/* amiri subset: arabic letters, digits, diacritics, ayah ornaments */
@font-face {
  font-family: "Amiri";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/amiri/amiri-arabic-subset.woff2") format("woff2");
}

.ar { font-family: "Amiri", serif; }

:root {
  /* night ink on night paper: the whole page is a dark room, lit by the
     moonlit painting at the top */
  --paper: #0f1218;
  --ink: #e6e1d5;
  --ink-rgb: 230, 225, 213;
  --accent: #d8ab72;
  --muted: #97a0ab;
  --moon-shadow: #242a35;
  --hairline: rgba(230, 225, 213, 0.14);
  --measure: 37rem;
  --column: 60rem;
  /* the site is night-paper throughout: keep dialogs & controls dark */
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Academica", Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
/* the link idiom: dotted for internal, solid for external */
a[href]:not([href^="http"]):not([href^="mailto"]):not([href^="#"]) {
  text-decoration-style: dotted;
}
a[href^="http"] { text-decoration-style: solid; }
a:hover { color: var(--accent); }

img { max-width: 100%; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

svg.moon {
  width: 0.9em;
  height: 0.9em;
  color: var(--accent);
  vertical-align: -0.1em;
}
svg.fleuron {
  width: 0.95rem;
  height: 0.95rem;
  color: var(--accent);
  display: block;
}

/* ═══════════ the white nav (subpages) ═══════════ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--hairline);
  transition: transform 220ms ease, opacity 220ms ease;
}
/* once the reading is under way the nav withdraws; it returns on the way up */
.site-header.is-withdrawn {
  transform: translateY(-100%);
  opacity: 0;
}
@media (prefers-reduced-motion: reduce) {
  .site-header { transition: none; }
}
.nav-bar {
  max-width: var(--column);
  margin: 0 auto;
  padding: 0.65rem 1.2rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.nav-brand {
  font-family: "IM Fell English", serif;
  text-decoration: none;
  font-size: 1.02rem;
}
.nav-brand .moon { margin-right: 0.4rem; }
.site-nav ul {
  display: flex;
  gap: 1.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.15s;
}
.site-nav a:hover { color: var(--accent); font-style: italic; }
.site-nav a[aria-current="page"] { color: var(--accent); text-decoration: dotted underline; text-underline-offset: 3px; }

/* ═══════════════════════════════════════════════════════════════
   the hero — Dovedale by Moonlight, cut to a few moonlit shades
   The painting is re-drawn in the browser: a Bayer dither cuts it
   to eight shades; a thresholded Perlin field dims the light like
   tree canopy; and a warm halo hugs only the moon and the lit
   ridges. Its palette lives here as custom properties.
   ═══════════════════════════════════════════════════════════════ */

.hero {
  /* the moonlit palette the shader reads */
  --moon-s0: #0a1124;
  --moon-s1: #3a548c;
  --moon-s2: #e7edfb;
  --moon-fringe: #c2cfff;
  --hero-ink: #f4efe2;
  --hero-dim: rgba(244, 239, 226, 0.72);

  position: relative;
  /* a centred, crisp band — not full-bleed, so it is not too broad.
     The canvas crops the full 1.35 painting into this 21:9 frame. */
  width: min(92%, 62rem);
  aspect-ratio: 21 / 9;
  height: auto;
  max-height: 24rem;
  margin-inline: auto;
  overflow: hidden;
  /* until the painting has loaded, the page is dark, never a blank hole */
  background: linear-gradient(180deg, #0c1222 0%, #05070f 100%);
  color: var(--hero-ink);
}
.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  /* the whole point: square, hard-edged texels */
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  opacity: 0;
  transition: opacity 900ms ease;
}
.moonlit--live .hero__canvas { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .hero__canvas { transition: none; }
}
/* the veil: a faint scrim at the head so the nav reads, and a vignette at
   the foot so the painting melts into the paper below it */
.hero__veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(5, 7, 15, 0.55) 0%, transparent 26%),
    linear-gradient(to bottom, transparent 76%, var(--paper) 100%);
}
/* the nav is written in the light of the moon */
.hero__nav {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  max-width: var(--column);
  margin: 0 auto;
  padding: 1.1rem 1.2rem;
}
.hero__nav a {
  color: var(--hero-ink);
  text-decoration: none;
}
.hero__brand {
  margin: 0;
  font-family: "IM Fell English", serif;
  font-size: 1.12rem;
  font-weight: normal;
}
.hero__nav .moon { color: var(--moon-s2); }
.hero__nav ul {
  display: flex;
  gap: 1.2rem;
  margin: 0; padding: 0; list-style: none;
}
.hero__nav li a { font-size: 0.98rem; }
.hero__nav a:hover, .hero__nav a[aria-current="page"] { color: var(--accent); }
.hero__nav a:hover { font-style: italic; }
.hero__nav a[aria-current="page"] { text-decoration: underline dotted; text-underline-offset: 3px; }

/* ═══════════ content column & sections ═══════════ */

.content {
  max-width: var(--column);
  margin: 0 auto;
  padding: 0 1.2rem;
}
.content--full { max-width: none; padding: 0; }

.column {
  max-width: var(--column);
  margin: 0 auto;
  padding: 0 1.2rem;
}
.leaf {
  position: relative;
  padding: 2.6rem 0 2.2rem;
}
.leaf__head {
  font-family: "IM Fell English SC", serif;
  font-weight: normal;
  font-size: 1.02rem;
  letter-spacing: 0.07em;
  text-align: center;
  color: var(--muted);
  margin: 0 0 1.6rem;
}

/* ── the epigraph ── */

.epigraph { text-align: center; padding-top: 2.8rem; }
.epigraph .fleuron { margin: 0 auto 1.4rem; }
.epigraph blockquote {
  margin: 0 auto;
  max-width: 32em;
  font-family: "IM Fell English", serif;
  font-style: italic;
  font-size: 1.16rem;
  line-height: 1.6;
}
.epigraph blockquote p { margin: 0; }
.epigraph figcaption {
  margin-top: 0.8rem;
  font-family: "IM Fell English SC", serif;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* the epigraph */
.epigraph .quran { margin: 0.6rem 0 0; }
.epigraph .quran blockquote {
  font-family: "Amiri", serif;
  font-style: normal;
  font-size: 1.5rem;
  line-height: 2.05;
  max-width: 22em;
}
.epigraph .quran__gloss {
  margin: 0.9rem auto 0;
  max-width: 32em;
  font-style: italic;
  font-size: 0.88rem;
  color: var(--muted);
}

/* ── the preface: small-caps lead-in, margin glosses ── */

.preface { max-width: var(--measure); margin: 0 auto; }
.preface p { margin: 0 0 1.1rem; }
/* a quiet literary open: the first word in small caps, set in the accent,
   stays on the baseline so the column never shifts */
.preface .lead-in {
  font-family: "IM Fell English SC", serif;
  font-size: 1.14em;
  letter-spacing: 0.13em;
  color: var(--accent);
  margin-right: 0.18em;
}
.signature {
  text-align: right;
  font-family: "Zeyada", cursive;
  font-size: 1.7rem;
  transform: rotate(-1.2deg);
  margin: 1.4rem 0.8rem 0 0;
}

/* the margin glosses — the preface reserves room for them on wide screens */
@media (min-width: 56rem) {
  .preface { max-width: calc(var(--measure) + 20rem); }
  .preface p, .preface .signature { max-width: var(--measure); margin-left: auto; margin-right: auto; }
}
.note {
  position: absolute;
  width: 8.8rem;
  font-family: "Zeyada", cursive;
  font-size: 1.32rem;
  line-height: 1.15;
  color: var(--muted);
  font-variant-emoji: text;
}
.note--l { left: 0; text-align: right; transform: rotate(-1.4deg); }
.note--r { right: 0; transform: rotate(1.1deg); }
/* the margin glosses are a wide-screen pleasure */
@media (max-width: 56rem) {
  .note { display: none; }
}

/* the life counter: a tally in the text */
.life-counter {
  position: relative;
  white-space: nowrap;
  cursor: help;
  font-variant-numeric: tabular-nums;
}
.life-counter__readout {
  padding: 0 0.1em;
  border-bottom: 1px dotted var(--ink);
  transition: background-color 140ms ease, color 140ms ease;
}
.life-counter:hover .life-counter__readout,
.life-counter:focus .life-counter__readout {
  background: var(--ink);
  color: var(--paper);
}
.life-counter:focus-visible { outline: 1px dotted var(--ink); outline-offset: 2px; }
.life-counter__panel {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.5rem);
  z-index: 20;
  display: grid;
  gap: 0.12rem;
  min-width: 11rem;
  padding: 0.5rem 0.75rem;
  background: var(--paper);
  border: 1px solid var(--hairline);
  box-shadow: 0 4px 14px rgba(var(--ink-rgb), 0.12);
  font-size: 0.85rem;
  line-height: 1.35;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 0.25rem);
  transition: opacity 140ms ease, transform 140ms ease;
}
.life-counter:hover .life-counter__panel,
.life-counter:focus .life-counter__panel {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ── the register: entries hung on the spine of time ── */

.register { max-width: 46rem; margin: 0 auto; }
.register ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.register li {
  display: grid;
  grid-template-columns: 5.5rem 1.4rem 1fr;
  align-items: baseline;
  min-height: 1.9rem;
}
.register .tick {
  position: relative;
  align-self: stretch;
  border-left: 1px solid var(--hairline);
}
.register .tick::before {
  content: "";
  position: absolute;
  left: -3.5px;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
}
.register li.live .tick::before {
  background: var(--accent);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot { 50% { opacity: 0.3; } }
.pulse__time {
  text-align: right;
  padding-right: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.86rem;
  white-space: nowrap;
}
.pulse__verb {
  font-style: italic;
  color: var(--muted);
  margin-right: 0.3rem;
}
.pulse__label { text-decoration: none; }
a.pulse__label { text-decoration-style: dotted; }
.pulse__detail { color: var(--muted); font-size: 0.9em; }
.pulse__dot { display: none; } /* the live marker is the spine tick */

/* ═══════════ footer ═══════════ */

.site-footer {
  max-width: var(--column);
  margin: 1.5rem auto 0;
  padding: 1.6rem 1.2rem 2.8rem;
  border-top: 1px solid var(--hairline);
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
}
.site-footer .ar { font-size: 1.1rem; line-height: 1; }
.site-footer .tonight {
  display: block;
  margin-top: 0.55rem;
  font-size: 0.82rem;
}
.site-footer .tonight svg { vertical-align: -0.15em; margin-right: 0.25rem; color: var(--ink); }

/* ═══════════ the seeds: the seedbed ═══════════ */

.dove { margin: 0; position: relative; height: clamp(12rem, 30vh, 16rem); overflow: hidden; }
.dove img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; display: block; }
.dove__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(12,18,22,0) 60%, rgba(15,18,24,0.5) 88%, var(--paper) 100%);
}

.seeds-bar {
  max-width: var(--column);
  margin: 0 auto;
  padding: 0.8rem 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--hairline);
  font-family: "IM Fell English SC", serif;
  letter-spacing: 0.06em;
  font-size: 1.05rem;
}
.seeds-bar a { text-decoration: none; }



.seed { margin-bottom: 1.6rem; }
.seed:target,
.seed:has(:target) { scroll-margin-top: 5rem; }
.seed__head { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; }
.seed__entry-no {
  font-family: "IM Fell English SC", serif;
  font-size: 0.82rem;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-decoration: none;
}
.seed__entry-no:hover { color: var(--ink); }
.seed:target .seed__head,
.seed:has(:target) .seed__head { border-bottom-color: var(--accent); }
.seed__time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.85rem; }
.seed__title {
  font-family: "IM Fell English", serif;
  font-weight: normal;
  font-size: 1.3rem;
  margin: 0.1rem 0 0;
  flex-basis: 100%;
}
.seed__line { margin: 0; }
.seed__verb { font-style: italic; color: var(--muted); }
.seed__detail { color: var(--muted); font-size: 0.9em; }
.seed__body { margin-top: 0.45rem; }
.seed__body p { margin: 0.45rem 0; }
.seed__body blockquote {
  margin: 0.6rem 0;
  padding-left: 1rem;
  border-left: 1px solid var(--hairline);
  font-style: italic;
}
.seed--essay .seed__body { font-size: 1.02rem; }

/* quote kind: a pull-quote */
.seed__quote { margin: 0.6rem 0 0; }
.seed__quote blockquote {
  margin: 0;
  padding: 0.1rem 0 0.1rem 1.1rem;
  border-left: 1px solid var(--hairline);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--ink);
}
.seed__quote blockquote p { margin: 0; }
.seed__quote figcaption { margin: 0.4rem 0 0 1.1rem; font-size: 0.85rem; color: var(--muted); }
.seed__quote figcaption::before { content: "— "; }

.seed__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.1rem;
  margin-top: 0.55rem;
  font-size: 0.82rem;
}
.seed__tags a { color: var(--muted); text-decoration: none; margin-right: 0.45rem; }
.seed__tags a:hover { color: var(--accent); }
.seed__leads-label { color: var(--muted); margin-right: 0.3rem; font-style: italic; }
.seed__leads a { text-decoration-style: dotted; }

/* references (goldmark footnotes) */
.seed__body .footnotes { margin-top: 0.9rem; font-size: 0.82rem; color: var(--muted); }
.seed__body .footnotes hr {
  height: 0;
  margin: 0.9rem 0 0;
  border: none;
  border-top: 1px solid var(--hairline);
}
.seed__body .footnotes ol { margin: 0.4rem 0 0; padding-left: 1.1rem; }
.seed__body .footnotes p { margin: 0.2rem 0; }
.seed__body sup a.footnote-ref,
.seed__body .footnote-backref { color: var(--accent); text-decoration: none; }
.seed__body sup a.footnote-ref::before { content: "["; }
.seed__body sup a.footnote-ref::after { content: "]"; }

/* the forge banner — the page is lit by the struck iron, not the moon */
.forge { height: clamp(14rem, 38vh, 20rem); }
.forge img { object-position: 50% 56%; }
.forge__scrim {
  background:
    radial-gradient(ellipse 42% 65% at 47% 60%,
      rgba(255, 138, 60, 0.16) 0%,
      rgba(255, 138, 60, 0) 70%),
    linear-gradient(to bottom,
      rgba(43, 15, 4, 0.28) 0%,
      rgba(43, 15, 4, 0) 30%,
      rgba(66, 20, 6, 0.10) 62%,
      rgba(15, 18, 24, 0.5) 88%,
      var(--paper) 100%);
}

/* ── the kinds, told apart at a glance ── */
.seed__kind {
  font-family: "IM Fell English SC", serif;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.seed--essay .seed__kind { color: var(--accent); }

/* a seed: a plain jotting, kept unadorned */

/* an essay: the drop cap marks the long form */
.seed--essay .seed__body > p:first-of-type::first-letter {
  font-family: "IM Fell English", serif;
  float: left;
  font-size: 3rem;
  line-height: 0.82;
  padding: 0.16rem 0.45rem 0 0;
  color: var(--accent);
}

/* a signpost: the host, small, beside the title */
.seed__title--link { font-size: 1.18rem; }
.seed__host {
  font-family: "Academica", Georgia, serif;
  font-style: italic;
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}

/* a likeness: hung in a hairline frame, captioned beneath */
.seed__plate { margin: 0.7rem 0 0; }
.seed__plate-frame {
  display: block;
  padding: 0.5rem;
  border: 1px solid var(--hairline);
  text-decoration: none;
}
.seed__plate-frame img { display: block; width: 100%; height: auto; }
.seed__plate-cap {
  margin-top: 0.45rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.seed__plate-cap .seed__caption p { display: inline; margin: 0; font-style: italic; }
.seed__credit { display: block; margin-top: 0.15rem; font-size: 0.78rem; }

/* the finding aid, come up empty */
.seedbed-empty {
  font-style: italic;
  color: var(--muted);
}
.seedbed-empty button {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  font-style: italic;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}
.seedbed-empty button:hover { color: var(--accent); }

/* tag archive pages */
.tag-back { font-size: 0.9rem; }
.tag-back a { text-decoration: none; }
.seed-permalink { padding: 1.6rem 0 2.4rem; }
.seed-permalink .seed__head {
  border-bottom: 1px dotted var(--hairline);
  padding-bottom: 0.4rem;
}
.tag-title {
  font-family: "IM Fell English", serif;
  font-weight: normal;
  font-size: 1.6rem;
  margin: 0.4rem 0 1.4rem;
}

/* ═══════════ goodreads: the commonplace book ═══════════ */

/* the study is warm — lit by the astronomer's candle, not the moon — so on
   the books page the greys warm up and sit lighter, keeping fine print clear */
.page-books { --muted: #a89f8e; }
.page-books .bar-link { color: #b3a893; }

/* the running catalogue also lives on storygraph, kept quiet on the right */
.seeds-bar__title { display: inline-flex; align-items: baseline; gap: 0.85rem; }
.bar-link {
  font-family: "IM Fell English SC", serif;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px dotted var(--hairline);
  white-space: nowrap;
}
.bar-link:hover { color: var(--accent); border-bottom-color: var(--accent); }
.bar-link__arrow { font-style: normal; font-size: 0.7em; }

/* the study banner — same crop idiom as the seeds, but warm:
   the page is lit by the astronomer's candle, not the moon */
.candle { height: clamp(13rem, 34vh, 18rem); }
.candle img { object-position: 50% 42%; }
.candle__scrim {
  background: linear-gradient(to bottom,
    rgba(24, 14, 6, 0.25) 0%,
    rgba(24, 14, 6, 0) 30%,
    rgba(58, 34, 12, 0.08) 62%,
    rgba(15, 18, 24, 0.55) 88%,
    var(--paper) 100%);
}

/* the tally on the section bar */
.bar-note {
  font-family: "Academica", Georgia, serif;
  font-style: italic;
  letter-spacing: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

/* iqraʾ — the epigraph of the ledger. Brought up closer to the bar
   so the page does not feel hollow between the header and the note. */
.iqra { padding-top: 1.7rem; padding-bottom: 1.2rem; }
.iqra__note {
  margin: 1rem auto 0;
  max-width: 30em;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--muted);
}

/* the key: how the marks read */
.marks {
  max-width: var(--column);
  margin: 0 auto;
  padding: 0.55rem 1.2rem 0.65rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 2rem;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  font-size: 0.82rem;
  color: var(--muted);
}
.marks__item { display: inline-flex; align-items: center; gap: 0.45rem; }
.marks__item em { color: var(--ink); }
.mark { width: 1.05rem; height: 1.05rem; flex: none; }
.mark--seal { color: var(--accent); }
.mark--flame { color: #b06a1f; }
.mark--ribbon { color: var(--muted); }

/* ═══════════ goodreads: the shelf ═══════════

   The books stand in a wide row of covers instead of a long spine, so the
   ledger stays readable at forty or fifty entries. A cover with a lit wick
   carries a review; touch it to unfold the review in a lit slip of paper.

   The study is warm — lit by the astronomer's candle, not the moon — so the
   muted greys warm up here, and sit lighter so the fine print reads.      */

/* the ledger: books stood in a shelf, newest touch first */
.shelf { max-width: 84rem; margin: 0 auto; padding-top: 2rem; }
.shelf__row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 2rem 1.3rem;
  justify-items: center;
}
.tome {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 12.5rem;
  padding: 0;
}

/* the cover: leaning against the shelf, straightens when touched */
.tome__open {
  display: block;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  border-radius: 4px;
  line-height: 0;
}
.tome__open:focus-visible { outline: 1px dotted var(--accent); outline-offset: 5px; }
.tome__cover {
  position: relative;
  display: block;
  width: min(100%, 10.5rem);
  margin-inline: auto;
  transform: rotate(-1.5deg);
  transition: transform 0.3s ease;
}
.tome__cover img {
  display: block;
  width: 100%;
  box-shadow: 2px 4px 14px rgba(var(--ink-rgb), 0.3);
  border: 1px solid rgba(var(--ink-rgb), 0.2);
}
.tome:hover .tome__cover,
.tome__open:hover .tome__cover,
.tome__open:focus-visible .tome__cover {
  transform: rotate(0deg) translateY(-2px);
}
.tome--laid-aside .tome__cover { filter: grayscale(0.85) sepia(0.12); opacity: 0.62; }
.tome--reading .tome__cover {
  box-shadow: 0 0 22px rgba(214, 138, 46, 0.4), 2px 4px 14px rgba(var(--ink-rgb), 0.3);
}

/* the badges on the cover's corner */
.tome__badge { position: absolute; }
.tome__badge.seal {
  right: -0.7rem;
  bottom: -0.7rem;
  width: 2.1rem;
  height: 2.1rem;
  color: var(--accent);
  filter: drop-shadow(0 1px 2px rgba(var(--ink-rgb), 0.35));
}
.tome__badge.ribbon {
  right: 0.35rem;
  top: -0.35rem;
  width: 1.1rem;
  height: 1.9rem;
  color: #8d2f26;
  filter: drop-shadow(0 1px 2px rgba(var(--ink-rgb), 0.3));
}
.tome__badge.flame {
  left: 50%;
  top: -1.15rem;
  width: 1.5rem;
  height: 1.5rem;
  transform: translateX(-50%);
  color: #c07a24;
}
.tome__badge.flame svg {
  position: relative;
  width: 100%;
  height: 100%;
  transform-origin: 50% 90%;
  animation: flicker 1.6s ease-in-out infinite;
}
.tome__badge.flame .flame__glow {
  position: absolute;
  inset: -0.9rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(224, 152, 52, 0.5) 0%, rgba(224, 152, 52, 0) 65%);
  animation: glow-breathe 1.6s ease-in-out infinite;
}
/* a review-bearing cover shows a quill flag at its top corner.
   It sits top-left, clear of the ribbon and the seal, so a book can
   carry a review and a state at the same time. */
.tome__flag {
  position: absolute;
  left: -0.55rem;
  top: -0.55rem;
  width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 62%, 0 100%);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}
.tome__flag svg {
  width: 0.85rem;
  height: 0.85rem;
  color: var(--paper);
  margin-top: -0.2rem; /* keep the quill clear of the flag's notch */
}
/* on hover or focus the flag names itself, in handwriting */
.tome__reviewtip {
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%) rotate(-2deg);
  margin-bottom: 0.3rem;
  font-family: "Caveat", cursive;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--accent);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}
.tome.has-review:hover .tome__reviewtip,
.tome__open:focus-visible .tome__reviewtip {
  opacity: 1;
}
/* on narrow shelves the hint would crowd its neighbours; rely on the flag */
@media (max-width: 56rem) {
  .tome__reviewtip { display: none; }
}
@keyframes flicker {
  0%, 100% { transform: scale(1) rotate(-1.5deg); }
  30% { transform: scale(1.08, 1.14) rotate(1.6deg); }
  55% { transform: scale(0.94, 0.97) rotate(-2.4deg); }
  80% { transform: scale(1.04, 1.1) rotate(0.8deg); }
}
@keyframes glow-breathe {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 0.35; }
}
@media (prefers-reduced-motion: reduce) {
  .tome__badge.flame svg, .flame__glow { animation: none; }
}

/* the words beneath the cover */
.tome__title {
  font-family: "IM Fell English", serif;
  font-weight: normal;
  font-size: 1.12rem;
  line-height: 1.2;
  margin: 0.75rem 0 0;
}
.tome--laid-aside .tome__title { color: var(--muted); }
.tome__author { margin: 0.18rem 0 0; font-style: italic; font-size: 0.9rem; color: var(--muted); }
.tome__dates { margin: 0.22rem 0 0; font-size: 0.74rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* the review: a lit slip of paper, unfolded on top of the study */
.review { border: 0; padding: 0; background: transparent; max-width: 40rem; width: calc(100vw - 1.6rem); color: var(--ink); }
.review:not([open]) { display: none; }
.review::backdrop {
  background: rgba(5, 7, 15, 0.72);
  backdrop-filter: blur(2px);
}
.review__frame {
  position: relative;
  max-height: 84vh;
  overflow-y: auto;
  background: linear-gradient(to bottom right, #241e15, #17130d);
  border: 1px solid var(--hairline);
  border-top: 3px solid var(--accent);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
  padding: 2.1rem 2.3rem 1.9rem;
}
.review__kicker {
  font-family: "IM Fell English SC", serif;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--accent);
}
.review__title {
  font-family: "IM Fell English", serif;
  font-weight: normal;
  font-size: 2rem;
  line-height: 1.12;
  margin: 0.35rem 0 0;
}
.review__author { margin: 0.3rem 0 0.2rem; font-style: italic; color: var(--muted); }
.review__body {
  margin-top: 1.3rem;
  font-size: 1.04rem;
}
.review__body p { margin: 0 0 1rem; }
.review__body p:last-of-type { margin-bottom: 0; }
.review__body blockquote {
  margin: 0 0 1.1rem;
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
  font-style: italic;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ═══════════ the wide sheet ═══════════ */
@media (min-width: 64rem) {
  .content--wide { max-width: 84rem; }
}

/* ═══════════ mobile ═══════════ */

@media (max-width: 46rem) {
  /* the tally panel floats over the text as a popover — no pushing, no clipping.
     (the counter stops being the containing block; the leaf takes over) */
  .life-counter { position: static; }
  .life-counter__panel {
    bottom: auto;
    left: 0.9rem;
    right: 0.9rem;
    min-width: 0;
    white-space: normal;
    transform: none;
    box-shadow: 0 6px 18px rgba(var(--ink-rgb), 0.16);
  }
  .life-counter:hover .life-counter__panel,
  .life-counter:focus .life-counter__panel { transform: none; }
  body { font-size: 16px; }
  .hero { aspect-ratio: 21 / 9; height: auto; min-height: 14rem; }
  .hero__nav { flex-direction: column; gap: 0.3rem; padding-top: 0.9rem; }
  .hero__nav ul { gap: 0.9rem; }
  .hero__nav li a { font-size: 0.88rem; }
  .nav-bar { flex-wrap: wrap; gap: 0.3rem 1rem; }
  .site-nav ul { gap: 1rem; }
  .register li { grid-template-columns: 4.6rem 1.1rem 1fr; }
  .pulse__time { font-size: 0.78rem; padding-right: 0.55rem; }
  /* the shelf row wraps on its own; only the key needs re-gapping */
  .marks { gap: 0.35rem 1.1rem; }
  .seed__plate-frame { padding: 0.35rem; }
  .seed--essay .seed__body > p:first-of-type::first-letter { font-size: 2.6rem; }
  .signature { margin-right: 0.2rem; }
}



/* The finding aid is the head of the cabinet: it spans the same sheet and its
   lower rule is the cabinet's head rule, so there is no second bar. */
.seed-tools {
  max-width: 82rem;
  margin: 0 auto;
  padding: 0.95rem 1.25rem 0.85rem;
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(20rem, 1.8fr);
  grid-template-areas: "search kinds" "search months" "status status";
  gap: 0.35rem 2.4rem;
  border-top: 1px solid var(--ink);
  font-size: 0.8rem;
}
.seed-tools__search { grid-area: search; padding-right: 1.5rem; border-right: 1px dotted var(--hairline); }
.seed-tools__row:first-of-type { grid-area: kinds; }
.seed-tools__row:nth-of-type(2) { grid-area: months; }
.seed-tools__status { grid-area: status; min-height: 0; margin: 0; color: var(--muted); font-size: 0.72rem; font-style: italic; text-align: right; }
.seed-tools__label {
  display: block;
  color: var(--muted);
  font-family: "IM Fell English SC", serif;
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  white-space: nowrap;
}

.seed-tools__searchline { display: flex; align-items: baseline; gap: 0.45rem; }
.seed-tools__search input {
  width: 100%;
  min-width: 0;
  padding: 0.15rem 0;
  border: 0;
  border-bottom: 1px dotted var(--hairline);
  outline: 0;
  color: var(--ink);
  background: transparent;
  font: italic 0.9rem "Academica", Georgia, serif;
}
.seed-tools__search input:focus { border-bottom-color: var(--accent); }
.seed-tools__search input::placeholder { color: var(--muted); opacity: 0.7; }
.seed-tools__search input::-webkit-search-cancel-button { appearance: none; }
.seed-tools kbd {
  padding: 0 0.28rem;
  border: 1px solid var(--hairline);
  color: var(--muted);
  background: transparent;
  font: 0.68rem "Academica", serif;
}
.seed-tools__row { display: grid; grid-template-columns: 4.2rem 1fr; gap: 0.8rem; align-items: baseline; }
.seed-tools__choices { display: flex; flex-wrap: wrap; gap: 0.05rem 0.85rem; }
.seed-tools button {
  appearance: none;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-style: italic;
}
.seed-tools button sup { margin-left: 0.08rem; color: var(--accent); font-size: 0.68em; font-style: normal; }
.seed-tools button:hover { color: var(--accent); }
.seed-tools button[aria-pressed="true"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

@media (max-width: 48rem) {
  .seed-tools {
    grid-template-columns: 1fr;
    grid-template-areas: "search" "kinds" "months" "status";
    gap: 0.85rem;
  }
  .seed-tools__search { padding: 0 0 0.8rem; border-right: 0; border-bottom: 1px dotted var(--hairline); }
  .seed-tools__row { grid-template-columns: 1fr; gap: 0.2rem; }
  .seed-tools__status { text-align: left; }
}



/* the journal: two large streams that share one mid-line.
   The notes run down each column; the two columns meet at a single
   dotted rule, so the bed reads as a folded sheet, not a list. */
.seed-stream {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  max-width: 84rem; /* run the columns to the edge so they match the finding aid */
  margin: 1.9rem auto 0;
  padding: 0 1.25rem 2.6rem; /* left gutter matches the finding aid, so the first column lines up with it */
}
.seed-stream__column { padding: 0 0.6rem; }
.seed-stream__column:first-child { padding-left: 0; }
.seed-stream__column + .seed-stream__column { border-left: 1px dotted var(--hairline); }
.seed-stream__column > .seed:last-child { margin-bottom: 0; }

/* while sifting, fold the two streams into one on the left, so the
   matches always lead from the same edge instead of wherever they sat */
.seed-stream.sifting { grid-template-columns: 1fr; }
.seed-stream.sifting .seed-stream__column { padding: 0; }
.seed-stream.sifting .seed-stream__column + .seed-stream__column { border-left: 0; }

/* the seed cards themselves are the running text of the bed */
.seed-stream .seed { margin-bottom: 1.7rem; }
.seed-stream .seed__head {
  border-bottom: 1px dotted var(--hairline);
  padding-bottom: 0.4rem;
}
.seed-stream .seedbed-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.2rem 0;
}

/* on a narrow sheet the two streams fold into one */
@media (max-width: 50rem) {
  .seed-stream { grid-template-columns: 1fr; gap: 1.4rem; }
  .seed-stream__column + .seed-stream__column { border-left: 0; border-top: 1px dotted var(--hairline); padding-top: 1.2rem; }
}

/* the seedbed keeps its light as a thin band, not a full hero */
.forge--slim {
  height: clamp(10.5rem, 20vw, 13rem);
  max-width: 82rem;
  margin: 0 auto;
}
.forge--slim img { object-position: 50% 52%; }

/* ═══════════ letterboxd: the contact sheet ═══════════ */

.page-films {
  --film-red: #c9655a;
  --film-light: #ece5d1;
  max-width: 72rem;
}

.film-cabinet { padding: clamp(2.5rem, 6vw, 5rem) 0 1rem; }
.film-cabinet__head {
  display: grid;
  grid-template-columns: 1fr minmax(16rem, 24rem);
  gap: 2rem;
  align-items: end;
  padding-bottom: 1.5rem;
}
.film-cabinet__eyebrow {
  margin: 0 0 0.25rem;
  color: var(--muted);
  font-family: "IM Fell English SC", serif;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
}
.film-cabinet h1 {
  margin: 0;
  color: var(--film-light);
  font-family: "IM Fell English", serif;
  font-size: clamp(3rem, 7vw, 5rem);
  font-weight: normal;
  line-height: 0.9;
}
.film-cabinet__intro {
  margin: 0;
  padding-left: 1rem;
  border-left: 1px solid var(--hairline);
  color: var(--muted);
  font-size: 0.88rem;
  font-style: italic;
}
.film-cabinet__intro a { color: var(--ink); }

/* The controls read as marks on the edge of a light table, not a toolbar. */
.film-index {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: center;
  padding: 0.65rem 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.film-index__years { display: flex; flex-wrap: wrap; gap: 0.3rem 1.1rem; }
.film-index button {
  appearance: none;
  padding: 0;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
  font: italic 0.78rem "Academica", Georgia, serif;
}
.film-index button:hover,
.film-index button[aria-pressed="true"] { color: var(--film-light); }
.film-index button[aria-pressed="true"] { text-decoration: underline dotted var(--film-red); text-underline-offset: 3px; }
.film-index button:focus-visible { outline: 1px dotted var(--film-light); outline-offset: 4px; }
.film-index sup { color: var(--film-red); font-size: 0.65em; font-style: normal; }
.film-index__search { display: flex; flex: 0 1 13rem; align-items: center; gap: 0.5rem; }
.film-index__search input {
  width: 100%;
  min-width: 0;
  padding: 0.15rem 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px dotted var(--hairline);
  border-radius: 0;
  outline: 0;
  font: italic 0.8rem "Academica", Georgia, serif;
}
.film-index__search input:focus { border-bottom-color: var(--film-red); }
.film-index__search input::placeholder { color: var(--muted); opacity: 0.8; }
.film-index__search input::-webkit-search-cancel-button { appearance: none; }
.film-index kbd {
  padding: 0 0.25rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--hairline);
  font: 0.64rem "Academica", serif;
}

/* A dense contact sheet can hold fifty frames without turning into fifty full
   reviews. Each frame has one job: identify the film and open its note. */
.contact-sheet {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.6rem, 1fr));
  gap: clamp(1.1rem, 2.3vw, 1.9rem) clamp(0.65rem, 1.5vw, 1.1rem);
  padding: 1.7rem 0 1rem;
}
.contact-frame { min-width: 0; }
.contact-frame[hidden] { display: none; }
.contact-frame__open {
  display: block;
  width: 100%;
  padding: 0;
  color: var(--ink);
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.contact-frame__open:focus-visible { outline: 1px dotted var(--film-light); outline-offset: 5px; }
.contact-frame__image {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #080a0d;
  border: 1px solid rgba(236, 229, 209, 0.14);
  box-shadow: 0 0.45rem 1.2rem rgba(0, 0, 0, 0.2);
}
.contact-frame__image::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 60%, rgba(8, 10, 13, 0.62));
}
.contact-frame__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.78) saturate(0.6) brightness(0.7);
  transform: scale(1.01);
  transition: filter 280ms ease, transform 450ms ease;
}
.contact-frame__number,
.contact-frame__rating {
  position: absolute;
  z-index: 2;
  bottom: 0.35rem;
  font-size: 0.6rem;
  line-height: 1;
}
.contact-frame__number { left: 0.4rem; color: rgba(236, 229, 209, 0.72); font-variant-numeric: tabular-nums; }
.contact-frame__rating { right: 0.4rem; color: var(--film-light); letter-spacing: -0.08em; }
.contact-frame__open:hover .contact-frame__image img,
.contact-frame__open:focus-visible .contact-frame__image img { filter: grayscale(0.05) saturate(0.9) brightness(0.85); transform: scale(1.035); }
.contact-frame__open:hover .contact-frame__image { border-color: rgba(201, 101, 90, 0.65); }
.contact-frame__caption {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem;
  padding-top: 0.48rem;
  line-height: 1.15;
}
.contact-frame__caption strong {
  display: -webkit-box;
  min-height: 2.15em;
  overflow: hidden;
  color: var(--film-light);
  font-family: "IM Fell English", serif;
  font-size: 0.88rem;
  font-weight: normal;
  line-height: 1.08;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.contact-frame__caption span { color: var(--muted); font-size: 0.63rem; }
.contact-sheet__empty { grid-column: 1 / -1; padding: 3rem 0; color: var(--muted); text-align: center; font-style: italic; }
.film-cabinet__status { min-height: 1.2rem; margin: 0; color: var(--muted); font-size: 0.7rem; text-align: right; }

/* The light table opens one frame at full size. It is deliberately plain:
   poster, note, exit. */
.film-viewer {
  width: min(51rem, calc(100vw - 1.5rem));
  max-width: none;
  padding: 0;
  color: var(--ink);
  background: #101319;
  border: 1px solid var(--hairline);
}
.film-viewer:not([open]) { display: none; }
.film-viewer::backdrop { background: rgba(4, 6, 9, 0.84); backdrop-filter: blur(3px); }
.film-viewer__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(12rem, 0.72fr) minmax(17rem, 1fr);
  max-height: min(86vh, 43rem);
  overflow: auto;
}
.film-viewer__close {
  position: absolute;
  z-index: 4;
  top: 0.6rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  color: var(--muted);
  background: rgba(15, 18, 24, 0.8);
  border: 1px solid var(--hairline);
  border-radius: 50%;
  cursor: pointer;
  font: 1.25rem/1 "Academica", serif;
}
.film-viewer__close:hover { color: var(--film-light); border-color: var(--film-red); }
.film-viewer__close:focus-visible { outline: 1px dotted var(--film-light); outline-offset: 3px; }
.film-viewer__poster { margin: 0; background: #080a0d; }
.film-viewer__poster img { display: block; width: 100%; height: 100%; max-height: min(86vh, 43rem); object-fit: cover; }
.film-viewer__copy { align-self: center; padding: clamp(2rem, 5vw, 3.5rem); }
.film-viewer__meta {
  margin: 0;
  color: var(--muted);
  font-family: "IM Fell English SC", serif;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}
.film-viewer h2 {
  margin: 0.35rem 0 0;
  color: var(--film-light);
  font-family: "IM Fell English", serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: normal;
  line-height: 1;
}
.film-viewer__rating { margin: 0.65rem 0 0; color: var(--film-red); font-size: 0.78rem; letter-spacing: 0.02em; }
.film-viewer__note {
  margin-top: 1.5rem;
  color: var(--film-light);
  font-family: "IM Fell English", serif;
  font-size: 1.08rem;
  line-height: 1.55;
}
.film-viewer__note p { margin: 0 0 0.9rem; }
.film-viewer__note p:last-child { margin-bottom: 0; }
.film-viewer__link { margin: 1.6rem 0 0; padding-top: 0.7rem; border-top: 1px dotted var(--hairline); font-size: 0.72rem; }
.film-viewer__link a { color: var(--muted); text-decoration: none; }
.film-viewer__link a:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .contact-frame__image img { transition: none; }
}

@media (max-width: 46rem) {
  .film-cabinet { padding-top: 2.4rem; }
  .film-cabinet__head { grid-template-columns: 1fr; gap: 1.3rem; }
  .film-cabinet__intro { max-width: 28rem; margin-left: auto; }
  .film-index { align-items: stretch; flex-direction: column; gap: 0.75rem; }
  .film-index__search { flex-basis: auto; width: 100%; }
  .contact-sheet { grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); }
  .film-viewer__inner { display: block; max-height: 90vh; }
  .film-viewer__poster { height: 15rem; }
  .film-viewer__poster img { height: 100%; object-position: 50% 22%; }
  .film-viewer__copy { padding: 1.7rem 1.25rem 2rem; }
}
