/* wilco.io home page (round 7, globe reworked for every window). Tokens, bar, footer, .wrap, .mark, .mark-big,
   .btn and .link come from site.css; this file only adds what the home page needs.

   Globe layouts (one rule set; home.js reads the same media queries through matchMedia):
     side   width >= 760 and height >= 520: words left, the globe right in a sticky box, vertically centred
            (>= 1000: 12 columns, words 1-7, globe box 340-600px; 760-999: globe box 240-320px)
     band   width < 760 and height >= 520: words full width, the globe in a short sticky band under the bar
     short  height < 520 (a phone on its side): the globe only in the first screen, never sticky
   Without JavaScript: no globe at all, the words are one clean column. */

.home{--fg:var(--ink);--fs:var(--ink-soft);--bh:var(--bar-h);
  --band:clamp(170px,28svh,250px);--cap:clamp(120px,34svh,360px);--cgap:48px}

/* ---------- the top half: words and globe ---------- */
/* the globe's canvas and its pointer circle can reach past the window's sides during the journey */
.home main{overflow-x:clip}
.hero{position:relative}
.txt{min-width:0;position:relative;z-index:2;padding-bottom:var(--s-160);container-type:inline-size}
/* the words lie over the globe's path: only the words take the pointer, so the globe can be dragged anywhere */
.txt{pointer-events:none}
.txt > *,.fin{pointer-events:auto}
.txt > .fold{pointer-events:none}

/* Reading focus: the paragraph being read is full ink, the others step back, but never below WCAG AA.
   Solid colours (no transparency) so the ratios are exact; ground is #F7F8FA. tools/check.py recomputes these
   three ratios from this file and fails if one drops below its minimum (DIM-CONTRAST below).
     --dim-large #848689  3.44:1 on ground   only the big paragraphs (.say) in the side layout, always 26px or more
     --dim-small #6C6F72  4.76:1 on ground   everything else that dims: trip rows, the Travel intro, the first screen
     --dim-mark  #616467  4.65:1 on the pale marker #F6E2AF (5.60:1 on ground)   words on a marker in a dimmed part
   DIM-CONTRAST: --dim-large 3.0 ground; --dim-small 4.5 ground; --dim-mark 4.5 #F6E2AF */
.home{--dim-large:#848689;--dim-small:#6C6F72;--dim-mark:#616467;--dim-marker:#F6E2AF}
.u{--fg:var(--ink);--fs:var(--ink-soft)}
.u.dim{--fg:var(--dim-small);--fs:var(--dim-small)}
@media (min-width:760px) and (min-height:520px){ .say.u.dim{--fg:var(--dim-large)} }

/* the first screen: the hello, then room at the bottom for the globe's crest (the "horizon") */
.fold{display:flex;flex-direction:column;min-height:calc(100svh - var(--bh) - var(--lm,0px));padding-bottom:calc(var(--cap) + var(--cgap))}
.fin{margin:auto 0;padding-top:var(--s-24)}
/* side layout, with script: the hello holds still under the bar while the scroll moves only the globe */
.fold.pin{display:flow-root;padding-bottom:0;height:var(--fw,1200px)}
.fold.pin > .fin{position:sticky;top:calc(var(--bh) + var(--fino,96px));margin:var(--fino,96px) 0 0;padding-top:0}

.hi{margin:0;font-weight:700;font-size:min(168px,23cqi,18.5svh);line-height:.95;letter-spacing:-.025em;white-space:nowrap;color:var(--fg);transition:color .3s ease}
.e{font-weight:400;letter-spacing:0;display:inline-block;transition:opacity .3s ease}
.hi .e{font-size:.46em;vertical-align:.66em;margin-left:.2em}
.say{margin:var(--s-64) 0 0;font-weight:500;font-size:clamp(21px,min(6.6cqi,7.5svh),44px);line-height:1.16;letter-spacing:-.015em;max-width:740px;color:var(--fg);transition:color .3s ease;text-wrap:pretty}
.say .e{font-size:.86em;vertical-align:-.02em}
.fin .lead{max-width:min(740px,22em);margin-top:min(32px,3.4svh);font-size:clamp(22px,min(6.6cqi,5svh),44px);text-wrap:balance}
.p1{margin-top:var(--gap,96px)}
.nw{white-space:nowrap}
/* emoji stay as they are in a dimmed part (a faded emoji is a faded picture: no contrast floor can apply) */

/* "Wilco" sweeps in once on load (site.css .sweep, CSS only, so it never flashes). Markers in the paragraphs wait
   for their turn (.pre from site.css, set by home.js only once real scrolling has started; .now skips the sweep);
   "twice" waits with .wait until its heading comes into view, then sweeps (.sweep). */
.mark.now{transition:none}
.mark-big.wait .mark-big-s{clip-path:inset(-10% 100% -10% 0)}
.mark{transition:background-size .6s var(--ease),background-position .6s var(--ease),opacity .3s ease}
.dim .mark{--marker:var(--dim-marker);color:var(--dim-mark)}
.dim .mark-big{color:var(--dim-mark)}
.dim .mark-big .mark-big-s{opacity:.34}
/* the menu words: in the top bar above 820px, here (under the bar) below it */
.links-m{display:none}
@media (max-width:820px){
  .home{--lm:48px}
  .links-m{display:flex;margin-left:-4px;min-height:48px;font-size:17px}
  .links-m a{white-space:nowrap}
}

/* ---------- travel ---------- */
.travel{margin-top:var(--s-128);scroll-margin-top:calc(var(--bh) + 48px)}
.h2{margin:0;font-weight:700;font-size:clamp(44px,9cqi,60px);line-height:1;letter-spacing:-.025em;color:var(--fg);transition:color .3s ease}
.intro{margin:var(--s-24) 0 0;font-size:20px;line-height:1.4;font-weight:500;color:var(--fs);max-width:680px;transition:color .3s ease}
.trips{list-style:none;margin:40px 0 0;padding:0;max-width:680px;border-top:1px solid var(--hairline)}
.trips li{border-bottom:1px solid var(--hairline)}
.trip{display:flex;align-items:baseline;justify-content:space-between;gap:var(--s-24);min-height:72px;padding:20px 0 18px;color:var(--fg);transition:color .3s ease;-webkit-tap-highlight-color:transparent;border-radius:6px}
[role="button"].trip{cursor:pointer}
.trip .pl{font-size:28px;line-height:1.15;font-weight:500;letter-spacing:-.015em}
.trip .yr{font-size:18px;font-weight:500;letter-spacing:0;color:var(--fs);margin-left:.4em;white-space:nowrap;transition:color .3s ease}
.trip .mo{flex:none;font-size:18px;font-weight:500;color:var(--fs);white-space:nowrap;transition:color .3s ease}
.trip .mark{background-size:0 58%,0 62%,0 64%;background-position:0 85.7%,calc(var(--ca) / 2) 89.5%,0 91.7%}
.trip.on .mark{background-size:var(--ca) 58%,calc(100% - var(--ca) / 2 - var(--cb) / 2) 62%,var(--cb) 64%;background-position:0 85.7%,calc(var(--ca) / 2) 89.5%,100% 91.7%}
.trip:hover .yr,.trip:hover .mo,.trip.on .yr,.trip.on .mo{color:var(--fg)}
.trip:focus-visible{outline-offset:2px}
/* a narrow words column (side layout on a small window, or a phone): the year goes under the place */
@container (max-width:520px){
  .trip{gap:var(--s-16);padding:16px 0 14px;min-height:64px}
  .trip .pl{font-size:22px}
  .trip .yr{display:block;margin:4px 0 0;font-size:16px}
  .trip .mo{font-size:16px}
  .intro{font-size:18px;margin-top:var(--s-16)}
  .trips{margin-top:var(--s-32)}
}

/* ---------- the globe ----------
   gstick: the sticky box (side: a window-tall column cell, band: the band, short: the first screen).
   gbox: where the globe ends up (home.js measures it). The canvas covers the window and never moves while the
   box is stuck (the globe is drawn where the scroll says). .g6 is an empty circle over the drawn globe that takes
   drag, keys and focus. The labels sit on top at their normal size. */
.gcol{position:relative;min-width:0}
.gpic{display:none}
.gstick{position:relative}
.gbox{pointer-events:none}
.g6c{position:absolute;left:var(--cl,0px);top:var(--ct,0px);width:var(--cw,100%);height:var(--ch,100%);display:block;pointer-events:none;z-index:0}
.g6{position:absolute;left:var(--hx,50%);top:var(--hy,50%);z-index:1;width:var(--hd,300px);height:var(--hd,300px);margin:calc(var(--hd,300px) / -2) 0 0 calc(var(--hd,300px) / -2);
  transform:translate(var(--jx,0px),var(--jy,0px)) scale(var(--js,1));outline:none;touch-action:pan-y;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;border-radius:50%;cursor:grab;pointer-events:auto}
.g6:active{cursor:grabbing}
.g6:focus-visible{box-shadow:0 0 0 calc(3px * var(--jk,1)) var(--ground),0 0 0 calc(6px * var(--jk,1)) var(--ink)}
.g6-label{z-index:2;position:absolute;left:0;top:0;transform:translate(var(--g6x,0px),var(--g6y,0px));opacity:var(--g6o,0);transition:opacity .25s ease;pointer-events:none;
  max-width:var(--labw,360px);font:500 17px/1.25 var(--font);letter-spacing:0;color:var(--ink);background:var(--white);border-radius:18px;padding:9px 16px;
  box-shadow:0 1px 2px rgba(16,20,24,.08),0 6px 20px rgba(16,20,24,.08)}
.g6-label:empty{display:none}

/* side: words left, the globe right */
@media (min-width:760px) and (min-height:520px){
  .hero{display:grid;grid-template-columns:minmax(0,1fr) clamp(240px,34vw,320px);column-gap:var(--s-32)}
  .txt{grid-column:1;grid-row:1}
  .gcol{grid-column:2;grid-row:1}
  .gstick{position:sticky;top:var(--bh);height:calc(100svh - var(--bh));display:grid;place-items:center}
  .gbox{width:min(100%,100svh - var(--bh) - 96px);aspect-ratio:1/1}
}
/* medium (upright tablets, 760-999px): the words take about 60% at 26-30px (28+ characters a line), the globe
   220-300px on the right */
@media (min-width:760px) and (max-width:999.98px) and (min-height:520px){
  .hero{grid-template-columns:minmax(0,1fr) clamp(220px,37%,300px);column-gap:var(--s-24)}
  .say{font-size:clamp(26px,7cqi,30px)}
  .fin .lead{font-size:clamp(26px,min(7cqi,5svh),30px)}
}
@media (min-width:1000px) and (min-height:520px){
  .hero{grid-template-columns:repeat(12,minmax(0,1fr))}
  .txt{grid-column:1 / span 7}
  .gcol{grid-column:8 / span 5}
  .gbox{width:clamp(340px,min(100%,100svh - var(--bh) - 96px),600px)}
}
/* band: the globe rides in a short band at the top, the words scroll under it */
@media (max-width:759.98px) and (min-height:520px){
  .hero{display:flex;flex-direction:column}
  .gcol{order:-1;position:sticky;top:var(--bh);z-index:3;height:var(--band);margin:0 calc(var(--side) * -1);pointer-events:var(--pe,none)}
  .gcol::before{content:'';position:absolute;inset:0;background:var(--ground);opacity:var(--bo,0)}
  .gcol::after{content:'';position:absolute;left:0;right:0;bottom:0;height:1px;background:var(--hairline);opacity:var(--bo,0)}
  /* one line only: the bar's hairline gives way while the band's own line shows under it (home.js sets --bbo) */
  .home .bar.scrolled::after{opacity:calc(1 - var(--bbo,0))}
  .gstick,.gbox{position:absolute;inset:0}
  .txt{margin-top:calc(var(--band) * -1)}
  .travel{scroll-margin-top:calc(var(--bh) + var(--band) + 24px)}
  .g6-label{font-size:16px;padding:8px 12px;border-radius:16px}
  .say{font-size:clamp(21px,6.6cqi,30px)}
  .fin .lead{font-size:clamp(21px,min(6.6cqi,5svh),30px)}
}
@media (max-width:759.98px) and (min-height:520px) and (scripting:none){ .txt{margin-top:0} }
/* short: the globe lives in the first screen only */
@media (max-height:519.98px){
  .gcol{position:absolute;left:0;right:0;top:0;height:var(--fh,100svh);z-index:0}
  .gstick,.gbox{position:absolute;inset:0}
  .txt{z-index:2}
}
/* without script: no journey; a still picture of the globe at home stands in its place (side: the sticky
   right column; band: a short picture under the travel list; short windows: none). The first screen is
   just the hello. */
@media (scripting:none){
  .fold{min-height:0;padding-bottom:0}
  .fin{margin:0;padding-top:var(--s-64)}
  .g6c,.g6,.g6-label{display:none}
  .gpic{display:block;width:100%;height:100%}
  .gpic img{display:block;width:100%;height:100%;object-fit:contain}
}
@media (scripting:none) and (max-width:759.98px) and (min-height:520px){
  .gcol{order:1;position:relative;top:auto;height:var(--band);margin:calc(var(--s-96) * -1) 0 0}
  .gstick,.gbox{position:static;height:100%}
  .fin{padding-top:var(--s-24)}
}
@media (scripting:none) and (max-height:519.98px){ .gcol{display:none} }

/* ---------- lower half, full width ---------- */
.door{padding-top:0;scroll-margin-top:calc(var(--bh) + 64px)}
.dh{margin:0;font-weight:700;font-size:clamp(52px,8.9vw,128px);line-height:.98;letter-spacing:-.025em;max-width:1312px}
.dl{margin:40px 0 0;font-weight:500;font-size:clamp(26px,3.06vw,44px);line-height:1.16;letter-spacing:-.015em;max-width:760px;text-wrap:pretty}
.more{display:inline-block;margin-top:40px;font-size:24px;font-weight:600}
.close{padding-top:var(--s-128)}
.cl{margin:0;font-weight:700;font-size:clamp(40px,6.1vw,88px);line-height:1.02;letter-spacing:-.03em;max-width:1100px;text-wrap:balance}
.cl .e{font-size:.7em;vertical-align:.06em;margin-left:.04em}
.close .btn{margin-top:var(--s-48)}

@media (max-width:360px){ .links-m{font-size:16px;gap:2px} }
@media (max-width:699.98px){
  .say{margin-top:40px;line-height:1.18}
  .fin .lead{margin-top:var(--s-24)}
  .travel{margin-top:var(--s-96)}
  .door{scroll-margin-top:calc(var(--bh) + 32px)}
  .dh{line-height:1}
  .dl{margin-top:var(--s-24);line-height:1.18}
  .more{font-size:20px;margin-top:var(--s-32)}
  .close .btn{margin-top:var(--s-32)}
}
@media (prefers-reduced-motion:reduce){
  .home *{transition:none !important;animation:none !important}
}
