/* GLN draft 15: "Walk through a GLN home" — a clay architectural model you walk through. */

/* Mona Sans: the latin subset Google Fonts serves, unmodified (SIL OFL, see CREDITS.md).
   One variable file carries both axes we use: width (headings are set expanded) and weight. */
@font-face {
  font-family: "Mona Sans";
  font-style: normal;
  font-weight: 200 900;
  font-stretch: 75% 125%;
  font-display: swap;
  src: url("fonts/mona-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Arial resized to Mona Sans' width and line box (measured in Chrome on Windows), so a late swap barely moves a line. */
@font-face { font-family: "GLN Sans Fallback"; src: local("Arial"), local("ArialMT"); size-adjust: 105%; ascent-override: 103.9%; descent-override: 30.5%; line-gap-override: 0%; }

:root {
  --clay: #E9E6E1;
  --floor: #CFC8BD;
  --ink: #15171A;
  --ink-2: #4B4E53;               /* 7.6:1 on white, 6.4:1 on clay */
  --graphite: #3A3D42;
  --white: #FBFAF8;
  --line: rgba(21, 23, 26, .14);
  --line-2: rgba(21, 23, 26, .28);
  --glass: rgba(251, 250, 248, .72);
  --glass-2: rgba(251, 250, 248, .88);
  --cool: #4F9CF2;  --cool-ink: #1C5CAB;
  --heat: #F28F3E;  --heat-ink: #9A4A0E;
  --accent: var(--cool);
  --accent-ink: var(--cool-ink);

  --sans: "Mona Sans", "GLN Sans Fallback", system-ui, sans-serif;
  /* 1px up to 1440 wide, growing to 1.5px at 2560: layout and display type scale with the screen */
  --u: clamp(1px, calc(1px + (100vw - 1440px) * 0.5 / 1120), 1.5px);
  --g: clamp(16px, 4vw, calc(var(--u) * 64));
  --r: calc(var(--u) * 18);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  color-scheme: light;
}
html { --scene-bg: #D8DEE2; }                     /* the 3D scene's background in each mode (sampled from the render) */
html[data-mode="heat"] { --accent: var(--heat); --accent-ink: var(--heat-ink); --scene-bg: #E8DDCF; }

*, *::before, *::after { box-sizing: border-box; }
html {
  /* running text: 16px up to 1440, about 21px at 2560 */
  font-size: clamp(16px, calc(16px + (100vw - 1440px) * 5 / 1120), 21px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  overflow-x: hidden;
  background: var(--clay);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 420;
  font-stretch: 100%;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-weight: 580; font-stretch: 114%; letter-spacing: -.018em; line-height: 1.04; margin: 0; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 12px; top: 12px; z-index: 50; padding: .7rem 1rem; background: var(--ink); color: #fff; border-radius: 8px; transform: translateY(-160%); transition: transform .2s; }
.skip:focus { transform: none; }
.num, .card-area, .temps dd, .result-n, [data-out] { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: 48px; padding: .75em 1.35em;
  background: var(--ink); color: #fff; border: 0; border-radius: 999px;
  font-weight: 560; font-stretch: 106%; font-size: 1rem; text-decoration: none; cursor: pointer;
  transition: background-color .3s var(--ease), transform .3s var(--ease);
}
.btn:hover { background: #2B2E33; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline-color: var(--accent-ink); }

/* ------------------------------------------------------------------ header: floating controls over the model */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; gap: calc(var(--u) * 14);
  padding: calc(var(--u) * 16) var(--g);
  pointer-events: none;
}
.bar > * { pointer-events: auto; }
.js .bar { animation: fade .6s .08s both; }
.wordmark {
  font-weight: 760; font-stretch: 125%; font-size: calc(var(--u) * 24); letter-spacing: .01em;
  text-decoration: none; line-height: 1; padding: .5rem .1rem; margin-right: auto;
  min-height: 44px; display: inline-flex; align-items: center;
}
/* scrolled: a glass pill appears behind the wordmark and the text moves .8rem right, as when padding grew from .1rem to .9rem,
   but with transform and opacity only */
.wordmark { position: relative; isolation: isolate; transition: transform .4s var(--ease); }
.wordmark::before { content: ""; position: absolute; z-index: -1; inset: 0 -.8rem; border-radius: 999px; background: var(--glass); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); opacity: 0; transition: opacity .4s var(--ease); }
.bar.is-scrolled .wordmark { transform: translateX(.8rem); }
.bar.is-scrolled .wordmark::before { opacity: 1; }
.bar-nav ul { list-style: none; display: flex; margin: 0; padding: 4px; gap: 2px; background: var(--glass); border-radius: 999px; backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); }
.bar-nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 1rem; border-radius: 999px; text-decoration: none; font-size: .9375rem; transition: background-color .25s; }
.bar-nav a:hover { background: rgba(255, 255, 255, .8); }
.mode {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; margin: 0; padding: 4px; border: 0; min-width: 0;
  background: var(--glass); border-radius: 999px; backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
}
html:not(.js) .mode { display: none; }   /* the switch needs JavaScript; without it the page shows the heating readings */
.mode label { position: relative; z-index: 1; cursor: pointer; }
.mode input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mode label span { display: inline-flex; align-items: center; justify-content: center; gap: .5em; width: 100%; min-height: 40px; padding: 0 1rem; border-radius: 999px; font-size: .9375rem; color: var(--ink-2); transition: color .4s; }
.mode input:checked + span { color: var(--ink); font-weight: 580; }
.mode input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 1px; }
.mode-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--cool); flex: none; }
.mode label + label .mode-dot { background: var(--heat); }
.mode-thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px; background: #fff; box-shadow: 0 1px 2px rgba(21, 23, 26, .12), 0 6px 16px -8px rgba(21, 23, 26, .3); transition: transform .6s var(--ease); }
html[data-mode="heat"] .mode-thumb { transform: translateX(100%); }
.btn-bar { min-height: 48px; font-size: .9375rem; padding: 0 1.2rem; }
@media (max-width: 1180px) { .bar-nav { display: none; } }
@media (max-width: 640px) {
  .btn-bar { display: none; }
  .bar { padding: 10px 12px; gap: 8px; }
  .mode label span { padding: 0 .8rem; font-size: .875rem; }
}

/* ------------------------------------------------------------------ intro */
.intro {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: grid; align-content: end;
  padding: calc(var(--u) * 120) var(--g) calc(var(--u) * 76);
  overflow: hidden;
}
.intro-still { position: absolute; inset: 0; z-index: 0; background: var(--scene-bg); }
.intro { background: var(--scene-bg); transition: background-color 1.4s var(--ease-io); }
.walk3d .intro { background: transparent; }
.walk3d body { background: var(--scene-bg); }
.intro-still img { width: 100%; height: 100%; object-fit: cover; }
.intro-copy { position: relative; z-index: 1; max-width: calc(var(--u) * 900); }
.intro h1 { font-size: clamp(2.75rem, min(7vw, 12.6vh), calc(var(--u) * 116)); font-weight: 600; font-stretch: 116%; letter-spacing: -.03em; line-height: .96; }
.intro h1 .line { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.intro h1 .line > span { display: inline-block; }
.intro-lede { margin-top: calc(var(--u) * 26); max-width: 30em; font-size: calc(var(--u) * 19); line-height: 1.5; color: var(--ink); }
.intro-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: calc(var(--u) * 30); }
.intro-hint { font-size: .9375rem; color: var(--ink-2); }
.intro-note { position: absolute; z-index: 1; right: var(--g); bottom: calc(var(--u) * 28); font-size: .8125rem; color: var(--ink-2); max-width: 22em; text-align: right; }
/* first screen: CSS keyframes, started by an inline class once the font is in (or 350 ms at most) */
.js .intro h1 .line > span { transform: translateY(104%); }
.js .intro-lede, .js .intro-actions, .js .intro-note { opacity: 0; }
.intro-go .intro h1 .line > span { animation: rise .95s var(--ease) forwards; }
.intro-go .intro h1 .line + .line > span { animation-delay: .09s; }
.intro-go .intro-lede { animation: fade-up .8s .3s var(--ease) forwards; }
.intro-go .intro-actions { animation: fade-up .8s .4s var(--ease) forwards; }
.intro-go .intro-note { animation: fade .8s .6s var(--ease) forwards; }
@keyframes rise { to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ the walk: stacked fallback (no JS, reduced motion, no WebGL) */
#scene { display: none; }
.stage { display: none; }
.walk { position: relative; padding: calc(var(--u) * 130) var(--g); }
.walk-head { max-width: calc(var(--u) * 860); margin: 0 auto calc(var(--u) * 80) 0; }
.walk-head h2 { font-size: clamp(2.1rem, 4.4vw, calc(var(--u) * 76)); margin-bottom: calc(var(--u) * 20); }
.walk-head p { font-size: calc(var(--u) * 19); color: var(--ink-2); max-width: 38em; }
.stops { list-style: none; margin: 0; padding: 0; display: grid; gap: calc(var(--u) * 110); }
.stop { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); column-gap: calc(var(--u) * 48); row-gap: calc(var(--u) * 20); align-items: center; }
.stop, .stop > * { min-width: 0; }
.stop > .stop-still { grid-column: 1; margin: 0; }
.stop > .card { grid-column: 2; grid-row: 1 / span 2; }
.stop-still img { width: 100%; height: auto; border-radius: calc(var(--u) * 14); background: var(--floor); }
.stop-still figcaption { margin-top: .6rem; font-size: .875rem; color: var(--ink-2); }
@media (max-width: 900px) {
  .stop { grid-template-columns: 1fr; }
  .stop > .card, .stop > .stop-still { grid-column: 1; grid-row: auto; }
  .walk { padding-block: 72px; }
  .stops { gap: 64px; }
}

/* the card: one per stop */
.card {
  position: relative;
  background: var(--glass-2);
  backdrop-filter: blur(22px) saturate(1.25); -webkit-backdrop-filter: blur(22px) saturate(1.25);
  border-radius: var(--r);
  padding: calc(var(--u) * 30) calc(var(--u) * 32) calc(var(--u) * 28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 28px 60px -34px rgba(52, 44, 34, .5);
}
.card h3 { font-size: clamp(1.75rem, calc(var(--u) * 36), 3.4rem); font-weight: 600; font-stretch: 118%; letter-spacing: -.024em; margin-bottom: calc(var(--u) * 12); }
.card-facts { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1.1rem; font-size: .9375rem; color: var(--ink-2); margin-bottom: calc(var(--u) * 16); }
.card-area { color: var(--ink); font-weight: 600; }
.card-panels { display: inline-flex; align-items: center; }
.pips { display: inline-flex; gap: 3px; margin-right: .55rem; }
.pips b { width: 5px; height: 15px; border-radius: 1.5px; background: var(--graphite); }
.pips-white b { background: #fff; box-shadow: inset 0 0 0 1px rgba(21, 23, 26, .4); }
.card-text { font-size: 1.0625rem; line-height: 1.55; max-width: 34em; }
.card-xray { margin-top: .8rem; font-size: 1rem; color: var(--ink-2); }
.card-cta { margin-top: calc(var(--u) * 22); }
.reading { margin-top: calc(var(--u) * 20); padding-top: calc(var(--u) * 16); border-top: 1px solid var(--line); }
.reading-when { font-size: .8125rem; color: var(--ink-2); margin-bottom: calc(var(--u) * 10); }
.temps { display: grid; grid-template-columns: 1fr 1.3fr 1.1fr; gap: 0 1rem; margin: 0; }
.temps dt { font-size: .8125rem; color: var(--ink-2); line-height: 1.3; }
.temps dd { margin: .2rem 0 0; font-size: clamp(1.35rem, calc(var(--u) * 27), 2.5rem); font-weight: 480; font-stretch: 108%; letter-spacing: -.01em; line-height: 1.1; white-space: nowrap; }
.temps .feel dd { color: var(--accent-ink); font-weight: 640; transition: color .8s var(--ease-io); }

/* ------------------------------------------------------------------ the walk in 3D */
.walk3d #scene { display: block; position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: 0; transition: opacity .8s var(--ease); }
.walk3d.scene-ready #scene { opacity: 1; }
.walk3d .intro-still { position: fixed; transition: opacity .8s .15s var(--ease), visibility 0s 1.2s, background-color 1.4s var(--ease-io); }
.walk3d.scene-ready .intro-still { opacity: 0; visibility: hidden; }
.walk3d .intro { z-index: 2; }
.walk3d .walk { z-index: 2; height: var(--walk-h, 960vh); padding: 0; }
.walk3d .walk-head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.walk3d .stop-still { display: none; }
.walk3d .card-xray { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.walk3d .stops { position: fixed; inset: 0; z-index: 3; pointer-events: none; display: block; }
.walk3d .stop { position: absolute; right: var(--g); top: 50%; width: min(calc(var(--u) * 440), 36vw); transform: translateY(-44%); display: block; }
.walk3d .stop .card { visibility: hidden; opacity: 0; pointer-events: auto; }
.walk3d .stage { display: block; position: fixed; inset: 0; z-index: 3; pointer-events: none; }
.walk3d.past-walk .stage { visibility: hidden; }
.walk3d .walk-nav { opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity .5s var(--ease), transform .6s var(--ease), visibility 0s .6s; }
.walk3d.in-walk .walk-nav { opacity: 1; visibility: visible; transform: none; transition: opacity .6s var(--ease), transform .7s var(--ease), visibility 0s; }

.walk-nav {
  position: absolute; left: var(--g); bottom: calc(var(--u) * 34);
  display: flex; align-items: flex-end; gap: calc(var(--u) * 16);
  padding: calc(var(--u) * 14) calc(var(--u) * 16) calc(var(--u) * 14) calc(var(--u) * 14);
  background: var(--glass); border-radius: calc(var(--u) * 16);
  backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2);
  pointer-events: auto;
}
.mini-plan { width: calc(var(--u) * 196); height: auto; aspect-ratio: 13 / 12.4; overflow: visible; }
.walk-nav ol { list-style: none; margin: 0; padding: 0; }
.walk-nav button {
  display: flex; align-items: center; gap: .55rem; width: 100%; min-height: 44px; padding: 0 .7rem 0 .45rem;
  background: none; border: 0; border-radius: 10px; cursor: pointer; font-size: .9375rem; color: var(--ink-2); text-align: left;
  transition: background-color .25s, color .25s;
}
.walk-nav button::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; flex: none; opacity: .55; transition: background-color .3s, border-color .3s, opacity .3s; }
.walk-nav button:hover { background: rgba(255, 255, 255, .7); color: var(--ink); }
.walk-nav button[aria-current] { color: var(--ink); font-weight: 600; }
.walk-nav button[aria-current]::before { background: var(--accent); border-color: var(--accent); opacity: 1; }
.mp-room { fill: rgba(255, 255, 255, .5); transition: fill .6s var(--ease); }
.mp-room.is-here { fill: color-mix(in srgb, var(--accent) 26%, #fff); }
.mp-balcony { fill: none; stroke: var(--ink); stroke-width: .05; stroke-dasharray: .22 .16; opacity: .45; }
.mp-wall { stroke: var(--ink); stroke-width: .1; stroke-linecap: square; }
.mp-ext { stroke-width: .2; }
.mp-win { stroke: var(--ink); stroke-width: .05; opacity: .45; }
.mp-panel { stroke: var(--accent); stroke-width: .24; stroke-linecap: round; transition: stroke .8s var(--ease-io); }
.mp-dot { fill: var(--ink); stroke: #fff; stroke-width: .12; }
.mp-you.is-above { opacity: 0; }
.mp-cone { fill: var(--ink); opacity: .16; transition: opacity .3s; }

.callouts { position: absolute; inset: 0; overflow: hidden; }
.callout { position: absolute; left: 0; top: 0; will-change: transform; }
.callout.is-off { display: none; }
.callout-dot { position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--ink), 0 0 0 7px color-mix(in srgb, var(--accent) 35%, transparent); }
.callout-line { position: absolute; left: 7px; top: -.5px; width: calc(var(--u) * 46); height: 1px; background: var(--ink); transform-origin: 0 50%; }
.callout-label { position: absolute; left: calc(7px + var(--u) * 52); top: 0; transform: translateY(-50%); white-space: nowrap; padding: .4rem .8rem; border-radius: 999px; background: var(--glass-2); font-size: .875rem; font-weight: 520; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.callout.is-left .callout-line { left: auto; right: 7px; transform-origin: 100% 50%; }
.callout.is-left .callout-label { left: auto; right: calc(7px + var(--u) * 52); }
.callout.is-left .callout-line, .callout.is-left .callout-label { position: absolute; }
.callout.is-left { width: 0; }
.callout-room .callout-label { left: 0; transform: translate(-50%, -50%); display: grid; text-align: center; padding: .45rem .9rem; border-radius: 12px; line-height: 1.25; }
.callout-room b { font-weight: 600; font-stretch: 110%; font-size: .9375rem; }
.callout-room .callout-label span { font-size: .8125rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.xray-cap {
  position: absolute; left: var(--g); top: calc(var(--u) * 96); margin: 0;
  max-width: min(calc(var(--u) * 520), 42vw); padding: .8rem 1.15rem; border-radius: 14px;
  background: var(--ink); color: #fff; font-size: .9375rem; line-height: 1.45;
  opacity: 0; visibility: hidden;
}
.xray-cap .xc-closed { display: none; }
.xray-cap[data-phase="closed"] .xc-open { display: none; }
.xray-cap[data-phase="closed"] .xc-closed { display: inline; }

@media (max-width: 767px), (max-aspect-ratio: 9/10) {
  .walk3d .stop { left: 12px; right: 12px; top: auto; bottom: 12px; width: auto; max-width: 600px; margin-inline: auto; transform: none; }
  .walk3d .card { padding: 18px 18px 16px; }
  .walk3d .card h3 { font-size: 1.6rem; margin-bottom: 6px; }
  .walk3d .card-facts { margin-bottom: 8px; font-size: .875rem; }
  .walk3d .card-text { font-size: 1rem; line-height: 1.5; }
  .walk3d .reading { margin-top: 12px; padding-top: 10px; }
  .walk3d .reading-when { margin-bottom: 4px; }
  .walk3d .temps dd { font-size: 1.3rem; }
  .walk-nav { left: auto; right: 12px; top: 66px; bottom: auto; padding: 8px; border-radius: 12px; }
  .walk-nav ol { display: none; }
  .mini-plan { width: 104px; }
  .xray-cap { display: none; }
  .callout-label { font-size: .8125rem; }
  .callout-room .callout-label { padding: .3rem .5rem; border-radius: 9px; }
  .callout-room b { font-size: .8125rem; }
  .callout-room .callout-label span { font-size: .75rem; }
}

/* ------------------------------------------------------------------ sections after the walk */
.unseen, .planner, .visit, .foot { position: relative; z-index: 5; background: var(--clay); }
.walk3d .unseen { border-radius: calc(var(--u) * 28) calc(var(--u) * 28) 0 0; box-shadow: 0 -30px 70px -40px rgba(40, 34, 26, .5); }
.wrap { width: min(100% - 2 * var(--g), calc(var(--u) * 1360)); margin-inline: auto; }
.unseen, .planner, .visit { padding-block: calc(var(--u) * 140); }
.planner { padding-top: calc(var(--u) * 40); }
.sec-head { margin-bottom: calc(var(--u) * 64); max-width: calc(var(--u) * 860); }
.sec-head h2 { font-size: clamp(2.1rem, 4.4vw, calc(var(--u) * 76)); margin-bottom: calc(var(--u) * 20); }
.sec-head p { font-size: calc(var(--u) * 19); color: var(--ink-2); max-width: 38em; }

.unseen-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: calc(var(--u) * 40); }
.unseen-list figure { margin: 0 0 calc(var(--u) * 24); }
.unseen-list img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: calc(var(--u) * 14); background: var(--floor); }
.unseen-list h3 { font-size: clamp(1.5rem, calc(var(--u) * 30), 2.8rem); margin-bottom: .5rem; }
.unseen-list p { font-size: 1.0625rem; max-width: 26em; color: var(--ink-2); }
.unseen-foot { margin-top: calc(var(--u) * 64); padding-top: calc(var(--u) * 24); border-top: 1px solid var(--line-2); font-size: calc(var(--u) * 19); max-width: 44em; }
@media (max-width: 900px) {
  .unseen-list { grid-template-columns: 1fr; gap: 48px; }
  .unseen-list li { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); grid-template-rows: auto 1fr; gap: 8px 16px; align-items: start; }
  .unseen-list figure { grid-row: 1 / span 2; margin: 0; }
}
@media (max-width: 520px) { .unseen-list li { grid-template-columns: 1fr; } .unseen-list figure { grid-row: auto; margin-bottom: 16px; } }

/* planner */
.planner-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 0 calc(var(--u) * 72); align-items: start; }
.planner-head { grid-column: 1 / -1; }
.room-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-2); }
.room-row { display: grid; grid-template-columns: minmax(0, 1fr) auto calc(var(--u) * 110) auto; align-items: center; gap: .5rem calc(var(--u) * 20); padding: calc(var(--u) * 12) 0; border-bottom: 1px solid var(--line); }
.room-name { font-size: 1.0625rem; font-weight: 520; }
input.room-name { min-height: 44px; border: 0; border-bottom: 1px dashed var(--line-2); background: transparent; padding: 0 .2rem; width: 100%; }
.area { display: inline-flex; align-items: center; background: #fff; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px; }
.area input { width: 4.6em; min-height: 44px; border: 0; background: transparent; text-align: right; font-variant-numeric: tabular-nums; font-size: 1.0625rem; -moz-appearance: textfield; appearance: textfield; }
.area input::-webkit-outer-spin-button, .area input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.area .unit { padding: 0 .6rem 0 .3rem; color: var(--ink-2); }
.step { width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; cursor: pointer; font-size: 1.2rem; line-height: 1; transition: background-color .2s; }
.step:hover { background: var(--clay); }
.count { text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rm { min-height: 44px; padding: 0 .4rem; border: 0; background: none; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: .9375rem; }
.rm:hover { color: var(--ink); }
.add-room { margin-top: calc(var(--u) * 20); min-height: 48px; padding: 0 1.2rem; border: 1px solid var(--ink); border-radius: 999px; background: transparent; cursor: pointer; font-weight: 540; }
.add-room:hover { background: #fff; }
.planner-result { position: sticky; top: calc(var(--u) * 96); background: var(--white); border-radius: var(--r); padding: calc(var(--u) * 34); box-shadow: 0 28px 60px -40px rgba(52, 44, 34, .45); }
.result-big { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .35em; }
.result-n { font-size: clamp(4rem, calc(var(--u) * 128), 12rem); font-weight: 620; font-stretch: 120%; letter-spacing: -.04em; line-height: .9; }
.result-unit { font-size: clamp(1.5rem, calc(var(--u) * 34), 3rem); font-weight: 580; font-stretch: 114%; }
.result-for { flex-basis: 100%; margin-top: .5rem; color: var(--ink-2); }
.glyphs { display: flex; flex-wrap: wrap; gap: 10px 14px; margin: calc(var(--u) * 24) 0; min-height: 26px; }
.glyph-group { display: inline-flex; gap: 3px; }
.glyphs i { width: 8px; height: 26px; border-radius: 2px; background: var(--graphite); transform-origin: 50% 100%; }
.result-kw { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 0 0 calc(var(--u) * 16); padding-top: calc(var(--u) * 16); border-top: 1px solid var(--line); }
.result-kw dt { font-size: .875rem; color: var(--ink-2); }
.result-kw dd { margin: .15rem 0 0; font-size: clamp(1.4rem, calc(var(--u) * 28), 2.6rem); font-stretch: 108%; }
.result-kw .is-mode dd { color: var(--accent-ink); font-weight: 620; }
.fine { font-size: .875rem; color: var(--ink-2); margin-bottom: calc(var(--u) * 22); }
@media (max-width: 900px) {
  .planner-grid { grid-template-columns: 1fr; }
  .planner-result { position: static; margin-top: 40px; }
  .unseen, .planner, .visit { padding-block: 72px; }
}
@media (max-width: 520px) {
  .room-row { grid-template-columns: minmax(0, 1fr) auto; }
  .room-row .area { grid-column: 1; }
  .room-row .count { grid-column: 2; grid-row: 1; }
  .room-row .rm { grid-column: 2; grid-row: 2; justify-self: end; }
}

/* visit */
.visit-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: calc(var(--u) * 40) calc(var(--u) * 80); align-items: start; }
.visit-copy h2 { font-size: clamp(2.1rem, 4.4vw, calc(var(--u) * 76)); margin-bottom: calc(var(--u) * 20); }
.visit-copy > p { font-size: calc(var(--u) * 19); color: var(--ink-2); max-width: 30em; }
.visit-facts { margin: calc(var(--u) * 36) 0 0; display: grid; gap: calc(var(--u) * 14); }
.visit-facts div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 1rem; padding-bottom: calc(var(--u) * 14); border-bottom: 1px solid var(--line); }
.visit-facts dt { color: var(--ink-2); }
.visit-facts dd { margin: 0; }
.visit-form { display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--u) * 20); background: var(--white); border-radius: var(--r); padding: calc(var(--u) * 34); }
.field { display: grid; gap: .4rem; align-content: start; }
.field-wide, .form-actions, .form-status { grid-column: 1 / -1; }
.field label { font-size: .9375rem; font-weight: 540; }
.opt { color: var(--ink-2); font-weight: 420; }
.field input, .field select, .field textarea { min-height: 48px; padding: .6rem .8rem; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; width: 100%; }
.field textarea { resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.field [aria-invalid="true"] { border-color: #A12B1F; }
.field-err { color: #A12B1F; font-size: .875rem; }
.form-status { font-size: .9375rem; color: var(--ink); }
.form-status:empty { display: none; }
@media (max-width: 900px) { .visit-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .visit-form { grid-template-columns: 1fr; padding: 20px; } }

/* footer */
.foot { padding: calc(var(--u) * 48) 0 calc(var(--u) * 56); border-top: 1px solid var(--line-2); font-size: .9375rem; color: var(--ink-2); }
.foot-grid { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.4fr); gap: 1rem calc(var(--u) * 48); align-items: baseline; }
.foot-mark { color: var(--ink); margin: 0; padding: 0; min-height: 0; font-size: calc(var(--u) * 22); }
@media (max-width: 900px) { .foot-grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

/* ------------------------------------------------------------------ language switch (EN / 中文) */
.lang {
  display: inline-flex; align-items: center; flex: none; padding: 0 4px; border-radius: 999px;
  background: var(--glass); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
}
.lang-b {
  position: relative; min-height: 44px; min-width: 44px; padding: 0 .45rem; border: 0; background: none; cursor: pointer;
  font-size: .875rem; font-weight: 520; color: var(--ink-2); transition: color .3s;
}
.lang-b-zh { font-family: "GLN Sans SC", "GLN Sans SC Fallback", "PingFang SC", "Microsoft YaHei", sans-serif; }
.lang-b::after { content: ""; position: absolute; left: .45rem; right: .45rem; bottom: 9px; height: 2px; border-radius: 1px; background: var(--ink); transform: scaleX(0); transition: transform .4s var(--ease); }
.lang-b:hover, .lang-b[aria-pressed="true"] { color: var(--ink); }
.lang-b[aria-pressed="true"]::after { transform: scaleX(1); }
.lang-b:focus-visible { outline: 2px solid var(--ink); outline-offset: -4px; border-radius: 999px; }
.lang-sep { color: var(--line-2); font-size: .8125rem; }
@media (max-width: 640px) {
  .lang { padding: 0 2px; }
  .lang-b { padding: 0 .3rem; font-size: .8125rem; }
}
@media (max-width: 400px) {
  .mode label span { padding: 0 .6rem; }
  .mode-dot { display: none; }
}

/* ------------------------------------------------------------------ Chinese */
:root { --zh: "GLN Sans SC", "GLN Sans SC Fallback", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Source Han Sans SC", sans-serif; }
html:lang(zh) { --sans: "Mona Sans", var(--zh); }
html:lang(zh) body { line-height: 1.8; letter-spacing: 0; line-break: strict; }
html:lang(zh) h1, html:lang(zh) h2, html:lang(zh) h3 { letter-spacing: 0; line-height: 1.3; font-weight: 700; text-wrap: balance; }
html:lang(zh) .intro h1 { font-size: clamp(2.25rem, min(5.2vw, 9.6vh), calc(var(--u) * 84)); line-height: 1.28; letter-spacing: 0; }
html:lang(zh) .intro h1 .line { padding-bottom: .12em; margin-bottom: -.12em; }
html:lang(zh) .walk-head h2, html:lang(zh) .sec-head h2, html:lang(zh) .visit-copy h2 { font-size: clamp(1.75rem, 3.4vw, calc(var(--u) * 58)); }
html:lang(zh) .card h3 { font-size: clamp(1.5rem, calc(var(--u) * 30), 2.8rem); letter-spacing: 0; }
html:lang(zh) .unseen-list h3 { font-size: clamp(1.3rem, calc(var(--u) * 26), 2.4rem); }
html:lang(zh) .result-unit { font-size: clamp(1.3rem, calc(var(--u) * 28), 2.5rem); font-weight: 700; }
html:lang(zh) .intro-lede, html:lang(zh) .walk-head p, html:lang(zh) .sec-head p, html:lang(zh) .visit-copy > p, html:lang(zh) .unseen-foot { line-height: 1.8; max-width: 32em; }
html:lang(zh) .card-text { line-height: 1.8; max-width: 30em; }
html:lang(zh) .unseen-list p { line-height: 1.8; max-width: 22em; }
html:lang(zh) .card-xray, html:lang(zh) .fine, html:lang(zh) .foot, html:lang(zh) .intro-note, html:lang(zh) .stop-still figcaption { line-height: 1.75; }
html:lang(zh) .callout-room .callout-label { line-height: 1.4; }
html:lang(zh) .temps dt, html:lang(zh) .reading-when { line-height: 1.5; }
html:lang(zh) .xray-cap { line-height: 1.7; }
@media (max-width: 767px), (max-aspect-ratio: 9/10) {
  html:lang(zh).walk3d .card h3 { font-size: 1.4rem; }
  html:lang(zh).walk3d .card-text { line-height: 1.7; }
}
