/* LUZ, css/base.css
   Everything colours itself from the custom properties core writes on :root.
   No literal colours below except pure black and white used as alpha carriers. */

/* ------------------------------------------------------------------ fonts */
/* Self hosted, latin subset, straight from the Google Fonts files (all three
   families are under the SIL Open Font License). Nothing is fetched from
   googleapis.com or gstatic.com at runtime. */

@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-400-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* seeded so the page is never unstyled, core overwrites on the first tick */
  --sky-top: rgb(26, 110, 214);
  --sky-bottom: rgb(210, 234, 248);
  --sea: rgb(12, 89, 167);
  --sea-deep: rgb(4, 51, 107);
  --sun: rgb(255, 255, 255);
  --glow: rgb(255, 249, 226);
  --ink: rgb(255, 255, 255);
  --paper: rgb(7, 24, 44);
  --mist: rgb(168, 207, 230);
  --sun-x: 0.5;
  --sun-y: 0.35;
  --moon-x: 0.5;
  --moon-y: 1.2;
  --night: 0;
  --warmth: 0.1;
  --grain: none;

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --gut: clamp(1.25rem, 4vw, 4.5rem);
  --rule: color-mix(in srgb, var(--ink) 16%, transparent);
  --scrim: color-mix(in srgb, var(--paper) 78%, transparent);
  color-scheme: dark;
}

* { box-sizing: border-box; }

/* one rule, so nothing has to fight the attribute element by element */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
}

/* the guard against sideways scroll lives on the root only. On body it would
   turn body into a clip container and every position: sticky in the chapters
   would silently stop sticking. */
html {
  overflow-x: clip;
  scroll-behavior: auto;
}

body {
  background: var(--sea-deep);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.94rem + 0.3vw, 1.12rem);
  line-height: 1.65;
  letter-spacing: 0.012em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

a { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 1px; }

:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--ink) 72%, var(--sun));
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--paper);
  color: var(--ink);
  padding: 0.75rem 1.1rem;
  font: 500 0.82rem/1 var(--mono);
}
.skip:focus { left: 0.6rem; top: 0.6rem; }

.u-caps {
  font-family: var(--sans);
  font-size: clamp(0.62rem, 0.55rem + 0.22vw, 0.74rem);
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.u-mono {
  font-family: var(--mono);
  font-size: clamp(0.66rem, 0.6rem + 0.2vw, 0.78rem);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ scene */

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, var(--sky-top) 0%, var(--sky-bottom) 52%, var(--sea) 53%, var(--sea-deep) 100%);
}

/* the grain sits over everything, generated at runtime, never downloaded */
.grain {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  background-image: var(--grain);
  background-size: 128px 128px;
  opacity: 0.5;
  mix-blend-mode: soft-light;
}

/* a single soft glow anchored to the real position of the sun on screen */
.aura {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(38vmax 38vmax at calc(var(--sun-x) * 100%) calc(var(--sun-y) * 100%),
      color-mix(in srgb, var(--glow) 40%, transparent) 0%,
      transparent 62%),
    radial-gradient(20vmax 20vmax at calc(var(--moon-x) * 100%) calc(var(--moon-y) * 100%),
      color-mix(in srgb, var(--mist) calc(var(--night) * 26%), transparent) 0%,
      transparent 70%);
  opacity: calc(0.35 + var(--warmth) * 0.5);
}

/* ----------------------------------------------------------------- loader */

#loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: var(--sea-deep);
}

.loader-frame {
  position: relative;
  width: min(58vw, 260px);
  height: min(29vw, 130px);
  overflow: hidden;
}
.loader-sun {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 74px;
  height: 74px;
  margin-left: -37px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--sun) 34%, color-mix(in srgb, var(--glow) 70%, transparent) 62%, transparent 74%);
  transform: translateY(58%);
}
.loader-line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: rgb(255 255 255 / 0.34);
}
.loader-word {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2.4rem;
  text-align: center;
  color: rgb(255 255 255 / 0.68);
}
#loader.is-gone { opacity: 0; pointer-events: none; }

/* ------------------------------------------------------------------- hero */

/* the light is allowed to be bright: the words get their own weather */
#hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(102deg,
      color-mix(in srgb, var(--paper) 62%, transparent) 0%,
      color-mix(in srgb, var(--paper) 30%, transparent) 30%,
      color-mix(in srgb, var(--paper) 8%, transparent) 52%,
      transparent 68%),
    linear-gradient(to top,
      color-mix(in srgb, var(--paper) 40%, transparent) 0%,
      color-mix(in srgb, var(--paper) 16%, transparent) 30%,
      transparent 54%);
}

#hero {
  position: relative;
  isolation: isolate;
  z-index: 2;
  min-height: 100svh;
  padding: clamp(1rem, 2.4vw, 2rem) var(--gut) 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 1rem;
}

.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.hero-kicker { color: color-mix(in srgb, var(--ink) 96%, transparent); }
.hero-tools { display: flex; gap: 0.5rem; }

.btn {
  appearance: none;
  border: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 42%, transparent);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  min-height: 44px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.btn:hover { border-color: color-mix(in srgb, var(--ink) 40%, transparent); }
.btn[aria-pressed="true"] {
  /* pressed reads as a denser pill, never as a darker one: the label is ink and
     the ground has to stay away from it at both ends of the day */
  background: color-mix(in srgb, var(--paper) 72%, transparent);
  border-color: color-mix(in srgb, var(--sun) 60%, var(--ink));
}

.hero-mid {
  display: grid;
  align-content: center;
  justify-items: start;
  padding-block: clamp(0.5rem, 4vh, 3rem);
  min-height: 0;
}

.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(4rem, min(28vw, 36vh), 26rem);
  line-height: 0.82;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
  text-shadow: 0 0.06em 0.5em color-mix(in srgb, var(--paper) 45%, transparent);
}

.hero-line {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.05rem, min(1rem + 1.5vw, 3.4vh), 2.35rem);
  line-height: 1.3;
  max-width: 30ch;
  margin: clamp(0.4rem, 1.4vh, 1.1rem) 0 0;
  color: color-mix(in srgb, var(--ink) 97%, transparent);
  text-shadow: 0 1px 14px color-mix(in srgb, var(--paper) 62%, transparent);
}

.hero-foot {
  position: relative;
  display: grid;
  gap: clamp(0.5rem, 1.4vh, 1rem);
  padding-bottom: clamp(0.75rem, 2vh, 1.5rem);
  text-shadow: 0 1px 12px color-mix(in srgb, var(--paper) 74%, transparent);
}

/* the lower third: a band of paper under the clock and the dial, so the small
   type keeps its contrast against a noon sky as well as against a night one */
.hero-foot::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -2.6rem;
  bottom: 0;
  left: calc(var(--gut) * -1);
  right: calc(var(--gut) * -1);
  pointer-events: none;
  background: linear-gradient(to top,
    color-mix(in srgb, var(--paper) 80%, transparent) 0%,
    color-mix(in srgb, var(--paper) 72%, transparent) 52%,
    color-mix(in srgb, var(--paper) 44%, transparent) 80%,
    transparent 100%);
}

.clock {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.9rem;
  color: color-mix(in srgb, var(--ink) 96%, transparent);
}
#clock-time {
  font-family: var(--mono);
  font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2.1rem);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
#clock-line {
  font-family: var(--mono);
  font-size: clamp(0.68rem, 0.6rem + 0.3vw, 0.82rem);
  letter-spacing: 0.05em;
  color: color-mix(in srgb, var(--ink) 88%, transparent);
}
[data-moment] #clock-line { color: var(--ink); }

/* -------------------------------------------------------------------- dial */

#dial {
  position: relative;
  height: clamp(92px, 13vh, 132px);
  margin-bottom: 1.5rem;
  /* the page still scrolls with a finger on the dial. Core takes the gesture
     over only once the finger has travelled sideways. */
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
#dial.is-scrubbing { touch-action: none; cursor: grabbing; }
#dial:active { cursor: grabbing; }
#dial svg { width: 100%; height: 100%; display: block; overflow: visible; }

.dial-arc { fill: none; stroke: color-mix(in srgb, var(--ink) 26%, transparent); stroke-width: 1; vector-effect: non-scaling-stroke; }
.dial-arc-day { stroke: color-mix(in srgb, var(--ink) 52%, transparent); }
.dial-horizon { stroke: color-mix(in srgb, var(--ink) 18%, transparent); stroke-width: 1; stroke-dasharray: 2 5; vector-effect: non-scaling-stroke; }
.dial-tick { stroke: color-mix(in srgb, var(--ink) 40%, transparent); stroke-width: 1; vector-effect: non-scaling-stroke; }

.dial-label {
  position: absolute;
  transform: translateX(-50%);
  bottom: -1.35rem;
  white-space: nowrap;
  color: color-mix(in srgb, var(--ink) 72%, transparent);
  pointer-events: none;
}

.dial-knob,
.dial-moon {
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.dial-knob::after {
  content: "";
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--sun);
  box-shadow:
    0 0 0 1.5px color-mix(in srgb, var(--ink) 42%, transparent),
    0 0 18px 6px color-mix(in srgb, var(--glow) 62%, transparent);
}
/* the beat at the horizon: the knob draws a ring while the sun crosses */
#dial.is-moment .dial-knob::after {
  box-shadow:
    0 0 0 1.5px color-mix(in srgb, var(--ink) 52%, transparent),
    0 0 0 7px color-mix(in srgb, var(--sun) 30%, transparent),
    0 0 26px 10px color-mix(in srgb, var(--glow) 78%, transparent);
}
.dial-moon::after {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) calc(30% + var(--moon-illum, 0.5) * 60%), var(--paper));
  box-shadow: 0 0 10px 2px color-mix(in srgb, var(--mist) 40%, transparent);
  opacity: calc(0.35 + var(--night) * 0.65);
}
#dial:focus-visible { outline-offset: 6px; }

#dial-labels { position: absolute; inset: 0; pointer-events: none; }

/* the invitation rides under the sun itself, never in the far corner */
.hero-scrub {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  padding: 0.34rem 0.66rem;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
  color: color-mix(in srgb, var(--ink) 92%, transparent);
  background: color-mix(in srgb, var(--paper) 72%, transparent);
  border: 1px solid color-mix(in srgb, var(--ink) 16%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  text-shadow: none;
  will-change: transform;
}

#back-to-now {
  justify-self: start;
  border-color: color-mix(in srgb, var(--sun) 55%, var(--ink));
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  align-items: center;
  margin-left: auto;
}
.clock-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.2rem;
}

/* --------------------------------------------------------------- chapters */

#main { position: relative; z-index: 2; }

.chapter {
  position: relative;
  display: grid;
  min-height: 150svh;
  padding-inline: var(--gut);
}

.chapter-media,
.chapter-stage,
.chapter-copy {
  grid-area: 1 / 1;
  position: sticky;
  top: 0;
  height: 100svh;
}

.chapter-media { z-index: 1; display: grid; place-items: center; }
.chapter-stage { z-index: 2; pointer-events: none; }
.chapter-copy { z-index: 3; pointer-events: none; display: grid; align-content: end; padding-bottom: clamp(2rem, 8vh, 5.5rem); }

.chapter-media-inner {
  position: relative;
  width: min(100%, 1120px);
  aspect-ratio: 16 / 9;
  max-height: 70svh;
  border-radius: 3px;
  border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
  box-shadow: 0 30px 90px -30px rgb(0 0 0 / 0.55);
  overflow: hidden;
  background: var(--chapter-fallback, linear-gradient(to bottom, var(--sky-top), var(--sea-deep)));
  will-change: transform;
}
.chapter-media-inner::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--grain);
  background-size: 128px 128px;
  opacity: 0.42;
  mix-blend-mode: overlay;
  pointer-events: none;
}
.chapter-media-inner img,
.chapter-media-inner video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* per phase gradients, the fallback that carries the page until the photos land */
#ch-madrugada  { --chapter-fallback: linear-gradient(168deg, rgb(6 10 26) 0%, rgb(14 22 52) 46%, rgb(4 7 18) 100%); }
#ch-alvorada   { --chapter-fallback: linear-gradient(168deg, rgb(38 52 104) 0%, rgb(214 132 96) 58%, rgb(255 197 138) 100%); }
#ch-manha      { --chapter-fallback: linear-gradient(168deg, rgb(24 88 178) 0%, rgb(120 186 232) 60%, rgb(18 74 140) 100%); }
#ch-meio-dia   { --chapter-fallback: linear-gradient(168deg, rgb(20 106 208) 0%, rgb(206 234 248) 54%, rgb(12 86 162) 100%); }
#ch-tarde      { --chapter-fallback: linear-gradient(168deg, rgb(46 104 170) 0%, rgb(232 178 108) 62%, rgb(180 96 44) 100%); }
#ch-hora-azul  { --chapter-fallback: linear-gradient(168deg, rgb(12 20 58) 0%, rgb(74 76 140) 52%, rgb(158 104 112) 100%); }
#ch-noite      { --chapter-fallback: linear-gradient(168deg, rgb(3 5 14) 0%, rgb(10 18 42) 50%, rgb(2 4 11) 100%); }

.chapter-copy-inner {
  pointer-events: auto;
  max-width: 44ch;
  padding: clamp(1rem, 2.4vw, 1.9rem) clamp(1rem, 2.4vw, 2.1rem);
  border-radius: 2px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--paper) 76%, transparent) 0%,
    color-mix(in srgb, var(--paper) 90%, transparent) 34%,
    color-mix(in srgb, var(--paper) 95%, transparent) 100%);
  border-left: 1px solid color-mix(in srgb, var(--sun) 55%, var(--ink));
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.chapter-index { margin: 0 0 0.5rem; color: color-mix(in srgb, var(--ink) 78%, transparent); }
.chapter-title {
  text-shadow: 0 1px 16px color-mix(in srgb, var(--paper) 70%, transparent);
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.1rem, 1.4rem + 3.2vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
  margin: 0 0 0.55rem;
}
.chapter-line { margin: 0 0 0.35rem; color: color-mix(in srgb, var(--ink) 94%, transparent); }
.chapter-line-2 { color: color-mix(in srgb, var(--ink) 80%, transparent); }
.chapter-hint {
  margin: 0.9rem 0 0;
  color: color-mix(in srgb, var(--ink) 78%, transparent);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.chapter-hint::before {
  content: "";
  width: 1.6rem;
  height: 1px;
  background: color-mix(in srgb, var(--sun) 60%, var(--ink));
  flex: none;
}

/* ------------------------------------------------------ modules from B and C */

#postcard:empty, #book:empty { display: none; }
#postcard, #book { position: relative; z-index: 2; }

/* ---------------------------------------------------------------- credits */

#credits {
  position: relative;
  z-index: 2;
  padding: clamp(3rem, 9vh, 7rem) var(--gut) clamp(2rem, 5vh, 3.5rem);
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--paper) 88%, transparent) 34%);
  display: grid;
  gap: 1.4rem;
}
.credits-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.4rem;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px solid var(--rule);
  padding-top: 1.4rem;
}
.credits-made { font-family: var(--serif); font-size: clamp(1.1rem, 0.9rem + 0.9vw, 1.6rem); margin: 0; }
.credits-made a { color: var(--ink); text-decoration-color: color-mix(in srgb, var(--sun) 60%, var(--ink)); }
.credits-eggs { margin: 0; color: color-mix(in srgb, var(--ink) 78%, transparent); max-width: 46ch; }
.credits-legal { margin: 0; color: color-mix(in srgb, var(--ink) 74%, transparent); max-width: 52ch; }

/* -------------------------------------------------------------------- 404 */

.nf {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  display: grid;
  align-content: center;
  gap: 1.2rem;
  padding: var(--gut);
}
.nf h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.6rem, 1.6rem + 6vw, 7rem); line-height: 0.95; margin: 0; }
.nf p { margin: 0; max-width: 42ch; color: color-mix(in srgb, var(--ink) 88%, transparent); }
#lighthouse { min-height: 0; }
.nf-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 0.6rem; }

/* --------------------------------------------------------------- responsive */

@media (max-width: 760px) {
  .hero-title { line-height: 0.86; }
  .chapter { min-height: 140svh; }
  .chapter-media-inner { aspect-ratio: 4 / 5; max-height: 62svh; }
  .chapter-copy { padding-bottom: clamp(1.5rem, 6vh, 3rem); }
  .chapter-copy-inner { max-width: none; }
  .hero-meta { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 420px) {
  .hero-top { flex-direction: column; gap: 0.6rem; }
  .hero-tools { align-self: flex-start; }
}

/* ------------------------------------------------------------ motion rules */
/* Every resting state above is already the visible one. Motion is added here
   and only here, so reduced motion needs no undoing. */

@media (prefers-reduced-motion: no-preference) {
  #loader { transition: opacity 0.7s ease; }
  .loader-sun { animation: luz-rise 1.9s cubic-bezier(0.22, 1, 0.36, 1) infinite; }
  @keyframes luz-rise {
    0% { transform: translateY(58%); opacity: 0.35; }
    55% { transform: translateY(-4%); opacity: 1; }
    100% { transform: translateY(-4%); opacity: 0.75; }
  }
  .btn { transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease; }
  .btn:hover { transform: translateY(-1px); }
  .dial-knob, .dial-moon { transition: transform 0.12s linear; }
  .chapter-media-inner { transition: box-shadow 0.6s ease; }
  .hero-scrub { transition: transform 0.12s linear; }
  #dial.is-moment .dial-knob::after { transition: box-shadow 0.25s ease; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain { opacity: 0.35; }
}

/* ------------------------------------------------ phones: the photo owns the screen */
/* Below 760 px the chapter photo goes full bleed and the copy becomes a low bottom
   sheet fading out of the picture, instead of a paper card sitting on a small 4:5 frame. */
@media (max-width: 760px) {
  .chapter { padding-inline: 0; min-height: 150svh; }
  .chapter-media { place-items: stretch; }
  .chapter-media-inner {
    width: 100%;
    height: 100svh;
    max-height: none;
    aspect-ratio: auto;
    border-radius: 0;
    border: 0;
    box-shadow: none;
  }
  .chapter-copy { padding: 0; align-content: end; }
  .chapter-copy-inner {
    max-width: none;
    margin: 0;
    padding: 5rem var(--gut) calc(1.1rem + env(safe-area-inset-bottom, 0px));
    border-left: 0;
    border-radius: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: linear-gradient(180deg,
      transparent 0%,
      color-mix(in srgb, var(--paper) 58%, transparent) 26%,
      color-mix(in srgb, var(--paper) 88%, transparent) 58%,
      color-mix(in srgb, var(--paper) 94%, transparent) 100%);
  }
  .chapter-index { margin-bottom: 0.3rem; font-size: 0.7rem; }
  .chapter-title { font-size: clamp(2rem, 9.5vw, 2.6rem); margin-bottom: 0.4rem; }
  .chapter-line { font-size: 0.98rem; line-height: 1.42; margin-bottom: 0.25rem; }
  .chapter-hint { margin-top: 0.6rem; font-size: 0.72rem; line-height: 1.35; }
}
