/* Layout and failure modes are the point of this file. Colours, type and spacing are placeholders: replace every token from the brand. */
:root{--night:#1f242e;--paper:#f9f8f6;--on-night:#f5f4f0;--on-night-2:#bdb7a6;--on-paper:#1f242e;--on-paper-2:#5f6776;--hot:#a8473a;--hot-lit:#de8070;--brand:#bb5244;--night-glow:linear-gradient(135deg,#1f242e 0%,#303541 50%,#562f29 100%);
  --pad:clamp(20px,5.6vw,104px);--nav:68px;--ease:cubic-bezier(.16,1,.3,1);--sans:"Barlow","Barlow Fallback",system-ui,-apple-system,"Segoe UI",sans-serif;--display:"Bebas Neue","Bebas Neue Fallback",Impact,sans-serif;--label:"Barlow Condensed","Barlow Fallback",sans-serif}
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;background:var(--paper)}
body{margin:0;font:400 17px/1.6 var(--sans);color:var(--on-paper);background:var(--paper);-webkit-font-smoothing:antialiased;overflow-x:clip} /* clip, never hidden: hidden on an ancestor kills position:sticky */
h1,h2,h3,p,ol{margin:0}h1,h2{font-family:var(--display);font-weight:400;letter-spacing:.01em;line-height:.92;text-wrap:balance}
h1{font-size:clamp(52px,min(9.4vw,17svh),168px)}h2{font-size:clamp(42px,min(6.4vw,12svh),112px)} /* svh in every display size: a laptop window is 600 to 700px tall */
.lede{font-size:clamp(16px,1.25vw,20px);color:var(--fg2);max-width:34em;text-wrap:pretty}
a{color:inherit}a,button{cursor:pointer;-webkit-tap-highlight-color:transparent}:focus-visible{outline:2px solid currentColor;outline-offset:4px;border-radius:4px}
.btn{display:inline-flex;align-items:center;gap:8px;min-height:50px;padding:0 26px;border-radius:99px;background:var(--brand);color:#fff;font-weight:600;text-decoration:none}.btn.line{background:none;color:inherit;box-shadow:inset 0 0 0 1.5px currentColor}
.actions{display:flex;flex-wrap:wrap;gap:12px}.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.skip{position:fixed;left:12px;top:-90px;z-index:99;background:#fff;color:#111;padding:12px 18px}.skip:focus{top:12px}
[data-ground=dark]{--fg:var(--on-night);--fg2:var(--on-night-2);--accent:var(--hot-lit);color:var(--fg);background:var(--night) var(--night-glow)}
[data-ground=light]{--fg:var(--on-paper);--fg2:var(--on-paper-2);--accent:var(--hot);color:var(--fg);background:var(--paper)}
.nav{position:fixed;z-index:20;inset:0 0 auto;height:var(--nav);padding-inline:var(--pad);display:flex;align-items:center;justify-content:space-between;transition:opacity .2s;color:var(--on-night)}.nav[data-tone=light]{color:var(--on-paper)}
.turning :is(.nav,[data-fixed]):not(:focus-within){opacity:0} /* give data-fixed to anything else pinned over the film, such as a progress marker */
.tap{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px} /* every small link: footer, marker, logo */
.nav::before{content:"";position:absolute;inset:0 0 -22px;z-index:-1;pointer-events:none;background:linear-gradient(var(--night) 50%,transparent);transition:opacity .4s}.nav[data-tone=light]::before{background:linear-gradient(var(--paper) 50%,#f6f5f200)}.nav.bare::before{opacity:0} /* bare: a held scene keeps its own clear space; scrolling words need the fade */.nav a{display:inline-flex;align-items:center;min-height:44px;font-weight:600;text-decoration:none}

/* ---- a beat: words plus a slot. This is the layout with no script at all: a plain, complete page ---- */
.stage{position:relative}.track{display:none}
.beat-in{min-height:100vh;min-height:100svh;padding:calc(var(--nav) + 12px) var(--pad) clamp(20px,4svh,56px);display:grid;gap:clamp(16px,3svh,32px);align-items:center}
.copy{display:grid;gap:clamp(12px,2.2svh,26px);justify-items:start;min-width:0}
.slot{min-width:0;min-height:0;display:grid;place-items:center}.slot>*{width:min(100%,46svh);height:auto;max-height:100%}
@media(min-aspect-ratio:1/1){.beat-in{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.slot{height:min(74svh,46vw)}.beat.swap .slot{order:-1}}
@media(max-aspect-ratio:1/1){.beat-in{grid-template-rows:minmax(0,1fr) auto}.beat .slot{order:-1;height:100%;min-height:30svh}.hero .beat-in{grid-template-rows:auto minmax(0,1fr)}.hero .slot{order:1;min-height:22svh}}
/* ---- film: html.film is set by the head script before first paint, only when the scene is going to run ---- */
.film .track{display:block;position:absolute;inset:0;pointer-events:none} /* the track ends with the stage, so the pin can never slide over what follows (a negative margin on the pin lets it) */
.film .pin{position:sticky;top:0;height:100vh;height:100lvh;background:var(--night) var(--night-glow);overflow:clip}
.day{position:absolute;inset:0;background:var(--paper);clip-path:circle(0)}.pin canvas{position:absolute;inset:0;width:100%;height:100%}
.film .beat{position:relative;background:none;height:calc((1 + var(--hold,1.2))*100vh);height:calc((1 + var(--hold,1.2))*100svh)}
.film .beat-in{position:sticky;top:0;height:100vh;height:100svh;min-height:0}
.film .copy{opacity:var(--o,1);transform:translateY(calc((1 - var(--o,1))*10px))} /* the finished state is the default: if the script stops, the words are there */
.film .beat-in:not(.up) .copy{pointer-events:none}
.film.live .slot>*{opacity:0}                    /* the still picture leaves only once a real frame has been drawn */
.film.live [data-land]{opacity:var(--in,0)}.film.live [data-land].live{opacity:1}
/* ---- plain sections after the film ---- */
.plain{padding:clamp(80px,14vh,170px) var(--pad);display:grid;gap:28px}
/* ---- demo window and walkthrough ---- */
.win{width:100%;min-height:min(440px,52svh);border-radius:16px;background:#fff;color:#1f242e;padding:20px;font-size:15px;box-shadow:0 40px 90px -40px #0009}.win button{min-height:44px;padding:0 16px;border:0;border-radius:10px;background:#1f242e;color:#fff;font:600 15px var(--sans)}
.tour-box{position:relative;display:grid;gap:12px;width:100%}.tour{display:grid;grid-template-columns:auto minmax(0,1fr);gap:4px 20px;align-items:center;padding:10px 18px 10px 10px;border-radius:20px;background:#1f242e;color:#f5f4f0}
.tour-go{grid-row:1/3;min-height:50px;padding:0 20px;border:0;border-radius:13px;background:var(--hot-lit);color:#1f242e;font:650 15px var(--sans);white-space:nowrap}
.tour-map{position:relative;list-style:none;padding:0;display:flex;justify-content:space-between}.tour-map::before,.tour-map::after{content:"";position:absolute;left:6px;right:6px;top:14px;height:2px;background:#ffffff30}.tour-map::after{background:var(--hot-lit);transform-origin:0 0;transform:scaleX(var(--p,0));transition:transform .8s var(--ease)}
.tour-map button{position:relative;z-index:1;display:grid;justify-items:center;gap:2px;min-height:44px;min-width:44px;padding:6px 2px 0;border:0;background:none;color:inherit;font:550 13px var(--sans)}.tour-map i{width:17px;height:17px;border-radius:50%;background:#1f242e;box-shadow:inset 0 0 0 2px #ffffff80}.tour-map :is(.done,.now) i{background:var(--hot-lit);box-shadow:none}
.tour-say{font-size:14.5px;line-height:1.4;min-height:2.8em}.tour-cur{position:absolute;left:0;top:0;z-index:5;width:28px;height:28px;opacity:0;pointer-events:none;transition:transform .85s cubic-bezier(.5,0,.15,1),opacity .3s}.tour-cur.show{opacity:1}.tour-cur i{position:absolute;inset:-8px;border-radius:50%;background:var(--hot-lit);opacity:0}.tour-cur.tap i{animation:tap .6s ease-out}@keyframes tap{from{opacity:.7;transform:scale(.2)}to{opacity:0;transform:scale(1.5)}}.tour-hit{outline:3px solid var(--hot-lit);outline-offset:3px}
@media(max-width:600px){.tour{grid-template-columns:1fr}.tour-go{grid-row:auto}.tour:not(.on):not(.seen) .tour-map{display:none}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}
