/* Property Scanner — final landing (A hero + C map chapters) */
:root {
  --night: #0b100d;
  --moss: #131b17;
  --moss-2: #1b2621;
  --moss-3: #24312b;
  --line: rgba(var(--fg-rgb), 0.12);
  --bone: #efeade;
  --soft: #cdc8bb;
  --mute: #9aa39c;
  --dim: #69736d;
  --amber: #f4a903;
  --amber-2: #fcca54;
  --display: "Outfit", system-ui, sans-serif;
  --serif: "Newsreader", Georgia, serif;
  --gut: clamp(20px, 4vw, 64px);
  --max: 1680px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-io: cubic-bezier(0.77, 0, 0.175, 1);
  /* theme tokens: dark is the default; light redefines them below */
  color-scheme: dark;
  --bg-rgb: 11, 16, 13;
  --fg-rgb: 236, 231, 218;
  --moss-rgb: 19, 27, 23;
  --river-rgb: 130, 180, 168;
  --accent: #fcca54;
  --accent-lg: #f4a903;
  --field-bg: #efeade;
  --field-fg: #16140f;
  --door-bg: #070b09;
  /* canvas colours, read by main.js */
  --map-dot: 226, 190, 112;
  --map-dot-2: 226, 190, 112;
  --map-lit: 252, 202, 84;
  --map-river: 60, 120, 110;
  --map-river-hi: 120, 180, 168;
  --map-grid: 236, 231, 218;
  --map-blend: lighter;
  --st-line: 239, 234, 222;
  --st-face: #0c1310;
  --st-face-back: #0a100d;
  --st-sky-top: 11, 16, 13;
  --st-sky-low: 27, 40, 70;
  --st-ground: #080d0a;
  --st-tree: #0d1511;
  --st-glass: 0, 0, 0, 0;
}


*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0;
  background: var(--night);
  color: var(--bone);
  font: 400 18px/1.6 var(--serif);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--amber); color: var(--night); }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 200; background: var(--amber); color: var(--night); padding: 10px 16px; font: 500 15px/1 var(--display); border-radius: 999px; text-decoration: none; }
.skip:focus { left: 8px; }

.h2 {
  font: 500 clamp(2.4rem, 5vw, 5rem)/0.98 var(--display);
  letter-spacing: -0.035em;
  margin: 0 0 24px;
  text-wrap: balance;
}
.muted { color: var(--dim); }
.body { color: var(--soft); max-width: 34em; font-size: clamp(17px, 1.25vw, 20px); line-height: 1.55; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 56px; padding: 0 28px; border-radius: 999px; border: 0;
  font: 600 16px/1 var(--display); letter-spacing: -0.01em; text-decoration: none;
  cursor: pointer; transition: transform 160ms var(--ease), background-color 200ms ease, box-shadow 300ms ease;
}
.btn--amber { background: var(--amber); color: #15120a; }
.btn--light { background: var(--bone); color: var(--night); }
@media (hover: hover) and (pointer: fine) {
  .btn--amber:hover { background: var(--amber-2); box-shadow: 0 12px 40px -12px rgba(244,169,3,.7); }
  .btn--light:hover { opacity: .9; }
  }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .7; cursor: progress; }
.btn--sm { height: 42px; padding: 0 20px; font-size: 14px; }
.btn--block { width: 100%; }

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 100; background: var(--night);
  display: grid; place-items: center; overflow: hidden;
}
.loader__mark { width: min(380px, 62vw); clip-path: inset(0 100% 0 0); }
.loader__beam {
  position: absolute; top: 0; bottom: 0; left: 0; width: 2px;
  background: var(--amber); box-shadow: 0 0 24px 6px rgba(244,169,3,.55), 0 0 120px 30px rgba(244,169,3,.18);
  transform: translateX(-10px);
}
.reduced .loader { display: none; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; z-index: 50; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 32px;
  padding: 18px var(--gut);
  transition: background .4s, backdrop-filter .4s, padding .4s, border-color .4s;
  border-bottom: 1px solid transparent;
}
.nav.is-solid { background: rgba(var(--bg-rgb),.74); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); padding-block: 12px; border-bottom-color: var(--line); }
.nav__logo img { height: 34px; width: auto; }
.nav__links { display: flex; gap: 30px; margin-left: auto; }
.nav__links a { text-decoration: none; font: 400 15px/1 var(--display); color: var(--soft); transition: color .2s; }
.nav__links a:hover { color: var(--accent); }

/* ---------- Map layers (fixed, behind main) ---------- */
#map { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.map-labels, .homes { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.lbl {
  position: absolute; left: 0; top: 0;
  font: 400 12px/1 var(--display); letter-spacing: 0.01em;
  color: rgba(var(--fg-rgb), 0.6);
  text-shadow: 0 0 3px var(--night), 0 0 8px var(--night), 0 0 14px var(--night);
  white-space: nowrap; transition: color .5s, opacity .5s; will-change: transform;
}
.lbl.is-lit { color: var(--accent); }
.lbl--river { font: italic 400 15px/1 var(--serif); color: rgba(var(--river-rgb), 0.6); letter-spacing: 0.06em; }

main { position: relative; z-index: 2; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; background: var(--night); }
/* the hero's bottom edge is the scan line that reveals the map as you scroll */
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; z-index: 4;
  background: linear-gradient(90deg, transparent, var(--amber-2) 20%, var(--amber) 50%, var(--amber-2) 80%, transparent);
  box-shadow: 0 0 18px 2px rgba(244,169,3,.55), 0 0 90px 12px rgba(244,169,3,.18);
  opacity: var(--edge, 0);
}
.hero__media { position: absolute; inset: 0; }
.hero__img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; filter: saturate(.85) brightness(.72) contrast(1.06); transform: scale(1.08); }
/* fade-through-dark that hides the loop seam of the forward drone move */
.hero__fade { position: absolute; inset: 0; background: var(--night); opacity: 0; pointer-events: none; transition: opacity 380ms ease; }
.hero__fade.is-on { opacity: 1; }
/* two stacked veils (dark + paper) so a theme switch crossfades instead of jumping */
.hero__shade { position: absolute; inset: 0; }
.hero__shade::before, .hero__shade::after { content: ""; position: absolute; inset: 0; transition: opacity 450ms ease; }
.hero__shade::before {
  background:
    linear-gradient(90deg, rgba(11,16,13,.92) 0%, rgba(11,16,13,.7) 36%, rgba(11,16,13,.2) 68%, rgba(11,16,13,.5) 100%),
    linear-gradient(0deg, #0b100d 0%, rgba(11,16,13,0) 45%),
    linear-gradient(180deg, rgba(11,16,13,.55) 0%, rgba(11,16,13,0) 22%);
}
.hero__shade::after {
  opacity: 0;
  background:
    linear-gradient(90deg, #fbf8f2 0%, rgba(251,248,242,.97) 30%, rgba(251,248,242,.8) 43%, rgba(251,248,242,.18) 60%, rgba(251,248,242,0) 72%),
    linear-gradient(0deg, #fbf8f2 0%, rgba(251,248,242,.6) 12%, rgba(251,248,242,0) 30%);
}
/* warm morning grade over the video, light theme only */
.hero__media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 450ms ease;
  background: linear-gradient(200deg, rgba(255,196,110,.55) 0%, rgba(255,226,170,.25) 40%, rgba(150,190,225,.25) 100%);
  mix-blend-mode: soft-light;
}
[data-theme="light"] .hero__shade::before { opacity: 0; }
[data-theme="light"] .hero__shade::after, [data-theme="light"] .hero__media::after { opacity: 1; }
.hero__grid {
  position: absolute; inset: 0; opacity: .22;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(ellipse at 70% 45%, #000 0%, transparent 65%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 45%, #000 0%, transparent 65%);
}
.hero__beam {
  position: absolute; top: 0; bottom: 0; left: 0; width: 38vw;
  background: linear-gradient(90deg, transparent 0%, rgba(244,169,3,0) 60%, rgba(244,169,3,.16) 97%, rgba(252,202,84,.95) 99.6%, transparent 100%);
  mix-blend-mode: screen;
  animation: sweep 9s cubic-bezier(.45,0,.55,1) infinite;
}
@keyframes sweep { 0% { transform: translateX(-40vw); } 100% { transform: translateX(110vw); } }

.hero__inner {
  position: relative; z-index: 2; width: 100%; max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(32px, 5vw, 96px); align-items: end;
  padding: 130px var(--gut) clamp(64px, 10vh, 112px);
}
.hero__place { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 28px; font: 400 15px/1 var(--display); color: var(--soft); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); animation: ping 2s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(244,169,3,.7); } 70% { box-shadow: 0 0 0 10px rgba(244,169,3,0); } 100% { box-shadow: 0 0 0 0 rgba(244,169,3,0); } }
.hero__title { margin: 0 0 28px; font: 600 clamp(3.4rem, 8vw, 9.4rem)/0.9 var(--display); letter-spacing: -0.045em; }
.hero__title .hl { color: var(--accent-lg); }
/* SplitText line masks: a little room for descenders */
[data-split] .ln-mask, .hero__title .ln-mask { padding: 0 .1em .26em 0; margin: 0 -.1em -.26em 0; }
.hero__lede { max-width: 30em; margin: 0 0 36px; color: var(--soft); font-size: clamp(17px, 1.35vw, 21px); line-height: 1.5; }
.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; }
.claimed { min-width: 200px; }
.claimed p { margin: 10px 0 0; font: 400 14px/1.2 var(--display); color: var(--mute); }
.claimed strong { color: var(--bone); font-weight: 600; }
.claimed__bar { height: 4px; border-radius: 4px; background: rgba(var(--fg-rgb),.14); overflow: hidden; }
.claimed__bar span { display: block; height: 100%; width: calc(var(--p) * 100%); background: var(--amber); border-radius: 4px; transform-origin: left; }

.hero__scroll { position: absolute; z-index: 3; left: 50%; bottom: 22px; width: 22px; height: 36px; border: 1.5px solid rgba(var(--fg-rgb),.35); border-radius: 12px; transform: translateX(-50%); }
.hero__scroll span { position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--amber); animation: wheel 1.8s infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* Scanner demo */
.scanner {
  position: relative; padding: 28px;
  background: rgba(var(--moss-rgb),.62);
  backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid var(--line); border-radius: 22px;
  min-height: 470px;
  font-family: var(--display);
}
.bracket { position: absolute; width: 22px; height: 22px; border: 0 solid var(--amber); }
.bracket--tl { top: -8px; left: -8px; border-top-width: 2px; border-left-width: 2px; }
.bracket--tr { top: -8px; right: -8px; border-top-width: 2px; border-right-width: 2px; }
.bracket--bl { bottom: -8px; left: -8px; border-bottom-width: 2px; border-left-width: 2px; }
.bracket--br { bottom: -8px; right: -8px; border-bottom-width: 2px; border-right-width: 2px; }
.scanner__input {
  display: flex; align-items: center; gap: 14px;
  min-height: 64px; padding: 12px 20px 12px 14px;
  border-radius: 999px; background: var(--field-bg); color: var(--field-fg);
}
.scanner__input svg { flex: none; width: 38px; height: 38px; padding: 9px; border-radius: 50%; background: var(--amber); fill: #16140f; }
.scanner__typed { font: italic 400 18px/1.3 var(--serif); min-height: 1.3em; }
.caret { display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -2px; background: var(--field-fg); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.scanner__status { margin: 18px 4px 12px; font-size: 14px; color: var(--mute); display: flex; align-items: center; gap: 8px; }
.scanner__status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.chips { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; min-height: 36px; }
.chips li { padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(244,169,3,.45); color: var(--accent); font: 500 14px/1 var(--display); background: rgba(244,169,3,.08); }
.matches { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.match {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center;
  padding: 10px 14px 10px 10px; border-radius: 14px;
  background: rgba(var(--fg-rgb),.06); border: 1px solid var(--line);
}
.match:first-child { background: rgba(244,169,3,.1); border-color: rgba(244,169,3,.35); }
.match img { width: 64px; height: 52px; object-fit: cover; border-radius: 9px; }
.match__street { font: 600 15px/1.25 var(--display); }
.match__why { margin-top: 3px; font: 400 13.5px/1.35 var(--display); color: var(--soft); }
.match__score { font: 700 24px/1 var(--display); letter-spacing: -0.03em; color: var(--accent); }
.match__score small { font-size: 14px; }

/* ---------- Scan (pinned brief over the map) ---------- */
.scan { height: 520vh; position: relative; }
.scan__pin {
  position: sticky; top: 0; height: 100svh;
  display: flex; align-items: center;
  padding: 100px var(--gut) 48px;
}
.brief { width: min(460px, 34vw); position: relative; }
.brief::before {
  content: ""; position: absolute; inset: -56px -48px; z-index: -1;
  background: radial-gradient(closest-side, rgba(var(--bg-rgb),.94), rgba(var(--bg-rgb),.62) 70%, rgba(var(--bg-rgb),0));
  filter: blur(8px);
}
.brief__title { font: 500 clamp(1.9rem, 2.6vw, 2.7rem)/1.05 var(--display); letter-spacing: -0.03em; text-wrap: balance; }
.brief__lede { color: var(--mute); margin-top: 14px; font-size: 1.05rem; }
.brief__sentence { margin-top: 36px; font: italic 400 clamp(1.6rem, 2.3vw, 2.4rem)/1.22 var(--serif); letter-spacing: -0.01em; }
.brief__sentence .q { color: var(--bone); }
.clause {
  color: rgba(var(--fg-rgb), var(--clause-a, .16));
  background-image: linear-gradient(var(--amber), var(--amber));
  background-repeat: no-repeat; background-position: 0 92%; background-size: 0% 2px;
  transition: color .5s var(--ease), background-size .6s var(--ease);
}
/* each word fills with the text colour left to right, in step with the underline drawing */
.clause .w { transition: color 400ms var(--ease) calc(var(--i, 0) * 70ms); }
.clause.is-on { color: var(--bone); background-size: 100% 2px; }
.clause.is-past { color: var(--bone); background-size: 100% 1px; }
.brief__meter { margin-top: 40px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.brief__count { font: 300 clamp(3rem, 4.6vw, 4.8rem)/1 var(--display); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.brief__count-label { font: 400 15px/1.3 var(--display); color: var(--mute); }
.brief__done { margin-top: 20px; max-width: 36ch; color: var(--mute); font-size: 1rem; opacity: 0; transform: translateY(8px); transition: opacity .5s, transform .5s var(--ease); }
.brief__done.is-on { opacity: 1; transform: none; }

/* ---------- Home cards pinned to the map ---------- */
.home {
  position: absolute; left: 0; top: 0;
  display: grid; grid-template-columns: 112px minmax(0, 1fr);
  background: rgba(var(--moss-rgb),.95);
  border: 1px solid rgba(252,202,84,.3);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 30px 60px -24px rgba(0,0,0,.8);
  opacity: 0; visibility: hidden; pointer-events: none; will-change: transform, opacity;
}
.home:first-child { border-color: rgba(252,202,84,.6); }
.home__img { position: relative; }
.home__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.home__body { padding: 13px 15px 14px; }
.home__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.home__street { font: 500 15px/1.25 var(--display); }
.home__score { font: 600 14px/1 var(--display); color: #15120a; background: var(--amber); border-radius: 999px; padding: 6px 8px; white-space: nowrap; }
.home__why { margin-top: 6px; font: 400 14px/1.35 var(--display); color: var(--bone); }
.home__unsure { margin-top: 6px; font-size: 14px; line-height: 1.35; color: var(--mute); font-style: italic; }
.home--compact { grid-template-columns: 72px minmax(0, 1fr); border-radius: 12px; }
.home--compact .home__body { padding: 10px 12px; }
.home--compact .home__street { font-size: 14px; }
.home--compact .home__why { font-size: 13px; margin-top: 4px; }
.home--compact .home__unsure { display: none; }

/* ---------- Ways to live (pinned on desktop) ---------- */
.live { position: relative; height: 440vh; }
.live__pin {
  position: sticky; top: 0; height: 100svh; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(32px, 4vw, 80px);
  padding: 104px var(--gut) clamp(32px, 5vh, 56px);
  max-width: var(--max); margin: 0 auto;
}
.live::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to right, rgba(var(--bg-rgb),.95) 0%, rgba(var(--bg-rgb),.85) 34%, rgba(var(--bg-rgb),0) 52%);
}
.live__copy { display: flex; flex-direction: column; min-height: 0; }
.live__copy .h2 { font-weight: 400; font-size: clamp(2.2rem, 3.6vw, 4.2rem); max-width: 12ch; }
.live__copy .body { font-size: clamp(16px, 1.1vw, 18px); max-width: 30em; }
.live__list { list-style: none; margin: auto 0 0; padding: 0; display: grid; gap: 4px; counter-reset: w; }
.way { counter-increment: w; }
.way__btn {
  all: unset; box-sizing: border-box; cursor: pointer; width: 100%;
  display: grid; grid-template-columns: 3px 1fr; column-gap: 22px; row-gap: 6px;
  padding: 14px 0;
}
.way__bar { grid-row: 1 / span 2; position: relative; border-radius: 3px; background: rgba(var(--fg-rgb),.12); overflow: hidden; }
.way__bar i { position: absolute; inset: 0; background: var(--amber); transform-origin: top; transform: scaleY(var(--fill, 0)); border-radius: 3px; }
.way__name {
  font: 400 clamp(1.15rem, 1.6vw, 1.6rem)/1.15 var(--display); letter-spacing: -0.02em; color: var(--dim);
  transform-origin: left center; transition: color 300ms ease, transform 500ms var(--ease);
}
.way__name::before { content: counter(w) "  "; color: var(--dim); font-weight: 300; white-space: pre; }
.way__note { font-size: 15px; line-height: 1.4; color: var(--dim); opacity: .6; transition: opacity 300ms ease, color 300ms ease; }
.way.is-on .way__name { color: var(--bone); transform: scale(1.06); }
.way.is-on .way__name::before { color: var(--accent); }
.way.is-on .way__note { opacity: 1; color: var(--soft); }
.way__btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; border-radius: 6px; }
.way__img { display: none; }

.live__stage { position: relative; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 20px; }
/* the map fills the top of the stage and the photo sits beneath it, never over the dots */
.live__map { position: relative; grid-row: 1; min-height: 0; }
.stage { grid-row: 2; position: relative; z-index: 2; }
.stage { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px; }
.stage__frame {
  position: relative; order: 2; width: min(24vw, 420px); aspect-ratio: 16 / 10;
  border-radius: 18px; overflow: hidden; background: var(--moss);
  border: 1px solid var(--line); box-shadow: 0 40px 80px -30px rgba(0,0,0,.9);
}
.stage__img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1;
  clip-path: inset(100% 0 0 0); transform: scale(1.12);
  /* the outgoing photo stays fully visible under the incoming one, then resets */
  transition: clip-path 0s 900ms, transform 0s 900ms;
}
.stage__img.is-on {
  z-index: 2; clip-path: inset(0 0 0 0); transform: scale(1);
  transition: clip-path 900ms var(--ease-io), transform 1400ms var(--ease);
}
.stage__cap { order: 1; display: grid; gap: 6px; justify-items: end; text-align: right; padding-bottom: 6px; }
.stage__step { font: 400 15px/1 var(--display); color: var(--mute); font-variant-numeric: tabular-nums; }
.stage__area { font: 400 clamp(2rem, 3.6vw, 4rem)/0.95 var(--display); letter-spacing: -0.04em; color: var(--accent-lg); }

/* ---------- Overnight: night to morning ---------- */
.night { position: relative; background: var(--night); }
.night__pin { position: relative; min-height: 100svh; overflow: hidden; display: flex; align-items: center; }
.night__sky { position: absolute; inset: 0; }
.sky { position: absolute; inset: 0; }
.sky--night { background: radial-gradient(120% 90% at 70% 110%, #15261f 0%, #0c1612 45%, #060a08 100%); }
.sky--dawn { opacity: 0; background: radial-gradient(130% 100% at 70% 112%, #f7b54a 0%, #d98a3c 20%, #6a5a45 44%, #1f332b 72%, #0c1612 100%); }
.sky--day { opacity: 0; background: linear-gradient(180deg, #243a32 0%, #58705f 40%, #c9a86c 80%, #e2bd76 100%); }
/* keeps the copy readable as the sky brightens */
.night__sky::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(6,10,8,.72) 0%, rgba(6,10,8,.45) 42%, rgba(6,10,8,0) 62%); }
.stars {
  position: absolute; inset: 0 0 35% 0; opacity: .7;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 42%, #fff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 41% 12%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 57% 30%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 66% 8%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 79% 36%, #fff 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 90% 16%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 7% 54%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 48% 58%, #fff 50%, transparent 51%),
    radial-gradient(1.1px 1.1px at 86% 60%, #fff 50%, transparent 51%);
}
.sun {
  position: absolute; left: 68%; bottom: 20%; width: clamp(120px, 14vw, 220px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, #ffe2a0 0%, #fcca54 40%, rgba(244,169,3,0) 70%);
  transform: translate(-50%, 60%); opacity: 0; filter: blur(2px);
}
.skyline {
  position: absolute; left: 0; right: 0; bottom: 0; height: 34%;
  background: #050907;
  clip-path: polygon(0 62%, 4% 62%, 4% 48%, 7% 48%, 7% 58%, 11% 58%, 11% 40%, 12% 36%, 13% 40%, 13% 56%, 18% 56%, 18% 44%, 22% 44%, 22% 60%, 26% 60%, 26% 30%, 27.5% 22%, 29% 30%, 29% 58%, 34% 58%, 34% 50%, 38% 50%, 38% 64%, 44% 64%, 44% 34%, 45% 26%, 46% 18%, 47% 26%, 48% 34%, 48% 60%, 53% 60%, 53% 46%, 57% 46%, 57% 38%, 60% 38%, 60% 56%, 64% 56%, 64% 28%, 66% 20%, 68% 28%, 68% 54%, 72% 54%, 72% 42%, 76% 42%, 76% 60%, 80% 60%, 80% 36%, 83% 36%, 83% 50%, 88% 50%, 88% 44%, 92% 44%, 92% 58%, 96% 58%, 96% 50%, 100% 50%, 100% 100%, 0 100%);
}
.night__inner {
  position: relative; z-index: 2; width: 100%; max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(32px, 6vw, 110px); align-items: center;
  padding: 104px var(--gut) 72px;
}
.night__copy .h2 { font-size: clamp(2.2rem, 4.2vw, 4.4rem); }
.night__copy .body { text-shadow: 0 1px 12px rgba(6,10,8,.6); }
.clock { margin-bottom: 18px; font: 300 clamp(3rem, 6vw, 5.6rem)/1 var(--display); letter-spacing: -0.04em; color: var(--accent); font-variant-numeric: tabular-nums; }
.steps { list-style: none; counter-reset: s; margin: 36px 0 0; padding: 0; display: grid; gap: 16px; max-width: 34em; }
.steps li { counter-increment: s; position: relative; padding-left: 52px; color: var(--soft); font-size: 16.5px; line-height: 1.5; text-shadow: 0 1px 12px rgba(6,10,8,.6); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(244,169,3,.55); background: rgba(var(--bg-rgb),.5); color: var(--accent); display: grid; place-items: center; font: 600 14px/1 var(--display); }
.steps strong { color: var(--bone); font: 500 17px/1.3 var(--display); }
.phone {
  justify-self: center; width: min(330px, 80vw); aspect-ratio: 9 / 18.5; max-height: calc(100svh - 150px);
  padding: 12px; border-radius: 48px; background: #070b09; font-family: var(--display);
  box-shadow: 0 0 0 1.5px #2a3530, 0 50px 120px -30px rgba(0,0,0,.9), 0 0 80px -20px rgba(244,169,3,.25);
}
.phone__screen {
  position: relative; height: 100%; border-radius: 38px; overflow: hidden; padding: 64px 14px 20px;
  background: linear-gradient(180deg, rgba(19,31,26,.94), rgba(9,14,11,.98));
  display: flex; flex-direction: column; gap: 10px;
}
.phone__time { position: absolute; top: 20px; left: 0; right: 0; text-align: center; font: 600 15px/1 var(--display); font-variant-numeric: tabular-nums; color: var(--bone); }
.note { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; padding: 11px; border-radius: 18px; background: rgba(var(--fg-rgb),.09); }
.note img { width: 44px; height: 44px; object-fit: cover; border-radius: 10px; }
.note__title { font: 600 13px/1.25 var(--display); }
.note__text { margin-top: 2px; font: 400 12px/1.3 var(--display); color: var(--soft); }
.note--match { opacity: 0; transform: translateY(16px) scale(.97); }
.note--match:first-of-type { border: 1px solid rgba(244,169,3,.35); }
.phone__foot { margin-top: auto; text-align: center; font: 400 12px/1.2 var(--display); color: var(--mute); }

/* ---------- Ranked by fit ---------- */
.fit { position: relative; background: var(--night); border-top: 1px solid var(--line); }
.fit__pin {
  min-height: 100svh; display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: clamp(32px, 6vw, 110px); align-items: center; padding: 120px var(--gut);
  max-width: var(--max); margin: 0 auto;
}
.fit__legend { display: flex; align-items: center; gap: 10px; margin-top: 36px; font: 400 14px/1 var(--display); color: var(--mute); }
.swatch { width: 28px; height: 2px; background: var(--amber); }
.rank { position: relative; height: calc(4 * 112px + 3 * 14px); padding-left: 64px; font-family: var(--display); }
.rank__slots { list-style: none; margin: 0; padding: 0; position: absolute; left: 0; top: 0; width: 48px; display: grid; grid-auto-rows: 112px; row-gap: 14px; }
.rank__slots li { display: grid; place-items: center start; font: 300 clamp(36px, 3.4vw, 52px)/1 var(--display); color: rgba(var(--fg-rgb),.22); letter-spacing: -0.04em; }
.rank__slots li:first-child { color: var(--accent); }
.rank__card {
  position: absolute; left: 64px; right: 0; top: 0; height: 112px;
  display: grid; grid-template-columns: 124px 1fr auto; gap: 22px; align-items: center;
  padding: 12px 28px 12px 12px; border-radius: 18px;
  background: var(--moss); border: 1px solid var(--line);
  will-change: transform;
}
.rank__card img { width: 124px; height: 88px; object-fit: cover; border-radius: 12px; }
.rank__tag { margin-bottom: 6px; font: 500 13px/1 var(--display); color: var(--accent); }
.rank__street { font: 600 clamp(16px, 1.4vw, 20px)/1.2 var(--display); letter-spacing: -0.01em; }
.rank__why { margin-top: 4px; font: 400 14px/1.35 var(--display); color: var(--mute); }
.rank__score { font: 700 clamp(28px, 3vw, 44px)/1 var(--display); letter-spacing: -0.04em; }
.is-promo { background: var(--moss-3); border-color: rgba(var(--fg-rgb),.2); }
.is-promo .rank__tag { color: var(--soft); }
.fee { position: relative; display: inline-block; }
.fee::after { content: ""; position: absolute; left: -2px; right: -2px; top: 52%; height: 2px; background: var(--amber); transform: scaleX(var(--strike, 0)); transform-origin: left; }
.is-promo .rank__score { color: var(--mute); }

/* ---------- Founding ---------- */
.founding { position: relative; padding: clamp(96px, 14vh, 180px) var(--gut); background: var(--moss); border-radius: 40px 40px 0 0; }
.founding > * { max-width: calc(var(--max) - 2 * 64px); margin-inline: auto; }
.founding__top { display: grid; grid-template-columns: 1.3fr auto; gap: 40px; align-items: end; margin-bottom: 64px; }
.founding__count { text-align: right; font-family: var(--display); }
.founding__count strong { display: block; font: 600 clamp(5rem, 11vw, 10rem)/.85 var(--display); letter-spacing: -0.06em; color: var(--accent-lg); font-variant-numeric: tabular-nums; }
.founding__count span { color: var(--mute); font-size: 15px; }
.founding__body { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: clamp(32px, 6vw, 110px); align-items: start; margin-top: clamp(48px, 6vw, 88px); }

.doors { display: grid; grid-template-columns: repeat(20, 1fr); gap: clamp(6px, .8vw, 12px); padding-top: 34px; }
/* a door: frame (the opening), warm light behind, and a leaf hinged on the left */
.door {
  --f: 0;
  position: relative; aspect-ratio: 5 / 8; perspective: 260px;
  border-radius: 999px 999px 4px 4px;
  box-shadow: inset 0 0 0 1.5px rgba(var(--fg-rgb),.14);
  background: var(--door-bg);
}
.door__light {
  position: absolute; inset: 0; border-radius: inherit; opacity: calc(var(--f) * .9);
  background: radial-gradient(120% 90% at 30% 70%, #ffe3a3 0%, #fcca54 35%, rgba(244,169,3,.2) 75%);
}
.door__leaf {
  position: absolute; inset: 0; border-radius: inherit; transform-origin: left center;
  display: grid; place-items: end center; padding-bottom: 12%;
  border: 1.5px solid rgba(var(--fg-rgb),.2); background: var(--moss);
  font: 500 clamp(9px, .8vw, 12px)/1 var(--display); color: rgba(var(--fg-rgb),.35);
  /* as it fills it swings open a touch, then settles slightly ajar */
  transform: rotateY(calc(var(--f) * (1 - var(--f)) * -90deg - var(--f) * 7deg));
  transition: transform 240ms var(--ease), border-color 200ms ease;
  will-change: transform;
}
.door__leaf::before {
  content: ""; position: absolute; inset: -1.5px; border-radius: inherit; background: var(--amber);
  opacity: var(--f); transform: scaleY(calc(.4 + var(--f) * .6)); transform-origin: bottom;
}
.door__leaf i { position: absolute; top: 44%; right: 18%; width: 12%; aspect-ratio: 1; border-radius: 50%; background: currentColor; opacity: .7; }
.door__leaf b { position: relative; font-weight: 500; }
.door.is-taken .door__leaf { color: rgba(58, 44, 5, calc(.35 + var(--f) * .65)); }
@media (hover: hover) and (pointer: fine) {
  .door:not(.is-taken):not(.is-yours):hover .door__leaf { transform: rotateY(-26deg); border-color: rgba(252,202,84,.6); }
}
.door.is-next .door__leaf { border-color: var(--accent); color: var(--accent); animation: knock 1.8s var(--ease) infinite; }
.door.is-next { box-shadow: inset 0 0 0 1.5px rgba(244,169,3,.4), 0 0 26px -4px rgba(244,169,3,.55); }
@keyframes knock {
  0%, 60%, 100% { transform: rotateY(0) translateX(0); }
  66% { transform: rotateY(-8deg) translateX(-1px); }
  72% { transform: rotateY(0) translateX(0); }
  78% { transform: rotateY(-6deg) translateX(-1px); }
}
.door__yours {
  position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: 3;
  border: 0; border-radius: 999px; padding: 6px 10px; cursor: pointer; white-space: nowrap;
  background: var(--amber); color: #15120a; font: 600 12px/1 var(--display);
  opacity: 0; transform: translate(-50%, 6px) scale(.96); pointer-events: none;
  transition: opacity 200ms ease, transform 300ms var(--ease);
}
.door.is-next .door__yours { opacity: 1; transform: translate(-50%, 0) scale(1); pointer-events: auto; }
.door__yours:active { transform: translate(-50%, 0) scale(.97); }
.door.is-yours { box-shadow: inset 0 0 0 1.5px var(--bone), 0 18px 40px -8px rgba(252,202,84,.7); }
.door.is-yours .door__light { opacity: 1; background: radial-gradient(120% 100% at 30% 60%, #fff4d6 0%, #ffe3a3 30%, #fcca54 70%); }
.door.is-yours .door__leaf { transform: rotateY(-68deg); transition: transform 1100ms var(--ease-io); background: var(--bone); color: var(--night); animation: none; }
.door.is-yours .door__leaf::before { opacity: 0; }
.door.is-yours::after {
  content: ""; position: absolute; left: -30%; right: -30%; top: 100%; height: 70%; pointer-events: none;
  background: radial-gradient(60% 100% at 50% 0%, rgba(252,202,84,.55), rgba(252,202,84,0));
  animation: spill 900ms var(--ease) both;
}
@keyframes spill { from { opacity: 0; transform: scaleY(.3); transform-origin: top; } to { opacity: 1; transform: scaleY(1); transform-origin: top; } }

.signup { background: var(--night); border: 1px solid var(--line); border-radius: 28px; padding: clamp(22px, 3vw, 36px); font-family: var(--display); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 5px; border-radius: 999px; background: var(--moss-2); margin-bottom: 28px; }
.tab:active { transform: scale(.97); }
.tab { border: 0; background: transparent; min-height: 46px; border-radius: 999px; font: 500 14px/1.1 var(--display); color: var(--mute); cursor: pointer; transition: background-color 200ms ease, color 200ms ease, transform 160ms var(--ease); padding: 0 10px; }
.tab.is-on { background: var(--bone); color: var(--night); }
.form { display: grid; gap: 18px; }
.form__intro { color: var(--soft); font: 400 16px/1.5 var(--serif); }
.field { display: grid; gap: 8px; }
.field > span { font: 500 14px/1 var(--display); color: var(--soft); }
.field i { font-style: normal; color: var(--dim); font-weight: 400; }
.field input, .field textarea {
  width: 100%; border: 1px solid rgba(var(--fg-rgb),.16); background: var(--moss); border-radius: 14px;
  padding: 15px 16px; font: 400 16px/1.35 var(--display); resize: none; transition: border-color .2s, background .2s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--dim); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); background: var(--moss-2); }
.field.has-error input { border-color: #ff8a6b; }
.err { font: normal 400 13px/1.3 var(--display); color: #ffab94; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fine { font-size: 13px; color: var(--mute); text-align: center; }
.done { text-align: center; padding: 20px 0 8px; outline: none; }
.done__num { font: 600 clamp(3.6rem, 7vw, 5.6rem)/1 var(--display); letter-spacing: -0.05em; color: var(--accent-lg); }
.done h3 { font: 500 26px/1.2 var(--display); margin: 12px 0 8px; }
.done p { color: var(--soft); font-family: var(--serif); }

.perks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.perks li { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 24px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.perks h3 { font: 500 18px/1.25 var(--display); letter-spacing: -0.01em; }
.perks p { font-size: 16px; line-height: 1.5; color: var(--mute); }

/* ---------- FAQ ---------- */
.faq { position: relative; padding: clamp(96px, 14vh, 180px) var(--gut); background: var(--moss); display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 110px); }
.faq__list { border-top: 1px solid var(--line); }
details { border-bottom: 1px solid var(--line); }
summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 24px; align-items: center;
  padding: 26px 0; font: 400 clamp(18px, 1.6vw, 23px)/1.3 var(--display); letter-spacing: -0.01em;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: ""; flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background:
  linear-gradient(var(--amber), var(--amber)) center / 12px 1.5px no-repeat,
  linear-gradient(var(--amber), var(--amber)) center / 1.5px 12px no-repeat; transition: transform 250ms var(--ease), scale 160ms var(--ease); }
details[open] summary::after { transform: rotate(135deg); }
summary:active::after { scale: .92; }
details p { margin: 0 0 28px; max-width: 40em; color: var(--soft); }
.faq__more { color: var(--mute); font-size: 16px; }
.faq__more a { color: var(--accent); }

/* ---------- Footer ---------- */
.foot { position: relative; z-index: 2; background: var(--night); padding: clamp(80px, 12vh, 140px) var(--gut) 28px; overflow: hidden; font-family: var(--display); border-top: 1px solid var(--line); }
.foot > * { max-width: calc(var(--max) - 2 * 64px); margin-inline: auto; }
.foot__top { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 110px); align-items: start; }
.foot__say { display: grid; gap: 28px; }
.foot__line { font: 400 clamp(2.4rem, 4.4vw, 4.6rem)/0.98 var(--display); letter-spacing: -0.04em; max-width: 13ch; text-wrap: balance; }
.foot__brief { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 22px; border-radius: 999px; background: rgba(var(--fg-rgb),.06); border: 1px solid rgba(var(--fg-rgb),.14); max-width: 620px; transition: border-color 200ms ease, background 200ms ease; }
.foot__brief:focus-within { border-color: var(--accent); background: rgba(var(--fg-rgb),.09); }
.foot__brief input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--bone); font: italic 400 18px/1.3 var(--serif, "Newsreader", serif); }
.foot__brief input::placeholder { color: rgba(var(--fg-rgb),.42); }
.foot__brief .btn { flex: none; }
.foot__count { display: flex; align-items: center; gap: 12px; color: var(--soft); font-size: 15px; }
.foot__count b { color: var(--accent); font-weight: 600; }
.foot__bar { width: 120px; height: 3px; border-radius: 3px; background: rgba(var(--fg-rgb),.12); overflow: hidden; }
.foot__bar i { display: block; height: 100%; background: var(--amber); border-radius: inherit; }
.foot__cols { display: grid; grid-template-columns: auto auto minmax(0, 1fr); column-gap: clamp(28px, 3.5vw, 56px); gap: 32px; padding-top: 12px; }
.foot__cols h3 { font: 500 14px/1 var(--display); color: var(--mute); margin-bottom: 20px; }
.foot__cols a, .foot__cols p { display: block; width: fit-content; margin-bottom: 12px; color: var(--bone); text-decoration: none; font: 400 17px/1.3 var(--display); transition: color 200ms ease, transform 200ms ease; }
.foot__cols p { color: var(--soft); font-size: 15px; }
.foot__mail { white-space: nowrap; font-size: clamp(18px, 1.45vw, 24px) !important; color: var(--accent) !important; overflow-wrap: anywhere; letter-spacing: -0.01em; }
.foot__mail span { display: inline-block; transition: transform 250ms var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .foot__cols a:hover { color: var(--accent); }
  .foot__mail:hover span { transform: translateX(6px); }
}
/* The street finale: full-bleed terrace line art at the very bottom */
.street {
  position: relative; height: clamp(260px, 24vw, 420px);
  margin: clamp(56px, 7vw, 96px) calc(var(--gut) * -1) -28px; max-width: none;
}
.street__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.street__yours {
  position: absolute; left: 0; top: 0; z-index: 2;
  border: 0; border-radius: 999px; padding: 8px 14px; cursor: pointer; white-space: nowrap;
  background: var(--amber); color: #15120a; font: 600 13px/1 var(--display);
  box-shadow: 0 10px 30px -8px rgba(244,169,3,.7);
  opacity: 0; transform: translate(-50%, calc(-100% + 6px)) scale(.96);
  transition: opacity 250ms ease, transform 350ms var(--ease);
}
.street__yours.is-on { opacity: 1; transform: translate(-50%, -100%) scale(1); }
.street__yours::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: 10px; background: var(--amber); }
.street__yours:active { transform: translate(-50%, -100%) scale(.97); }
.street__yours.is-mine { background: var(--bone); }
.street__yours.is-mine::after { background: var(--bone); }
.foot__legal { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; border-top: 1px solid var(--line); padding-top: 22px; font-size: 14px; color: var(--mute); }
.foot__mark { height: 28px; width: auto; }
.foot__legal-links { display: flex; gap: 24px; }
.foot__legal a { color: var(--soft); text-decoration: none; }
.foot__legal a:hover { color: var(--bone); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 860px) {
  .foot__top { grid-template-columns: 1fr; }
  .foot__cols { grid-template-columns: 1fr 1fr; }
  .foot__contact { grid-column: 1 / -1; }
  .foot__brief { flex-direction: column; align-items: stretch; border-radius: 22px; padding: 14px; }
  .foot__brief input { padding: 6px 8px 10px; }
  .foot__legal { justify-content: flex-start; }
}


/* ---------- Light theme: a sunlit editorial page. Paper + warm stone, white cards, ink type ---------- */
:root[data-theme="light"] {
  color-scheme: light;
  --night: #fbf8f2;          /* paper */
  --moss: #f1ebdf;           /* warm stone */
  --moss-2: #e9e1d2;
  --moss-3: #e4dac8;
  --line: rgba(23, 32, 27, 0.12);
  --bone: #151d18;
  --soft: #3a433e;
  --mute: #535c56;
  --dim: #646c66;
  --amber-2: #e29c00;
  --bg-rgb: 251, 248, 242;
  --fg-rgb: 21, 29, 24;
  --moss-rgb: 241, 235, 223;
  --river-rgb: 44, 92, 132;
  --accent: #8a5c00;         /* AA on paper and stone for small text */
  --accent-lg: #b07400;      /* display sizes */
  --field-bg: #f5f0e7;
  --field-fg: #151d18;
  --door-bg: #ddd2bd;
  --card: #ffffff;
  --shadow-1: 0 1px 2px rgba(58, 42, 12, .06), 0 6px 18px -10px rgba(58, 42, 12, .16);
  --shadow-2: 0 1px 2px rgba(58, 42, 12, .05), 0 12px 28px -14px rgba(58, 42, 12, .2), 0 40px 80px -40px rgba(58, 42, 12, .28);
  --map-dot: 150, 96, 18;
  --map-dot-2: 44, 52, 46;
  --map-lit: 226, 146, 0;
  --map-river: 186, 214, 234;
  --map-river-hi: 70, 122, 168;
  --map-grid: 21, 29, 24;
  --map-blend: multiply;
  --st-line: 38, 44, 40;
  --st-face: #f4eee3;
  --st-face-back: #dfe5e8;
  --st-sky-top: 251, 248, 242;
  --st-sky-low: 196, 220, 238;
  --st-ground: #e6dfd1;
  --st-tree: #a9b894;
  --st-glass: 150, 184, 204, 1;
}
/* view transition: the new theme is revealed as a circle from the toggle (JS drives the clip) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 2; }
/* fallback when view transitions are missing: a plain crossfade of colours */
.theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after {
  transition: background-color 450ms ease, color 450ms ease, border-color 450ms ease, fill 450ms ease, box-shadow 450ms ease, opacity 450ms ease, filter 450ms ease !important;
}

/* nav: a frosted paper bar so links always read over the bright video */
[data-theme="light"] .nav { background: rgba(251,248,242,.62); backdrop-filter: blur(16px) saturate(1.5); -webkit-backdrop-filter: blur(16px) saturate(1.5); border-bottom-color: rgba(21,29,24,.07); }
[data-theme="light"] .nav.is-solid { background: rgba(251,248,242,.84); border-bottom-color: rgba(21,29,24,.1); }
[data-theme="light"] .nav__links a { color: #2c3530; }
[data-theme="light"] .nav__links a:hover { color: var(--accent); }
[data-theme="light"] .theme-toggle { background: #fff; border-color: rgba(21,29,24,.1); box-shadow: var(--shadow-1); }

/* hero: paper on the left, the street kept vivid on the right under a warm morning grade */
[data-theme="light"] .hero { background: var(--night); }
[data-theme="light"] .hero__img { filter: saturate(1.12) brightness(1.1) contrast(1.06); }
[data-theme="light"] .hero__grid { opacity: .5; }
[data-theme="light"] .hero__beam { mix-blend-mode: multiply; opacity: .35; }
[data-theme="light"] .hero__scroll { border-color: rgba(21,29,24,.3); }
[data-theme="light"] .scanner {
  background: rgba(255,255,255,.94); border-color: rgba(21,29,24,.07);
  box-shadow: 0 1px 2px rgba(58,42,12,.06), 0 24px 48px -24px rgba(58,42,12,.3), 0 60px 120px -50px rgba(40,50,70,.35);
}
[data-theme="light"] .scanner__input { background: var(--field-bg); box-shadow: inset 0 0 0 1px rgba(21,29,24,.06); }
[data-theme="light"] .chips li { background: #fdf3dc; border-color: rgba(176,116,0,.32); color: #7a5200; }
[data-theme="light"] .match { background: #faf7f1; border-color: rgba(21,29,24,.07); }
[data-theme="light"] .match:first-child { background: #fff6e0; border-color: rgba(176,116,0,.3); }
[data-theme="light"] .match__score { color: var(--accent); }

/* map chapters */
[data-theme="light"] .lbl { color: rgba(21,29,24,.74); font-weight: 500; text-shadow: 0 0 2px #fbf8f2, 0 0 5px #fbf8f2, 0 0 10px #fbf8f2, 0 0 16px #fbf8f2; }
[data-theme="light"] .lbl.is-lit { color: #7a5200; }
[data-theme="light"] .lbl--river { color: rgba(44,92,132,.82); font-weight: 400; }
[data-theme="light"] .clause { --clause-a: .24; }
[data-theme="light"] .home { background: #fff; border-color: rgba(21,29,24,.08); box-shadow: var(--shadow-2); }
[data-theme="light"] .home:first-child { border-color: rgba(176,116,0,.42); }
[data-theme="light"] .home__score { background: var(--amber); }
[data-theme="light"] .stage__frame { background: var(--moss); border-color: rgba(21,29,24,.06); box-shadow: var(--shadow-2); }
[data-theme="light"] .way__bar { background: rgba(21,29,24,.1); }

/* ranked by fit: warm stone band, white cards */
[data-theme="light"] .fit { background: var(--moss); border-top-color: transparent; }
[data-theme="light"] .rank__card { background: var(--card); border-color: rgba(21,29,24,.07); box-shadow: var(--shadow-1); }
[data-theme="light"] .rank__card.is-promo { background: #e9e2d4; border-color: rgba(21,29,24,.1); box-shadow: none; }
[data-theme="light"] .rank__slots li { color: rgba(21,29,24,.2); }
[data-theme="light"] .rank__tag { color: var(--accent); }

/* founding: paper sheet lifting off the stone band */
[data-theme="light"] .founding { background: var(--night); box-shadow: 0 -1px 0 rgba(21,29,24,.06), 0 -18px 40px -30px rgba(58,42,12,.14); }
[data-theme="light"] .signup { background: var(--card); border-color: rgba(21,29,24,.07); box-shadow: var(--shadow-2); }
[data-theme="light"] .tabs { background: var(--moss); }
[data-theme="light"] .tab:not(.is-on):hover { color: var(--bone); }
[data-theme="light"] .field input, [data-theme="light"] .field textarea { background: var(--field-bg); border-color: rgba(21,29,24,.13); }
@media (hover: hover) and (pointer: fine) {
  [data-theme="light"] .field input:hover, [data-theme="light"] .field textarea:hover { border-color: rgba(21,29,24,.26); }
}
[data-theme="light"] .field input:focus, [data-theme="light"] .field textarea:focus { background: #fff; border-color: var(--accent-lg); box-shadow: 0 0 0 4px rgba(244,169,3,.18); }
[data-theme="light"] .field input:not(:placeholder-shown), [data-theme="light"] .field textarea:not(:placeholder-shown) { background: #fff; }
[data-theme="light"] .field.has-error input { border-color: #c2410c; box-shadow: 0 0 0 4px rgba(194,65,12,.1); }
[data-theme="light"] .err { color: #a3340f; }
[data-theme="light"] :focus-visible { outline-color: #b07400; }
[data-theme="light"] .perks { border-top-color: rgba(21,29,24,.12); }
/* doors: white leaves in stone openings; claimed ones glow amber */
[data-theme="light"] .door { box-shadow: inset 0 0 0 1.5px rgba(21,29,24,.1); }
[data-theme="light"] .door__leaf { background: #fff; border-color: rgba(21,29,24,.2); color: rgba(21,29,24,.5); box-shadow: 0 2px 6px -3px rgba(58,42,12,.25); }
[data-theme="light"] .door.is-taken .door__leaf { color: rgba(58, 40, 0, calc(.4 + var(--f) * .6)); }
[data-theme="light"] .door.is-next .door__leaf { border-color: var(--accent-lg); color: var(--accent); }
[data-theme="light"] .door.is-next { box-shadow: inset 0 0 0 1.5px rgba(176,116,0,.4), 0 0 26px -6px rgba(244,169,3,.6); }
@media (hover: hover) and (pointer: fine) {
  [data-theme="light"] .door:not(.is-taken):not(.is-yours):hover .door__leaf { border-color: var(--accent-lg); }
}
[data-theme="light"] .door.is-yours { box-shadow: inset 0 0 0 1.5px var(--accent-lg), 0 18px 40px -8px rgba(244,169,3,.6); }
[data-theme="light"] .door.is-yours .door__leaf { background: #fff; color: var(--bone); }

/* FAQ back on stone, footer on paper */
[data-theme="light"] .faq { background: var(--moss); }
[data-theme="light"] summary::after { background-color: #fff; border-color: rgba(21,29,24,.1); }
[data-theme="light"] .foot { border-top-color: transparent; }
[data-theme="light"] .foot__brief { background: #fff; border-color: rgba(21,29,24,.1); box-shadow: var(--shadow-1); }
[data-theme="light"] .foot__brief:focus-within { background: #fff; border-color: var(--accent-lg); box-shadow: 0 0 0 4px rgba(244,169,3,.16); }
[data-theme="light"] .foot__brief input::placeholder { color: rgba(21,29,24,.5); }
[data-theme="light"] .street__yours.is-mine { background: var(--bone); color: var(--night); }
@media (max-width: 960px) {
  [data-theme="light"] .way { background: var(--card); border-color: rgba(21,29,24,.07); box-shadow: var(--shadow-1); }
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
  flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line); background: rgba(var(--fg-rgb), .04); color: var(--bone);
  transition: transform 160ms var(--ease), background-color 200ms ease;
}
.theme-toggle:active { transform: scale(.94); }
@media (hover: hover) and (pointer: fine) { .theme-toggle:hover { background: rgba(var(--fg-rgb), .1); } }
.theme-toggle svg { grid-area: 1 / 1; width: 20px; height: 20px; transition: transform 400ms cubic-bezier(.65,0,.35,1), opacity 300ms ease; }
.theme-toggle .i-sun { opacity: 0; transform: rotate(-90deg) scale(.4); }
[data-theme="light"] .theme-toggle .i-sun { opacity: 1; transform: none; }
[data-theme="light"] .theme-toggle .i-moon { opacity: 0; transform: rotate(90deg) scale(.4); }
.logo-light { display: none !important; }
[data-theme="light"] .logo-dark { display: none !important; }
[data-theme="light"] .logo-light { display: block !important; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .nav__links { display: none; }
  .theme-toggle { margin-left: auto; }
  .nav { justify-content: space-between; }
  .hero__inner, .fit__pin, .founding__body, .faq, .founding__top { grid-template-columns: 1fr; }
  .hero__inner { padding-top: 116px; }
  .scanner { min-height: 440px; }
  .fit__pin { padding-block: 96px; }
  .founding__count { text-align: left; }

  .scan { height: 560vh; }
  .scan__pin { align-items: flex-end; padding-bottom: 28px; }
  .brief { width: 100%; }
  .brief::before { inset: -80px calc(var(--gut) * -1) -40px; background: linear-gradient(to top, rgba(var(--bg-rgb),.97) 55%, rgba(var(--bg-rgb),0)); filter: none; }
  .brief__title { font-size: 1.6rem; }
  .brief__lede, .brief__done { display: none; }
  .brief__sentence { margin-top: 16px; font-size: 1.45rem; }
  .brief__meter { margin-top: 18px; }
  .brief__count { font-size: 2.6rem; }

  .live { height: auto; }
  .live::before { background: rgba(var(--bg-rgb),.9); }
  .live__pin { position: relative; height: auto; overflow: visible; display: block; padding: 18vh var(--gut) 12vh; }
  .live__stage { display: none; }
  .live__list { margin-top: 40px; gap: 16px; }
  .way { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: rgba(var(--moss-rgb),.8); }
  .way__btn { padding: 20px 20px 18px; cursor: default; }
  .way__bar { display: none; }
  .way__btn { grid-template-columns: 1fr; }
  .way .way__name, .way.is-on .way__name { color: var(--bone); transform: none; }
  .way .way__note { opacity: 1; color: var(--soft); }
  .way__img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
  .night__inner { grid-template-columns: 1fr; padding-block: 96px; gap: 56px; }
  .phone { max-height: none; }
  .foot__top { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 17px; }
  .nav { padding-block: 14px; }
  .nav__logo img { height: 28px; }
  .hero__title { font-size: clamp(3rem, 15.5vw, 4.4rem); }
  .hero__shade::before { background: linear-gradient(0deg, #0b100d 0%, rgba(11,16,13,.62) 45%, rgba(11,16,13,.5) 75%, rgba(11,16,13,.7) 100%); }
  .hero__shade::after { background: linear-gradient(0deg, #fbf8f2 0%, #fbf8f2 42%, rgba(251,248,242,.9) 58%, rgba(251,248,242,.55) 80%, rgba(251,248,242,.6) 100%); }
  .hero__cta { gap: 20px; }
  .hero__cta .btn { width: 100%; }
  .claimed { width: 100%; }
  .scanner { padding: 18px; min-height: 420px; }
  .scanner__input { min-height: 56px; }
  .scanner__typed { font-size: 16px; }
  .match { grid-template-columns: 52px 1fr auto; gap: 10px; }
  .match img { width: 52px; height: 44px; }
  .match__score { font-size: 20px; }
  .fit__pin { padding: 76px var(--gut) 24px; gap: 28px; }
  .fit .body { font-size: 16px; }
  .fit__legend { display: none; }
  .rank { height: calc(4 * 96px + 3 * 10px); padding-left: 34px; }
  .rank__slots { width: 26px; grid-auto-rows: 96px; row-gap: 10px; }
  .rank__slots li { font-size: 26px; }
  .rank__card { left: 34px; height: 96px; grid-template-columns: 72px 1fr auto; gap: 12px; padding: 10px 14px 10px 10px; border-radius: 14px; }
  .rank__card img { width: 72px; height: 74px; }
  .rank__why { font-size: 12.5px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rank__meta { min-width: 0; }
  .rank__street { font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .rank__card { grid-template-columns: 72px minmax(0, 1fr) auto !important; }
  .rank__score { font-size: 24px; }
  .doors { gap: 6px; grid-template-columns: repeat(10, 1fr); }
  .door__leaf { font-size: 9px; }
  .field-row { grid-template-columns: 1fr; }
  .perks li { grid-template-columns: 1fr; gap: 8px; }
  .foot__cols { grid-template-columns: 1fr 1fr; }
  .foot__cols > div:last-child { grid-column: 1 / -1; }
  .founding { border-radius: 28px 28px 0 0; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .hero__beam { display: none; }
  .scan { height: auto; }
  .scan__pin { position: relative; height: auto; min-height: 100svh; }
  .live { height: auto; }
  .live__pin { position: relative; height: auto; min-height: 100svh; }
  .note--match { opacity: 1; transform: none; }
  .stage__img { transition: none !important; }
}

/* Clickable doors: open ones swing ajar and lead to the form, taken ones shake */
.door:not(.is-taken) { cursor: pointer; }
.door:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.door.is-ajar .door__light { opacity: .85; }
.door.is-ajar .door__leaf { transform: rotateY(-48deg); border-color: var(--accent); color: var(--accent); transition: transform 520ms var(--ease); animation: none; }
.door.is-nope { animation: nope 360ms var(--ease); }
@keyframes nope { 20%, 60% { transform: translateX(-3px); } 40%, 80% { transform: translateX(3px); } }
@media (prefers-reduced-motion: reduce) { .door.is-nope { animation: none; } .door.is-ajar .door__leaf { transition: none; } }

/* ---------- Overnight chapter v2: colours follow the sky, not the theme ----------
   JS sets --n-b on .night: 0 = dark sky (bone text, dark phone), 1 = bright daylight (ink text, light phone).
   Dark theme runs night → morning; light theme runs the inverse, a bright day → night. */
.night { --n-b: 0; --n-sky: 0; }
.night .sky--noon { opacity: 0; background:
  radial-gradient(90% 70% at 72% 88%, rgba(255,236,190,.95) 0%, rgba(255,236,190,0) 60%),
  linear-gradient(180deg, #a9cbe0 0%, #cfe0ea 38%, #f3e7cf 78%, #f7dcae 100%); }
/* readability scrims: dark one fades out as the sky brightens, paper one fades in */
.night__sky::after { opacity: calc(1 - var(--n-b)); }
.night__sky::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: var(--n-b);
  background: linear-gradient(90deg, rgba(251,248,242,.82) 0%, rgba(251,248,242,.5) 42%, rgba(251,248,242,0) 64%); }
.night .skyline { z-index: 1; background: color-mix(in srgb, #8e9ba3 calc(var(--n-sky) * 100%), #050907); }
.night__inner { --n-fg: color-mix(in srgb, #17140d calc(var(--n-b) * 100%), #efeade);
  --n-soft: color-mix(in srgb, #3b372c calc(var(--n-b) * 100%), #cdc8bb);
  --n-accent: color-mix(in srgb, #8a5f00 calc(var(--n-b) * 100%), #fcca54); }
.night__copy .h2, .night__copy .h2 * { color: var(--n-fg); }
.night__copy .body, .steps li { color: var(--n-soft); text-shadow: 0 1px 12px rgba(6,10,8, calc(.6 * (1 - var(--n-b)))); }
.steps strong { color: var(--n-fg); }
.clock { color: var(--n-accent); }
.steps li::before { color: var(--n-accent); background: color-mix(in srgb, rgba(251,248,242,.85) calc(var(--n-b) * 100%), rgba(6,10,8,.5)); border-color: color-mix(in srgb, #8a5f00 calc(var(--n-b) * 100%), rgba(244,169,3,.55)); }

/* phone: light UI in daylight, dark UI at night */
.phone { transition: background .35s; --p-fg: color-mix(in srgb, #17140d calc(var(--n-b) * 100%), #efeade);
  --p-soft: color-mix(in srgb, #5b5646 calc(var(--n-b) * 100%), #b9b4a6);
  --p-card: color-mix(in srgb, rgba(255,255,255,.92) calc(var(--n-b) * 100%), rgba(236,231,218,.08));
  --p-line: color-mix(in srgb, rgba(23,20,13,.1) calc(var(--n-b) * 100%), rgba(236,231,218,.1));
  --p-accent: color-mix(in srgb, #8a5f00 calc(var(--n-b) * 100%), #fcca54);
  background: color-mix(in srgb, #1c1e1d calc(var(--n-b) * 100%), #070b09); }
.phone__screen { padding: 46px 12px 14px; gap: 8px; color: var(--p-fg);
  background: color-mix(in srgb, #f3efe6 calc(var(--n-b) * 100%), #0d1512); }
.phone__status { position: absolute; top: 16px; left: 26px; right: 26px; display: flex; justify-content: space-between; align-items: center; font: 600 14px/1 var(--display); font-variant-numeric: tabular-nums; color: var(--p-fg); }
.phone__icons { display: flex; align-items: flex-end; gap: 2px; }
.phone__icons i { width: 3px; background: var(--p-fg); border-radius: 1px; }
.phone__icons i:nth-child(1) { height: 5px; } .phone__icons i:nth-child(2) { height: 8px; } .phone__icons i:nth-child(3) { height: 11px; }
.phone__icons b { width: 20px; height: 10px; margin-left: 6px; border: 1.5px solid var(--p-fg); border-radius: 3px; position: relative; }
.phone__icons b::after { content: ""; position: absolute; inset: 1.5px 5px 1.5px 1.5px; background: var(--p-fg); border-radius: 1px; }
.pcard { border-radius: 16px; background: var(--p-card); border: 1px solid var(--p-line); padding: 10px 11px; }
.pcard__label { font: 500 11px/1 var(--display); color: var(--p-soft); margin-bottom: 7px; }
.pbrief__chips { display: flex; flex-wrap: wrap; gap: 4px; }
.pbrief__chips span { font: 500 11px/1 var(--display); padding: 5px 7px; border-radius: 999px; color: var(--p-fg); background: color-mix(in srgb, rgba(244,169,3,.16) calc(var(--n-b) * 100%), rgba(244,169,3,.14)); border: 1px solid rgba(244,169,3,.35); }
.pscan { display: grid; grid-template-columns: 44px 1fr; gap: 11px; align-items: center; }
.pscan__ring { width: 44px; height: 44px; transform: rotate(-90deg); }
.pscan__ring circle { fill: none; stroke-width: 4; stroke: var(--p-line); }
.pscan__ring .pscan__arc { stroke: #f4a903; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; }
.pscan__area { margin-top: 3px; font: italic 400 12px/1.2 var(--serif); color: var(--p-accent); }
.note__title { color: var(--p-fg); }
.note__title em { font-style: normal; color: var(--p-accent); margin-right: 4px; }
.note__text { color: var(--p-soft); }
.note__unsure { margin-top: 3px; font: italic 400 11.5px/1.3 var(--serif); color: var(--p-soft); opacity: .9; }
.pfunnel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pfunnel div { text-align: center; padding: 7px 4px; border-radius: 12px; background: var(--p-card); border: 1px solid var(--p-line); }
.pfunnel b { display: block; font: 600 16px/1 var(--display); font-variant-numeric: tabular-nums; color: var(--p-fg); }
.pfunnel span { display: block; margin-top: 4px; font: 400 11px/1.1 var(--display); color: var(--p-soft); }
.pfunnel .is-hot b { color: var(--p-accent); }
.note { background: var(--p-card); border: 1px solid var(--p-line); padding: 9px; gap: 10px; grid-template-columns: 40px 1fr; align-items: start; }
.note img { width: 40px; height: 40px; }
.note--match:first-of-type { border-color: rgba(244,169,3,.45); }
.phone__cta { margin-top: auto; display: block; text-align: center; text-decoration: none; padding: 10px; border-radius: 999px; background: #f4a903; color: #17140d; font: 600 13px/1 var(--display); opacity: 0; transform: translateY(8px); transition: opacity .4s, transform .4s; }
.phone__cta.is-on { opacity: 1; transform: none; }
.phone__foot { margin-top: 2px; color: var(--p-soft); }
.phone__home { align-self: center; width: 110px; height: 4px; border-radius: 4px; background: var(--p-fg); opacity: .35; margin-top: 2px; }
/* shorter viewports: drop the least important modules rather than overflow */
@media (max-height: 820px) { .note__unsure { display: none; } }
@media (max-height: 720px) { .pfunnel { display: none; } .pbrief__chips span:nth-child(n+4) { display: none; } }
@media (max-width: 960px) { .phone { aspect-ratio: auto; max-height: none; } .phone__screen { min-height: 640px; } }
