/*
 * Baseline shared by every concept: reset, lightbox, form skeleton, floor plan,
 * reveal. Concepts theme it with these variables on :root:
 *   --bg --fg --muted --line --accent --accent-fg --radius --font-body
 *   --lb-bg  --fp-room --fp-room-hover --fp-active --fp-line --fp-furn --fp-label --fp-shared
 */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; hanging-punctuation: first last; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
body { margin: 0; background: var(--bg, #fff); color: var(--fg, #111); font-family: var(--font-body, system-ui, sans-serif); line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: clip; }
img { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--accent, #2563eb); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html.lb-open { overflow: hidden; }

.photo-btn { all: unset; display: block; width: 100%; height: 100%; cursor: zoom-in; }
.photo-btn:focus-visible { outline: 2px solid var(--accent, #2563eb); outline-offset: 3px; }
.photo-btn img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- reveal ---------- */
[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0s); }
[data-reveal].is-in { opacity: 1; transform: none; }
html:not(.is-ready) [data-reveal] { opacity: 1; transform: none; }

/* ---------- language switch ---------- */
[data-lang-switch] { display: inline-flex; gap: 2px; }
[data-lang-switch] :is(button, a) { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: inherit; border: 0; background: transparent; padding: .35em .6em; border-radius: 999px; font-size: .8rem; font-weight: 600; letter-spacing: .04em; opacity: .6; transition: opacity .2s, background .2s; }
[data-lang-switch] .is-active { opacity: 1; background: color-mix(in oklab, currentColor 12%, transparent); }

/* ---------- lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 1000; background: var(--lb-bg, rgba(10,10,10,.96)); color: #fff; opacity: 0; transition: opacity .25s; }
.lb.is-open { opacity: var(--lb-fade, 1); }
.lb-track { position: absolute; inset: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior: contain; scrollbar-width: none; transition: transform .25s; }
.lb-track::-webkit-scrollbar { display: none; }
.lb-slide { flex: 0 0 100%; height: 100%; margin: 0; display: grid; place-items: center; scroll-snap-align: center; scroll-snap-stop: always; padding: 68px 16px 76px; overflow: hidden; }
/* Fit the photo inside the viewport (minus the top bar and caption), never larger. */
.lb-slide img { width: auto; height: auto; max-width: min(100%, 1600px); max-height: calc(100dvh - 144px); object-fit: contain; border-radius: 4px; transform: scale(.96); transition: transform .4s cubic-bezier(.2,.7,.2,1); }
@media (min-width: 900px) { .lb-slide { padding-inline: 88px; } }
@media (max-width: 599px) { .lb-slide { padding-inline: 0; } .lb-slide img { border-radius: 0; } }
.lb.is-open .lb-slide img { transform: none; }
.lb-bar { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: max(12px, env(safe-area-inset-top)) 16px 12px; }
.lb-count { font-size: .85rem; letter-spacing: .08em; font-variant-numeric: tabular-nums; opacity: .8; }
.lb button { border: 0; background: rgba(255,255,255,.12); color: #fff; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: background .2s; }
.lb button:hover { background: rgba(255,255,255,.24); }
.lb svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lb-nav { position: absolute; top: 50%; translate: 0 -50%; }
.lb-prev { left: 16px; } .lb-next { right: 16px; }
@media (hover: none) { .lb-nav { display: none !important; } }
.lb-cap { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 16px 20px max(20px, env(safe-area-inset-bottom)); text-align: center; font-size: .9rem; opacity: .8; }

/* ---------- floor plan ---------- */
.fp { width: 100%; height: auto; display: block; overflow: visible; }
.fp-room { fill: var(--fp-room, #f4f1ec); stroke: none; cursor: pointer; transition: fill .3s; outline: none; }
.fp-room.fp-shared { fill: var(--fp-shared, #e9e6e0); }
.fp-room:hover, .fp-room:focus-visible { fill: var(--fp-room-hover, #ebe4d8); }
.fp-room.is-active { fill: var(--fp-active, #d9c6a5); }
.fp-walls { fill: none; stroke: var(--fp-line, #222); stroke-width: 14; pointer-events: none; }
.fp-win { stroke: var(--fp-win, #7fb2d8); stroke-width: 10; stroke-dasharray: 60 16; fill: none; pointer-events: none; }
.fp-furn { fill: none; stroke: var(--fp-furn, #b9b2a6); stroke-width: 4; pointer-events: none; }
.fp-furn .fp-cab { fill: var(--fp-furn, #b9b2a6); fill-opacity: .35; }
.fp-furn .fp-core { stroke-dasharray: 10 10; opacity: .6; }
.fp-labels text { fill: var(--fp-label, #222); font-size: 38px; font-weight: 600; text-anchor: middle; pointer-events: none; font-family: var(--font-body, system-ui); }
[data-room-panel] .rp-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; margin-top: 12px; }
[data-room-panel] .rp-photos .photo-btn { aspect-ratio: 4/3; border-radius: calc(var(--radius, 12px) * .6); overflow: hidden; }
.rp-anim { animation: rp-in .5s cubic-bezier(.2,.7,.2,1); }
@keyframes rp-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- contact form skeleton ---------- */
.cf { display: grid; gap: 16px; }
.cf-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .cf-grid { grid-template-columns: 1fr 1fr; } .cf-wide { grid-column: 1 / -1; } }
.cf-field { display: grid; gap: 6px; font-size: .85rem; font-weight: 500; }
.cf-field input, .cf-field select, .cf-field textarea { width: 100%; padding: 14px 16px; border: 1px solid var(--line, #ddd); border-radius: var(--radius, 12px); background: var(--field-bg, transparent); font-size: 16px; transition: border-color .2s, box-shadow .2s; }
.cf-field input:focus, .cf-field select:focus, .cf-field textarea:focus { outline: none; border-color: var(--accent, #2563eb); box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent, #2563eb) 18%, transparent); }
.cf-field textarea { resize: vertical; min-height: 110px; }
.cf-check { display: flex; gap: 10px; align-items: center; font-size: .95rem; }
.cf-check input { width: 20px; height: 20px; accent-color: var(--accent, #2563eb); }
.cf-hp { position: absolute; left: -9999px; }
.cf-submit { justify-self: start; border: 0; padding: 16px 28px; border-radius: 999px; background: var(--accent, #111); color: var(--accent-fg, #fff); font-weight: 600; font-size: 1rem; transition: transform .2s, opacity .2s; }
.cf-submit:active { transform: scale(.97); }
.is-sending .cf-submit { opacity: .6; pointer-events: none; }
.cf-status { margin: 0; min-height: 1.4em; font-size: .95rem; }
.cf-status[data-state="error"] { color: #c0392b; }
.cf-privacy { margin: 0; font-size: .8rem; opacity: .6; }
@media (max-width: 639px) { .cf-submit { justify-self: stretch; } }
