/* Real State by MBCO - the landing at /. Tokens and faces come from /tokens.css and
   /vendor/fonts.css, shared with the map. One map of Switzerland stays on screen
   (the stage) while five sections pass it, one screen each; each section changes
   what the map shows. The request dialog is styled in /request.css.

   Type is set for reading: 20 px medium copy and 13 px labels in full ink (the
   operator found the first, lighter setting hard to read, 2026-11-17). */

*{ box-sizing:border-box; }
html{ scroll-snap-type:y proximity; }
@media (min-height:600px){ html{ scroll-snap-type:y mandatory; } }
body.landing{ position:relative; margin:0; background:var(--bg); color:var(--fg); font:500 18px/1.5 var(--font-body); letter-spacing:0;
  -webkit-font-smoothing:antialiased; }
a{ color:inherit; }
:focus-visible{ outline:2px solid transparent; box-shadow:var(--focus-ring); border-radius:6px; }
.skip{ position:absolute; left:-9999px; }
.skip:focus{ left:12px; top:12px; z-index:20; padding:8px 12px; background:var(--bg-card); }
.mono{ font:500 13px/1.4 var(--font-data); letter-spacing:.12em; text-transform:uppercase; }

/* the two actions: the map is the page's one accent, the request a quiet second */
.cta,.ghost{ display:inline-flex; align-items:center; gap:10px; height:48px; padding:0 24px; white-space:nowrap;
  border-radius:var(--radius-pill); font:600 15px/1 var(--font-body); text-decoration:none; cursor:pointer; }
.cta{ background:var(--accent); color:var(--on-accent); border:0;
  transition:background .3s var(--ease-out), translate .3s var(--ease-out); }
.cta:hover{ background:var(--accent-hover); translate:0 -2px; }
.cta svg{ transition:translate .3s var(--ease-out); } .cta:hover svg{ translate:4px 0; }
.ghost{ background:none; color:var(--fg); border:1px solid var(--border-strong); transition:background .3s var(--ease-out); }
.ghost:hover{ background:var(--bg-raised); }

/* the bar: the brand and the one action, always in reach */
.top{ position:fixed; z-index:5; top:0; left:0; right:0; display:flex; align-items:center; gap:12px; height:68px;
  padding:0 clamp(1.25rem, 3vw, 2.5rem); pointer-events:none; }
.top > *{ pointer-events:auto; }
.brand{ display:flex; align-items:center; gap:10px; text-decoration:none; white-space:nowrap; }
.brand b{ font:400 22px/1 var(--font-display); letter-spacing:var(--track-display); text-transform:uppercase; padding-top:2px; }
.brand span{ font:500 13px/1 var(--font-data); letter-spacing:var(--track-kicker); text-transform:uppercase; }
.mark-d{ display:none; }
:root[data-theme="dark"] .mark-l{ display:none; }
:root[data-theme="dark"] .mark-d{ display:block; }
.top .cta{ margin-left:auto; height:40px; padding:0 18px; font-size:13px; }
.rail{ position:fixed; z-index:5; right:14px; top:50%; translate:0 -50%; display:grid; gap:10px; }
.rail i{ display:block; width:10px; height:2px; margin-left:auto; background:var(--fg-muted);
  transition:width .38s var(--ease-out), background-color .38s var(--ease-out); }

/* the stage */
.stage{ position:fixed; z-index:1; inset:0 0 0 42%; display:grid; place-items:center; overflow:hidden;
  background:var(--bg-raised); transition:background-color .7s var(--ease-out); }
.stage svg{ width:min(92%, 62rem, (90svh - 14.8vw - 5.5rem) * 1.65); overflow:visible; }
/* the border's width is in map units: a dash measured on the path draws all of it */
.out{ fill:none; stroke:var(--fg); stroke-width:.75; stroke-linejoin:round; transition:stroke .7s var(--ease-out); }
.kt path{ fill:var(--bg); fill-opacity:0; stroke:var(--fg); stroke-opacity:0; stroke-width:.6; vector-effect:non-scaling-stroke;
  transition:fill-opacity .5s var(--ease-out), stroke-opacity .5s var(--ease-out), fill .5s var(--ease-out), stroke .5s var(--ease-out);
  transition-delay:calc(var(--i, 0) * 34ms); }
.dots circle{ fill:var(--fg); opacity:0; transition:opacity .5s var(--ease-out); transition-delay:calc(var(--d, 0) * 1ms); }
.read{ position:absolute; left:clamp(1.25rem, 4vw, 3.5rem); bottom:clamp(1.25rem, 5vh, 3rem); margin:0; max-width:none; color:var(--fg); }
.read b{ display:block; font:400 clamp(3.5rem, 9vw, 9rem)/.82 var(--font-display); letter-spacing:var(--track-hero);
  font-variant-numeric:tabular-nums; }
.read span{ display:block; margin-top:10px; }

/* what each section does to the map */
[data-step="1"] .dots circle{ opacity:.85; }
/* 02 to 04 leave the map to a quiet outline and draw their own figure over it */
.stage .out{ transition:stroke .7s var(--ease-out), stroke-opacity .7s var(--ease-out); }
[data-step="2"] .out,[data-step="3"] .out{ stroke-opacity:.5; } [data-step="4"] .out{ stroke-opacity:.16; }
/* 02: the cantons themselves, each a thin line once it has answered */
[data-step="2"] .kt path{ stroke-opacity:.4; }
/* 03: each canton tints by its transfer tax (as the sweep reaches it, below); the federal outline stays */
[data-step="3"] .kt path{ fill:var(--fg); fill-opacity:var(--v, 0); stroke-opacity:.16; transition-property:stroke-opacity; }
/* the hero's light round the border, only where motion is welcome (below) */
.lap{ fill:none; stroke:var(--accent); stroke-width:1.1; stroke-linecap:round; stroke-dasharray:.035 .965; opacity:0; }
[data-step="2"] .dots circle,[data-step="3"] .dots circle,[data-step="4"] .dots circle{ transition-delay:0s; }
[data-step="4"] .stage{ background:#10100e; color:#f4f3ee; }
[data-step="4"] .kt path{ transition:none; }   /* 03's cantons leave at once, never linger over the dark map */
[data-step="4"] .out{ stroke:#f4f3ee; }
[data-step="4"] .read{ color:#f4f3ee; }
/* a figure fades in on arrival and leaves at once, so a half-run motion is never seen frozen */
.fx{ opacity:0; }
[data-step="3"] .fx3,[data-step="4"] .fx4{ opacity:1; transition:opacity .5s var(--ease-out); }
.fx circle,.fx path{ fill:none; stroke:currentColor; }
.fx .pt{ fill:var(--accent); stroke:none; }
.fx circle,.fx line,.fx rect,.fx3 .bd{ transform-box:fill-box; transform-origin:center; }
/* 03: where the Second Homes Act applies, and the light that sweeps the country */
.fx3 .z{ fill:var(--accent); stroke:none; }
.fx3 .band{ stop-color:var(--accent); }
.fx3 .sweep{ opacity:0; }
.fx3 .sweep line{ stroke:var(--accent); stroke-width:.6; stroke-opacity:.7; vector-effect:non-scaling-stroke; }
.fx4 path{ stroke-width:.9; } .fx4 .tr{ stroke:currentColor; stroke-width:1.3; transform-origin:0 50%; }
.fx4 .ring{ stroke:var(--accent); stroke-width:.6; opacity:0; }
[data-step="0"] .rail i:nth-child(1),[data-step="1"] .rail i:nth-child(2),[data-step="2"] .rail i:nth-child(3),
[data-step="3"] .rail i:nth-child(4),[data-step="4"] .rail i:nth-child(5){ width:28px; background:var(--accent); }

/* the sections: a narrow column, three lines each */
.ch{ position:relative; z-index:2; width:42%; min-height:100svh; scroll-snap-align:start; overflow:clip;
  display:grid; align-content:center; padding:88px clamp(1.25rem, 3.4vw, 3.25rem) 48px; }
main:focus{ outline:none; }
.rule{ display:flex; gap:14px; margin:0 0 20px; padding-bottom:12px; border-bottom:1px solid var(--border-strong); }
.rule em{ font-style:normal; margin-left:auto; white-space:nowrap; }
.rule span{ white-space:nowrap; }
h1,h2{ margin:0 0 18px; font:400 clamp(2.75rem, 5vw, 4.75rem)/.95 var(--font-display); letter-spacing:var(--track-display);
  text-transform:uppercase; text-wrap:balance; }
h1{ font-size:clamp(3.25rem, 6.4vw, 6rem); line-height:.9; }
.ch p{ margin:0 0 24px; max-width:30rem; font-size:clamp(1.125rem, 1.4vw, 1.3rem); text-wrap:pretty; }
.ch p.note{ font-size:13px; }
.acts{ display:flex; flex-wrap:wrap; gap:12px; }
.src{ margin:0 0 24px; padding:0; list-style:none; }
.src li{ display:flex; gap:14px; align-items:baseline; padding:9px 0; border-bottom:1px solid var(--border-soft); }
.src b{ flex:none; width:6.2rem; font:400 1.8rem/1 var(--font-display); letter-spacing:var(--track-display); }
.src span{ font-size:16px; }
/* each section's own figure: read by crawlers, screen readers and a browser without
   script; with script the stage shows it large, so here it leaves the eye */
.ch p.fig{ margin:18px 0 0; font-size:13px; }
.js .ch p.fig{ position:absolute; width:1px; height:1px; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
/* the page's footer: it follows main in the markup and sits at the foot of the last section's column */
.foot{ position:absolute; z-index:3; left:clamp(1.25rem, 3.4vw, 3.25rem); right:calc(58% + clamp(1.25rem, 3.4vw, 3.25rem)); bottom:16px;
  display:flex; flex-wrap:wrap; align-items:center; gap:10px 18px; white-space:nowrap; }   /* whole items move to a second row, never off the page */
.foot a{ text-decoration:none; }
.foot a,.foot button{ padding:12px 4px; margin:-12px -4px; }
.foot button{ border:0; background:none; color:inherit; font:inherit; letter-spacing:inherit; text-transform:inherit; cursor:pointer; }
.foot a:hover,.foot button:hover{ color:var(--accent-tint); }
/* the footer's Pause: every figure stands in its finished frame, as for a reader who asked for less motion */
.still .stage *{ animation:none !important; } .still .stage .out{ stroke-dashoffset:0; }   /* outranks the border's draw-in */
.foot .build{ flex:1 1 0; min-width:0; text-align:right; overflow:hidden; text-overflow:ellipsis; color:var(--fg-muted); }   /* fills its row, never forces one */
#sources{ padding-bottom:80px; }   /* room for a two-row footer under the last section's button */

@media (max-width:860px){
  .stage{ inset:0 0 auto 0; z-index:3; height:44svh; padding-top:56px; place-items:start center; }
  .stage svg{ width:min(70%, 44svh * 1.05); } .out{ stroke-width:1.9; }
  .fx4 path{ stroke-width:1.6; } .fx4 .tr{ stroke-width:2.2; }
  .fx3 .z{ r:1.6px; } .lap{ stroke-width:2.4; } .kt path{ stroke-width:.75; }
  .read{ left:1rem; right:1rem; bottom:.75rem; } .read b{ font-size:clamp(2.75rem, 14vw, 4.5rem); } .read span{ margin-top:6px; }
  /* over the last section's dark map the brand turns light */
  [data-step="4"] .brand{ color:#f4f3ee; } [data-step="4"] .mark-l{ display:none; } [data-step="4"] .mark-d{ display:block; }
  .top{ height:56px; } .brand span,.rail{ display:none; }
  .ch{ width:100%; align-content:start; padding:calc(44svh + 14px) 1.25rem 44px; }
  h1{ font-size:clamp(2.5rem, 11vw, 3.5rem); }
  .ch p{ margin-bottom:18px; }
  .cta,.ghost{ height:44px; padding:0 17px; font-size:14px; } .acts{ gap:8px; }
  .src{ margin-bottom:10px; } .src li{ padding:3px 0; } .src b{ width:5rem; font-size:1.25rem; } .src span{ font-size:14px; }
  .mono{ font-size:12px; letter-spacing:.1em; }
  .foot{ right:clamp(1.25rem, 3.4vw, 3.25rem); gap:10px 12px; bottom:14px; } .foot .build{ display:none; }
}

/* motion: a section arrives once, its lines 120 ms apart; the border draws itself;
   the map's own changes are the transitions above. Nothing moves for a reader who
   asked for less motion, and nothing is hidden from a browser without script. */
@media (prefers-reduced-motion:no-preference){
  .js .ch > *{ opacity:0; translate:0 48px; transition:opacity .72s cubic-bezier(.16,1,.3,1), translate .72s cubic-bezier(.16,1,.3,1);
    transition-delay:calc(var(--i, 0) * 120ms + 60ms); }
  .js .ch > :nth-child(2){ --i:1; } .js .ch > :nth-child(3){ --i:2; } .js .ch > :nth-child(4){ --i:3; } .js .ch > :nth-child(5){ --i:4; }
  .js .ch.in > *{ opacity:1; translate:0 0; }
  .js .out{ stroke-dasharray:1; stroke-dashoffset:1; animation:draw 2.8s cubic-bezier(.45,0,.2,1) .2s forwards; }
  @keyframes draw{ to{ stroke-dashoffset:0; } }
  /* every figure opens once, then keeps a soft, slow loop while its section stays in view */
  /* the hero: once the border is drawn, a light runs round it */
  [data-step="0"] .lap{ opacity:.75; animation:fx-fade 1.2s ease 3s both, lap 18s linear 3.2s infinite; }   /* an animation, so a fresh load holds it hidden too */
  /* 01: once the buildings are in, a few at a time warm to the hero's red light and settle,
     each on its own long clock, so no two rounds look alike */
  [data-step="1"] .dots .g{ transform-box:fill-box; transform-origin:center;
    animation:dot-glow var(--gd) ease-in-out var(--gl) infinite; }
  /* 02: a soft glow walks through the cantons in federal order, ZH first, and comes round again */
  [data-step="2"] .kt path{ fill:var(--accent); transition-delay:0s;
    animation:kt-hum 10s ease-in-out calc(var(--t, 0) * 4.2ms) infinite; }
  /* 03: the light crosses once, west to east, and each point stands as it passes; then it
     keeps crossing, slowly, with a rest between */
  [data-step="3"] .kt path{ animation:fx-fade .6s ease-out calc(var(--x, 0) * 1ms) both; }   /* held clear until the light arrives */
  [data-step="3"] .fx3 .z{ animation:fx-pop .5s cubic-bezier(.34,1.56,.64,1) calc(var(--x, 0) * 1ms) both; }
  [data-step="3"] .fx3 .sweep{ animation:c3-open 2.4s linear .2s, c3-sweep 14s cubic-bezier(.45,0,.55,1) 3.2s infinite; }
  /* 04: the four run in, meet and flow into one line, and keep flowing at that pace; the point pings with them */
  [data-step="4"] .fx4 path{ animation:fx-wave .9s cubic-bezier(.16,1,.3,1) calc(var(--i, 0) * 90ms) both, fx-flow 1.2s linear 1.4s infinite; }
  [data-step="4"] .fx4 .tr{ animation:fx-rule .6s cubic-bezier(.65,0,.35,1) .7s both; }
  [data-step="4"] .fx4 .pt{ animation:fx-pop .5s cubic-bezier(.34,1.56,.64,1) 1.2s both; }
  [data-step="4"] .fx4 .ring{ animation:fx-ping 1.6s cubic-bezier(.16,1,.3,1) 1.4s infinite; }
  @keyframes lap{ to{ stroke-dashoffset:-1; } }
  @keyframes dot-glow{ 0%,100%{ opacity:.85; fill:var(--fg); scale:1; } 7%{ opacity:1; fill:var(--accent); scale:1.9; } 15%{ opacity:.85; fill:var(--fg); scale:1; } }
  /* across and out of the frame in 70 % of its time; the rest of the round the light is gone */
  @keyframes c3-open{ 0%{ opacity:1; translate:0 0; } 92%{ opacity:1; } 100%{ opacity:0; translate:396px 0; } }
  @keyframes c3-sweep{ 0%{ opacity:0; translate:0 0; } 6%{ opacity:1; } 64%{ opacity:1; } 70%,100%{ opacity:0; translate:396px 0; } }
  @keyframes kt-hum{ 6%{ fill-opacity:.32; } 20%,100%{ fill-opacity:0; } }
  @keyframes fx-breath{ 0%{ opacity:0; scale:1; } 12%{ opacity:.3; } 60%,100%{ opacity:0; scale:4; } }
  @keyframes fx-fade{ from{ opacity:0; } }
  @keyframes fx-pop{ from{ scale:0; } }
  @keyframes fx-down{ from{ scale:1 0; } }
  @keyframes fx-rule{ from{ scale:0 1; } }
  @keyframes fx-wave{ from{ opacity:0; translate:-24px 0; } }
  @keyframes fx-flow{ to{ stroke-dashoffset:var(--p); } }
  @keyframes fx-ping{ from{ opacity:.9; scale:1; } to{ opacity:0; scale:5; } }
}
@media (prefers-reduced-motion:reduce){
  html{ scroll-behavior:auto; }
  .kt path,.dots circle{ transition-delay:0s; }
}
@media print{
  .stage,.rail,.top,.skip,.acts{ display:none; }
  .ch{ width:auto; min-height:0; padding:24px 0; }
  .js .ch > *{ opacity:1; translate:none; transition:none; }
  .js .ch p.fig{ position:static; width:auto; height:auto; margin:18px 0 0; clip-path:none; white-space:normal; }
  .foot{ position:static; margin-top:24px; }
}
