/* =========================================
   THE REEL (/reel, reel.php)
   A dark film frame on the light page. rl-* classes; body.reel-page.
   Scenes are built by assets/js/reel.js, which sets --p (0 to 1, the
   scene's progress) on each scene every frame. All movement here is
   worked out from --p, so pausing, seeking and replaying are exact.
   Sizes inside the frame use container units (cqw/cqh), so the frame
   scales like a video, from a phone held upright to full screen.
   ========================================= */

body.reel-page {
  --banner-h: clamp(200px, 30vh, 300px);
  --banner-pos: center 60%;
  --sheet-edge: -60px;
}

/* The film's own colours and type, wherever the frame is (/reel and the
   home page's band). */
body.reel-page,
.rl {
  --rl-serif: Georgia, "Times New Roman", serif;
  --rl-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --rl-gold: #d9b26a;
  --rl-cream: #f3e9d4;
  --rl-night: #0d0f0c;
}

.rl-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px 32px;
  box-sizing: border-box;
  color: var(--ls-ink);
}

/* ---------- Intro ---------- */

.rl-intro {
  max-width: 46rem;
  margin: 0 auto 18px;
  text-align: center;
}

.rl-kicker {
  font-family: var(--rl-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ls-accent-deep);
  margin: 0 0 6px;
}

.rl-intro h1 {
  font-family: var(--rl-serif);
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  line-height: 1.15;
  margin: 0 0 8px;
  text-wrap: balance;
}

.rl-lede {
  margin: 0;
  color: var(--ls-ink-soft);
  text-wrap: pretty;
}

.rl-lede a {
  color: var(--ls-link);
}

/* ---------- The frame ---------- */

.rl {
  --rl-ratio: 16 / 9;
  --rl-max-h: 78svh;
  position: relative;
  margin: 0 auto 40px;
  width: min(100%, calc(var(--rl-max-h) * 16 / 9));
}

@media (max-aspect-ratio: 4/5) {
  .rl {
    --rl-ratio: 4 / 5;
    width: min(100%, calc(var(--rl-max-h) * 4 / 5));
  }
}

/* The home page's band (index.php): wide on desktop, never shorter than the
   scenes can be read at (about 290px), so 16:9 on tablets and 4:3 on phones.
   .rl.rl-band outranks the upright-screen rule above. */
.rl.rl-band {
  --rl-ratio: 21 / 9;
  width: 100%;
  margin: 0;
}

@media (max-width: 900px) {
  .rl.rl-band { --rl-ratio: 16 / 9; }
}

@media (max-width: 600px) {
  .rl.rl-band { --rl-ratio: 4 / 3; }
}

.rl-stage {
  container: rl / size;
  position: relative;
  aspect-ratio: var(--rl-ratio);
  overflow: hidden;
  border-radius: 6px;
  background: var(--rl-night);
  color: var(--rl-cream);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.5),
    0 30px 60px -20px rgba(30,18,6,0.55),
    0 12px 24px -12px rgba(30,18,6,0.4);
  isolation: isolate;
}

.rl:fullscreen {
  width: 100%;
  margin: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.rl:fullscreen .rl-stage {
  aspect-ratio: auto;
  flex: 1;
  border-radius: 0;
}

.rl-scenes {
  position: absolute;
  inset: 0;
  view-transition-name: rl-scenes;
}

.rl-scene {
  position: absolute;
  inset: 0;
  display: block;
  color: inherit;
  text-decoration: none;
  overflow: hidden;
}

/* Rain and dust, drawn by reel.js. */
.rl-weather {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}

/* Film grain: a generated noise tile, so it costs no download. */
.rl-grain {
  position: absolute;
  inset: -50%;
  z-index: 4;
  pointer-events: none;
  opacity: 0.13;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 1.4 -.2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: rl-grain 0.9s steps(6) infinite;
}

@keyframes rl-grain {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-7%, 4%); }
  40%  { transform: translate(5%, -6%); }
  60%  { transform: translate(-3%, 8%); }
  80%  { transform: translate(8%, 2%); }
  100% { transform: translate(-5%, -4%); }
}

.rl-vignette {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.55) 100%),
    linear-gradient(180deg, rgba(0,0,0,0.25), transparent 14%, transparent 86%, rgba(0,0,0,0.3));
}

.rl-timecode {
  position: absolute;
  top: 3.2cqh;
  right: 3cqw;
  z-index: 6;
  margin: 0;
  font: 500 max(10px, 1.1cqw) / 1 ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.12em;
  color: rgba(243,233,212,0.55);
  pointer-events: none;
}

.rl-timecode::before {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  margin-right: 0.6em;
  border-radius: 50%;
  background: #c4462c;
  vertical-align: 0.05em;
  animation: rl-blink 1.6s steps(1) infinite;
}

.rl[data-state="paused"] .rl-timecode::before,
.rl[data-state="idle"] .rl-timecode::before {
  animation: none;
  background: rgba(243,233,212,0.4);
}

@keyframes rl-blink { 50% { opacity: 0; } }

.rl[data-state="paused"] .rl-grain { animation-play-state: paused; }

.rl-big-play {
  position: absolute;
  left: 50%;
  bottom: 12cqh;
  z-index: 7;
  translate: -50% 0;
  padding: 0.75em 1.4em;
  border: 1px solid rgba(217,178,106,0.7);
  border-radius: 999px;
  background: rgba(13,15,12,0.55);
  backdrop-filter: blur(6px);
  color: var(--rl-cream);
  font: 600 max(14px, 1.4cqw) / 1 var(--rl-sans);
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.rl-big-play:hover,
.rl-big-play:focus-visible {
  background: rgba(150,82,32,0.85);
}

.rl:not([data-state="idle"]) .rl-big-play {
  display: none;
}

/* ---------- Controls ---------- */

.rl-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.rl-controls[hidden],
.rl-btn[hidden] { display: none; }

.rl:fullscreen .rl-controls {
  padding: 10px 16px 14px;
  margin: 0;
}

.rl-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--ls-hairline);
  border-radius: 50%;
  background: var(--ls-field-bg, #fff8ec);
  color: var(--ls-ink);
  cursor: pointer;
}

.rl:fullscreen .rl-btn {
  background: #1b1b17;
  color: var(--rl-cream);
  border-color: #3a352b;
}

.rl-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.rl-btn:hover,
.rl-btn:focus-visible {
  border-color: var(--ls-accent);
}

.rl .rl-i-play { display: none; }
.rl[data-state="paused"] .rl-i-play,
.rl[data-state="ended"] .rl-i-play { display: block; }
.rl[data-state="paused"] .rl-i-pause,
.rl[data-state="ended"] .rl-i-pause { display: none; }

.rl-chapters {
  flex: 1;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
}

.rl-chapters li {
  flex: var(--w, 1) 1 0;
  min-width: 0;
}

.rl-chapters button {
  display: block;
  width: 100%;
  padding: 6px 0 0;
  border: 0;
  background: none;
  font: 600 0.68rem / 1.2 var(--rl-sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  color: var(--ls-muted);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rl:fullscreen .rl-chapters button { color: #a89d88; }

.rl-chapters button::before {
  content: "";
  display: block;
  height: 4px;
  margin-bottom: 6px;
  border-radius: 2px;
  background:
    linear-gradient(90deg, var(--ls-accent) calc(var(--fill, 0) * 100%), transparent 0)
    rgba(168,98,44,0.18);
}

.rl-chapters button[aria-current="step"] { color: var(--ls-ink); }
.rl:fullscreen .rl-chapters button[aria-current="step"] { color: var(--rl-cream); }

@media (max-width: 560px) {
  .rl-chapters button { font-size: 0; padding-top: 10px; }
  .rl-chapters button::before { margin-bottom: 10px; }
}

/* ---------- Shared scene parts ---------- */

/* 0 until --p passes --from, then to 1 over --span. */
.rl-in {
  --from: 0;
  --span: 0.15;
  --k: clamp(0, (var(--p) - var(--from)) / var(--span), 1);
  opacity: var(--k);
  translate: 0 calc((1 - var(--k)) * 2cqh);
}

.rl-label {
  margin: 0;
  font: 600 max(10px, 1.15cqw) / 1.3 var(--rl-sans);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rl-gold);
}

.rl-cta {
  display: inline-block;
  margin-top: 2.4cqh;
  padding: 0.7em 1.2em;
  border: 1px solid rgba(217,178,106,0.75);
  border-radius: 999px;
  font: 600 max(12px, 1.25cqw) / 1 var(--rl-sans);
  letter-spacing: 0.05em;
  color: var(--rl-cream);
  background: rgba(13,15,12,0.35);
  transition: background 0.2s;
}

a.rl-scene:hover .rl-cta,
a.rl-scene:focus-visible .rl-cta,
.rl-cta:hover,
.rl-cta:focus-visible {
  background: #965220;
  border-color: #965220;
}

.rl-scene a:focus-visible,
a.rl-scene:focus-visible {
  outline: 2px solid var(--rl-gold);
  outline-offset: -4px;
}

/* ---------- Poster (before play, and the reduced-motion still) ---------- */

.rl-poster,
.rl-open,
.rl-end {
  display: grid;
  place-content: center;
  text-align: center;
}

.rl-poster-sky,
.rl-open-sky,
.rl-end-sky {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(13,15,12,0.15), rgba(13,15,12,0.75)),
    url("/assets/images/img/fence-storm-banner.webp") 70% 60% / cover no-repeat;
}

.rl-poster-sky { filter: saturate(0.8) brightness(0.7); }

.rl-signal {
  margin: 0 0 2cqh;
  font: 500 max(10px, 1.2cqw) / 1 ui-monospace, Consolas, monospace;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(243,233,212,0.7);
}

.rl-poster-title,
.rl-open-title,
.rl-end-name {
  margin: 0;
  white-space: nowrap;
  font: 400 clamp(28px, 9cqw, 140px) / 0.95 var(--rl-serif);
  letter-spacing: 0.04em;
  color: var(--rl-cream);
  text-shadow: 0 0.04em 0.4em rgba(0,0,0,0.6);
}

.rl-poster-sub {
  margin: 2cqh 0 0;
  font: 600 max(11px, 1.3cqw) / 1 var(--rl-sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rl-gold);
}

/* ---------- 1. Cold open ---------- */

.rl-open-sky {
  --k: clamp(0, (var(--p) - 0.3) / 0.35, 1);
  opacity: var(--k);
  scale: calc(1.18 - var(--p) * 0.14);
  filter: saturate(calc(0.4 + var(--k) * 0.5)) brightness(calc(0.35 + var(--k) * 0.45));
}

.rl-open .rl-signal {
  --k: clamp(0, var(--p) / 0.05, 1);
  opacity: calc(var(--k) * (1 - clamp(0, (var(--p) - 0.42) / 0.08, 1)));
  animation: rl-flicker 2.2s steps(1) infinite;
}

.rl-open-status {
  margin: 0;
  font: 500 max(9px, 0.95cqw) / 1.6 ui-monospace, Consolas, monospace;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(243,233,212,0.45);
  opacity: calc(clamp(0, (var(--p) - 0.08) / 0.06, 1) * (1 - clamp(0, (var(--p) - 0.42) / 0.08, 1)));
}

.rl-open-titles {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
}

.rl-open-title {
  --k: clamp(0, (var(--p) - 0.45) / 0.3, 1);
  opacity: var(--k);
  /* Letters close up as the title arrives; one line throughout. */
  --spread: 0.46em;
  white-space: nowrap;
  letter-spacing: calc(0.04em + (1 - var(--k)) * var(--spread));
  filter: blur(calc((1 - var(--k)) * 12px));
}

.rl-open-sub {
  --from: 0.72;
}

.rl-open-sub .rl-label {
  margin-top: 2.4cqh;
}

@keyframes rl-flicker {
  0%, 100% { filter: none; }
  47% { filter: brightness(2.2); }
  48% { filter: none; }
  71% { filter: blur(1px); }
  72% { filter: none; }
}

/* ---------- 2. A story in full ---------- */

.rl-hero {
  display: grid;
  grid-template-columns: 38cqw 1fr;
  align-items: center;
  gap: 5cqw;
  padding: 0 8cqw 0 9cqw;
  perspective: 120cqw;
}

.rl-hero.rl-flip {
  grid-template-columns: 1fr 38cqw;
  padding: 0 9cqw 0 8cqw;
}

.rl-hero.rl-flip .rl-hero-cover { order: 2; }

.rl-hero-bg {
  position: absolute;
  inset: -10%;
  z-index: -1;
  background: var(--img) center / cover no-repeat;
  filter: blur(40px) saturate(1.1) brightness(0.42);
  scale: calc(1.15 + var(--p) * 0.12);
}

.rl-hero-cover {
  --k: clamp(0, var(--p) / 0.22, 1);
  justify-self: center;
  position: relative;
  margin: 0;
  width: min(30cqw, 54cqh);
  aspect-ratio: 2 / 3;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 3cqh 6cqh rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.06);
  transform:
    rotateY(calc((1 - var(--k)) * -28deg + var(--p) * 8deg))
    translateZ(calc(var(--k) * 4cqw))
    translateY(calc((1 - var(--k)) * 6cqh));
  opacity: var(--k);
  view-transition-name: rl-cover;
}

.rl-flip .rl-hero-cover {
  transform:
    rotateY(calc((1 - var(--k)) * 28deg - var(--p) * 8deg))
    translateZ(calc(var(--k) * 4cqw))
    translateY(calc((1 - var(--k)) * 6cqh));
}

.rl-hero-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  scale: calc(1.02 + var(--p) * 0.1);
}

/* A slow light passing across the cover. */
.rl-hero-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255,240,210,0.28) 50%, transparent 65%);
  translate: calc(-110% + var(--p) * 230%) 0;
}

.rl-hero-text {
  max-width: 50cqw;
}

.rl-hero .rl-label { --from: 0.12; }

.rl-hero-title {
  --k: clamp(0, (var(--p) - 0.16) / 0.18, 1);
  margin: 1.6cqh 0 2.2cqh;
  font: 400 clamp(22px, 5.4cqw, 86px) / 1.02 var(--rl-serif);
  color: var(--rl-cream);
  text-wrap: balance;
  clip-path: inset(-10% calc((1 - var(--k)) * 100%) -20% 0);
  text-shadow: 0 0.05em 0.5em rgba(0,0,0,0.5);
}

.rl-hero-line {
  margin: 0;
  font: italic 400 clamp(13px, 1.9cqw, 30px) / 1.4 var(--rl-serif);
  color: rgba(243,233,212,0.88);
  text-wrap: pretty;
}

.rl-hero-line .rl-rest { visibility: hidden; }

.rl-hero-line .rl-caret {
  display: inline-block;
  width: 0.08em;
  height: 1em;
  margin-left: 0.04em;
  vertical-align: -0.12em;
  background: var(--rl-gold);
  animation: rl-blink 0.9s steps(1) infinite;
}

.rl-hero .rl-cta-wrap { --from: 0.55; }

.rl-hero-fresh {
  color: #f0c27a;
}

@container rl (aspect-ratio < 1) {
  /* Upright: a narrower frame, so the letters start closer together. */
  .rl-open-title { --spread: 0.08em; }
  .rl-hero,
  .rl-hero.rl-flip {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    align-content: center;
    gap: 3cqh;
    padding: 6cqh 8cqw;
    text-align: center;
  }
  .rl-hero.rl-flip .rl-hero-cover { order: 0; }
  .rl-hero-cover { width: min(44cqw, 36cqh); }
  .rl-hero-text { max-width: none; }
  .rl-hero-title { font-size: clamp(22px, 8.5cqw, 60px); margin: 1cqh 0 1.4cqh; }
  .rl-hero-line { font-size: clamp(13px, 3.6cqw, 22px); }
  .rl-label { font-size: max(10px, 2.4cqw); }
  .rl-cta { font-size: max(12px, 3cqw); margin-top: 1.6cqh; }
}

/* ---------- 3. The wall of every story ---------- */

.rl-wall {
  perspective: 140cqw;
  background: radial-gradient(ellipse at 50% 40%, #252219 0%, var(--rl-night) 70%);
}

.rl-wall-grid {
  position: absolute;
  left: 50%;
  top: 44%;
  display: grid;
  grid-template-columns: repeat(var(--cols), var(--tile));
  gap: calc(var(--tile) * 0.12);
  translate: -50% -50%;
  transform:
    rotateX(calc(22deg - var(--p) * 12deg))
    rotateZ(calc(-4deg + var(--p) * 4deg))
    scale(calc(0.92 + var(--p) * 0.1));
  transform-style: preserve-3d;
}

.rl-tile {
  --k: clamp(0, (var(--p) - var(--d)) / 0.12, 1);
  display: block;
  aspect-ratio: 2 / 3;
  border-radius: 2px;
  overflow: hidden;
  background: #1c1a15;
  opacity: var(--k);
  transform:
    translateZ(calc((1 - var(--k)) * 30cqw))
    rotateY(calc((1 - var(--k)) * 90deg));
  box-shadow: 0 1cqh 2cqh rgba(0,0,0,0.5);
  transition: filter 0.35s, scale 0.35s, box-shadow 0.35s;
}

.rl-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rl-wall.has-lit .rl-tile:not(.is-lit) {
  filter: brightness(0.45) saturate(0.6);
}

.rl-tile.is-lit,
.rl-tile:hover,
.rl-tile:focus-visible {
  filter: none;
  scale: 1.18;
  z-index: 2;
  box-shadow: 0 0 0 2px var(--rl-gold), 0 2cqh 4cqh rgba(0,0,0,0.7);
  position: relative;
}

.rl-wall-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 14cqh 6cqw 6cqh;
  text-align: center;
  background: linear-gradient(180deg, transparent, rgba(13,15,12,0.92) 55%);
  pointer-events: none;
}

.rl-wall-count {
  margin: 0;
  font: 400 clamp(20px, 4.2cqw, 64px) / 1.05 var(--rl-serif);
  color: var(--rl-cream);
}

.rl-wall-count b {
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: var(--rl-gold);
}

.rl-wall-now {
  display: block;
  min-height: 1.4em;
  margin: 1.2cqh 0 0;
  font: italic 400 clamp(13px, 1.8cqw, 26px) / 1.4 var(--rl-serif);
  color: rgba(243,233,212,0.85);
}

.rl-wall-now em {
  font: normal 600 0.62em / 1 var(--rl-sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rl-gold);
  margin-left: 0.8em;
}

@container rl (aspect-ratio < 1) {
  .rl-wall-grid { top: 40%; }
  .rl-wall-count { font-size: clamp(20px, 7cqw, 44px); }
  .rl-wall-now { font-size: clamp(13px, 3.6cqw, 20px); }
}

/* ---------- 4. The map ---------- */

.rl-map {
  background:
    radial-gradient(ellipse at 45% 45%, #1d2119 0%, #0b0d0a 75%);
}

.rl-map svg {
  position: absolute;
  inset: 17cqh 3cqw 14cqh;
  width: calc(100% - 6cqw);
  height: calc(100% - 31cqh);
  overflow: visible;
}

.rl-grat {
  stroke: rgba(217,178,106,0.1);
  stroke-width: 1;
  fill: none;
  vector-effect: non-scaling-stroke;
}

.rl-grat-label {
  font-family: ui-monospace, Consolas, monospace;
  fill: rgba(217,178,106,0.35);
  letter-spacing: 0.1em;
}

.rl-place {
  font-family: var(--rl-sans);
  font-weight: 600;
  letter-spacing: 0.22em;
  fill: rgba(243,233,212,0.0);
  transition: fill 0.8s;
  pointer-events: none;
}

.rl-place.is-on { fill: rgba(243,233,212,0.55); }

.rl-route {
  fill: none;
  stroke: rgba(217,178,106,0.45);
  stroke-width: 1.2;
  stroke-dasharray: 1;
  stroke-dashoffset: calc(1 - var(--route, 0));
  vector-effect: non-scaling-stroke;
}

.rl-pin {
  opacity: 0;
  transition: opacity 0.6s;
  cursor: pointer;
}

.rl-pin.is-on { opacity: 1; }

.rl-pin-dot {
  fill: #f0c27a;
}

.rl-pin-halo {
  fill: rgba(240,194,122,0.25);
  transform-box: fill-box;
  transform-origin: center;
  scale: 0;
}

.rl-pin.is-now .rl-pin-halo {
  animation: rl-halo 1.4s ease-out infinite;
}

.rl-pin.is-on:not(.is-now) .rl-pin-dot { fill: #c99a55; }

.rl-pin:hover .rl-pin-dot,
.rl-pin:focus-visible .rl-pin-dot { fill: #fff3d8; }

@keyframes rl-halo {
  0% { scale: 0.6; opacity: 1; }
  100% { scale: 4; opacity: 0; }
}

/* A short frame (the home page's band on a phone): the heading keeps its
   20px floor, so the map starts lower to clear it. */
@container rl (aspect-ratio >= 1) and (max-height: 360px) {
  .rl-map svg { inset: 26cqh 3cqw 15cqh; height: calc(100% - 41cqh); }
}

.rl-map-head {
  position: absolute;
  top: 5cqh;
  left: 5cqw;
  pointer-events: none;
}

.rl-map-head h2 {
  margin: 1cqh 0 0;
  font: 400 clamp(20px, 3.8cqw, 58px) / 1 var(--rl-serif);
  color: var(--rl-cream);
}

.rl-map-now {
  position: absolute;
  left: 5cqw;
  right: 5cqw;
  bottom: 5cqh;
  display: flex;
  align-items: baseline;
  gap: 1.4cqw;
  flex-wrap: wrap;
  color: var(--rl-cream);
  text-decoration: none;
  font: 400 clamp(16px, 2.6cqw, 40px) / 1.1 var(--rl-serif);
}

.rl-map-now em {
  font: normal 600 max(10px, 1.1cqw) / 1 var(--rl-sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rl-gold);
}

.rl-map-now .rl-coord {
  margin-left: auto;
  font: 500 max(10px, 1cqw) / 1 ui-monospace, Consolas, monospace;
  letter-spacing: 0.1em;
  color: rgba(243,233,212,0.45);
}

.rl-map-now:hover span:first-child,
.rl-map-now:focus-visible span:first-child {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

@container rl (aspect-ratio < 1) {
  .rl-map svg { inset: 18cqh 2cqw 22cqh; height: calc(100% - 40cqh); width: calc(100% - 4cqw); }
  .rl-map-head h2 { font-size: clamp(20px, 7cqw, 40px); }
  .rl-map-now { font-size: clamp(16px, 5cqw, 28px); }
  .rl-map-now .rl-coord { margin-left: 0; width: 100%; }
}

/* ---------- 5. The ring of books ---------- */

.rl-books {
  background:
    radial-gradient(ellipse at 50% 120%, #3a2a17 0%, transparent 60%),
    radial-gradient(ellipse at 50% 40%, #1d1c16 0%, var(--rl-night) 75%);
}

.rl-books-head {
  position: absolute;
  top: 5cqh;
  left: 5cqw;
  pointer-events: none;
}

.rl-books-head h2 {
  margin: 1cqh 0 0;
  font: 400 clamp(20px, 3.8cqw, 58px) / 1 var(--rl-serif);
  color: var(--rl-cream);
}

.rl-ring-wrap {
  position: absolute;
  inset: 0 0 24cqh;
  perspective: 110cqw;
  perspective-origin: 50% 30%;
}

.rl-ring {
  --card: 13cqw;
  position: absolute;
  left: 50%;
  top: 56%;
  width: var(--card);
  aspect-ratio: 2 / 3;
  translate: -50% -50%;
  transform-style: preserve-3d;
  transform: translateZ(calc(var(--r) * -1)) rotateX(-6deg) rotateY(var(--rot, 0deg));
}

.rl-ring-card {
  position: absolute;
  inset: 0;
  display: block;
  border-radius: 2px;
  overflow: hidden;
  backface-visibility: hidden;
  transform: rotateY(calc(var(--i) * 360deg / var(--n))) translateZ(var(--r));
  box-shadow: 0 2cqh 4cqh rgba(0,0,0,0.6);
  filter: brightness(0.5) saturate(0.7);
  transition: filter 0.4s;
}

.rl-ring-card.is-front,
.rl-ring-card:hover,
.rl-ring-card:focus-visible {
  filter: none;
}

.rl-ring-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rl-books-now {
  position: absolute;
  inset: auto 6cqw 5cqh;
  text-align: center;
}

.rl-books-now a {
  color: var(--rl-cream);
  text-decoration: none;
  font: 400 clamp(18px, 3.2cqw, 48px) / 1.05 var(--rl-serif);
}

.rl-books-now a:hover,
.rl-books-now a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.rl-books-now p {
  margin: 1cqh auto 0;
  max-width: 70cqw;
  font: italic 400 clamp(12px, 1.6cqw, 24px) / 1.35 var(--rl-serif);
  color: rgba(243,233,212,0.8);
  text-wrap: balance;
}

.rl-books-now .rl-label { margin-bottom: 1cqh; }

@container rl (aspect-ratio < 1) {
  .rl-ring { --card: 26cqw; top: 54%; }
  .rl-ring-wrap { inset: 8cqh 0 28cqh; }
  .rl-books-head h2 { font-size: clamp(20px, 7cqw, 40px); }
  .rl-books-now a { font-size: clamp(18px, 6cqw, 32px); }
  .rl-books-now p { font-size: clamp(12px, 3.4cqw, 18px); max-width: none; }
}

/* ---------- 6. End card ---------- */

.rl-end-sky {
  scale: calc(1.08 - var(--p) * 0.06);
  filter: brightness(0.6) saturate(0.85);
}

.rl-end-name {
  --k: clamp(0, var(--p) / 0.25, 1);
  opacity: var(--k);
  filter: blur(calc((1 - var(--k)) * 8px));
}

.rl-end-counts { --from: 0.15; }
.rl-end-counts .rl-label { margin-top: 2.2cqh; }

.rl-end-actions {
  --from: 0.3;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.4cqw;
  margin: 3cqh 0 0;
}

.rl-end-actions .rl-cta {
  margin: 0;
  text-decoration: none;
  cursor: pointer;
}

.rl-end-actions .rl-cta-main {
  background: #965220;
  border-color: #965220;
}

.rl-end-actions button.rl-cta {
  font-family: var(--rl-sans);
}

/* ---------- Colours inside the frame ----------
   The light shell colours every h2, p and link for paper; inside the dark
   frame these win (body.reel-page .rl-stage outranks body.light-shell;
   body.home-compact is the home page's band). */

body:is(.reel-page, .home-compact) .rl-stage :is(h2, p, a) { color: var(--rl-cream); }
body:is(.reel-page, .home-compact) .rl-stage .rl-label,
body:is(.reel-page, .home-compact) .rl-stage .rl-poster-sub { color: var(--rl-gold); }
body:is(.reel-page, .home-compact) .rl-stage .rl-signal { color: rgba(243,233,212,0.7); }
body:is(.reel-page, .home-compact) .rl-stage .rl-open-status { color: rgba(243,233,212,0.45); }
body:is(.reel-page, .home-compact) .rl-stage .rl-timecode { color: rgba(243,233,212,0.55); }
body:is(.reel-page, .home-compact) .rl-stage .rl-hero-line { color: rgba(243,233,212,0.88); }
body:is(.reel-page, .home-compact) .rl-stage .rl-wall-now { color: rgba(243,233,212,0.85); }
body:is(.reel-page, .home-compact) .rl-stage .rl-books-now p:not(.rl-label) { color: rgba(243,233,212,0.8); }

/* ---------- Scene cuts (View Transitions) ---------- */

::view-transition-old(rl-scenes) {
  animation: 0.7s cubic-bezier(0.4, 0, 0.2, 1) both rl-cut-out;
}

::view-transition-new(rl-scenes) {
  animation: 0.7s cubic-bezier(0.4, 0, 0.2, 1) both rl-cut-in;
}

::view-transition-group(rl-cover) {
  animation-duration: 0.8s;
  animation-timing-function: cubic-bezier(0.5, 0, 0.1, 1);
}

@keyframes rl-cut-out {
  to { opacity: 0; scale: 1.06; filter: brightness(1.8) blur(6px); }
}

@keyframes rl-cut-in {
  from { opacity: 0; scale: 0.97; filter: brightness(0.3); }
}

/* Browsers without View Transitions get the same cut by hand. */
.rl-scene.is-leaving { animation: 0.7s ease both rl-cut-out; pointer-events: none; }
.rl-scene.is-entering { animation: 0.7s ease both rl-cut-in; }

/* ---------- The list ---------- */

.rl-index {
  max-width: 1080px;
  margin: 0 auto;
}

.rl-index h2 {
  font-family: var(--rl-serif);
  font-size: 1.5rem;
  margin: 28px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ls-hairline);
}

.rl-index h2 span {
  font-family: var(--rl-sans);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ls-muted);
}

.rl-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 10px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rl-list li {
  content-visibility: auto;
  contain-intrinsic-size: auto 100px;
}

.rl-list a {
  display: flex;
  gap: 14px;
  padding: 8px;
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
  transition: background 0.2s;
}

.rl-list a:hover,
.rl-list a:focus-visible {
  background: var(--ls-paper-card);
}

.rl-list img {
  flex: none;
  width: 60px;
  height: 90px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 2px 6px rgba(40,25,10,0.25);
}

.rl-list strong {
  display: block;
  font-family: var(--rl-serif);
  font-size: 1.05rem;
  line-height: 1.2;
}

.rl-list em {
  display: block;
  margin: 3px 0 4px;
  font: normal 0.74rem / 1.3 var(--rl-sans);
  color: var(--ls-muted);
}

.rl-list-line {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--ls-ink-soft);
}

.rl-more {
  margin: 14px 0 0;
  font-weight: 600;
}

.rl-more a { color: var(--ls-link); }

/* Each entry rises into place as it scrolls in, where scroll-driven
   animations are supported. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .rl-list li {
      animation: rl-rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 60%;
    }
  }
}

@keyframes rl-rise {
  from { opacity: 0; translate: 0 18px; }
}

/* ---------- Reduced motion: cuts only, nothing moves ---------- */

@media (prefers-reduced-motion: reduce) {
  .rl-grain,
  .rl-open .rl-signal,
  .rl-timecode::before,
  .rl-hero-line .rl-caret,
  .rl-pin.is-now .rl-pin-halo { animation: none; }
  .rl-scene *,
  .rl-wall-grid,
  .rl-ring { scale: none; translate: none; }
  .rl-hero-cover,
  .rl-flip .rl-hero-cover,
  .rl-tile { transform: none; }
  .rl-hero-cover::after { display: none; }
  .rl-wall-grid { transform: none; translate: -50% -50%; }
  .rl-ring { translate: -50% -50%; }
  ::view-transition-old(rl-scenes),
  ::view-transition-new(rl-scenes) { animation-duration: 0.01s; }
  .rl-scene.is-leaving,
  .rl-scene.is-entering { animation-duration: 0.01s; }
}

/* ---------- Film mode (?film=1): the frame fills the window ----------
   For making the social-media video; see the note at the top of reel.js. */

html.rl-film,
html.rl-film body { overflow: hidden; background: #000; }

html.rl-film .site-header,
html.rl-film body > :not(.ls-sheet):not(script) { display: none; }
html.rl-film .ls-sheet { z-index: auto; }

html.rl-film .rl {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  width: auto;
  margin: 0;
}

html.rl-film .rl-stage {
  aspect-ratio: auto;
  height: 100%;
  border-radius: 0;
  box-shadow: none;
}

html.rl-film .rl-big-play,
html.rl-film .rl-controls { display: none; }

html.rl-film .rl *,
html.rl-film .rl *::before,
html.rl-film .rl *::after { animation: none !important; transition: none !important; }

.rl-end-url {
  margin: 3.4cqh 0 0;
  font: 600 clamp(14px, 2.4cqw, 40px) / 1 var(--rl-sans);
  letter-spacing: 0.14em;
}

body:is(.reel-page, .home-compact) .rl-stage .rl-end-url { color: var(--rl-cream); }

@container rl (aspect-ratio < 1) {
  .rl-end-url { font-size: clamp(14px, 5.2cqw, 40px); }
}

/* Upright video (Reels, TikTok, Shorts): text sized for a phone held in the
   hand, without the web page's upper limits. */
@container rl (aspect-ratio < 1) {
  html.rl-film .rl-label { font-size: 2.7cqw; }
  html.rl-film .rl-signal { font-size: 2.6cqw; }
  html.rl-film .rl-open-status { font-size: 2cqw; }
  html.rl-film .rl-open-title,
  html.rl-film .rl-end-name { font-size: 12cqw; }
  html.rl-film .rl-hero-cover { width: min(58cqw, 44cqh); }
  html.rl-film .rl-hero-title { font-size: 9.5cqw; }
  html.rl-film .rl-hero-line { font-size: 4.6cqw; }
  html.rl-film .rl-cta { font-size: 3.4cqw; }
  html.rl-film .rl-wall-count { font-size: 6.6cqw; }
  html.rl-film .rl-wall-now { font-size: 4.8cqw; }
  html.rl-film .rl-map-head h2,
  html.rl-film .rl-books-head h2 { font-size: 8.6cqw; }
  html.rl-film .rl-map-now { font-size: 6cqw; }
  html.rl-film .rl-map-now em,
  html.rl-film .rl-map-now .rl-coord { font-size: 2.6cqw; }
  html.rl-film .rl-books-now a { font-size: 7.4cqw; }
  html.rl-film .rl-books-now p { font-size: 4.2cqw; }
  html.rl-film .rl-ring { --card: 30cqw; }
  html.rl-film .rl-end-url { font-size: 5.6cqw; }
  html.rl-film .rl-timecode { font-size: 2.2cqw; }
}

/* Feed video (4:5, 1080x1350): shorter than a phone screen, so the covers
   give the text room. */
@container rl (0.7 < aspect-ratio < 1) {
  html.rl-film .rl-hero-cover { width: min(44cqw, 34cqh); }
  html.rl-film .rl-hero { gap: 2.4cqh; }
  html.rl-film .rl-hero-title { font-size: 8cqw; margin: 0.6cqh 0 1cqh; }
  html.rl-film .rl-hero-line { font-size: 4cqw; }
  html.rl-film .rl-ring { --card: 22cqw; top: 50%; }
  html.rl-film .rl-ring-wrap { inset: 10cqh 0 30cqh; }
  html.rl-film .rl-books-now a { font-size: 6.4cqw; }
  html.rl-film .rl-books-now p { font-size: 3.8cqw; }
}
