/* Apartment Twin: the sales-office model you can walk into.
   White mount card, cut foam board, basswood, graphite plinth; one proposal colour (cobalt acrylic). */
:root {
  --card: #efefeb;
  --card-2: #e4e3de;
  --white: #fafaf7;
  --ink: #16181a;
  --ink-2: #45484c;
  --muted: #5e6266;
  --rule: rgba(22, 24, 26, 0.2);
  --graphite: #232527;
  --graphite-2: #2e3134;
  --graphite-3: #3a3e42;
  --on-dark: #ededea;
  --on-dark-2: #a9adb1;
  --on-dark-rule: rgba(237, 237, 234, 0.18);
  --wood: #d9bc91;
  --cobalt: #2445d6;
  --cobalt-deep: #1a33a8;
  --cobalt-light: #9fb1ff;
  --cobalt-soft: rgba(36, 69, 214, 0.12);
  --display: "Miriam Libre", Heebo, Arial, sans-serif;
  --sans: Heebo, Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --bar-h: 56px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
  accent-color: var(--cobalt);
  scrollbar-color: #8a8e92 var(--card-2);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar-h) + 8px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--card);
  color: var(--ink);
  font: 400 17px/1.65 var(--sans);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  caret-color: var(--cobalt);
}
::selection { background: var(--cobalt); color: #fff; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--card-2); }
::-webkit-scrollbar-thumb { background: #8a8e92; border: 3px solid var(--card-2); }
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 700; letter-spacing: -0.01em; }
h2 { text-wrap: balance; }
.change-head h2 span { display: block; }
p { margin: 0; }
a { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; }
.skip { position: absolute; inset-inline-start: -9999px; top: 8px; z-index: 300; background: var(--cobalt); color: #fff; padding: 10px 14px; }
.skip:focus { inset-inline-start: 8px; }

/* ---------- bar: a strip of the plinth ---------- */
.bar { position: fixed; inset: 0 0 auto 0; z-index: 60; height: var(--bar-h); display: flex; align-items: center; gap: 28px; padding: 0 var(--gutter); background: var(--graphite); color: var(--on-dark); border-bottom: 1px solid #000; }
.bar :focus-visible { outline-color: var(--cobalt-light); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 700 1rem var(--display); letter-spacing: 0.02em; }
.brand-mark { width: 22px; height: 22px; }
.nav { display: flex; gap: 2px; margin-inline-start: auto; }
.nav a { text-decoration: none; color: var(--on-dark-2); font-size: 0.94rem; padding: 6px 12px; transition: color 0.2s; }
.nav a:hover { color: var(--on-dark); text-decoration: underline; }
.bar-cta { border: 0; background: var(--cobalt); color: #fff; font-weight: 600; font-size: 0.92rem; padding: 0 16px; height: 36px; cursor: pointer; transition: background-color 0.2s; }
.bar-cta:hover { background: var(--cobalt-deep); }
@media (max-width: 759px) { .nav { display: none; } .bar-cta { margin-inline-start: auto; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 26px; border: 1px solid transparent; font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer; transition: background-color 0.2s, color 0.2s, border-color 0.2s; }
.btn-primary { background: var(--cobalt); color: #fff; }
.btn-primary:hover { background: var(--cobalt-deep); }
.btn-primary:active { transform: translateY(1px); }
.btn-quiet { padding: 0 4px; color: var(--ink); text-decoration: underline; text-underline-offset: 0.3em; }
.btn-quiet:hover { color: var(--cobalt); }
.btn-line { background: transparent; color: var(--on-dark); border-color: var(--on-dark-2); }
.btn-line:hover { border-color: var(--on-dark); background: var(--graphite-2); }

/* ---------- stage: the model on its plinth ---------- */
.stage-wrap { position: relative; height: 230svh; background: #1d1f21; }
.stage-wrap[data-mode="explore"], .stage-wrap.no-scrub { height: 100svh; min-height: 560px; }
.stage { position: sticky; top: 0; height: 100svh; min-height: 560px; overflow: hidden; color: var(--ink); --p: 0; }
.stage:focus { outline: none; }
.viewport { position: absolute; inset: 0; touch-action: pan-y; }
.stage-wrap[data-mode="explore"] .viewport { touch-action: none; }
.viewport canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
.viewport canvas:focus-visible { outline: 2px solid var(--cobalt-light); outline-offset: -4px; }
.viewport::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 40% 55%, transparent 55%, rgba(10, 11, 12, 0.42) 100%); }
.stage-wrap[data-mode="explore"] .viewport::after { opacity: 0.5; }
.poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 35% 50%; transition: opacity 0.8s var(--ease-out); }
.poster.is-gone { opacity: 0; pointer-events: none; }

/* the model's title card */
.title-card { position: absolute; z-index: 5; top: calc(var(--bar-h) + clamp(20px, 5vh, 56px)); inset-inline-start: var(--gutter); width: min(640px, 44vw); padding: clamp(20px, 2.2vw, 30px); background: var(--white); border: 1px solid var(--ink);
  opacity: calc(1 - var(--p) * 3.2); transform: translateY(calc(var(--p) * -60px)); }
.stage-wrap[data-mode="explore"] .title-card { display: none; }
.title-card h1 { font-size: clamp(2.3rem, 5vw, 4.75rem); line-height: 1.02; letter-spacing: -0.02em; }
.title-card h1 span { display: block; white-space: nowrap; }
.title-card h1 span:last-child { font-weight: 400; color: var(--ink-2); }
.title-card .lead { margin-top: 16px; font-size: clamp(1.02rem, 1.2vw, 1.14rem); color: var(--ink-2); max-width: 36ch; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-top: 22px; }

.plaque { position: absolute; z-index: 5; bottom: clamp(16px, 4vh, 36px); inset-inline-end: var(--gutter); display: grid; gap: 2px; padding: 10px 16px; background: var(--graphite); color: var(--on-dark-2); border: 1px solid var(--graphite-3); font-size: 0.82rem; line-height: 1.4; max-width: min(360px, 60vw); }
.plaque b { font-family: var(--display); color: var(--on-dark); font-size: 0.92rem; letter-spacing: 0.02em; }
.stage-wrap[data-mode="explore"] .plaque, .stage[data-docked] .plaque { display: none; }

.scroll-cue { position: absolute; z-index: 4; bottom: clamp(16px, 4vh, 36px); left: 50%; transform: translateX(-50%); display: grid; justify-items: center; gap: 8px; color: var(--on-dark); font-size: 0.82rem; opacity: calc(1 - var(--p) * 5); pointer-events: none; }
.scroll-cue span { background: rgba(35, 37, 39, 0.88); border: 1px solid var(--graphite-3); padding: 4px 12px; }
.scroll-cue::after { content: ""; width: 1px; height: 36px; background: var(--graphite); }
@media (prefers-reduced-motion: no-preference) { .scroll-cue::after { animation: cue 2.4s var(--ease-out) infinite; transform-origin: top; } }
@keyframes cue { 0% { transform: scaleY(0); } 60% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }
.stage-wrap[data-mode="explore"] .scroll-cue, .stage-wrap.no-scrub .scroll-cue { display: none; }

/* dock: the plinth's control rail */
.dock { position: absolute; z-index: 6; inset-inline: var(--gutter); bottom: clamp(12px, 3vh, 24px); display: grid; gap: 8px; color: var(--on-dark); visibility: hidden; opacity: 0; transform: translateY(14px); transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out), visibility 0s 0.5s; }
.stage[data-docked] .dock, .stage-wrap[data-mode="explore"] .dock { visibility: visible; opacity: 1; transform: none; transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out), visibility 0s; }
.dock :focus-visible { outline-color: var(--cobalt-light); }
.variant-line { justify-self: start; background: rgba(35, 37, 39, 0.92); border: 1px solid var(--graphite-3); padding: 6px 12px; font-size: 0.9rem; color: var(--on-dark-2); max-width: 70ch; }
.variant-line b { color: var(--on-dark); font-weight: 600; }
.variant-line strong { color: var(--cobalt-light); font-weight: 600; }
.dock-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px; background: var(--graphite); border: 1px solid var(--graphite-3); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.6); }
.seg { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--graphite-3); }
.seg button { border: 0; background: transparent; color: var(--on-dark-2); min-height: 38px; padding: 0 16px; cursor: pointer; font-weight: 500; font-size: 0.94rem; white-space: nowrap; transition: background-color 0.2s, color 0.2s; }
.seg button:hover { color: var(--on-dark); background: var(--graphite-2); }
.seg button[aria-pressed="true"] { background: var(--on-dark); color: var(--ink); }
.seg button[data-variant="a"][aria-pressed="true"] { background: var(--cobalt); color: #fff; }
.mob-tabs { display: none; }
.checks { display: inline-flex; gap: 4px; }
.chk { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 12px; cursor: pointer; font-size: 0.94rem; color: var(--on-dark-2); border: 1px solid var(--graphite-3); }
.chk:has(input:checked) { color: var(--on-dark); }
.chk input { appearance: none; -webkit-appearance: none; width: 16px; height: 16px; margin: 0; border: 1px solid var(--on-dark-2); border-radius: 0; background: transparent; cursor: pointer; display: grid; place-content: center; }
.chk input:checked { background: var(--on-dark) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.3l3 3 6-6.6' fill='none' stroke='%2316181a' stroke-width='1.8'/%3E%3C/svg%3E") center / 14px no-repeat; border-color: var(--on-dark); }
.chk input:focus-visible { outline: 2px solid var(--cobalt-light); outline-offset: 2px; }
@media (forced-colors: active) { .chk input { appearance: auto; -webkit-appearance: auto; } }
.tools { display: inline-flex; gap: 2px; margin-inline-start: auto; }
.tool { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 12px; border: 0; background: transparent; color: var(--on-dark-2); cursor: pointer; font-size: 0.92rem; transition: color 0.2s, background-color 0.2s; }
.tool svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.tool:hover, .tool[aria-expanded="true"], .tool[aria-pressed="true"] { color: var(--on-dark); background: var(--graphite-2); }

.vp-hint { position: absolute; z-index: 6; top: calc(var(--bar-h) + 14px); inset-inline-start: var(--gutter); max-width: min(480px, calc(100% - 32px)); padding: 6px 12px; background: rgba(35, 37, 39, 0.9); border: 1px solid var(--graphite-3); color: var(--on-dark); font-size: 0.84rem; pointer-events: none; transition: opacity 0.6s; }
.vp-hint.is-faded { opacity: 0; }

.annot { position: absolute; z-index: 5; left: 0; top: 0; pointer-events: none; transform: translate(-50%, calc(-100% - 22px)); }
.annot-dot { position: absolute; left: 50%; bottom: -22px; width: 9px; height: 9px; margin-left: -4px; background: var(--cobalt); outline: 1px solid #fff; }
.annot-dot::before { content: ""; position: absolute; left: 4px; bottom: 9px; width: 1px; height: 13px; background: var(--cobalt); }
.annot-text { display: grid; gap: 1px; padding: 8px 14px; background: var(--cobalt); color: #fff; font-size: 0.84rem; line-height: 1.35; white-space: nowrap; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.5); }
.annot-text b { font-family: var(--display); font-weight: 700; }

.walk-pad { position: absolute; z-index: 6; right: var(--gutter); bottom: calc(var(--dock-h, 140px) + 12px); display: grid; grid-template-columns: repeat(3, 48px); grid-template-rows: repeat(2, 48px); gap: 4px; direction: ltr; }
.walk-pad button { display: grid; place-items: center; border: 1px solid var(--graphite-3); background: rgba(35, 37, 39, 0.9); color: var(--on-dark); cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
.walk-pad svg { width: 20px; height: 20px; fill: currentColor; }
.walk-pad button.on, .walk-pad button:active { background: var(--cobalt); border-color: var(--cobalt); }
.walk-pad [data-pad="f"] { grid-column: 2; grid-row: 1; }
.walk-pad [data-pad="l"] { grid-column: 1; grid-row: 2; }
.walk-pad [data-pad="b"] { grid-column: 2; grid-row: 2; }
.walk-pad [data-pad="r"] { grid-column: 3; grid-row: 2; }

.drawer { position: absolute; z-index: 5; top: calc(var(--bar-h) + 14px); bottom: calc(var(--dock-h, 140px) + 12px); inset-inline-end: var(--gutter); width: min(380px, 34%); display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--ink); box-shadow: 0 24px 48px -20px rgba(0, 0, 0, 0.55); transition: transform 0.5s var(--ease-out), opacity 0.4s var(--ease-out); }
.stage[data-drawer="closed"] .drawer, .stage-wrap[data-mode="intro"] .drawer { transform: translateX(calc(-100% - 40px)); opacity: 0; pointer-events: none; visibility: hidden; }
.drawer-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 18px 4px; border-bottom: 1px solid var(--rule); }
.drawer-head h2 { font-size: 1.1rem; }
.drawer-hint { font-size: 0.8rem; color: var(--muted); }
.plan { flex: 1; min-height: 0; display: flex; align-items: center; padding: 6px 10px; }
.plan .plan-svg { width: 100%; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 10px 18px 12px; border-top: 1px solid var(--rule); font-size: 0.8rem; color: var(--ink-2); }
.sw { display: inline-block; width: 14px; height: 10px; margin-inline-end: 6px; vertical-align: -1px; }
.sw-removed { border: 1px dashed var(--cobalt); }
.sw-gain { background: var(--cobalt-soft); border: 1px solid var(--cobalt); }

.stage[data-nogl] .seg:has([data-view]), .stage[data-nogl] #reset-view, .stage[data-nogl] #full-toggle, .stage[data-nogl] .mob-tabs { display: none; }
.vp-fallback { position: absolute; inset: 0; z-index: 3; display: grid; place-items: end start; padding: 0 var(--gutter) 130px; }
.vp-fallback p { max-width: 42ch; background: var(--white); border: 1px solid var(--ink); padding: 12px 16px; }

.full-exit { position: absolute; z-index: 8; top: 16px; inset-inline-start: 16px; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--graphite-3); background: var(--graphite); color: var(--on-dark); font-weight: 600; font-size: 0.9rem; cursor: pointer; }
.full-exit svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.8; }
.full-exit:hover { background: var(--cobalt); border-color: var(--cobalt); }
.stage.is-full { position: fixed; inset: 0; z-index: 200; height: 100%; }
.stage.is-full .vp-hint, .stage.is-full .drawer { top: 16px; }
body.no-scroll { overflow: hidden; }

@media (max-width: 899px) {
  .stage-wrap { height: 200svh; }
  .title-card { top: auto; bottom: 12px; inset-inline: 12px; width: auto; padding: 20px; }
  .title-card h1 { font-size: clamp(2rem, 8.4vw, 2.6rem); }
  .title-card .lead { margin-top: 12px; font-size: 1rem; }
  .actions { margin-top: 18px; }
  .actions .btn-primary { flex: 1 1 100%; }
  .plaque { top: calc(var(--bar-h) + 10px); bottom: auto; inset-inline-end: 12px; padding: 6px 10px; font-size: 0.74rem; }
  .plaque b { font-size: 0.82rem; }
  .scroll-cue { display: none; }
  .dock { inset-inline: 8px; bottom: 8px; }
  .dock-row { gap: 6px; padding: 6px; }
  .mob-tabs { display: inline-flex; flex: 1 1 100%; }
  .seg { flex: 1 1 calc(50% - 3px); }
  .seg button { flex: 1; min-height: 44px; padding: 0 6px; }
  .checks { flex: 1 1 auto; }
  .chk { flex: 1; justify-content: center; min-height: 44px; }
  .tools { margin-inline-start: 0; }
  .tool span { display: none; }
  .tool { min-width: 44px; min-height: 44px; justify-content: center; border: 1px solid var(--graphite-3); }
  #plan-toggle { display: none; }
  .variant-line { font-size: 0.82rem; }
  .vp-hint { top: calc(var(--bar-h) + 8px); inset-inline-start: 8px; font-size: 0.78rem; }
  .walk-pad { right: 10px; }
  .drawer, .stage[data-drawer="closed"] .drawer { inset: var(--bar-h) 0 auto 0; bottom: calc(var(--dock-h, 220px) + 8px); width: auto; border-inline: 0; transform: none; opacity: 0; pointer-events: none; visibility: hidden; }
  .stage-wrap[data-mode="explore"] .stage[data-panel="plan"] .drawer { opacity: 1; pointer-events: auto; visibility: visible; }
}

/* ---------- shared plan svg: printed on white card ---------- */
.plan-svg { width: 100%; height: auto; }
.room .room-fill { fill: #f6f6f2; transition: fill 0.3s var(--ease-out); }
.room.wet .room-fill { fill: #e3e3de; }
.room.outdoor .room-fill { fill: #ecdcc2; }
.room { cursor: pointer; outline: none; }
.room:hover .room-fill, .room.is-hover .room-fill, .room:focus-visible .room-fill { fill: #dde3fb; }
.wall { fill: var(--ink); transition: fill 0.4s var(--ease-out), opacity 0.6s var(--ease-out); }
.window { fill: #f6f6f2; stroke: var(--ink); stroke-width: 0.022; }
.window-line { stroke: var(--ink); stroke-width: 0.018; }
.door { fill: none; stroke: #6c7075; stroke-width: 0.02; stroke-dasharray: 0.07 0.05; transition: opacity 0.4s; }
.door.entry { stroke: var(--cobalt); stroke-dasharray: none; stroke-width: 0.03; }
.slider { stroke: var(--ink); stroke-width: 0.03; }
.railing { stroke: #6c7075; stroke-width: 0.035; stroke-dasharray: 0.15 0.08; }
.furn { fill: none; stroke: #a8acb0; stroke-width: 0.022; }
.furn-rug { fill: #a8acb0; fill-opacity: 0.1; stroke-dasharray: 0.1 0.06; }
.furn-detail { fill: #a8acb0; fill-opacity: 0.22; stroke: #a8acb0; stroke-width: 0.016; }
.furn-blanket { fill: #a8acb0; fill-opacity: 0.12; stroke: none; }
.room-name { font-family: var(--display); font-size: 0.3px; font-weight: 700; fill: var(--ink); paint-order: stroke; stroke: #f6f6f2; stroke-width: 0.08px; stroke-linejoin: round; }
.room-dim { font-family: var(--sans); font-size: 0.22px; font-weight: 400; fill: var(--muted); paint-order: stroke; stroke: #f6f6f2; stroke-width: 0.07px; stroke-linejoin: round; font-variant-numeric: tabular-nums; }
.room-name.small { font-size: 0.22px; }
.room-dim.small { font-size: 0.17px; }
@media (max-width: 899px) {
  .drawer .room-name { font-size: 0.4px; }
  .drawer .room-name.small { font-size: 0.3px; }
  .drawer .room-dim { font-size: 0.28px; }
  .drawer .room-dim.small { font-size: 0.22px; }
}
.labels { pointer-events: none; }
.dim-line, .dim-tick { stroke: var(--ink-2); stroke-width: 0.018; }
.dim-text { font-family: var(--sans); font-size: 0.26px; font-weight: 500; fill: var(--ink-2); }
.gain { stroke: var(--cobalt); stroke-width: 0.04; pointer-events: none; }
.gain-bg { fill: rgba(36, 69, 214, 0.1); }
.gain-line { stroke: var(--cobalt); stroke-width: 0.03; stroke-opacity: 0.55; }
.gain-label { font-family: var(--display); font-size: 0.2px; font-weight: 700; fill: var(--cobalt); paint-order: stroke; stroke: #f6f6f2; stroke-width: 0.06px; }
.removed-wall { fill: none; stroke: var(--cobalt); stroke-width: 0.025; stroke-dasharray: 0.1 0.06; }
.removed { pointer-events: none; }
.north-ring { fill: none; stroke: var(--ink-2); stroke-width: 0.02; }
.north-arrow { fill: var(--ink-2); }
.north-text { font-family: var(--display); font-size: 0.19px; fill: var(--ink-2); font-weight: 700; }
.marker-cone { fill: var(--cobalt); fill-opacity: 0.18; stroke: var(--cobalt); stroke-width: 0.025; }
.marker-dot { fill: var(--cobalt); stroke: #f6f6f2; stroke-width: 0.05; }
.marker { pointer-events: none; }

/* ---------- the trade-off ---------- */
.change { padding: clamp(80px, 11vw, 160px) var(--gutter) clamp(72px, 9vw, 140px); max-width: 1440px; margin: 0 auto; }
.change-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 64px; align-items: end; margin-bottom: clamp(40px, 6vw, 80px); padding-bottom: 28px; border-bottom: 1px solid var(--ink); }
.change-head h2, .process-head h2 { font-size: clamp(2.2rem, 4.6vw, 4.4rem); line-height: 1.02; letter-spacing: -0.02em; }
.section-lead { color: var(--ink-2); font-size: clamp(1.02rem, 1.2vw, 1.14rem); max-width: 52ch; }
.change-body { display: grid; grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr); gap: clamp(24px, 5vw, 80px); }
.change-steps { list-style: none; margin: 0; padding: 0; grid-column: 1; grid-row: 1; }
.change-visual { grid-column: 2; grid-row: 1; align-self: start; position: sticky; top: calc(var(--bar-h) + max(20px, (100svh - var(--bar-h) - 620px) / 2)); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto; gap: 12px; }
.cv-plan { background: var(--white); border: 1px solid var(--ink); padding: 4%; display: flex; align-items: center; min-height: 0; aspect-ratio: 1 / 1.02; }
.cv-plan .plan-svg { width: 100%; height: 100%; }
.cv-photo { position: relative; min-height: 0; overflow: hidden; border: 1px solid var(--ink); background: #1d1f21; }
.cv-photo picture { display: contents; }
.cv-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; transition: opacity 0.9s var(--ease-out); }
.cv-photo .cv-after { clip-path: inset(0 0 0 100%); transition: clip-path 1s var(--ease-out); }
.cv-tag { position: absolute; top: 10px; inset-inline-start: 10px; padding: 3px 10px; font: 700 0.8rem var(--display); background: var(--white); border: 1px solid var(--ink); transition: opacity 0.6s; }
.cv-tag-after { opacity: 0; background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.change-body[data-s2] .cv-photo .cv-after { clip-path: inset(0 0 0 0); }
.change-body[data-s2] .cv-tag-after { opacity: 1; }
.change-body[data-s2] .cv-tag-before { opacity: 0; }

/* fixed readout: the figures stay put and change in place */
.readout { grid-column: 1 / -1; margin: 0; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--ink); background: var(--white); }
.ro { padding: 12px 18px; display: grid; gap: 2px; }
.ro + .ro { border-inline-start: 1px solid var(--rule); }
.ro dt { font-size: 0.86rem; color: var(--muted); }
.ro dd { margin: 0; position: relative; height: 1.1em; font: 400 clamp(2.4rem, 4vw, 3.6rem)/1 var(--display); font-variant-numeric: tabular-nums; direction: ltr; text-align: right; }
.ro dd span { position: absolute; inset: 0; transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out); }
.ro-after { opacity: 0; transform: translateY(0.3em); color: var(--cobalt); }
.change-body[data-s2] .ro:first-child .ro-before, .change-body[data-s3] .ro-cost .ro-before { opacity: 0; transform: translateY(-0.3em); }
.change-body[data-s2] .ro:first-child .ro-after, .change-body[data-s3] .ro-cost .ro-after { opacity: 1; transform: none; }

.cstep { min-height: 70svh; display: flex; flex-direction: column; justify-content: center; padding: 24px 0; border-top: 1px solid var(--rule); color: var(--muted); transition: color 0.4s var(--ease-out), border-color 0.4s var(--ease-out); }
.cstep:first-child { border-top: 0; min-height: 58svh; justify-content: flex-start; padding-top: 6svh; }
.cstep.is-active { color: var(--ink); border-top-color: var(--cobalt); }
.cstep:first-child.is-active { border-top: 0; }
.cstep h3 { font-size: clamp(1.5rem, 2.4vw, 2.1rem); line-height: 1.12; margin-bottom: 12px; }
.cstep p { color: var(--muted); max-width: 42ch; transition: color 0.4s var(--ease-out); }
.cstep.is-active p { color: var(--ink-2); }

/* story states on the plan */
.story .story-gain, .story .story-removed { opacity: 0; transition: opacity 0.7s var(--ease-out); }
[data-label-room] { transition: opacity 0.5s; }
.change-body[data-s1]:not([data-s2]) .wc-wall { fill: var(--cobalt); }
.change-body[data-s1]:not([data-s2]) [data-room="wc"] .room-fill { fill: #dde3fb; }
.change-body[data-s2] .wc-wall, .change-body[data-s2] .wc-door { opacity: 0; }
.change-body[data-s2] .story-gain, .change-body[data-s2] .story-removed { opacity: 1; }
.change-body[data-s2] [data-room="wc"] .room-fill { fill: #f6f6f2; }
.change-body[data-s2] [data-label-room="wc"] { opacity: 0; }
.change-body[data-s3] [data-room="bath"] .room-fill { fill: #dde3fb; stroke: var(--cobalt); stroke-width: 0.04; }

@media (max-width: 899px) {
  .change-head { grid-template-columns: 1fr; }
  .change-body { grid-template-columns: 1fr; gap: 0; }
  .change-steps { grid-column: 1; grid-row: 1; padding-bottom: 6svh; }
  .change-visual { grid-column: 1; grid-row: 2; position: sticky; top: auto; bottom: 0; height: auto; max-height: none; margin: 0 calc(-1 * var(--gutter)); padding: 8px var(--gutter) calc(8px + env(safe-area-inset-bottom)); grid-template-columns: 1fr 1fr; grid-template-rows: 26svh auto; gap: 6px; z-index: 2; background: var(--card); border-top: 1px solid var(--ink); }
  .ro { padding: 6px 10px; }
  .ro dt { font-size: 0.74rem; }
  .ro dd { font-size: 1.8rem; }
  .cstep, .cstep:first-child { min-height: 48svh; padding-top: 24px; justify-content: flex-start; }
}

.ledger { display: grid; grid-template-columns: 1fr 1fr; gap: 0 clamp(24px, 5vw, 80px); margin-top: clamp(56px, 8vw, 110px); padding-top: 28px; border-top: 1px solid var(--ink); }
.ledger h3 { font-size: 1.5rem; margin-bottom: 10px; }
.ledger ul { list-style: none; margin: 0; padding: 0; }
.ledger li { display: flex; gap: 12px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.ledger li::before { content: ""; flex: none; width: 9px; height: 9px; transform: translateY(-1px); }
.ledger-col:first-child li::before { background: var(--cobalt); }
.ledger-col:last-child li::before { border: 1px solid var(--ink); }
.ledger li b { font-weight: 600; }
.ledger-note { grid-column: 1 / -1; margin-top: 26px; font-size: 0.92rem; color: var(--muted); max-width: 80ch; }
@media (max-width: 699px) { .ledger { grid-template-columns: 1fr; } .ledger-col + .ledger-col { margin-top: 28px; } }

/* ---------- process: a dimension string ---------- */
.process { padding: clamp(40px, 6vw, 80px) var(--gutter) clamp(80px, 10vw, 150px); max-width: 1440px; margin: 0 auto; }
.process-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 64px; align-items: end; margin-bottom: clamp(36px, 5vw, 64px); }
.process-line { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); position: relative; }
.process-line::before { content: ""; position: absolute; inset-inline: 0; top: 10px; height: 1px; background: var(--ink); }
.process-line li { position: relative; padding: 40px clamp(16px, 3vw, 44px) 0 0; }
.process-line li::before { content: ""; position: absolute; top: 2px; inset-inline-start: 0; width: 1px; height: 17px; background: var(--ink); }
.process-line li:last-child::after { content: ""; position: absolute; top: 2px; inset-inline-end: 0; width: 1px; height: 17px; background: var(--ink); }
.process-line h3 { font-size: 1.35rem; margin-bottom: 8px; }
.process-line p { color: var(--ink-2); max-width: 34ch; }
@media (max-width: 819px) {
  .process-head { grid-template-columns: 1fr; }
  .process-line { grid-template-columns: 1fr; }
  .process-line::before { inset-inline: auto; inset-inline-start: 0; top: 0; bottom: 0; width: 1px; height: auto; }
  .process-line li { padding: 0 24px 28px 0; padding-inline-start: 24px; }
  .process-line li::before { top: 8px; width: 17px; height: 1px; }
  .process-line li:last-child::after { display: none; }
}

/* ---------- closing: the plinth ---------- */
.closing { background: var(--graphite); color: var(--on-dark); padding: clamp(88px, 12vw, 180px) var(--gutter); border-top: 1px solid #000; }
.closing h2 { font-size: clamp(2.4rem, 5.4vw, 5rem); line-height: 1.02; letter-spacing: -0.02em; max-width: 16ch; }
.closing p { margin-top: 22px; color: var(--on-dark-2); font-size: 1.08rem; max-width: 58ch; }
.closing :focus-visible { outline-color: var(--cobalt-light); }
.closing-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 40px; }
.copy-status { color: var(--cobalt-light); font-size: 0.94rem; min-height: 1.4em; }
@media (max-width: 559px) { .closing-actions .btn { flex: 1 1 100%; } }

.foot { display: flex; flex-wrap: wrap; gap: 6px 24px; padding: 20px var(--gutter) calc(24px + env(safe-area-inset-bottom)); background: var(--graphite); color: var(--on-dark-2); border-top: 1px solid var(--on-dark-rule); font-size: 0.84rem; }
.foot-brand { font-family: var(--display); font-weight: 700; color: var(--on-dark); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
