/* ───────────────────────────────────────────────
   MS. Erron. 404 — a scriptorium in CSS
   Scroll position is the hour of the day.
   ─────────────────────────────────────────────── */

@property --q     { syntax: '<number>'; inherits: true; initial-value: 0; }
@property --wax   { syntax: '<length>'; inherits: true; initial-value: 44vh; }
@property --dark  { syntax: '<color>';  inherits: true; initial-value: white; }
@property --glow  { syntax: '<number>'; inherits: true; initial-value: 0; }
@property --lit   { syntax: '<number>'; inherits: true; initial-value: 1; }

:root {
  --ink: #2a1c12;
  --ghost: rgb(90 66 40 / .17);
  --red: #a3231b;
  --blue: #1f3f8a;
  --gold: #c9971c;
  --hand-late: "Apple Chancery", "Snell Roundhand", "Segoe Script", "URW Chancery L", cursive;
  --cr: max(10px, calc(50% - 31rem));   /* candle distance from the right edge */
  scroll-behavior: smooth;
}

* { box-sizing: border-box; }

/* the whole day passes between the top and the bottom of the page */
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 1.17rem/1.8 "Palatino Linotype", Palatino, "Book Antiqua", "Iowan Old Style", Georgia, serif;
  background:
    repeating-linear-gradient(92deg, rgb(0 0 0 / .07) 0 2px, transparent 2px 9px, rgb(255 255 255 / .03) 9px 11px, transparent 11px 23px),
    linear-gradient(180deg, #4a2f1c, #3b2414 60%, #2f1d10);
  overflow-x: clip;
  animation: day linear both;
  animation-timeline: scroll(root);
}

@keyframes day {
  0%   { --wax: 44vh; --dark: rgb(255 255 255); --glow: 0;   --lit: 1; }
  25%  {              --dark: rgb(255 246 228); --glow: 0; }
  40%  {              --dark: rgb(236 196 160); --glow: .35; }
  52%  {              --dark: rgb(150 118 128); --glow: .8; }
  64%  {              --dark: rgb(92 78 104);   --glow: 1; }
  82%  {              --dark: rgb(84 72 100);   --glow: 1; }
  91%  {              --dark: rgb(170 150 170); --glow: .6;  --lit: 1; }
  95%  {                                        --glow: 0;   --lit: 0; }
  100% { --wax: 3vh;  --dark: rgb(255 236 222); --glow: 0;   --lit: 0; }
}

/* ── light ─────────────────────────────────────── */
.shade, .glow {
  position: fixed; inset: 0;
  pointer-events: none;
  --fx: calc(100% - var(--cr) - 28px);
  --fy: calc(100% - var(--wax) - 42px);
}
.shade {
  z-index: 5;
  mix-blend-mode: multiply;
  background: radial-gradient(circle at var(--fx) var(--fy),
      white calc(var(--lit) * 3vmax),
      var(--dark) calc(12vmax + var(--lit) * 50vmax));
}
.glow {
  z-index: 6;
  mix-blend-mode: soft-light;
  opacity: var(--glow);
  background: radial-gradient(circle at var(--fx) var(--fy),
      rgb(255 180 80 / .9), rgb(255 140 40 / .35) 22vmax, transparent 55vmax);
  animation: breathe 2.7s infinite;
}
@keyframes breathe {
  0%, 100% { filter: brightness(1); }
  23% { filter: brightness(.82); }
  41% { filter: brightness(1.08); }
  57% { filter: brightness(.9); }
  78% { filter: brightness(1.04); }
}

/* ── the candle ────────────────────────────────── */
.candle {
  position: fixed; bottom: 0; right: var(--cr);
  z-index: 7; width: 56px;
  display: flex; flex-direction: column; align-items: center;
  pointer-events: none;
}
.flame-box { position: relative; width: 56px; height: 46px; }
.wick {
  position: absolute; bottom: 0; left: 50%;
  width: 2px; height: 9px; margin-left: -1px;
  background: linear-gradient(#111, #3a2a1a);
  border-radius: 1px;
}
.flame {
  position: absolute; left: 50%; bottom: 5px;
  width: 14px; height: 32px; margin-left: -7px;
  border-radius: 50% 50% 45% 45% / 70% 70% 30% 30%;
  background: radial-gradient(ellipse 60% 70% at 50% 78%, #fff 0 18%, #fff3b8 32%, #ffb52e 62%, rgb(255 100 0 / 0) 78%);
  box-shadow: 0 0 16px 5px rgb(255 175 60 / .45), 0 0 70px 26px rgb(255 140 40 / .16);
  transform-origin: 50% 100%;
  opacity: var(--lit);
  transition: opacity .4s;
  animation: flicker 1.9s infinite;
}
.flame::before {   /* blue heart of the flame */
  content: ""; position: absolute; left: 4px; bottom: 2px;
  width: 6px; height: 7px; border-radius: 50%;
  background: rgb(70 110 255 / .6); filter: blur(1px);
}
@keyframes flicker {
  0%, 100% { transform: scale(1, 1) skewX(0); }
  12% { transform: scale(.94, 1.06) skewX(2deg); }
  27% { transform: scale(1.04, .93) skewX(-3deg); }
  38% { transform: scale(.97, 1.1) skewX(1deg); }
  52% { transform: scale(1.02, .96) skewX(-1deg); }
  66% { transform: scale(.92, 1.08) skewX(4deg); }
  80% { transform: scale(1.03, .98) skewX(-2deg); }
}
.smoke {
  position: absolute; left: 50%; bottom: 8px;
  opacity: calc(1 - var(--lit));
}
.smoke i {
  position: absolute; left: -5px; bottom: 0;
  width: 10px; height: 10px; border-radius: 50%;
  background: rgb(190 185 180 / .55); filter: blur(3px);
  animation: rise 3.6s linear infinite;
}
.smoke i:nth-child(2) { animation-delay: -1.2s; }
.smoke i:nth-child(3) { animation-delay: -2.4s; }
@keyframes rise {
  from { transform: translate(0, 0) scale(.6); opacity: .9; }
  50%  { transform: translate(6px, -50px) scale(1.4); }
  to   { transform: translate(-4px, -110px) scale(2.4); opacity: 0; }
}
.wax {
  position: relative;
  width: 30px; height: var(--wax);
  background: linear-gradient(90deg, #cdbb92, #f2e6c8 35%, #fffaf0 52%, #e4d4ad 80%, #c4ae80);
  border-radius: 5px 5px 0 0 / 3px 3px 0 0;
}
.wax::before, .wax::after {     /* drips */
  content: ""; position: absolute; top: 0;
  width: 7px; border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, #e9dcba, #fffaf0);
}
.wax::before { left: -3px; height: min(36px, var(--wax)); }
.wax::after  { right: 3px; height: min(18px, var(--wax)); width: 5px; }
.holder {
  width: 76px; height: 20px;
  background: linear-gradient(#d8ae52, #8a6420 60%, #5b4114);
  border-radius: 50% 50% 10px 10px / 40% 40% 10px 10px;
  box-shadow: 0 -3px 0 #e8c46a inset;
}

/* ── the folio ─────────────────────────────────── */
.folio {
  position: relative;
  z-index: 1;
  width: min(54rem, 100% - 2rem);
  margin: 4rem auto 8rem;
  padding: 5rem 11rem 5rem 4.5rem;
  overflow-x: clip;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .3 0 0 0 0 .14 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse 120% 80% at 30% 20%, rgb(255 255 255 / .35), transparent 60%),
    radial-gradient(ellipse at 50% 50%, #f4e7c5 45%, #e3cc98 85%, #c9a96c);
  border-radius: 6px 10px 8px 4px / 8px 5px 10px 6px;
  box-shadow: 0 30px 60px rgb(0 0 0 / .5), 0 0 0 1px rgb(80 50 20 / .3), inset 0 0 70px rgb(120 80 30 / .35);
}
.folio::before {   /* the ruled frame of the text block */
  content: ""; position: absolute;
  inset: 3rem 9.5rem 3rem 3rem;
  border: 3px double rgb(163 35 27 / .35);
  pointer-events: none;
}

.incipit { text-align: center; margin-bottom: 3rem; }
.shelf {
  margin: 0 0 1rem;
  font: italic .8rem/1.4 var(--hand-late);
  color: rgb(70 50 30 / .7);
  letter-spacing: .04em;
}
h1 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  line-height: 1.25;
  font-weight: normal;
  font-variant: small-caps;
  letter-spacing: .05em;
}
h1 .r { color: var(--red); font-size: 1.6em; line-height: .5; }
h1 .b { color: var(--blue); }
.sub { margin: .6rem 0 0; font-style: italic; color: var(--red); }
.flourish { display: block; width: 60%; margin: .8rem auto 0; }
.hint { margin: .6rem 0 0; font-size: .8rem; font-style: italic; opacity: .55; }

.hour { position: relative; margin: 0 0 4.5rem; }
.hour p { margin: 0 0 1rem; }

h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-weight: normal;
  font-variant: small-caps;
  letter-spacing: .06em;
}
h2 small { font-size: .82em; font-style: italic; font-variant: normal; letter-spacing: 0; }

/* ── a line of script, inked by scrolling ──────── */
.l {
  --i: var(--ink);
  display: flow-root;
  width: fit-content;
  max-width: 100%;
  position: relative;
  color: transparent;
  background: linear-gradient(90deg,
      var(--i) calc(var(--q) * 100% - 2.5%),
      var(--ghost) calc(var(--q) * 100% + 2.5%));
  -webkit-background-clip: text;
  background-clip: text;
  animation: ink linear both;
  animation-timeline: view();
  animation-range: cover 34% cover 45%;
}
.l.r { --i: var(--red); }
.l.b { --i: var(--blue); }
@keyframes ink { from { --q: -.04; } to { --q: 1.04; } }

/* the quill rides the edge of the wet ink */
.l::after {
  content: "";
  position: absolute;
  left: calc(var(--q) * 100%);
  bottom: .38em;
  width: 34px; height: 52px;
  margin-left: -1px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 34 52'%3E%3Cpath d='M7 41C9 26 18 11 33 1 32 15 24 31 10 44Z' fill='%23f7f1e3' stroke='%237a6650' stroke-width='.7'/%3E%3Cpath d='M2 50L31 4' stroke='%233a2a1a' stroke-width='1.1'/%3E%3Cpath d='M12 33l7-4M15 27l8-5M19 21l8-6M10 38l6-2M24 14l6-6' stroke='%239a8670' stroke-width='.5'/%3E%3Cpath d='M0 52l1.6-5.5 2.6 1.4z' fill='%23201510'/%3E%3C/svg%3E") no-repeat 0 100% / contain;
  transform-origin: 0 100%;
  opacity: clamp(0, calc(min(var(--q), 1 - var(--q)) * 30), 1);
  pointer-events: none;
  z-index: 2;
  animation: scribble .16s ease-in-out infinite alternate;
}
@keyframes scribble {
  from { transform: rotate(-5deg) translateY(0); }
  to   { transform: rotate(3deg) translateY(-2px); }
}

.l.blank {
  width: 100%;
  border-bottom: 1px solid rgb(110 80 50 / .2);
}
.l.mid { margin: .2rem auto; }
.tally { letter-spacing: .08em; }
.sr {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip-path: inset(50%);
}

/* ── illuminated initial ───────────────────────── */
.initial {
  float: left;
  margin: .35rem .7rem 0 0;
  padding: .12em .28em .02em;
  font-size: 4.3rem; line-height: 1;
  border: 2px solid var(--gold);
  background:
    radial-gradient(circle, rgb(255 230 160 / .8) 1px, transparent 1.6px) 0 0 / 9px 9px,
    linear-gradient(135deg, #234a9e, #142c66);
  box-shadow: 0 0 0 3px #7d1c16, 0 0 0 4px var(--gold);
  animation: illumine linear both;
  animation-timeline: view();
  animation-range: cover 20% cover 40%;
}
.initial b {
  display: block;
  color: transparent;
  background: linear-gradient(115deg, transparent 35%, rgb(255 255 240 / .95) 50%, transparent 65%) 0 0 / 300% 100%,
              linear-gradient(#fff1a8, #d9a520 45%, #f6d66a 55%, #9c6b0e);
  -webkit-background-clip: text; background-clip: text;
  animation: sheen 5s linear infinite;
}
@keyframes illumine {
  from { opacity: 0; transform: scale(.6) rotate(-6deg); filter: grayscale(1); }
  60%  { opacity: 1; filter: grayscale(1); }
  to   { opacity: 1; transform: none; filter: none; }
}
@keyframes sheen { from { background-position: 100% 0, 0 0; } to { background-position: -50% 0, 0 0; } }

/* ── the margins ───────────────────────────────── */
.marg {
  position: absolute;
  right: -9.5rem;
  width: 7.5rem;
  font-size: .85rem;
  line-height: 1.35;
  z-index: 3;
}
.note { margin: 0; font: italic .82rem/1.35 var(--hand-late); color: #5b4636; }

.gloss summary {
  list-style: none;
  cursor: pointer;
  color: var(--red);
  font-size: 1.3rem;
  width: fit-content;
  transition: transform .3s;
}
.gloss summary span { font: italic .75rem var(--hand-late); vertical-align: middle; opacity: .7; }
.gloss summary::-webkit-details-marker { display: none; }
.gloss summary:hover { transform: rotate(-8deg) scale(1.1); }
.gloss p {
  margin: .3rem 0 0;
  padding: .5rem .6rem;
  font: .85rem/1.4 var(--hand-late);
  color: #4c3a5e;
  background: rgb(255 248 225 / .7);
  border-left: 2px solid rgb(163 35 27 / .4);
  rotate: -2deg;
}
.gloss::details-content {
  opacity: 0;
  translate: 0 -6px;
  transition: opacity .5s, translate .5s, content-visibility .5s allow-discrete;
}
.gloss[open]::details-content { opacity: 1; translate: 0 0; }

/* the hand that cannot decide what to point at */
.manicule {
  display: inline-block;
  font-size: 2.4rem; line-height: 1;
  color: var(--ink);
  rotate: 180deg;
  animation: point 6s ease-in-out infinite;
}
@keyframes point {
  0%, 30%  { transform: translateX(0) rotate(0); }
  10%, 20% { transform: translateX(-8px) rotate(0); }
  40%, 55% { transform: translateX(0) rotate(-90deg); }   /* points at the heavens */
  65%, 80% { transform: translateX(4px) rotate(180deg) scale(1.15); }   /* points at you */
  90%      { transform: rotate(160deg) scale(.9); }
}

/* hidden drawing: hover or focus to restore Wulfric's sin */
.doodle { cursor: help; outline: none; text-align: center; }
.doodle svg { width: 6.5rem; display: block; margin: auto; }
.doodle path {
  fill: none; stroke: #4a4440; stroke-width: 1.4; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.6s ease-in-out;
}
.doodle path:nth-child(2) { transition-delay: .15s; }
.doodle path:nth-child(3) { transition-delay: .3s; }
.doodle path:nth-child(4) { transition-delay: .7s; }
.doodle path:nth-child(5) { transition-delay: .9s; }
.doodle path:nth-child(6) { transition-delay: 1.1s; }
.doodle svg {
  background: radial-gradient(ellipse at 50% 55%, rgb(150 120 90 / .18), transparent 65%);
  border-radius: 50%;
}
.doodle:hover path, .doodle:focus path { stroke-dashoffset: 0; }
.doodle-cap { font: italic .72rem/1.3 var(--hand-late); color: rgb(80 60 40 / .55); }

/* bas-de-page: the eternal snail combat */
.bas {
  position: relative;
  height: 5rem; margin-top: 1.5rem;
  border-top: 1px dotted rgb(110 80 50 / .25);
}
.snail {
  position: absolute; left: 0; bottom: 1.2rem; width: 3.6rem;
  animation: creep 26s linear infinite;
}
@keyframes creep {
  0%   { transform: translateX(0); }
  70%  { transform: translateX(13rem); }
  100% { transform: translateX(17rem); }
}
.knight {
  position: absolute; left: 21rem; bottom: .6rem; width: 4.4rem;
  animation: flee 26s linear infinite;
}
.knight .lance { transform-origin: 44px 36px; animation: tremble .12s infinite alternate; }
.knight .sweat { opacity: 0; animation: sweat 26s infinite; }
@keyframes tremble { to { transform: rotate(3deg); } }
@keyframes sweat { 0%, 45% { opacity: 0; } 50%, 70% { opacity: 1; } 75%, 100% { opacity: 0; } }
@keyframes flee {
  0%, 68%  { transform: none; }
  70%      { transform: scaleX(-1); }
  85%      { transform: translateX(9rem) scaleX(-1); opacity: 1; }
  86%, 94% { transform: translateX(9rem) scaleX(-1); opacity: 0; }
  100%     { transform: none; opacity: 1; }
}
.bas-cap {
  position: absolute; right: 0; bottom: 0;
  font: italic .72rem var(--hand-late); color: rgb(80 60 40 / .6);
}

/* ── nothing, in a strange unlettered hand ─────── */
.screen { margin: 1.4rem 0 1.6rem; }
.glass {
  max-width: 22rem;
  margin: auto;
  padding: 1.1rem 1.5rem .6rem;
  text-align: center;
  font-family: system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color: #1d1a17;
  background: rgb(255 253 246 / .55);
  border: 2px solid var(--ink);
  outline: 1px solid var(--red); outline-offset: 4px;
  border-radius: 3px;
}
.glass .nf { margin: 0; font-size: 1.7rem; font-weight: 700; line-height: 1.3; }
.glass hr { border: 0; border-top: 1px solid #555; margin: .7rem 0 .5rem; }
.glass .nginx { margin: 0; font-size: .95rem; }
.screen figcaption { text-align: center; font: italic .75rem var(--hand-late); opacity: .6; margin-top: .55rem; }

.o {
  display: inline-block;
  animation: roll linear both;
  animation-timeline: view();
  animation-range: cover 48% cover 75%;
}
@keyframes roll {
  0%   { transform: none; }
  15%  { transform: rotate(-18deg); }
  28%  { transform: translate(.08em, .04em) rotate(14deg); }
  40%  { transform: translate(.4em, .9em) rotate(120deg); }
  100% { transform: translate(11em, 1.6em) rotate(900deg); color: var(--red); }
}

/* ── the copied nothing ────────────────────────── */
.nothing {
  padding: .3rem 0;
  background:
    radial-gradient(circle, rgb(80 60 40 / .35) 1px, transparent 1.5px) left 0 top .9rem / 6px 1.8rem repeat-y,
    radial-gradient(circle, rgb(80 60 40 / .35) 1px, transparent 1.5px) right 0 top .9rem / 6px 1.8rem repeat-y;
}

/* ── Bede ──────────────────────────────────────── */
.bede { padding-bottom: 5rem; }
.paws { position: absolute; inset: 0 0 4rem; pointer-events: none; z-index: 2; }
.paws svg {
  position: absolute; width: 1.6rem; height: 1.6rem;
  fill: rgb(28 18 12 / .72);
  rotate: var(--r);
  animation: step linear both;
  animation-timeline: view();
  animation-range: cover 34% cover 40%;
}
.paws svg:nth-child(odd) { translate: .7rem 0; }
@keyframes step {
  from { opacity: 0; transform: scale(1.8); }
  to   { opacity: 1; transform: scale(1); }
}
.cat {
  position: absolute; right: 0; bottom: -.5rem;
  width: 6rem; text-align: center;
}
.cat svg { width: 5rem; display: block; margin: auto; overflow: visible; }
.cat .bas-cap { position: static; }
.cat .tail { transform-origin: 58px 66px; animation: swish 2.4s ease-in-out infinite; }
.cat .eyes { transform-origin: 34px 25px; animation: blink 5s infinite; }
@keyframes swish { 50% { transform: rotate(-14deg) scaleY(.9); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }

/* ── the gilded numbers ────────────────────────── */
.illum {
  position: relative;
  width: fit-content;
  margin: 2.5rem auto 1rem;
  padding: .6rem 2.4rem 1.6rem;
  border: 3px solid var(--gold);
  outline: 4px solid var(--blue); outline-offset: 3px;
  background:
    radial-gradient(circle, rgb(240 200 90 / .9) 1.2px, transparent 1.7px) 6px 6px / 12px 12px,
    conic-gradient(#7d1c16 25%, #1f3f8a 0 50%, #7d1c16 0 75%, #1f3f8a 0) 0 0 / 24px 24px;
  box-shadow: 0 6px 18px rgb(60 30 10 / .35);
}
.gilt { position: relative; font: bold 7rem/1.05 "Palatino Linotype", Palatino, Georgia, serif; letter-spacing: .04em; }
.gilt-ghost { color: transparent; -webkit-text-stroke: 1.5px rgb(250 235 190 / .55); }
.gilt-gold {
  position: absolute; inset: 0;
  color: transparent;
  background: linear-gradient(115deg, transparent 35%, rgb(255 255 240 / .95) 50%, transparent 65%) 0 0 / 300% 100%,
              linear-gradient(#fff4b8, #e2ae2a 42%, #f8dc78 52%, #a8750f 90%);
  -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(0 2px 0 #4a2e06);
  animation: sheen 4s linear infinite, gild linear both;
  animation-timeline: auto, view();
  animation-range: normal, cover 25% cover 52%;
}
@keyframes gild {
  from { clip-path: inset(100% 0 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}
.vine { position: absolute; left: 0; right: 0; bottom: .1rem; width: 100%; height: 1.4rem; }
.bird {
  position: absolute; top: -1.75rem; left: 1.2rem; width: 2.6rem;
  animation: hop 9s infinite;
}
.bird .head { transform-origin: 26px 16px; animation: peck 9s infinite; }
@keyframes peck {
  0%, 8%, 16%, 24%, 60%, 100% { transform: rotate(0); }
  4%, 12%, 20%  { transform: rotate(55deg); }
  64%, 66%      { transform: rotate(-20deg); }
}
@keyframes hop {
  0%, 30%  { transform: translateX(0); }
  34%      { transform: translate(2rem, -.8rem); }
  38%, 70% { transform: translateX(4rem); }
  74%      { transform: translate(2rem, -.8rem) scaleX(-1); }
  78%, 100%{ transform: translateX(0); }
}

.lost-o {
  display: inline-block;
  font: 700 1.7rem system-ui, -apple-system, Arial, sans-serif;
  color: var(--red);
  animation: wobble 3s ease-in-out infinite;
}
@keyframes wobble { 50% { transform: rotate(14deg) translateX(3px); } }

/* ── the loose leaf that turns ─────────────────── */
.leaf-wrap { perspective: 1400px; margin: 1rem auto 2rem; max-width: 26rem; }
.turn-toggle { position: absolute; opacity: 0; pointer-events: none; }
.leaf {
  display: grid;
  transform-style: preserve-3d;
  transition: transform 1.3s cubic-bezier(.5, 0, .25, 1);
  rotate: -1.5deg;
}
.turn-toggle:checked + .leaf { transform: rotateY(-180deg); }
.side {
  grid-area: 1 / 1;
  padding: 1.6rem 1.8rem 1.2rem;
  text-align: center;
  backface-visibility: hidden;
  background:
    radial-gradient(ellipse at 40% 30%, #fbf1d6, #ead6a6 80%, #d6b97c);
  border-radius: 3px 8px 4px 6px;
  box-shadow: 0 10px 24px rgb(40 20 5 / .35), inset 0 0 30px rgb(140 100 40 / .25);
}
.verso { transform: rotateY(180deg); }
.colophon { margin: 0 0 .9rem; font-style: italic; color: var(--red); line-height: 1.5; }
.tr { font-size: .85rem; opacity: .7; margin: 0 0 1rem; }
.later { margin: 0 0 .8rem; font: 1rem/1.5 var(--hand-late); color: #4c3a5e; }
.hello {
  display: inline-block;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: .9rem;
  padding: 0 .3em;
  background: rgb(255 255 255 / .5);
  border: 1px solid rgb(0 0 0 / .2);
}
.links a { color: var(--blue); }
.turn-btn {
  display: inline-block;
  margin-top: .4rem;
  padding: .2rem .9rem;
  cursor: pointer;
  font-variant: small-caps;
  letter-spacing: .05em;
  color: var(--blue);
  border: 1px solid rgb(31 63 138 / .4);
  border-radius: 2px;
  transition: background .2s, transform .2s;
}
.turn-btn:hover { background: rgb(31 63 138 / .08); transform: translateY(-1px); }
.turn-toggle:focus-visible + .leaf .turn-btn { outline: 2px solid var(--red); outline-offset: 2px; }

.explicit { text-align: center; color: var(--red); letter-spacing: .3em; font-variant: small-caps; margin: 2rem 0 0; }

/* ── narrow leaves ─────────────────────────────── */
@media (max-width: 820px) {
  body { font-size: .98rem; }
  .folio { width: calc(100% - 1rem); margin-top: 1.5rem; padding: 3rem 1.2rem 4rem; }
  .folio::before { inset: 1.6rem .6rem; }
  .initial { font-size: 3.2rem; }
  .marg {
    position: relative; right: auto; top: auto !important; bottom: auto !important;
    float: right; width: 7rem; margin: 0 0 .6rem .8rem;
  }
  .knight { left: auto; right: 2rem; }
  @keyframes creep { to { transform: translateX(calc(100vw - 14rem)); } }
  .gilt { font-size: 4.5rem; }
  .candle { scale: .55; transform-origin: bottom right; opacity: .9; }
}

/* ── browsers without scroll timelines: the scribe has finished ── */
@supports not (animation-timeline: view()) {
  .l { --q: 1.1; }
  .gilt-gold { clip-path: none; }
}

@media (prefers-reduced-motion: reduce) {
  .flame, .glow, .smoke i, .manicule, .snail, .knight, .knight *, .bird, .bird .head,
  .cat *, .lost-o, .initial b, .l::after { animation: none !important; }
  .gilt-gold { animation: gild linear both; animation-timeline: view(); animation-range: cover 25% cover 52%; }
}
