/* the sequence: one tall section, one sticky stage */
.sequence{position:relative;height:640vh;height:640svh}
.stage{position:sticky;top:0;height:100vh;height:100svh;overflow:hidden}
.world{position:absolute;inset:0;opacity:0;transition:opacity 1.1s ease}
.world.ready{opacity:1}
#globe{display:block;width:100%;height:100%}
.frame{position:absolute;inset:0;pointer-events:none}
.frame a{pointer-events:auto}
.still{display:none}
/* the globe's resting place. On desktop it is the box the live globe will fill; on phones it is the free space above the headline.
   The placeholder svg fills it now, and the live globe is positioned from it, so the swap does not move anything. */
.globe-slot{position:absolute;left:calc(77% - 51svh);top:-3%;height:102%;aspect-ratio:1;pointer-events:none}
.ph{display:block;width:100%;height:100%;opacity:1;transition:opacity 1.1s ease}
.ph.off{opacity:0}
/* stage 2: lake names and the Ann Arbor pin, placed by script from the live globe's projection */
.lk,.pin-aa{position:absolute;left:0;top:0;margin:0;opacity:0;pointer-events:none;will-change:transform}
/* text over the shoreline gets a cutout in the ground colour so it stays readable */
.lk,.pin-aa span{-webkit-text-stroke:5px var(--ground);paint-order:stroke fill}
.lk{font-size:clamp(12px,1.05vw,15px);color:var(--text2);white-space:nowrap}
.pin-aa{width:0;height:0}
.pin-aa i{position:absolute;left:-6px;top:-6px;width:12px;height:12px;border-radius:50%;background:var(--gold-hi);box-shadow:0 0 0 3px var(--shadow)}
.pin-aa i::after{content:"";position:absolute;inset:-9px;border-radius:50%;border:2px solid var(--gold-hi);animation:pulse2 2.4s ease-out infinite}
.pin-aa span{position:absolute;right:16px;top:0;transform:translateY(-50%);white-space:nowrap;font-weight:600;font-size:clamp(14px,1.3vw,18px);color:var(--text)}
@keyframes pulse2{0%{transform:scale(.5);opacity:.9}100%{transform:scale(1.8);opacity:0}}

/* text blocks, low and left */
.copy{position:absolute;left:var(--gx);right:var(--gx);bottom:clamp(26px,6.5vh,72px);max-width:46rem}
h1{margin:0 0 clamp(14px,2.4vh,26px);font-weight:400;font-size:clamp(2.6rem,5.6vw,6rem);line-height:.96;letter-spacing:-.045em;max-width:7.6em;text-wrap:balance}
.sub{margin:0 0 clamp(18px,3vh,30px);max-width:30em;font-size:clamp(1rem,1.25vw,1.2rem);color:var(--text2)}
.line{margin:0 0 .5em;font-weight:600;font-size:clamp(2rem,4.8vw,5rem);line-height:.98;letter-spacing:-.038em;max-width:11em;text-wrap:balance}
.aside{margin:0;max-width:32em;font-size:clamp(.95rem,1.15vw,1.1rem);color:var(--text2)}
.m{display:inline-block;overflow:hidden;vertical-align:top;padding-bottom:.1em;margin-bottom:-.1em}
.m>span{display:inline-block}
.f4 .w{display:block}

/* stage 3: the county */
.f3{display:grid;justify-items:end;align-items:center;padding:0 var(--gx)}
.map{margin:0;width:min(46vw,72vh);transform-origin:50% 50%}
.map svg{display:block;width:100%;height:auto;overflow:visible}
.map figcaption{margin-top:10px;font-size:13px;color:var(--text3);text-align:right}
#county .fillshape{fill:url(#dots)}
#county .base{fill:var(--map-base)}
#county .pat{fill:var(--map-dot)}
#county .outline{fill:none;stroke:var(--text);stroke-width:2.6;stroke-linejoin:round;stroke-dasharray:1;stroke-dashoffset:0}
#county .road{fill:none;stroke:var(--map-road);stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
#county .river{fill:none;stroke:var(--river);stroke-width:4;stroke-linecap:round;stroke-linejoin:round}
#county .town .dot{fill:var(--town-dim)}
#county .town .halo{fill:none;stroke:var(--gold-hi);stroke-width:2;transform-box:fill-box;transform-origin:center;opacity:0}
#county .town text{font:600 34px "Grotesk",system-ui,sans-serif;fill:var(--text);paint-order:stroke;stroke:var(--ground);stroke-width:7;stroke-linejoin:round;opacity:0}
#county .town.on .dot{fill:var(--gold-hi)}
#county .town.on .halo{animation:pulse 2.6s ease-out infinite}
@keyframes pulse{0%{transform:scale(.5);opacity:.9}100%{transform:scale(2.6);opacity:0}}

/* stage 4: the laptop screen */
.f4{display:grid;justify-items:end;align-items:center;padding:0 var(--gx)}
.laptop{width:min(60vw,980px);container-type:inline-size;transform-origin:50% 50%}
.bezel{position:relative;background:#0c0908;border-radius:1.3cqw 1.3cqw .5cqw .5cqw;padding:1.2cqw 1.2cqw 1.5cqw;box-shadow:0 0 0 1px #4a3b31 inset,0 3cqw 7cqw -1cqw rgba(0,0,0,.6)}
.bezel::before{content:"";position:absolute;top:.5cqw;left:50%;width:.55cqw;height:.55cqw;margin-left:-.28cqw;border-radius:50%;background:#2b231e}
.screen{aspect-ratio:16/10;background:var(--ui-paper);border-radius:.5cqw;overflow:hidden;position:relative}
.lip{position:relative;height:1.5cqw;width:112%;margin:0 -6%;border-radius:0 0 1.6cqw 1.6cqw;background:#bdb7ad;box-shadow:0 1px 0 #e8e3da inset,0 2cqw 4cqw -1cqw rgba(0,0,0,.55)}
.lip::after{content:"";position:absolute;left:50%;top:0;width:13%;height:.55cqw;margin-left:-6.5%;border-radius:0 0 .6cqw .6cqw;background:#8f8a82}
.ui{display:grid;grid-template-columns:13% 1fr 29%;height:100%;font:400 clamp(8px,1.42cqw,15px)/1.45 "UI",system-ui,sans-serif;color:var(--ui-ink)}
.ui-side{background:#ECEBE6;padding:1.6em 1em;border-right:1px solid var(--ui-line)}
.side-h{margin:0 0 1em;font-weight:600}
.ui-side ul{list-style:none;margin:0;padding:0}
.ui-side li{padding:.45em .7em;border-radius:.4em;color:var(--ui-mute)}
.ui-side li.on{background:#fff;color:var(--ui-ink);font-weight:600}
.ui-main{padding:1.3em 1.6em;overflow:hidden;position:relative}
.ui-bar{display:flex;justify-content:space-between;align-items:center;margin-bottom:1em;font-weight:600}
.send{background:var(--ui-accent);color:#fff;border-radius:.4em;padding:.35em 1.1em;font-weight:600}
.mail{background:#fff;border:1px solid var(--ui-line);border-radius:.6em;padding:.9em 1.1em;margin-bottom:.9em}
.fld{display:flex;gap:1em;padding:.3em 0;border-bottom:1px solid var(--ui-line)}
.fld span{flex:none;width:5.4em;color:var(--ui-mute)}
.fld b{font-weight:600}
.fld .when{color:var(--ui-mute);font-weight:400}
.bodytxt{padding-top:.7em;white-space:pre-wrap}
.ty .tt{color:inherit}
.ty .rest{visibility:hidden}
.caret{display:inline-block;width:.14em;height:1.05em;margin:0 -.14em 0 0;vertical-align:-.15em;background:var(--ui-accent);animation:blink 1s steps(2,start) infinite}
@keyframes blink{to{visibility:hidden}}
.ui-ai{background:#F0EFEA;border-left:1px solid var(--ui-line);padding:1.3em 1.1em;display:flex;flex-direction:column;gap:.8em}
.ai-h{margin:0;display:flex;align-items:center;gap:.5em;font-weight:600;color:var(--ui-accent)}
.ask{background:#fff;border:1px solid var(--ui-line);border-radius:.8em .8em .8em .2em;padding:.7em .85em}
.stat{margin:0;display:flex;align-items:center;gap:.55em;color:var(--ui-mute);opacity:0}
.stat i{width:.9em;height:.9em;border-radius:50%;background:var(--ui-accent);position:relative;flex:none}
.stat i::after{content:"";position:absolute;left:.27em;top:.14em;width:.22em;height:.42em;border:solid #fff;border-width:0 .12em .12em 0;transform:rotate(45deg)}
.a2,.s2{opacity:0}

/* desktop: the stage 4 text stays in the column left of the laptop so it never sits on the light screen */
@media (min-width:821px){
  .f4 .copy{max-width:max(16rem,calc(100vw - 2 * var(--gx) - min(60vw,980px) - 3rem))}
  .f4 .line{font-size:clamp(1.8rem,3.5vw,3.6rem)}
}

/* phones: shorter sequence, visual on top, text low */
@media (max-width:820px){
  .sequence{height:540vh;height:540svh}
  .copy{bottom:clamp(20px,4.5vh,40px)}
  /* phones: the globe sits in the free space above the headline, never behind it */
  .f1{display:flex;flex-direction:column}
  .f1 .globe-slot{position:relative;left:auto;top:auto;height:auto;aspect-ratio:auto;flex:1 1 0;min-height:0;margin:76px var(--gx) 6px;display:grid;place-items:center}
  .f1 .ph{width:auto;height:auto;max-width:100%;max-height:100%;aspect-ratio:1}
  .f1 .copy{position:static;max-width:none;margin:0;padding:0 var(--gx) clamp(20px,4.5vh,40px)}
  .lk{display:none}
  h1{font-size:clamp(2.3rem,11.6vw,3.6rem);max-width:9em}
  .line{font-size:clamp(1.9rem,9.6vw,3rem)}
  .f4 .line{font-size:clamp(1.7rem,8.2vw,2.6rem)}
  .map{width:min(88vw,46vh);justify-self:center}
  .f3{align-items:start;padding-top:clamp(92px,15vh,130px)}
  .f4{align-items:start;padding-top:76px}
  .f4{justify-items:center}
  .laptop{width:min(92vw,520px);margin-top:0}
  .bezel{padding:0;background:transparent;box-shadow:none;border-radius:0}
  .bezel::before,.lip{display:none}
  .screen{aspect-ratio:auto;border-radius:12px;box-shadow:0 20px 50px -12px rgba(0,0,0,.7)}
  .ui{grid-template-columns:1fr;font-size:12.5px;height:auto}
  .ui-side{display:none}
  .ui-ai{order:-1;border-left:0;border-bottom:1px solid var(--ui-line);padding:.8em 1em;gap:.5em}
  .ui-ai .ai-h,.ui-ai .stat,.ui-ai .a2{display:none}
  .ask{border-radius:.7em}
  .ui-main{padding:.9em 1em .4em}
  .mail{padding:.6em .8em;margin-bottom:.6em}
  .bodytxt{font-size:12px;line-height:1.4}
  .fld span{width:4.8em}
  .map figcaption{text-align:center}
  /* phones, last stage: the laptop window takes only the space above the headline, so the two can never overlap
     (the window used to be as tall as its text and the headline was pinned to the bottom, so on some screens they collided) */
  html.live .f4{display:flex;flex-direction:column;align-items:stretch;padding:76px 0 0}
  html.live .f4 .laptop{flex:1 1 0;min-height:0;width:min(92vw,520px);margin:0 auto 14px;display:flex;flex-direction:column}
  html.live .f4 .bezel{flex:1 1 auto;min-height:0;display:flex}
  html.live .f4 .screen{flex:1 1 auto;min-height:0;overflow:hidden;width:100%}
  html.live .f4 .copy{position:static;max-width:none;margin:0;padding:0 var(--gx) clamp(20px,4.5vh,40px)}
  html.live .m2{display:none}
}
/* short phones: tighten the email so it still fits above the headline */
@media (max-width:820px) and (max-height:740px){
  .ui{font-size:11px}
  .bodytxt{font-size:11px;line-height:1.35}
  .ui-main{padding:.6em .8em .2em}
  .ui-bar{margin-bottom:.5em}
  html.live .f4 .copy .aside{font-size:.9rem}
}

html.js:not(.live):not(.static) :is(.f3,.f4){visibility:hidden}
.mapbox{display:block}
/* static frames: reduced motion or no WebGL. Four stacked stills, nothing scrubbed. */
html:is(.static,:not(.js)) .sequence{height:auto}
html:is(.static,:not(.js)) .stage{position:static;height:auto;overflow:visible}
html:is(.static,:not(.js)) .world{display:none}
html:is(.static,:not(.js)) .frame{position:relative;inset:auto;pointer-events:auto;min-height:100svh;padding-top:96px;padding-bottom:56px;border-top:1px solid var(--line-soft);overflow:hidden}
html:is(.static,:not(.js)) .f1{border-top:0}
html:is(.static,:not(.js)) .f2{display:block}
html:is(.static,:not(.js)) .still{display:block;position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:.95}
html:is(.static,:not(.js)) .copy{position:relative;left:auto;right:auto;bottom:auto;margin:0;padding:0;max-width:46rem;top:auto}
html:is(.static,:not(.js)) .f1,html:is(.static,:not(.js)) .f2{display:flex;flex-direction:column;justify-content:flex-end}
html:is(.static,:not(.js)) .f1 .copy,html:is(.static,:not(.js)) .f2 .copy{position:relative;z-index:1;padding:0 var(--gx)}
html:is(.static,:not(.js)) .f3,html:is(.static,:not(.js)) .f4{display:flex;flex-direction:column;gap:32px;justify-content:center;align-items:flex-start;padding-inline:var(--gx)}
html:is(.static,:not(.js)) .map{width:min(520px,100%);margin:0}
html:is(.static,:not(.js)) .f4 .laptop{width:min(100%,980px)}
html:is(.static,:not(.js)) .lip{width:100%;margin:0}
html:is(.static,:not(.js)) .copy .m,html:is(.static,:not(.js)) .copy .m>span{display:inline;transform:none!important}
html:is(.static,:not(.js)) #county .town text,html:is(.static,:not(.js)) #county .town .halo{opacity:1}
html:is(.static,:not(.js)) #county .town .halo{animation:none;transform:scale(1.6);opacity:.5}
html:is(.static,:not(.js)) .stat,html:is(.static,:not(.js)) .a2,html:is(.static,:not(.js)) .s2{opacity:1}
html:is(.static,:not(.js)) :is(.lk,.pin-aa,.globe-slot){display:none}
html.bare .frame,html.bare .top,html.bare .end{display:none!important}
@media (prefers-reduced-motion:reduce){.caret{animation:none}.world,.ph{transition:none}.pin-aa i::after{animation:none}}
