:root {
  --bg: var(--deep);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { background: var(--bg); color: var(--paper); }
/* the home page is light below the hero */
body.home-page { background: var(--paper); }

/* Height of this section decides how long the scroll takes to play the whole video */
#scene { position: relative; height: 600vh; height: 600svh; background: var(--deep); }

/* sticky keeps the canvas on screen while the page scrolls through #scene */
#stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  width: 100%;
  overflow: hidden;
}

#canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* subtle vignette so the white text stays readable on bright water */
.shade {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(0,0,0,.05) 0%, rgba(0,0,0,.45) 100%);
}

/* darkens the lower part of the frame at the end of the scroll, under the closing lines */
#fade { position: absolute; inset: 0; opacity: 0; pointer-events: none; background: linear-gradient(to top, rgba(8, 11, 10, .88) 0%, rgba(8, 11, 10, .5) 38%, rgba(8, 11, 10, 0) 70%); }

#title {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: "EB Garamond", Georgia, serif;
  font-weight: 500;
  font-size: clamp(2.6rem, 11vw, 9rem);
  line-height: 1.05;
  letter-spacing: .18em;
  padding-left: .18em; /* balances trailing letter-spacing so text is truly centered */
  text-shadow: 0 2px 30px rgba(0,0,0,.35);
  will-change: opacity, transform;
  pointer-events: none;
}

#scroll-hint {
  position: absolute;
  left: 0; right: 0;
  text-align: center;
  font-family: "EB Garamond", Georgia, serif;
  letter-spacing: .2em;
  text-transform: uppercase;
  pointer-events: none;
}

#scroll-hint { bottom: 6svh; font-size: .85rem; opacity: .8; }
#scroll-hint::after {
  content: ""; display: block; width: 1px; height: 42px; margin: 12px auto 0;
  background: var(--paper); transform-origin: top; animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: scaleY(.3); opacity: .4; } 50% { transform: scaleY(1); opacity: 1; } }

/* closing lines of the hero, bottom left, over the last frames */
#hero-end { position: absolute; left: var(--gutter); right: var(--gutter); bottom: clamp(48px, 9svh, 96px); opacity: 0; pointer-events: none; }
/* letters of the closing lines (script.js); a word holds its letters together so lines break between words */
#hero-end .hw { display: inline-block; white-space: nowrap; }
#hero-end .hc { display: inline-block; opacity: 0; will-change: opacity, transform; }
.hero-end-eyebrow { opacity: 0; }
.hero-end-eyebrow { font-family: var(--sans); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--river-text); margin-bottom: 1rem; }
#intro-text { font-family: var(--serif); font-weight: 500; font-size: clamp(3.2rem, 8.4vw, 7.4rem); line-height: .95; letter-spacing: -.01em; max-width: 8em; }
#intro-sub { font-family: var(--sans); font-size: clamp(1rem, 1.4vw, 1.2rem); line-height: 1.55; max-width: 36ch; margin-top: clamp(16px, 2.6svh, 28px); color: rgba(246, 244, 238, .9); }

#loader {
  position: fixed; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1.1rem; letter-spacing: .4em;
  transition: opacity .8s ease;
}
#loader.done { opacity: 0; pointer-events: none; }

@media (prefers-reduced-motion: reduce) { #scroll-hint::after { animation: none; } }

/* Rising water between differently coloured sections: a wave of the next colour that climbs on scroll */
.rise { position: relative; z-index: 3; height: var(--rise-h); margin-top: calc(-1 * var(--rise-h)); pointer-events: none; }
.rise svg { display: block; width: 100%; height: 100%; }
.rise path { fill: var(--next); }
.to-paper { --next: var(--paper); }
.to-mist { --next: var(--mist); }
.to-deep { --next: var(--deep); }

/* visually hidden, still read by screen readers */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* 2. Places carousel */
#places {
  --card-h: min(64svh, 640px);
  --slot-w: calc(var(--card-h) * .75);
  position: relative; padding: clamp(110px, 18svh, 200px) 0 clamp(70px, 12svh, 140px);
}
.places-head { padding: 0 var(--gutter); margin-bottom: clamp(28px, 6svh, 64px); }
.places-head h2 { font-size: clamp(2.6rem, 7vw, 6.5rem); }

/* default / native mode: horizontal swipe with snap */
.places-track {
  display: flex; gap: clamp(12px, 1.6vw, 28px);
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 0 var(--gutter) 8px; scroll-padding: 0 var(--gutter);
  scrollbar-width: none;
}
.places-track::-webkit-scrollbar { display: none; }
.places-progress { display: none; }

.slot { flex: none; position: relative; width: var(--slot-w); height: var(--card-h); scroll-snap-align: start; }

.card {
  display: block; text-decoration: none;
  position: absolute; left: 0; top: 0; height: 100%; width: 100%;
  border: 0; padding: 0; background: #232a27; color: var(--paper); font: inherit; text-align: left;
  cursor: pointer; overflow: hidden; border-radius: 2px;
  transition: width .6s cubic-bezier(.2, .7, .2, 1);
}
.card .media { position: absolute; inset: 0; transition: transform .9s cubic-bezier(.2, .7, .2, 1), filter .5s ease; }
.card img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* one quiet tone across photos from different cameras */
.card .media img, .card .media .gl { filter: saturate(.84) contrast(1.03); }
.card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(21, 26, 24, .88) 0%, rgba(21, 26, 24, .35) 38%, rgba(21, 26, 24, 0) 62%);
}
.card .label { position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; padding: 22px 22px 24px; }
.card .name { display: block; font-family: var(--serif); font-size: clamp(1.6rem, 2.4vw, 2.2rem); line-height: 1.05; }
.card .desc {
  display: block; max-width: 30ch; font-size: .9rem; color: rgba(246, 244, 238, .72);
  max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height .5s ease, opacity .5s ease, margin .5s ease;
}
.card .more { display: block; margin-top: .9rem; font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: rgba(246, 244, 238, .86); }
/* last card: everything else is on the map */
.card-all { background: var(--deep); }
.card-all::after { display: none; }
.card-all .label { top: 0; display: flex; flex-direction: column; justify-content: space-between; }
.card-all .name { font-size: clamp(2rem, 3vw, 2.8rem); max-width: 6em; }
.card-all .more { font-size: 2rem; letter-spacing: 0; color: var(--river-light); transition: transform .4s cubic-bezier(.2, .7, .2, 1); }
.card-all:hover .more { transform: translateX(10px); }
.slot-all .card:hover { width: 100%; }

/* desktop with a mouse: the hovered card widens and shows its description */
@media (hover: hover) and (pointer: fine) and (min-width: 769px) {
  .card:hover, .slot:has(.card:focus-visible) .card { width: calc(100% * 1.7); z-index: 2; }
  .card:hover .media, .slot:has(.card:focus-visible) .media { transform: scale(1.06); }
  .card:hover .desc, .slot:has(.card:focus-visible) .desc { max-height: 9em; opacity: 1; margin-top: .7rem; }
  .places-track:has(.slot:hover) .slot:not(:hover) .media,
  .places-track:has(.card:focus-visible) .slot:not(:has(.card:focus-visible)) .media { filter: brightness(.5); }
  .places-track { padding-right: calc(var(--gutter) + var(--slot-w) * .7); }
}

/* pinned mode (desktop, set by main.js): the section stays and the track moves sideways */
#places.pinned { height: 100svh; padding: 64px 0 0; overflow: clip; display: flex; flex-direction: column; justify-content: center; gap: clamp(20px, 5svh, 56px); --card-h: min(58svh, 620px); }
#places.pinned .places-head { margin: 0; }
#places.pinned .places-track { overflow: visible; width: max-content; scroll-snap-type: none; }
#places.pinned .places-head br { display: none; }
#places.pinned .places-head h2 { font-size: clamp(2.2rem, 5vw, 4.6rem); }

/* mobile / touch: swipe with snap, next card peeks in, description always visible, a thin progress line */
@media (max-width: 768px), (pointer: coarse) {
  #places { --slot-w: min(74vw, 340px); --card-h: calc(var(--slot-w) * 4 / 3); }
  .places-track { overscroll-behavior-x: contain; }
  .card .label { padding: 18px 18px 20px; }
  .card .name { font-size: 1.6rem; }
  .card .desc { max-height: none; opacity: 1; margin-top: .5rem; color: rgba(246, 244, 238, .78); }
  .card::after { background: linear-gradient(to top, rgba(21, 26, 24, .94) 0%, rgba(21, 26, 24, .7) 42%, rgba(21, 26, 24, 0) 75%); }
  .card .more { padding: .75rem 0 0; }
  .places-progress { display: block; height: 2px; margin: 22px var(--gutter) 0; background: var(--rule); }
  .places-progress i { display: block; height: 100%; background: var(--acc); transform-origin: left; transform: scaleX(.06); }
}

/* 3. History */
#history { padding: clamp(70px, 12svh, 150px) var(--gutter); }
.h-block { margin-bottom: clamp(90px, 16svh, 190px); }
.h-block:last-child { margin-bottom: 0; }

/* a) the name: the Latin word large, in the colour of water, beside the text */
.h-name-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 6vw; align-items: end; margin-top: clamp(28px, 5svh, 56px); }
.h-word-big { display: block; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(8rem, 21vw, 19rem); line-height: .8; color: var(--river); padding-bottom: .1em; }
.h-word-cap { display: block; margin-top: 1rem; font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--fg-muted); }
.big-text { font-family: var(--serif); font-size: clamp(1.6rem, 2.7vw, 2.5rem); line-height: 1.24; max-width: 24em; }
.big-text em { color: var(--acc); }
.h-chain { list-style: none; display: flex; flex-wrap: wrap; gap: .8rem 0; margin-top: clamp(24px, 4svh, 44px); font-family: var(--serif); font-size: clamp(1.25rem, 1.8vw, 1.6rem); line-height: 1.1; }
.h-chain li { position: relative; display: flex; flex-direction: column; }
.h-chain li + li { padding-left: 2.6em; }
.h-chain li + li::before { content: "\2192"; position: absolute; left: .9em; top: .1em; color: var(--river); font-family: var(--sans); font-size: .8em; }
.h-chain small { margin-top: .4rem; font-family: var(--sans); font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; color: var(--fg-muted); }

/* b) the timeline: heading and the year that is reached stay on the left, entries run on the right.
   Photos sit under their entry, all in one proportion and one width, in line with the text. */
.h-centuries { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 6vw; }
.h-side { position: sticky; top: 16svh; align-self: start; }
.h-now { margin-top: clamp(20px, 4svh, 48px); min-height: .9em; font-family: var(--serif); font-weight: 500; font-size: clamp(5rem, 11vw, 10rem); line-height: .9; font-variant-numeric: lining-nums; }
.h-now.s { font-size: clamp(2.6rem, 5vw, 4.6rem); line-height: 1; }

.timeline { --tl-pad: clamp(26px, 3vw, 48px); list-style: none; position: relative; padding-left: var(--tl-pad); }
.timeline::before, .tl-line { content: ""; position: absolute; left: 4px; top: .7rem; bottom: 0; width: 1.5px; }
.timeline::before { background: var(--rule); }
.timeline .tl-line { background: var(--river); transform-origin: top; }
.timeline li { position: relative; padding-bottom: clamp(34px, 6svh, 64px); transition: opacity .5s ease; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li.tl-line { padding: 0; opacity: 1; }
.timeline li.tl-line::before { display: none; }
.timeline li::before {
  content: ""; position: absolute; z-index: 1; left: calc(-1 * var(--tl-pad)); top: .75rem; width: 9.5px; height: 9.5px; border-radius: 50%;
  background: var(--sec-bg); border: 1.5px solid var(--fg-muted); transition: background .4s ease, border-color .4s ease, box-shadow .4s ease;
}
.timeline li.on::before { background: var(--river); border-color: var(--river); }
.timeline li.now::before { box-shadow: 0 0 0 6px rgba(23, 149, 160, .18); }
.js-anim .timeline li:not(.on):not(.tl-line) { opacity: .74; }
.yr { display: block; font-family: var(--serif); font-weight: 500; font-size: clamp(2.2rem, 3.4vw, 3.2rem); line-height: 1; font-variant-numeric: lining-nums; }
.yr.s { font-size: clamp(1.6rem, 2.3vw, 2.2rem); }
.timeline p { color: var(--fg-soft); max-width: 46ch; margin-top: .6rem; }
/* photos of the entries: under the entry on phones; on wide screens the one of the entry that is reached sits in the frame beside the list */
.tl-photo { margin-top: 1rem; max-width: 560px; }
.tl-photo img { width: 100%; aspect-ratio: 16 / 10; height: auto; object-fit: cover; display: block; border-radius: 14px; background: var(--mist); filter: saturate(.84) contrast(1.03); }
.tl-photo figcaption, .h-frame figcaption { margin-top: .55rem; font-size: .78rem; line-height: 1.4; color: var(--fg-muted); }
.h-frame { display: none; }
.tl-photo img[data-fit="contain"] { object-fit: contain; }
@media (min-width: 769px) {
  .timeline .tl-photo { display: none; }
  /* more room per entry, so each photo stays beside the list for a while */
  .timeline li { padding-bottom: clamp(56px, 14svh, 140px); }
  .h-frame { display: block; margin-top: clamp(18px, 3svh, 32px); max-width: 520px; }
  .h-frame-im { position: relative; aspect-ratio: 4 / 3; max-height: 40svh; border-radius: 16px; overflow: hidden; background: var(--mist); transition: opacity .5s ease; }
  .h-frame-im img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.03); filter: saturate(.84) contrast(1.03); transition: opacity .6s ease, transform 1.2s cubic-bezier(.2, .7, .2, 1); }
  .h-frame-im img:not([src]) { display: none; }
  .h-frame-im img.whole { object-fit: contain; padding: 14px; }
  .h-frame-im img.in { opacity: 1; transform: none; }
  .h-frame.empty .h-frame-im img { opacity: 0; }
  .h-frame figcaption { min-height: 1.4em; }
  /* An entry without a photo: the frame folds away instead of standing empty, and the year grows into the room it leaves */
  .h-frame { transition: opacity .5s ease; }
  .h-frame-im { transition: opacity .5s ease, max-height .7s cubic-bezier(.2, .7, .2, 1), margin .7s cubic-bezier(.2, .7, .2, 1); }
  .h-frame.empty { opacity: 0; }
  .h-frame.empty .h-frame-im { max-height: 0; }
  .h-now { transition: font-size .6s cubic-bezier(.2, .7, .2, 1); }
  .h-side.no-photo .h-now { font-size: clamp(7rem, 17vw, 15rem); }
  .h-side.no-photo .h-now.s { font-size: clamp(3.4rem, 7vw, 6.4rem); }
}
@media (prefers-reduced-motion: reduce) { .h-frame-im img, .h-frame, .h-frame-im, .h-now { transition: none; } }
@media (prefers-reduced-motion: reduce) { .timeline li, .timeline li::before { transition: none; } }

/* Numbers: a grid of tiles, each figure with a small drawing or a photo of what it counts */
#numbers { padding: clamp(40px, 8svh, 100px) var(--gutter) clamp(70px, 12svh, 150px); }
#numbers header { margin-bottom: clamp(28px, 5svh, 56px); }
.bento { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(168px, auto); gap: clamp(10px, 1.2vw, 18px); }
.tile { position: relative; min-width: 0; overflow: hidden; border-radius: 18px; padding: clamp(16px, 1.6vw, 26px); display: flex; flex-direction: column; justify-content: flex-end; }
.tile > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(.84) contrast(1.03); }
.t-photo { background: var(--deep); color: var(--paper); }
.t-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(8, 11, 10, .9) 0%, rgba(8, 11, 10, .45) 55%, rgba(8, 11, 10, .12) 100%); }
.tile > p, .tile > div { position: relative; z-index: 1; }
/* the darker water tone: white text on it passes AA, on --river it would not */
.t-water { background: var(--sand-dark); color: #fff; }
.t-plain { background: #fff; border: 1px solid var(--rule); }
.t-56 { grid-row: span 2; }
.t-1374 { grid-column: span 2; }
.num { font-family: var(--serif); font-weight: 500; font-size: clamp(3.4rem, 6.2vw, 6rem); line-height: 1; font-variant-numeric: lining-nums; }
.num .u { font-size: .36em; }
.t-plain .num .u { color: var(--acc); }
.cap { margin-top: .5rem; max-width: 36ch; font-size: .88rem; line-height: 1.4; }
.t-plain .cap { color: var(--fg-muted); }
.t-photo .cap { color: rgba(246, 244, 238, .9); }

/* 56 m: a measure beside the waterfall */
.ruler { position: absolute; z-index: 1; right: 14px; top: 16px; bottom: 16px; width: 30px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; border-right: 1.5px solid rgba(246, 244, 238, .85); font-size: .6rem; line-height: 1; transform-origin: bottom; }
.ruler b { position: relative; padding-right: 11px; font-weight: 400; }
.ruler b::after { content: ""; position: absolute; right: 0; top: 50%; width: 7px; height: 1px; background: currentColor; }
/* 9: nine thin lines run into one (drawn by main.js to the size of the tile) */
.nine-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.nine-lines path { fill: none; stroke: rgba(255, 255, 255, .6); stroke-width: 1.2; }
.nine-lines .trunk { stroke: #fff; stroke-width: 5; stroke-linecap: butt; }
.t-9 .cap { max-width: min(62%, 20ch); }
/* 142 km and 1374: a line with a dot that travels from one end to the other */
.trk { height: 2px; margin-top: 1rem; background: rgba(23, 149, 160, .22); }
.trk i { display: block; height: 100%; background: var(--river); transform-origin: left; }
.trk b { position: absolute; left: 100%; top: -5px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--river); box-shadow: 0 0 0 5px rgba(23, 149, 160, .2); }
.trk-ends { display: flex; justify-content: space-between; gap: 1rem; margin-top: .6rem; font-size: .68rem; letter-spacing: .06em; color: var(--fg-muted); }
.t-142 .trk { order: 2; } .t-142 .trk-ends { order: 3; } .t-142 .cap { order: 1; }
.t-photo .trk { background: rgba(246, 244, 238, .35); }
.t-photo .trk i, .t-photo .trk b { background: var(--paper); }
.t-photo .trk b { box-shadow: 0 0 0 5px rgba(246, 244, 238, .2); }
.t-photo .trk-ends { color: rgba(246, 244, 238, .85); }
/* 176: one dot for each grave */
.dots { display: grid; grid-template-columns: repeat(16, 1fr); gap: 4px; margin-top: .9rem; max-width: 260px; }
.dots i { width: 100%; max-width: 7px; aspect-ratio: 1; border-radius: 50%; background: var(--river); }

@media (min-width: 900px) {
  .bento { grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-rows: minmax(250px, auto); }
  .t-56 { grid-column: 1; grid-row: 1 / span 2; }
  .t-9 { grid-column: 2; grid-row: 1; }
  .t-142 { grid-column: 3 / span 2; grid-row: 1; }
  .t-4 { grid-column: 5; grid-row: 1 / span 2; }
  .t-1374 { grid-column: 2 / span 2; grid-row: 2; }
  .t-176 { grid-column: 4; grid-row: 2; }
  .tile { border-radius: 20px; }
}

/* 4. Nine rivers: the drawing is built by main.js to the size of .river-map */
#rivers { position: relative; overflow: clip; padding: clamp(40px, 8svh, 100px) var(--gutter) calc(clamp(60px, 10svh, 120px) + var(--rise-h)); }
.rivers-head { position: relative; }
.rivers-head > :not(.nine) { position: relative; z-index: 1; }
.nine { position: absolute; z-index: 0; right: -2vw; top: -.2em; font-family: var(--serif); font-size: clamp(14rem, 62vw, 22rem); line-height: 1; color: rgba(23, 149, 160, .1); pointer-events: none; }
.rivers-fact { max-width: 34ch; margin-top: 1.2rem; color: var(--fg-muted); }
/* phones: full width, so the tributaries start at the edges of the screen */
.river-map { position: relative; height: 720px; margin: clamp(28px, 5svh, 56px) calc(-1 * var(--gutter)) 0; }
.river-map svg { display: block; width: 100%; height: 100%; overflow: visible; }
.riv-name { font-family: var(--serif); font-weight: 500; font-size: 21px; fill: var(--ink); }
.riv-sana { font-size: 30px; fill: var(--sand-dark); }
@media (min-width: 900px) {
  .rivers-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 4vw; }
  .rivers-head { position: sticky; top: 18svh; align-self: start; }
  .nine { right: auto; left: -1vw; top: 78%; font-size: clamp(20rem, 30vw, 32rem); }
  .river-map { height: 880px; margin: 0 calc(-1 * var(--gutter)) 0 0; }
  .riv-name { font-size: 28px; }
  .riv-sana { font-size: 40px; }
}

.h-more {
  grid-column: 2; justify-self: start; display: inline-flex; align-items: center; gap: .6rem; min-height: 48px; margin-top: 2.4rem;
  padding: 0 1.3rem; border: 1px solid var(--acc); color: var(--fg); text-decoration: none;
  font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; transition: background .2s, color .2s;
}
.h-more:hover { background: var(--acc); color: var(--paper); }
@media (max-width: 768px) { .h-more { grid-column: 1; } }


@media (max-width: 768px) {
  .h-name-grid, .h-centuries { grid-template-columns: minmax(0, 1fr); }
  .h-name-grid { gap: 28px; }
  .h-side { position: static; margin-bottom: 36px; }
  .h-now { display: none; }
  .timeline p { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .card .media, .card .desc { transition: none; }
}

/* Hero caption */
#hero-caption { position: absolute; left: var(--gutter, 24px); bottom: 5svh; z-index: 1; font-family: "EB Garamond", Georgia, serif; font-size: .95rem; letter-spacing: .12em; color: rgba(246, 244, 238, .6); pointer-events: none; }

/* Line-by-line heading reveal: each line sits in a mask so it can rise from below; the padding keeps descenders visible */
.ln-mask { padding-bottom: .14em; margin-bottom: -.14em; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* Card effects (desktop with a mouse only, see fx.js) */
.card .media .gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.card.no-cursor { cursor: none; }
.view-cursor { position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 50; pointer-events: none; transform: translate(var(--x, -200px), var(--y, -200px)); }
.view-cursor span {
  position: absolute; left: -43px; top: -43px; width: 86px; height: 86px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(246, 244, 238, .94); color: var(--ink); font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; padding-left: .2em;
  transform: scale(0); transition: transform .35s cubic-bezier(.2, .7, .2, 1);
}
.view-cursor.on span { transform: scale(1); }

/* Ambient sound button (sound.js), only present when ENABLED is set there */
.sound-btn {
  position: fixed; right: var(--gutter); bottom: 16px; z-index: 60; min-height: 44px; padding: 0 1rem;
  background: rgba(21, 26, 24, .72); color: var(--paper); border: 1px solid rgba(246, 244, 238, .28); cursor: pointer;
  font: inherit; font-size: .72rem; letter-spacing: .2em; text-transform: uppercase;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.sound-btn span { color: var(--sand); margin-left: .5rem; }
.sound-btn b { font-weight: inherit; }
.sound-btn:hover { border-color: var(--sand); }

/* On phones the browser bar hides while scrolling, and the screen grows from the small (svh) to the large (lvh) height. */
/* A stage of 100svh then leaves a strip of the page showing under it, so the stage takes the large height. */
/* The lines near its bottom are lifted by the difference, so the bar does not cover them while it is shown. */
@supports (height: 100lvh) {
  #stage { height: 100lvh; }
  #scroll-hint { bottom: calc(100lvh - 100svh + 6svh); }
  #hero-caption { bottom: calc(100lvh - 100svh + 5svh); }
  #hero-end { bottom: calc(100lvh - 100svh + clamp(48px, 9svh, 96px)); }
}
