/* The story version of the page (src/story.py): a long landscape that moves sideways while the
   page scrolls, chapters of text on top of it, and sheets with the details.

   The page is a tall track; the stage inside it sticks to the window. js/story.js turns the
   scroll position into --cam (where the walkers are, in units of the drawing), --day and --warm
   (the light), and marks the chapter, the group of people and the place that are current.
   --u is the size of one unit of the drawing, --fx where the walkers stand on the screen (story.js moves the
   picture on in a window too narrow for what a place shows). */
.story{--sh:clamp(340px,74vh,880px);--u:calc(var(--sh) / 640);--fx:42vw;--step:115vh}
.track{position:relative;margin-top:-90px;height:calc(var(--step) * (var(--n) - 1) + 100vh)}
.stop{position:absolute;left:0;top:calc(var(--step) * var(--i));width:1px;height:1px;pointer-events:none}
.stage{position:sticky;top:0;height:100vh;height:100svh;overflow:hidden;isolation:isolate;--day:0;
  background:linear-gradient(180deg,#0C1310 0%,#131A16 50%,#1C2821 100%)}

/* ---- sky ---- */
.sky-day,.sky-warm{position:absolute;inset:0;pointer-events:none}
.sky-day{opacity:0;background:linear-gradient(180deg,#6FA6C6 0%,#A3CADB 42%,#D5E4DA 68%,#EDE6C8 100%)}
.sky-warm{opacity:.15;background:linear-gradient(180deg,rgba(217,129,47,0) 26%,rgba(217,129,47,.32) 56%,rgba(243,190,120,.8) 80%)}
.night{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
/* Sun and moon travel across the sky as the story goes on; story.js places them. They lie behind
   the landscape, so they rise and set behind the mountains. */
.sun,.moon{position:absolute;left:0;top:0;aspect-ratio:1;border-radius:50%;pointer-events:none;opacity:0;will-change:transform}
.sun{width:calc(var(--sh) * .13);background:radial-gradient(circle at 42% 38%,#FFFBE8,#FFE39C 62%,#F7C566);box-shadow:0 0 calc(var(--sh) * .16) calc(var(--sh) * .06) rgba(255,214,130,.6)}
.moon{width:calc(var(--sh) * .1);background:radial-gradient(circle at 40% 36%,#FFFDF2,#EFE6C6 66%);box-shadow:0 0 calc(var(--sh) * .09) calc(var(--sh) * .025) rgba(240,232,200,.38)}

/* ---- the landscape: layers that move at different speeds ---- */
.land{position:absolute;left:0;right:0;bottom:0;height:var(--sh);pointer-events:none}
.land svg{display:block;max-width:none}
/* js/story.js moves each layer itself; nothing here depends on a value that changes while scrolling */
.layer{position:absolute;left:0;bottom:0;height:var(--sh);will-change:transform}
svg.layer,.world .ground{height:var(--sh);width:auto}
/* the turf in front begins one tile (2400 units) to the left, like every layer (world.py: LEFT) */
.fore{display:flex;margin-left:calc(var(--u) * -2400)}
.fore img{flex:none;height:100%;width:auto;max-width:none}
/* night: a dark veil over the landscape; lights, people and the foreground lie above it */
/* the veil thins out towards the sky, so the moon stays bright up there and dims near the horizon */
.veil{position:absolute;left:0;right:0;bottom:0;height:100vh;opacity:.5;background:linear-gradient(180deg,rgba(7,16,13,0) calc(100% - var(--sh) * .96),#07100D calc(100% - var(--sh) * .6))}
.life{position:absolute;bottom:0;left:calc(var(--u) * var(--x));height:var(--sh);width:auto;aspect-ratio:1500/640;overflow:visible}
/* lights and motion of a place run only while the walkers stand there: on the way nothing repaints */
.life:not(.active) *{animation-play-state:paused!important}
/* --day is set per place (on .life), not on the stage: so a change restyles only a few elements */
.stage .lamp{opacity:calc(1 - var(--day,0) * .62)}
/* The walkers: a point on the path at the place where they stand (story.js moves it when they fall
   behind, and dims them at night with --day). Each person is a picture of the game's figure: a sheet of
   pictures, 10 per row, rows from the top walk, run, stand (scripts/Editor/StoryFigureRenderer.cs). A picture
   is 2.32 m high and the settler in it 1.68 m; --big sets how large the people are in the landscape. */
.walkers{--big:1.3;--day:0;position:absolute;left:var(--fx);bottom:calc(var(--u) * (640 - var(--path)));width:0;height:0;will-change:transform;
  filter:brightness(calc(.62 + var(--day) * .38))}
.cast-set{position:absolute;left:0;bottom:0;width:0;height:0;opacity:0;transition:opacity .4s}
.cast-set.on{opacity:1}
.figure{position:absolute;left:calc(var(--u) * var(--big) * var(--dx,0));bottom:calc(var(--u) * var(--big) * -3);height:calc(var(--u) * var(--big) * 88.4);aspect-ratio:144/196;
  transform:translateX(-50%);background:0 100%/1000% 300% no-repeat}
.walking .walkers .figure{background-position-y:0;animation:pictures .8s steps(10,jump-none) var(--lag,0s) infinite}
.running .walkers .figure{background-position-y:50%;animation-duration:.6s}
@keyframes pictures{from{background-position-x:0}to{background-position-x:100%}}
/* Walking back, everyone turns round on the spot, one after the other, so the last becomes the first. */
.walkers .figure{transition:transform .2s ease calc(var(--n,0) * 50ms)}
.stage.back .walkers .figure{transform:translateX(-50%) scaleX(-1)}
/* a couple that stands face to face (she looks at him) does so whichever way they came */
.stage:not(.walking) .cast-set.facing .figure{transform:translateX(-50%)}
.stage:not(.walking) .cast-set.facing .figure.turned{transform:translateX(-50%) scaleX(-1)}
/* The people beside the path stand in the landscape itself and have a life of their own, whatever the visitor
   scrolls: two children run to and fro, the founders grown old stroll between the graves (story.js sends them a
   few steps and lets them rest: --at, --face, --dur, .going). Only while their place is near. A little smaller,
   as they are further back. */
.folk{width:0}
.by-set{--big:1.12;--day:1;position:absolute;left:0;bottom:calc(var(--u) * (640 - var(--path)));width:0;height:0;filter:brightness(calc(.62 + var(--day) * .38))}
.by-set .figure{left:calc(var(--u) * var(--x));bottom:calc(var(--u) * (var(--lift,0) - 3 * var(--big)))}
.by-set .figure.play{transform:translateX(-50%) scaleX(var(--face,1))}
.by-set.near .figure.play{background-position-y:50%;
  animation:pictures .6s steps(10,jump-none) var(--lag,0s) infinite,play var(--t,3s) linear infinite}
.by-set .figure.stroll{transform:none;translate:calc(-50% + var(--u) * var(--at,0)) 0;scale:var(--face,1) 1;transition:translate var(--dur,0s) linear}
.by-set .figure.going{background-position-y:0;animation:pictures 1.4s steps(10,jump-none) infinite}
@keyframes play{
  0%{transform:translateX(-50%) scaleX(var(--face))}
  49.9%{transform:translateX(calc(-50% + var(--u) * var(--run) * var(--face))) scaleX(var(--face))}
  50%{transform:translateX(calc(-50% + var(--u) * var(--run) * var(--face))) scaleX(calc(var(--face) * -1))}
  99.9%{transform:translateX(-50%) scaleX(calc(var(--face) * -1))}
  100%{transform:translateX(-50%) scaleX(var(--face))}}
/* on the opening screen the founders walk in from the left (--from is set by story.js) */
.walkers.enter .cast-set.on{animation:enter 3.4s cubic-bezier(.25,.6,.35,1) both}
@keyframes enter{from{transform:translateX(var(--from,-600px))}}

/* ---- what happens at a place, once the walkers stand there ---- */
/* a fire of the game: it burns while it is dark at its place (--day, set per place), each layer of the flame in its own rhythm */
.fire{opacity:clamp(0,calc((.6 - var(--day,0)) * 6),1)}
/* a fire never stands still: it goes on burning on the way to and from its place, while it fades with the light;
   neither does the smoke over a chimney */
.life.near .fire *,.life.near .smoke{animation-play-state:running!important}
.fire .flame,.fire .tongue,.fire .spark{transform-box:fill-box;transform-origin:50% 100%}
.fire .f1{animation:flame1 1.15s ease-in-out calc(var(--n,0) * -.37s) infinite alternate}
.fire .f2{animation:flame2 .83s ease-in-out calc(var(--n,0) * -.21s) infinite alternate}
.fire .f3{animation:flame3 .61s ease-in-out calc(var(--n,0) * -.13s) infinite alternate}
@keyframes flame1{0%{transform:scale(1,1) skewX(0)}35%{transform:scale(.92,1.12) skewX(5deg)}70%{transform:scale(1.06,.9) skewX(-6deg)}100%{transform:scale(.96,1.08) skewX(3deg)}}
@keyframes flame2{0%{transform:scale(1,1) skewX(-4deg)}40%{transform:scale(1.1,.86) skewX(6deg)}100%{transform:scale(.9,1.16) skewX(-2deg)}}
@keyframes flame3{0%{transform:scale(1,.9)}50%{transform:scale(.86,1.2) skewX(5deg)}100%{transform:scale(1.08,1) skewX(-5deg)}}
.fire .tongue{animation:tongue 1.3s ease-out calc(var(--i) * -.65s + var(--n,0) * -.3s) infinite}
@keyframes tongue{0%{opacity:0;transform:translate(0,.5px) scale(1.5)}15%{opacity:1}100%{opacity:0;transform:translate(.14px,-.7px) scale(.3) rotate(25deg)}}
.fire .spark{animation:spark 2.1s ease-out calc(var(--i) * -1.05s + var(--n,0) * -.5s) infinite}
@keyframes spark{0%{opacity:0;transform:translate(0,.4px)}10%{opacity:1}100%{opacity:0;transform:translate(.5px,-1.5px)}}
.fire .fire-glow,.fire .fire-ground{animation:fireglow 1.7s ease-in-out calc(var(--n,0) * -.6s) infinite alternate}
@keyframes fireglow{0%{opacity:.8}45%{opacity:1}100%{opacity:.88}}
/* the mill's sails turn round their hub, as long as the mill grinds: in the story, always */
.sails{transform-box:fill-box;transform-origin:50% 50%;animation:sails 7.8s linear infinite}
@keyframes sails{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.fire *,.sails{animation:none!important}}
.fell{transition:transform .5s}
.life.active .fell{animation:fell 2.6s cubic-bezier(.6,0,.9,.5) .5s forwards}
@keyframes fell{0%{transform:rotate(0)}12%{transform:rotate(3deg)}24%{transform:rotate(-2deg)}100%{transform:rotate(-87deg)}}
.heart{opacity:0;transform-box:fill-box;transform-origin:50% 100%}
.life.active .heart{animation:heart 2.8s ease-out .4s infinite}
@keyframes heart{0%{opacity:0;transform:translateY(14px) scale(.5)}25%{opacity:1;transform:translateY(0) scale(1)}100%{opacity:0;transform:translateY(-46px) scale(1.25)}}
.rock{animation:rock 2.4s ease-in-out infinite alternate}
@keyframes rock{from{transform:rotate(-7deg)}to{transform:rotate(7deg)}}
.saw{animation:saw .7s ease-in-out infinite alternate}
@keyframes saw{from{transform:translateY(-10px)}to{transform:translateY(18px)}}
.flame{transform-box:fill-box;transform-origin:50% 100%;animation:lamp 3.4s ease-in-out infinite,flame .5s ease-in-out infinite alternate}
@keyframes flame{from{transform:scale(1,.9)}to{transform:scale(.94,1.08)}}

/* ---- points in the landscape that open a sheet ---- */
.points{pointer-events:none}
.spot{position:absolute;left:calc(var(--u) * var(--x));top:calc(var(--u) * var(--y));transform:translate(-50%,-50%);display:inline-flex;align-items:center;gap:.55rem;
  padding:.42rem .9rem .42rem .7rem;border:1px solid var(--ember);border-radius:999px;background:rgba(var(--surf),.88);color:var(--cream);
  font:400 .98rem var(--serif);white-space:nowrap;cursor:pointer;pointer-events:auto;box-shadow:0 8px 22px rgba(0,0,0,.3);transition:transform .2s,background .2s,color .2s}
.spot:hover{transform:translate(-50%,-50%) scale(1.06);color:var(--ember-hi)}
.spot i{flex:none;width:9px;height:9px;background:var(--ember);transform:rotate(45deg);animation:ping 2.4s ease-out infinite}

/* ---- the chapters ---- */
.chapters{position:absolute;left:0;right:0;top:0;height:0;max-width:var(--max);margin:0 auto;pointer-events:none}
.chapter{position:absolute;left:clamp(1rem,4vw,2rem);top:clamp(5.6rem,12vh,8.4rem);width:min(36rem,calc(100% - 2rem));opacity:0;transform:translateY(14px);
  transition:opacity .45s,transform .45s;pointer-events:none;isolation:isolate}
.chapter.on{opacity:1;transform:none;pointer-events:auto}
/* the opening stands free on the night sky, on a soft dark patch; every other chapter is a card.
   It belongs to the landscape: on leaving it stays where it stands and goes out to the left with the
   ground (story.js moves it and marks it .away for as long as it is in the picture). */
.chapter.first{transform:none;transition:opacity .3s;will-change:transform}
.chapter.first.away{opacity:1;pointer-events:auto}
.chapter.first::before{content:"";position:absolute;z-index:-1;left:-7rem;right:-9rem;top:-3rem;bottom:-3.5rem;pointer-events:none;
  background:radial-gradient(closest-side,rgba(var(--surf),.9),rgba(var(--surf),.7) 58%,rgba(var(--surf),0))}
.chapter:not(.first){padding:1.5rem 1.7rem 1.6rem;border:1px solid var(--line-hi);border-radius:var(--r);background:rgba(var(--surf),.9);box-shadow:0 18px 44px rgba(0,0,0,.3)}
.chapter h1{line-height:0;margin:0 0 1.4rem}
.chapter h1 img{width:min(100%,430px,50vh);height:auto}
.chapter h2{font:400 clamp(2rem,4.2vw,3.1rem)/1.08 var(--serif);color:var(--cream);margin-bottom:1rem}
.chapter h2::after{content:"";display:block;width:6.5rem;height:12px;margin-top:.9rem;background:var(--rule) left center/contain no-repeat}
.chapter>p{color:var(--text);font-size:1.12rem}
.chapter .tagline{font-size:min(4.2rem,7.6vh,11vw)}
.chapter .lead{margin-bottom:1.5rem;text-shadow:none}
.chapter .cta{margin-top:1.4rem}
.looks{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem .6rem;margin-top:1.3rem}
.looks:empty{display:none}
.looks-label{font:700 .7rem var(--sans);letter-spacing:.16em;text-transform:uppercase;color:var(--dim);margin-right:.2rem}
.looks-label:last-child{display:none}
.look{display:inline-flex;align-items:center;gap:.5rem;padding:.4rem .9rem;border:1px solid var(--ember);border-radius:999px;background:rgba(var(--surf2),.7);color:var(--cream);
  font:400 1rem var(--serif);cursor:pointer;transition:color .2s,background .2s}
.look::before{content:"";width:7px;height:7px;background:var(--ember);transform:rotate(45deg)}
.look:hover{color:var(--ember-hi);background:rgba(var(--surf2),.95)}
.hint{display:flex;align-items:center;gap:.6rem;margin-top:1.6rem;font-size:.95rem;font-weight:600;color:var(--text)}
.hint span{animation:along 1.8s ease-in-out infinite}
@keyframes along{0%,100%{transform:translateX(0)}50%{transform:translateX(7px)}}
.travel{position:absolute;left:0;right:0;bottom:0;height:3px;background:rgba(var(--tint),.12)}
.travel i{display:block;height:100%;background:var(--ember);transform-origin:0 50%;transform:scaleX(0)}

/* ---- one step back, one step on ---- */
.stage{--go:3.2rem;--go-x:clamp(.6rem,2vw,1.6rem)}
.go{position:absolute;z-index:5;top:50%;width:var(--go);height:var(--go);margin-top:calc(var(--go) / -2);padding:0;display:grid;place-items:center;border:1px solid var(--ember);border-radius:50%;
  background:rgba(var(--surf),.86);color:var(--cream);cursor:pointer;box-shadow:0 10px 26px rgba(0,0,0,.32);transition:transform .2s,color .2s,background .2s}
.go svg{display:block;width:1.5rem;height:1.5rem}
.go-prev{left:var(--go-x)}
.go:hover{transform:scale(1.1);color:var(--ember-hi);background:rgba(var(--surf),.98)}
.go[hidden]{display:none}
/* The button for the next step and the hint beside it are one piece (.onward). The hint shows where the opening
   text has no room for its own (a small or a low window), for as long as the walkers are at the start; there
   the whole piece, button and words, nudges to the right together. */
.onward{position:absolute;z-index:5;right:var(--go-x);top:50%;height:var(--go);margin-top:calc(var(--go) / -2);display:flex;align-items:center;gap:.75rem;pointer-events:none}
.onward .go{position:static;flex:none;margin:0;pointer-events:auto}
.hint.low{display:none;margin:0;text-shadow:0 1px 8px rgba(var(--surf),.95),0 0 2px rgba(var(--surf),.9);opacity:0;transition:opacity .3s}
.hint.low span{animation:none}
.stage.at-start .hint.low{opacity:1}
.fx{position:absolute;left:var(--fx);top:0;width:0;height:0}

/* ---- the end of the walk: the footer stands at the right edge, from top to bottom ---- */
footer.end{position:absolute;z-index:6;top:0;right:0;bottom:0;width:clamp(15rem,25vw,22rem);margin:0;display:flex;flex-direction:column;justify-content:center;gap:1.5rem;
  padding:6rem 1.8rem 3rem 2.6rem;background:var(--paper);background-image:linear-gradient(90deg,rgba(84,58,26,.3),rgba(84,58,26,0) 6rem),url("../assets/paper.svg");
  filter:drop-shadow(-10px 0 18px rgba(0,0,0,.35));transform:translate3d(110%,0,0);will-change:transform}
footer.end::before{left:auto;right:calc(100% - 1px);top:0;bottom:0;width:14px;height:auto;background:var(--paper);background-image:linear-gradient(rgba(84,58,26,.3),rgba(84,58,26,.3)),url("../assets/paper.svg");
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='28' viewBox='0 0 14 28'%3E%3Cpolygon points='14,0 14,28 0,14'/%3E%3C/svg%3E") repeat-y;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='28' viewBox='0 0 14 28'%3E%3Cpolygon points='14,0 14,28 0,14'/%3E%3C/svg%3E") repeat-y}
.end .brand{flex-direction:column;align-items:flex-start;gap:.9rem}
.end .brand img{border-radius:11px}
.end .brand .brand-word{display:block;height:20px}
.end-line{font:400 1.5rem/1.2 var(--serif);color:var(--ink)}
.end .links{display:flex;flex-direction:column;align-items:flex-start;gap:.7rem;padding-top:1.3rem;border-top:1px solid var(--line-hi);font-size:1.05rem}
.end .links a,.end .links button{color:var(--cream);text-decoration:none;background:none;border:0;padding:0;font:inherit;cursor:pointer}
.end .links a:hover,.end .links button:hover{color:var(--ember-hi);text-decoration:underline;text-underline-offset:4px}
.end .links button[hidden]{display:none}
.end-copy{font-size:.9rem;color:var(--muted)}
/* The legal pages: a small wooden signpost on the opening screen points to the end of the walk,
   where they are linked on the parchment. It wobbles when touched. */
.sign{position:absolute;z-index:4;left:clamp(1rem,4vw,2.2rem);bottom:.25rem;display:flex;flex-direction:column;align-items:center;text-decoration:none;
  transform-origin:50% 100%;transform:rotate(-2.5deg);filter:drop-shadow(0 5px 6px rgba(0,0,0,.45));opacity:0;pointer-events:none;transition:opacity .3s}
.stage.at-start .sign{opacity:1;pointer-events:auto}
.sign::after{content:"";width:.55rem;height:2.3rem;margin-top:-.25rem;border-radius:0 0 2px 2px;background:linear-gradient(90deg,#5E432B,#7A5A3A 55%,#4E3B2A)}
.plank{position:relative;z-index:1;display:block;padding:.42rem 1.7rem .46rem .95rem;font:400 .98rem/1.2 var(--serif);color:#2A1C10;white-space:nowrap;
  clip-path:polygon(0 9%,3% 0,88% 3%,100% 50%,88% 97%,2% 100%,0 90%);
  background:radial-gradient(circle at .5rem 50%,#3E2C1D 0 .12rem,transparent .14rem),
    repeating-linear-gradient(178deg,rgba(62,44,29,0) 0 .42rem,rgba(62,44,29,.28) .42rem .5rem),
    linear-gradient(180deg,#B08A5A,#8F6C43)}
.sign:hover,.sign:focus-visible{animation:wobble .9s ease-in-out}
.sign:hover .plank,.sign:focus-visible .plank{color:#5A2A06}
@keyframes wobble{0%{transform:rotate(-2.5deg)}18%{transform:rotate(-9deg)}40%{transform:rotate(4deg)}62%{transform:rotate(-5.5deg)}82%{transform:rotate(-.5deg)}100%{transform:rotate(-2.5deg)}}

/* ---- sheets: the details, each a page of its own with ordinary scrolling ---- */
/* A sheet scrolls up and down only: what reaches past its edge (the soft shadow behind a heading) is cut off
   by its content (.sheet-in), so the sheet has nothing to scroll sideways to.
   A sheet lies in the ground below the landscape. Opening it is a ride down: the stage and the
   menu bar leave upwards while the sheet comes up from below at the same pace, so the turf at the
   foot of the landscape and the turf at the top of the sheet stay joined. */
.sheet{position:fixed;inset:0;z-index:30;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;background:#1C1B19;transform:translate3d(0,100%,0);
  transition:transform .8s cubic-bezier(.55,0,.2,1);will-change:transform}
.sheet.open{transform:none}
.sheet[hidden]{display:none}
.stage,.top{transition:transform .8s cubic-bezier(.55,0,.2,1)}
.sheet-open .stage{transform:translate3d(0,-100%,0)}
.sheet-open .top{transform:translate3d(0,-100vh,0)}
.sheet-close{position:sticky;top:14px;z-index:5;display:block;margin:14px 0 -2.6rem max(clamp(1rem,4vw,2rem),calc((100% - var(--max)) / 2 + clamp(1rem,4vw,2rem)));padding:.5rem 1rem;
  border:1px solid var(--ember);border-radius:999px;background:rgba(20,26,22,.94);color:#EADFC6;font:400 1rem var(--serif);cursor:pointer;box-shadow:0 8px 22px rgba(0,0,0,.28)}
.sheet-close:hover{color:#EDA257}
.sheet-in{overflow-x:clip}
.sheet-in.under{min-height:100%;padding-top:calc(var(--u) * 170);padding-bottom:5rem}
.sheet .reveal{opacity:1!important;transform:none!important}
.sheet .chron{margin:0}
.sheet .chron::before,.sheet .chron::after{background:#1C1B19}
@media (prefers-reduced-motion:reduce){.sheet,.stage,.top{transition:none}}
/* the page below must not scroll meanwhile; the lock sits on the root, so the stage keeps sticking to the window */
html.sheet-open{overflow:hidden}

/* ---- small and low windows ---- */
/* Below this width the text column reaches the edge of the window, so the step buttons would lie on the text:
   they become small and quiet and sit in the bottom corners, on the ground in front of the path. The sign
   stands bottom left on the opening screen, where the button back is not shown. */
@media (max-width:1279px){
  .stage{--go:2.6rem;--go-x:clamp(.75rem,2vw,1.4rem)}
  .go{top:auto;bottom:.8rem;margin-top:0;border-color:var(--line-hi);background:rgba(var(--surf),.72);box-shadow:none;
    -webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}
  .go svg{width:1.2rem;height:1.2rem}
  .onward{top:auto;bottom:.8rem;margin-top:0}
}
/* too small or too low for the hint below the opening text: it moves to the button */
@media (max-width:1279px),(max-height:819px){
  .chapter.first .hint{display:none}
  .hint.low{display:block}
  .stage.at-start .onward{animation:along 1.8s ease-in-out infinite}
}
/* a low window (a tablet lying on its side, a small laptop): the opening text draws together */
@media (min-width:701px) and (max-height:819px){
  .chapter{top:clamp(4.8rem,11vh,8.4rem)}
  .chapter.first .badge{margin-bottom:1rem}
  .chapter h1{margin-bottom:1rem}
  .chapter .tagline{margin-bottom:.9rem}
  .chapter .lead{margin-bottom:1.1rem;font-size:1.08rem}
  .chapter .cta{margin-top:1.1rem}
  .looks{margin-top:1rem}
}
@media (min-width:701px) and (max-height:619px){
  .chapter.first .lead{display:none}
}

/* ---- narrow screens ---- */
/* An upright window is narrower than a place is wide: a point in the landscape would hang over its edge. The same
   link stands in the text. */
@media (max-aspect-ratio:1/1){.spot{display:none}}
@media (max-width:700px){
  .story{--fx:50vw;--sh:clamp(250px,46vh,440px)}
  .stage{--go:2.4rem;--go-x:.75rem}
  .chapter{top:5.2rem}
  .chapter>p{font-size:1rem;line-height:1.55}
  .chapter h2{font-size:1.9rem}
  .chapter.first .lead{display:none}
  .chapter.first::before{left:-2rem;right:-2rem}
  .chapter.first .badge{margin-bottom:1.1rem;font-size:min(.85rem,3.3vw);gap:.5rem;padding:.36rem .8rem .36rem .7rem;white-space:nowrap}
  .chapter h1{margin-bottom:1.1rem}
  .chapter .tagline{margin-bottom:1rem;font-size:min(4.2rem,6.4vh,11vw)}
  .chapter .cta{margin-top:1rem;gap:.55rem}
  .chapter .btn{padding:.62rem .9rem .62rem 1.1rem;font-size:.96rem}
  .looks{margin-top:1rem}
  .chapter:not(.first){padding:1.1rem 1.2rem 1.2rem}
  .chapter:not(.first) .cta{grid-template-columns:repeat(2,minmax(0,1fr))}
  .chapter:not(.first) .btn{position:relative;justify-content:center;padding:.62rem .5rem;font-size:.88rem}
  .chapter:not(.first) .btn .soon{position:absolute;right:.6rem;top:-.55rem;font-size:.58rem;background:var(--bg);color:var(--muted);border:1px solid var(--line-hi)}
  /* no points in the landscape on a narrow screen: where the walkers stand they would be cut off at the
     edge or lie behind the chapter card; the card carries the same button */
  .spot{display:none}
  .go{bottom:.7rem}
  .go svg{width:1.1rem;height:1.1rem}
  /* the hint in two short lines, so that it fits between the sign and the button */
  .onward{bottom:.7rem;gap:.5rem}
  .hint.low{max-width:7.2rem;font-size:.8rem;line-height:1.15;text-align:right;text-wrap:balance}
  .sign{left:.7rem}
  .sign::after{height:.8rem}
  .plank{font-size:.78rem;padding:.3rem 1.2rem .32rem .75rem}
  footer.end{width:min(78vw,19rem);padding:5.5rem 1.4rem 2.5rem 2rem}
}
@media (max-width:339px){.hint.low{display:none}}
/* a phone of middling height: the cards draw together, so the walkers stay in the picture below them */
@media (max-width:700px) and (max-height:700px){
  .chapter>p{font-size:.95rem;line-height:1.48}
  .chapter h2{font-size:1.7rem;margin-bottom:.8rem}
  .chapter h2::after{margin-top:.7rem}
  .chapter .eyebrow{margin-bottom:.7rem}
  .looks{margin-top:.9rem}
  .looks-label{display:none}
}
/* a short phone: the two buttons side by side */
@media (max-width:700px) and (max-height:620px){
  .chapter{top:4.9rem}
  .chapter .cta{grid-template-columns:repeat(2,minmax(0,1fr))}
  .chapter .btn{position:relative;justify-content:center;padding:.62rem .5rem;font-size:.86rem}
  .chapter .btn .soon{position:absolute;right:.6rem;top:-.55rem;font-size:.58rem;background:var(--bg);color:var(--muted);border:1px solid var(--line-hi)}
  .chapter>p{font-size:.9rem;line-height:1.42}
  .chapter .eyebrow{margin-bottom:.5rem}
  .chapter h2{font-size:1.5rem;margin-bottom:.6rem}
  .chapter h2::after{margin-top:.5rem;height:10px}
  .chapter:not(.first){padding:.85rem 1rem .95rem}
  .looks{margin-top:.7rem}
  .look{padding:.32rem .8rem;font-size:.94rem}
}

/* ---- a phone lying on its side: text on the left, the walkers beside it on the right ---- */
@media (max-height:520px) and (min-width:560px){
  .story{--fx:80vw;--sh:clamp(220px,80vh,340px)}
  .stage{--go:2.3rem;--go-x:.7rem}
  .chapter{top:4.4rem;left:3.6rem;width:min(58vw,34rem)}
  .chapter.first{left:clamp(1rem,4vw,2rem)}
  .chapter.first::before{left:-3rem;right:-4rem;top:-2rem;bottom:-2rem}
  .chapter.first .badge{margin-bottom:.7rem;font-size:.78rem;padding:.3rem .8rem .3rem .7rem}
  .chapter h1{margin-bottom:.7rem}
  .chapter h1 img{width:min(100%,430px,64vh)}
  .chapter .tagline{margin-bottom:.7rem;font-size:min(2rem,7.4vh)}
  .chapter .tagline .l1,.chapter .tagline .l2{display:inline}
  .chapter.first .lead{display:none}
  .chapter .cta{margin-top:.7rem;gap:.5rem;grid-template-columns:repeat(2,minmax(0,1fr))}
  .chapter .btn{padding:.5rem .8rem .5rem 1rem;font-size:.86rem}
  .chapter .btn .soon{font-size:.6rem}
  .looks{margin-top:.7rem}
  .look{padding:.3rem .8rem;font-size:.92rem}
  .looks-label{display:none}
  .chapter:not(.first){padding:.65rem 1rem .75rem}
  .chapter:not(.first) .cta{margin-top:.55rem}
  .chapter:not(.first) .looks{margin-top:.5rem}
  .chapter .eyebrow{margin-bottom:.25rem;font-size:.7rem}
  .chapter h2{font-size:clamp(1.15rem,5.6vh,1.5rem);margin-bottom:.35rem}
  .chapter h2::after{display:none}
  .chapter>p{font-size:clamp(.78rem,3.5vh,.92rem);line-height:1.4}
  .spot{display:none}
  .go{bottom:.6rem}
  .onward{bottom:.6rem}
  .hint.low{font-size:.85rem}
  .sign{left:.7rem}
  .sign::after{height:.6rem}
  .plank{font-size:.78rem;padding:.3rem 1.2rem .32rem .75rem}
  footer.end{width:min(46vw,18rem);padding:4.4rem 1.2rem .9rem 1.9rem;gap:.55rem;justify-content:flex-end}
  .end .brand{gap:.5rem}
  .end .brand>img{width:32px;height:32px;border-radius:8px}
  .end .brand .brand-word{height:15px}
  .end-line{font-size:1.1rem}
  .end .links{gap:.3rem;padding-top:.55rem;font-size:.95rem}
  .end-copy{font-size:.8rem}
}
@media (max-height:340px) and (min-width:560px){
  .chapter{top:4rem}
  .chapter:not(.first) .eyebrow{display:none}
  .chapter>p{font-size:.75rem}
}

/* ---- without scripts, or when the visitor asked for less motion: the story as a plain page ---- */
html:not(.js) .track,html.plain .track{height:auto;margin-top:0}
html:not(.js) .stage,html.plain .stage{position:static;height:auto;overflow:visible;background:none}
html:not(.js) .stage>:not(.chapters):not(.end),html.plain .stage>:not(.chapters):not(.end),html:not(.js) .stop,html.plain .stop{display:none}
html:not(.js) .chapters,html.plain .chapters{position:static;height:auto;padding:1rem 0 3rem}
html:not(.js) .chapter,html.plain .chapter{position:static;opacity:1;transform:none;pointer-events:auto;margin:0 clamp(1rem,4vw,2rem) 4.5rem}
html:not(.js) .chapter.first::before,html.plain .chapter.first::before,html:not(.js) .hint,html.plain .hint{display:none}
html:not(.js) .sheet[hidden]{display:block;position:static}
html:not(.js) .sheet-close,html:not(.js) .looks{display:none}
html:not(.js) footer.end,html.plain footer.end{position:static;width:auto;transform:none;filter:none;padding:2.5rem clamp(1rem,4vw,2rem)}
html:not(.js) footer.end::before,html.plain footer.end::before{display:none}
