/*
 * The home page around the journey: the stage lets go at the end of the story,
 * the guide in the corner, the handing over to paper.
 */
.river-story { position: relative; z-index: 3; }
/* the stage paints over the paper beneath it until the story has ended */
.scroll-stage { z-index: 20; }
/* parked, the stage must also clip: Chrome lets its composited river video paint past `overflow: hidden` */
.river-story.ended .scroll-stage { position: absolute; inset: auto 0 0 0; overflow: clip; }
/* a long page: the stage's fixed layer must not paint over the pages beneath */
.journey-ended .site-chrome { pointer-events: none; }

/* the guide */
.guide {
  position: absolute; z-index: 90; right: 56px; bottom: 28px;
  display: flex; align-items: center; gap: 12px;
  padding: 8px 16px 8px 8px; border-radius: 999px;
  color: #d5e5fb; text-decoration: none;
  background: rgba(4, 9, 18, .72); border: 1px solid rgba(120, 180, 255, .22);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  font: 500 11px/1.2 Manrope, sans-serif; letter-spacing: .14em; text-transform: uppercase;
  transition: opacity .35s, transform .35s;
  pointer-events: none;   /* a label: taps and clicks go through it (Nov 15) */
}
.guide.hidden { opacity: 0; transform: translateY(8px); pointer-events: none; }
.guide img { width: 36px; height: 31px; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0, 20, 80, .5)); }
.guide-text { display: flex; flex-direction: column; gap: 5px; }
.guide-n { color: #62bafa; font-weight: 700; letter-spacing: .12em; }
.guide-n[hidden] { display: none; }
.guide-name { color: #eef6ff; }
.guide-dots { display: flex; gap: 3px; margin-top: 1px; }
.guide-dots i { width: 9px; height: 2px; border-radius: 2px; background: rgba(213, 229, 251, .22); }
.guide-dots i.on { background: #62bafa; }
.guide:not(.has-step) .guide-dots i.on { background: rgba(213, 229, 251, .22); }
/* on a phone (Nov 18) the corner is the pills' (Skip to demo, Every step): the caption at the top already names the chapter */
@media (max-width: 760px) { .guide { display: none; } }

/* the close: the way on */
.close-title .scroll-on { margin: 34px 0 0; font: 500 11px/1 Manrope, sans-serif; letter-spacing: .18em; text-transform: uppercase; color: #9fb6cc; }
.close-title .scroll-on span { display: inline-block; margin-left: 8px; animation: cue 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .close-title .scroll-on span { animation: none; } }

/* the pages beneath the river */
/* above the river (z 3), so the bar it carries stays on top while the current's last screen scrolls away */
.under { position: relative; z-index: 4; }
/* one top bar, never two: under the current, its bar is the same bar, fixed in the same place; it takes over from the
   current's own bar the moment the current ends, so no second bar slides up the page */
body .under .site-header { position: fixed; top: 0; left: 0; right: 0; opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
body.journey-ended .under .site-header { opacity: 1; visibility: visible; }
body.journey-ended .river-story .site-chrome { opacity: 0 !important; transition: opacity .25s; }
.river-floor { height: 1px; background: #020409; }

/* two ways into the current: a deep dive (every step) or a skim of the surface (the fast one); quiet, close under the words; since
   Nov 18 ("aren't the buttons too big?") 40px, one family with the pills at the foot (they were 50px with 14.5px words) */
.hero-choice { margin: var(--dek-top, 38px) 0 0 var(--copy-offset, 0); pointer-events: auto; }
/* hung by the pill's own left padding, so the mark and the words line up with the text above and the rounded edge sits just outside it */
.hero-choice .ways { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-left: -13px; }
.hero-choice a {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 17px 0 13px; border-radius: 999px;
  color: #e6f0fa; text-decoration: none; white-space: nowrap;
  font: 600 13px/1 Manrope, sans-serif; letter-spacing: 0;
  background: rgba(2, 8, 20, .22); box-shadow: inset 0 0 0 1px rgba(160, 205, 255, .24);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: box-shadow .2s, background-color .2s;
}
.hero-choice a.deep { box-shadow: inset 0 0 0 1px rgba(98, 186, 250, .55); }
.hero-choice a:hover { background: rgba(98, 186, 250, .08); box-shadow: inset 0 0 0 1px rgba(160, 210, 255, .7); }
.hero-choice a:focus-visible { outline: 2px solid #a6d4ff; outline-offset: 3px; }
.hero-choice svg { flex: none; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; color: #9fb6cc; }
.hero-choice a.deep svg { color: #62bafa; }
.hero-choice small { font: 500 12px/1 Manrope, sans-serif; color: #8fa8c2; }
.hero-choice .or { font: italic 400 18px/1 "Caveat", Georgia, serif; color: #7f94aa; }
/* on a phone (Nov 19, his iPhone screenshot: the buttons sat on the falcon) the two stay on ONE row down to 375 wide, so they end
   the same distance under the copy's top on every phone, and the falcon starts below them (styles.css .hero-falcon, max-width 700px) */
@media (max-width: 760px) {
  .hero-choice { margin-top: 18px; }
  .hero-choice .ways { flex-wrap: nowrap; gap: 6px; margin-left: -12px; }
  .hero-choice a { height: 40px; gap: 6px; padding: 0 12px 0 10px; font-size: 12px; }
  .hero-choice small { font-size: 11px; }
  .hero-choice svg { width: 15px; height: 15px; }
  .hero-choice .or { font-size: 16px; }
}

/* always on screen: skip to the demo video. River's plate in a small ring, the words, and a thin bar under them that fills on hover */
.skip-film {
  position: fixed; left: 28px; bottom: 28px; z-index: 95;
  display: inline-flex; align-items: center; gap: 10px; padding: 4px 16px 4px 4px; border-radius: 999px;
  color: #eef6ff; text-decoration: none; white-space: nowrap;
  background: rgba(4, 9, 26, .78); border: 1px solid rgba(120, 180, 255, .22);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
  font: 600 12.5px/1 Manrope, sans-serif; letter-spacing: 0;
  transition: border-color .2s, background-color .2s;
}
.skip-film .thumb { flex: none; width: 32px; height: 32px; border-radius: 50%; background: #0b1220 url(/assets/skip-thumb.webp) center / cover; box-shadow: 0 0 0 1.5px rgba(98, 186, 250, .55); }
.skip-film .words { display: grid; gap: 5px; }
.skip-film .words > span { display: flex; align-items: baseline; gap: 8px; }
.skip-film .time { font-size: 12px; font-weight: 500; color: #8fa8c2; }
.skip-film .bar { position: relative; display: block; height: 2px; overflow: hidden; border-radius: 1px; background: rgba(255, 255, 255, .16); }
/* the bar is how much of the current has been scrolled */
.skip-film .bar::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; right: calc((1 - var(--p, 0)) * 100%); border-radius: 1px; background: #62bafa; transition: right .2s linear; }
.skip-film:hover { border-color: rgba(160, 205, 255, .6); background: rgba(8, 16, 30, .92); }
.skip-film:focus-visible { outline: 2px solid #a6d4ff; outline-offset: 4px; }
/* past the end of the current there is nothing left to skip */
body.journey-ended .skip-film { opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }

/* the two versions of the current (src/current.js): beside "Skip to demo", the way to the other one: on the deep dive (the
   default) it offers the skim, while skimming the deep dive. Not on the hero, where the two buttons are the choice */
.foot-pills { position: fixed; left: 28px; bottom: 28px; z-index: 95; display: flex; align-items: center; gap: 10px; pointer-events: none; }
.foot-pills > * { pointer-events: auto; }
.foot-pills .skip-film { position: relative; left: auto; bottom: auto; }
.mode-pill {
  box-sizing: border-box; display: inline-flex; align-items: center; gap: 2px; height: 42px; padding: 4px; border-radius: 999px;
  background: rgba(4, 9, 26, .78); border: 1px solid rgba(120, 180, 255, .22);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
  transition: opacity .25s, visibility .25s;
}
.mode-pill[hidden] { display: none; }
.mode-pill button {
  box-sizing: border-box; display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 13px 0 10px; border: 0; border-radius: 999px;
  cursor: pointer; white-space: nowrap; background: transparent; color: #8fa8c2;
  font: 600 12.5px/1 Manrope, sans-serif; letter-spacing: 0; transition: background-color .2s, color .2s, box-shadow .2s;
}
.mode-pill svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.mode-pill .time { font-size: 11.5px; font-weight: 500; color: #6f88a3; }
.mode-pill button:hover { color: #dbe9f7; }
/* the version playing: lit, the way the hero's Deep dive is */
.mode-pill button[aria-pressed="true"] { color: #eef6ff; background: rgba(98, 186, 250, .16); box-shadow: inset 0 0 0 1px rgba(98, 186, 250, .6); cursor: default; }
.mode-pill button[aria-pressed="true"] svg { color: #62bafa; }
.mode-pill button[aria-pressed="true"] .time { color: #9fc4e6; }
.mode-pill button:focus-visible { outline: 2px solid #a6d4ff; outline-offset: 2px; }
body.journey-ended .mode-pill, .mode-pill.at-hero { opacity: 0; visibility: hidden; }
@media (max-width: 760px) { .foot-pills { left: 14px; bottom: 14px; gap: 6px; } .mode-pill button { gap: 6px; padding: 0 10px 0 8px; } .mode-pill .time { display: none; } }
/* the skim's dip: while the work is under, the river glides to where the next picture has it */
html.dipping .river-strip { transition: transform .5s cubic-bezier(.4, 0, .2, 1); }

/* The current (src/current.js): the page snaps to its stops, one snap point per stop (the skim's among them).
   Beneath the story the page is an ordinary page: the snapping is switched off there. */
html.current { scroll-snap-type: y mandatory; }
.river-story .stop { position: absolute; left: 0; width: 1px; height: 1px; scroll-snap-align: start; scroll-snap-stop: always; pointer-events: none; }
.under { scroll-snap-align: start; }

/* The current on a phone (Nov 9; src/unified.js PHONE): River's stage is framed on its pictures, and its words are read in a
   caption at the top, at a phone's size; the stage's own copies are drawn at the stage's scale, far too small, so they are hidden */
.phone-current .plate-frame :is(.heading, .big-title, .close-title) { opacity: 0 !important; pointer-events: none !important; }
.phone-cap { position: absolute; z-index: 40; left: 22px; right: 22px; visibility: hidden; pointer-events: none; color: #eef6ff; font-family: Manrope, sans-serif; }
.phone-cap a { pointer-events: auto; }
.phone-cap .tool-label, .phone-cap .eyebrow { margin: 0 0 10px; font: 600 10.5px/1.3 Manrope, sans-serif; letter-spacing: .22em; text-transform: uppercase; color: #62bafa; }
.phone-cap h2, .phone-cap h3 { margin: 0; font: 500 27px/1.14 Manrope, sans-serif; letter-spacing: -.02em; color: #eef6ff; text-wrap: balance; }
.phone-cap em { font: 500 1.14em/1.05 Caveat, cursive; letter-spacing: 0; color: #9fd0ff; }
.phone-cap .tool-body, .phone-cap .sel-sub { margin: 10px 0 0; max-width: 34ch; font: 400 14px/1.5 Manrope, sans-serif; color: #9fb6cc; }
.phone-cap .cta { display: inline-flex; margin-top: 16px; padding: 12px 18px; border-radius: 999px; background: #eef6ff; color: #06101c; font: 600 14px/1 Manrope, sans-serif; text-decoration: none; }
.phone-cap .support-actions { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 14px; font: 500 12.5px/1.3 Manrope, sans-serif; }
.phone-cap .support-actions a { color: #c9dbee; text-decoration: none; }
.phone-cap .scroll-on { display: none; }
/* on a phone the river isn't blurred under the journey (Nov 9: "why is the background video quality so bad on the phone"): the
   phone draws it about 2.5 times smaller than a laptop, so the same 1.2 px blur took 2.5 times its detail, and a blur over moving
   video is the costliest thing Safari draws. The veil still dims it under the words */
.phone-current .demo-blur { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
/* the layers on a phone (src/black-plate.js FLAT): no animated blur on the ice sheet and no 120 px shadow under the stack; drawn at
   the size of the whole stage and three times over for the screen, they were what iPhone Safari reloaded the page on */
.phone-current .sheet:nth-child(2) img { filter: none !important; }
.phone-current .sheet.base img { box-shadow: none !important; }

/* the film (Nov 18, "make the last payoff video out of the scroll, in both versions, independent, below it"): its own
   section straight under the story (scripts/pages/home.mjs; src/home.js plays it), one screen with the film centred at
   its whole frame (1920 x 822). Press anywhere on it to pause, with a see-through sign in its centre while paused; the
   speaker on its corner, struck through while silent (the stage's player, as it was) */
.end-film { position: relative; display: grid; place-items: center; box-sizing: border-box; min-height: 100vh; min-height: 100svh; padding: 92px 48px 48px; background: #020409; }
.end-film .film { position: relative; margin: 0; width: min(1320px, 100%, calc((100vh - 160px) * 1920 / 822)); aspect-ratio: 1920 / 822; border-radius: 16px; overflow: hidden; background: #000; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 60px 160px rgba(0, 0, 0, .65); }
.end-film video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.end-film .pp { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 0; border: 0; background: none; color: #fff; cursor: pointer; }
.end-film .pp .sign { display: grid; place-items: center; width: 92px; height: 92px; border-radius: 50%; background: rgba(4, 9, 18, .28); opacity: 0; transition: opacity .35s ease; }
.end-film .pp svg { width: 40px; height: 40px; filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .45)); }
.end-film .i-pause { display: none; }
.end-film .film:not(.paused).pressed .i-pause { display: block; }
.end-film .film:not(.paused).pressed .i-play { display: none; }
.end-film .film.paused .sign, .end-film .film.pressed .sign { opacity: .9; }
.end-film .sound { position: absolute; right: 16px; bottom: 16px; z-index: 3; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: rgba(4, 9, 18, .32); color: #eef6ff; cursor: pointer; transition: background-color .2s; }
.end-film .sound:hover { background: rgba(4, 9, 18, .55); }
.end-film .sound:focus-visible, .end-film .pp:focus-visible .sign { outline: 2px solid #a6d4ff; outline-offset: 3px; }
.end-film .sound svg { width: 22px; height: 22px; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .5)); }
.end-film .sound .mute { display: none; }
.end-film .sound:not(.audible) .mute { display: inline; }
.end-film .sound:not(.audible) .waves { display: none; }
.end-film .sound.blocked:not(.audible) { animation: end-ask-sound 2.4s ease-in-out infinite; }
@keyframes end-ask-sound { 50% { background: rgba(98, 186, 250, .35); } }
/* on a phone the film runs edge to edge */
@media (max-width: 760px) {
  .end-film { padding: 72px 0 40px; }
  .end-film .film { width: 100%; border-radius: 0; }
  .end-film .sound { right: 10px; bottom: 10px; width: 34px; height: 34px; }
  .end-film .sound svg { width: 19px; height: 19px; }
  .end-film .pp .sign { width: 64px; height: 64px; }
  .end-film .pp svg { width: 28px; height: 28px; }
}

/* Nov 19 (his screenshot of a tall browser window on a PC, "too much empty space"): in a portrait window wider than a phone the
   hero's words kept the landscape scale (its 0.72 floor: a 45px headline on an 884 x 1333 window) and sat in the top third,
   over a screen of empty night. Here they are sized to the width instead, as on a phone, so the words, the falcon (styles.css,
   the same window) and the river fill the height together */
@media (min-width: 701px) and (max-aspect-ratio: 4 / 5) {
  .river-story .hero-copy { left: 8vw; top: 13vw; width: 84vw; }
  .river-story .hero-copy .eyebrow { font-size: 2.2vw; }
  .river-story .hero-copy h1 { font-size: 10vw; }
  .river-story .hero-copy .dek { max-width: none; margin-top: 3.2vw; font-size: 2.1vw; }
  .river-story .hero-copy .hero-choice { margin-top: 3.4vw; }
  .river-story .hero-choice a { height: 46px; font-size: 14.5px; padding: 0 19px 0 15px; }
  .river-story .hero-choice small { font-size: 13px; }
}
