/* 3D stages: one WebGL canvas travels between these hosts */
.stage { position: relative; overflow: hidden; background: #E8EBE5; isolation: isolate; }
.stage__canvas { position: absolute; inset: 0; z-index: 0; }
.stage__gl { width: 100%; height: 100%; display: block; outline: none; }
.stage__poster { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; object-fit: cover; pointer-events: none; }
.stage.is-live .stage__poster { visibility: hidden; }
.stage__fallback { position: absolute; inset: 0; z-index: 0; background-size: cover; background-position: center; }
.stage:not(.has-snapshot) .stage__poster { opacity: 0; }
.stage__hud { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.stage__hud > * { pointer-events: auto; }
.stage__hint {
  position: absolute; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 6px;
  background: rgba(251, 250, 247, 0.9); font-size: 0.82rem; color: var(--ink-2); pointer-events: none;
  font-variation-settings: "wdth" 92; max-width: calc(100% - 200px);
}
.stage__hint svg { width: 16px; height: 16px; flex-shrink: 0; }
.stage__tools { position: absolute; right: 16px; bottom: 16px; display: flex; gap: 6px; }
.stage__tools .lock-btn { display: none; }
.is-touch .stage__tools .lock-btn { display: inline-grid; }
.no-webgl .stage__tools, .no-webgl .stage__hint, .no-webgl .needs-3d { display: none !important; }
@media (max-width: 599px) {
  .stage__tools { flex-direction: column; right: 12px; bottom: 12px; }
  .stage__hint { left: 12px; bottom: 12px; max-width: calc(100% - 80px); font-size: 0.78rem; }
}
.webgl-note {
  position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 4; display: none;
  background: var(--white); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; font-size: 0.88rem;
}
.no-webgl .webgl-note { display: block; }

/* ---------------- hero ---------------- */
.hero { height: clamp(620px, 92svh, 900px); margin-top: 0; background: #E6EAE4; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, rgba(242, 240, 235, 0.94) 0%, rgba(242, 240, 235, 0.72) 30%, rgba(242, 240, 235, 0) 54%);
}
.hero__content {
  position: relative; z-index: 2; height: 100%;
  display: flex; flex-direction: column; justify-content: center; gap: 22px;
  padding-top: calc(var(--nav-h) + 20px); padding-bottom: 96px;
  pointer-events: none;
}
.hero__content > * { pointer-events: auto; max-width: 620px; }
.hero__brand { display: flex; align-items: center; gap: 10px; }
.hero__title { font-size: clamp(2.9rem, 1.5rem + 5.4vw, 6.4rem); }
.hero__content > .hero__title { max-width: 820px; }
.hero__title .reveal-line > span { will-change: transform; }
.hero__lead { font-size: var(--step-1); color: var(--ink-2); max-width: 30ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.titleblock {
  display: grid; grid-template-columns: repeat(4, auto); justify-content: start;
  border: 1px solid var(--line-strong); border-radius: 2px; background: rgba(251, 250, 247, 0.75); width: max-content; max-width: 100%;
}
.titleblock div { padding: 8px 14px 9px; border-left: 1px solid var(--line); min-width: 0; }
.titleblock div:first-child { border-left: 0; }
.titleblock dt { font-size: 0.66rem; font-variation-settings: "wdth" 78; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.titleblock dd { margin: 2px 0 0; font-weight: 700; font-variation-settings: "wdth" 104; font-size: 0.95rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hero__daynight { position: absolute; right: 16px; top: calc(var(--nav-h) + 16px); }
.hero__scroll { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 3; display: none; }

@media (max-width: 899px) {
  .hero { height: auto; display: flex; flex-direction: column; }
  .hero::before { display: none; }
  .hero__content { order: 1; height: auto; padding-bottom: 20px; padding-top: calc(var(--nav-h) + 28px); background: var(--paper); gap: 18px; }
  .hero .stage__canvas, .hero .stage__poster, .hero .stage__fallback { top: auto; height: min(62svh, 520px); }
  .hero__stagebox { order: 2; position: relative; height: min(62svh, 520px); }
  .hero .stage__hud { top: auto; height: min(62svh, 520px); }
  .hero__daynight { top: 14px; right: 14px; }
  .titleblock { grid-template-columns: repeat(2, auto); }
  .titleblock div:nth-child(3) { border-left: 0; }
  .titleblock div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (min-width: 900px) { .hero__stagebox { display: none; } }

/* ---------------- explore ---------------- */
.explore-stage { height: clamp(520px, 82svh, 820px); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.explore-top { position: absolute; left: 16px; right: 16px; top: 16px; display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; justify-content: space-between; pointer-events: none; }
.explore-top > * { pointer-events: auto; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; padding: 6px 10px; background: rgba(251, 250, 247, 0.92); border: 1px solid var(--line); border-radius: 6px; font-size: 0.84rem; font-variation-settings: "wdth" 92; min-height: 44px; }
.crumbs button { background: none; border: 0; padding: 4px 6px; color: var(--ink-2); border-radius: 4px; }
.crumbs button:hover { color: var(--ink); background: var(--paper-2); }
.crumbs span[aria-current] { padding: 4px 6px; font-weight: 700; color: var(--ink); }
.crumbs .sep { color: var(--muted); }
.room-indicator {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 4;
  display: flex; align-items: center; gap: 10px; padding: 6px; max-width: calc(100% - 32px);
  background: var(--white); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 10px 30px -18px rgba(27, 29, 30, 0.4);
}
.room-indicator__text { display: grid; gap: 0; padding: 0 6px; min-width: 150px; text-align: center; }
.room-indicator strong { font-size: 1rem; font-variation-settings: "wdth" 106; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-indicator .note { white-space: nowrap; }
.room-nav { display: contents; }
.room-indicator .icon-btn { width: 42px; height: 42px; }
.room-list {
  position: absolute; left: 16px; top: 76px; display: grid; gap: 2px; padding: 8px; width: 250px;
  background: rgba(251, 250, 247, 0.94); border: 1px solid var(--line); border-radius: 6px;
}
.room-list button {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  text-align: left; border: 0; background: transparent; padding: 7px 8px; border-radius: 4px; font-size: 0.88rem; color: var(--ink-2);
}
.room-list button span:last-child { font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.room-list button:hover { background: var(--paper-2); color: var(--ink); }
.room-list button[aria-current="true"] { background: var(--ink); color: var(--paper); }
.room-list button[aria-current="true"] span:last-child { color: var(--on-dark-muted); }
.room-list__total { display: flex; justify-content: space-between; padding: 8px 8px 2px; border-top: 1px solid var(--line); margin-top: 4px; font-size: 0.8rem; font-weight: 700; }

.labels { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.plan-label {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); pointer-events: auto;
  border: 0; background: rgba(251, 250, 247, 0.88); border-radius: 3px; padding: 4px 8px; text-align: center;
  font-size: 0.74rem; line-height: 1.2; color: var(--ink); box-shadow: 0 0 0 1px var(--line);
  font-variation-settings: "wdth" 88; white-space: nowrap;
}
.plan-label strong { display: block; font-weight: 700; font-size: 0.78rem; }
.plan-label:hover { background: var(--ink); color: var(--paper); }
.marker {
  position: absolute; left: 0; top: 0; pointer-events: auto; transform: translate(-50%, -100%);
  display: inline-flex; flex-direction: column; align-items: center; border: 0; background: none; padding: 0; color: var(--ink);
}
.marker__tag { background: var(--white); border: 1px solid var(--line-strong); border-radius: 3px; padding: 4px 8px; font-size: 0.76rem; font-weight: 650; white-space: nowrap; font-variation-settings: "wdth" 92; transition: background-color 0.2s, color 0.2s; }
.marker__stem { width: 1px; height: 18px; background: var(--ink); }
.marker__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--forest); box-shadow: 0 0 0 4px rgba(31, 59, 45, 0.18); }
.marker:hover .marker__tag, .marker:focus-visible .marker__tag { background: var(--forest); color: var(--forest-ink); border-color: var(--forest); }
.plan-meta { position: absolute; left: 16px; bottom: 64px; display: flex; gap: 14px; align-items: flex-end; pointer-events: none; }
.north { width: 38px; height: 38px; color: var(--ink); }
.scalebar { display: grid; gap: 4px; font-size: 0.7rem; font-variation-settings: "wdth" 80; font-weight: 600; color: var(--ink); }
.scalebar__bar { height: 6px; border: 1px solid var(--ink); background: linear-gradient(90deg, var(--ink) 0 25%, transparent 25% 50%, var(--ink) 50% 75%, transparent 75%); }
.scalebar__nums { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }

/* info panel (explore + exploded) */
.info {
  position: absolute; right: 16px; top: 76px; bottom: 76px; z-index: 5; width: min(360px, calc(100% - 32px));
  background: var(--white); border: 1px solid var(--line); border-radius: 8px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 18px 50px -24px rgba(27, 29, 30, 0.35);
}
.info__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 16px 12px; border-bottom: 1px solid var(--line); }
.info__title { font-size: 1.3rem; font-variation-settings: "wdth" 110; font-weight: 750; line-height: 1.12; margin-top: 4px; }
.info__body { padding: 14px 16px 18px; overflow-y: auto; display: grid; gap: 14px; align-content: start; }
.info__desc { color: var(--ink-2); font-size: 0.95rem; }
.specs { display: grid; margin: 0; border-top: 1px solid var(--line); }
.specs div { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.specs dt { font-size: 0.8rem; color: var(--muted); }
.specs dd { margin: 0; font-size: 0.88rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.info__options { display: grid; gap: 8px; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 10px 4px 4px;
  border: 1px solid var(--line-strong); border-radius: 5px; background: var(--white); font-size: 0.84rem; text-align: left;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.swatch__chip { width: 30px; height: 30px; border-radius: 3px; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
.swatch:hover { border-color: var(--ink); }
.swatch[aria-checked="true"] { border-color: var(--forest); box-shadow: 0 0 0 2px var(--forest); }
.info__note { font-size: 0.78rem; color: var(--muted); padding-top: 10px; border-top: 1px dashed var(--line-strong); }
.info .action-link { justify-self: start; }
@media (max-width: 899px) {
  .info { top: auto; bottom: 8px; left: 8px; right: 8px; width: auto; max-height: 52%; }
  .room-list { display: none; }
  .room-indicator { left: 8px; right: 66px; transform: none; bottom: 12px; justify-content: space-between; max-width: none; }
  .room-indicator__text { min-width: 0; flex: 1; }
  .room-indicator strong { font-size: 0.92rem; }
  .explore-stage[data-view="interior"] .stage__hint { display: none; }
  .plan-meta { bottom: 64px; }
}
.room-chips { display: none; }
@media (max-width: 899px) {
  .room-chips {
    display: flex; gap: 6px; overflow-x: auto; padding: 10px var(--gutter-r) 4px var(--gutter); scrollbar-width: none;
  }
  .room-chips::-webkit-scrollbar { display: none; }
  .room-chips button { flex-shrink: 0; min-height: 40px; padding: 0 12px; border-radius: 20px; border: 1px solid var(--line-strong); background: var(--white); font-size: 0.86rem; }
  .room-chips button[aria-current="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
}

/* ---------------- exploded ---------------- */
.on-dark { background: var(--graphite); color: var(--on-dark); }
.on-dark .label, .on-dark .note { color: var(--on-dark-muted); }
.on-dark .lead { color: var(--on-dark-muted); }
.exploded-grid { display: grid; gap: 24px; }
.exploded-stage { height: clamp(520px, 80svh, 840px); background: var(--graphite); border-radius: 0; border: 1px solid var(--line-dark); }
.layers { list-style: none; margin: 0; padding: 0; display: grid; border-top: 1px solid var(--line-dark); counter-reset: layer; }
.layers li { border-bottom: 1px solid var(--line-dark); }
.layers button {
  width: 100%; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; text-align: left;
  background: none; border: 0; color: var(--on-dark-muted); padding: 11px 4px; font-size: 0.95rem;
  transition: color 0.2s, background-color 0.2s;
}
.layers button .num { font-size: 0.78rem; font-variation-settings: "wdth" 80; font-weight: 600; color: var(--on-dark-muted); }
.layers button:hover { color: var(--on-dark); background: rgba(255, 255, 255, 0.04); }
.layers button[aria-current="true"] { color: var(--on-dark); background: rgba(169, 217, 182, 0.1); }
.layers button[aria-current="true"] .num { color: #A9D9B6; }
.layers button .tick { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--line-dark); }
.layers button[aria-current="true"] .tick { background: #A9D9B6; border-color: #A9D9B6; }
.explode-ctrl { position: absolute; right: 16px; top: 16px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.explode-cta {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 4;
}
.exploded-stage .info { background: #34373A; color: var(--on-dark); border-color: var(--line-dark); }
.exploded-stage .info__head { border-color: var(--line-dark); }
.exploded-stage .info__desc { color: var(--on-dark-muted); }
.exploded-stage .specs, .exploded-stage .specs div { border-color: var(--line-dark); }
.exploded-stage .specs dt { color: var(--on-dark-muted); }
.exploded-stage .info__note { color: var(--on-dark-muted); border-color: var(--line-dark); }
.exploded-stage .stage__hint { background: rgba(43, 45, 47, 0.85); color: var(--on-dark-muted); }
.exploded-stage .icon-btn { background: rgba(43, 45, 47, 0.85); color: var(--on-dark); border-color: var(--line-dark); }
.exploded-stage .icon-btn:hover { background: var(--on-dark); color: var(--graphite); }
.func { padding: 10px 12px; border-radius: 5px; background: rgba(169, 217, 182, 0.1); font-size: 0.9rem; }
.func strong { display: block; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; font-variation-settings: "wdth" 78; color: #A9D9B6; margin-bottom: 2px; }
.section-svg { width: 100%; height: auto; display: block; }
.section-svg .ground { stroke: var(--on-dark-muted); stroke-width: 1; stroke-dasharray: 3 3; }
.section-svg .layer-shape { fill: rgba(236, 234, 228, 0.08); stroke: rgba(236, 234, 228, 0.42); stroke-width: 1; }
.section-svg .layer-shape path[fill="none"], .section-svg .layer-shape line { fill: none; stroke: rgba(236, 234, 228, 0.42); }
.section-svg .layer-shape.is-active { fill: #A9D9B6; stroke: #A9D9B6; }
.section-svg .layer-shape.is-active path[fill="none"], .section-svg .layer-shape.is-active line { stroke: #A9D9B6; }
.exploded-aside { min-width: 0; }
@media (min-width: 1000px) {
  .exploded-grid { grid-template-columns: minmax(250px, 0.36fr) minmax(0, 1.64fr); align-items: start; gap: 32px; }
  .exploded-aside { position: sticky; top: calc(var(--nav-h) + 24px); order: 0; }
}
@media (max-width: 999px) {
  .exploded-aside { order: 2; }
}
@media (max-width: 899px) {
  .exploded-stage { --cv: min(72svh, 580px); height: auto; min-height: var(--cv); padding-top: var(--cv); }
  .exploded-stage .stage__canvas, .exploded-stage .stage__poster, .exploded-stage .stage__fallback, .exploded-stage .stage__hud { bottom: auto; height: var(--cv); }
  .exploded-stage .info { position: relative; inset: auto; width: auto; max-height: none; border-radius: 0; border-width: 1px 0 0; box-shadow: none; }
  .explode-ctrl { left: 12px; right: 12px; justify-content: flex-start; }
  .no-webgl .exploded-stage .webgl-note { top: calc(var(--cv) - 90px); bottom: auto; }
}

/* ---------------- configurator ---------------- */
.config-grid { display: grid; gap: 0; border: 1px solid var(--line); background: var(--white); }
.config-stage { height: clamp(440px, 64svh, 700px); }
.config-panel { padding: 20px; display: grid; gap: 22px; align-content: start; border-top: 1px solid var(--line); }
.opt-group { display: grid; gap: 10px; }
.opt-group__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.opt-group__head h3 { font-size: 1rem; font-variation-settings: "wdth" 108; font-weight: 700; }
.opt-group__head span { font-size: 0.84rem; color: var(--muted); }
.opt-group.is-flash { animation: flash 1.2s var(--ease); }
@keyframes flash { 0% { background: rgba(31, 59, 45, 0.12); } 100% { background: transparent; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 5px 12px 5px 5px; border-radius: 6px;
  border: 1px solid var(--line-strong); background: var(--white); font-size: 0.86rem; text-align: left;
  transition: border-color 0.2s, box-shadow 0.25s var(--ease);
}
.chip:hover { border-color: var(--ink); }
.chip[aria-checked="true"] { border-color: var(--forest); box-shadow: 0 0 0 2px var(--forest); }
.chip__swatch { width: 32px; height: 32px; border-radius: 4px; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); position: relative; overflow: hidden; }
.chip__swatch i { position: absolute; right: 0; top: 0; bottom: 0; width: 45%; }
.summary { display: grid; margin: 0; border-top: 1px solid var(--line); }
.summary div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 0.88rem; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 650; text-align: right; }
.config-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.config-tabs { position: absolute; left: 16px; top: 16px; }
@media (min-width: 1000px) {
  .config-grid { grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.75fr); }
  .config-stage { height: clamp(560px, 78svh, 820px); }
  .config-panel { border-top: 0; border-left: 1px solid var(--line); max-height: clamp(560px, 78svh, 820px); overflow-y: auto; padding: 24px; }
}

/* modal */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; }
.modal__scrim { position: absolute; inset: 0; background: rgba(27, 29, 30, 0.55); }
.modal__card {
  position: relative; width: min(760px, 100%); max-height: calc(100svh - 32px); overflow-y: auto;
  background: var(--paper); border-radius: 10px; padding: 20px; display: grid; gap: 16px;
}
.modal__card img { width: 100%; border-radius: 6px; border: 1px solid var(--line); background: var(--paper-2); }
.modal__head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.codebox { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.codebox input { flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--white); font-variant-numeric: tabular-nums; }
