/* PlyView home — the "showroom at night".
   Loaded after styles.css and showroom.css on the home page only
   (html.home): the header over the stage, the opening scene and the gallery.
   The shared dark theme lives in showroom.css. */

/* ── header over the stage ──────────────────────────────────────────── */
html.home .hdr { position: fixed; inset: 0 0 auto; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; transition: background .3s ease, border-color .25s ease; }
html.home .hdr[data-stuck="1"] { background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2); }

/* ── the opening: a chip that becomes the room ──────────────────────── */
.open { position: relative; height: 470svh; background: var(--bg); }
.open__pin { position: sticky; top: 0; height: 100svh; min-height: 560px; overflow: hidden; }
.open__glow { position: absolute; inset: 0; background: radial-gradient(60vmax 46vmax at var(--gx, 64%) 52%, color-mix(in srgb, var(--cta) 20%, transparent), transparent 62%); opacity: var(--intro, 1); pointer-events: none; }

/* The window. JS drives the four insets from "chip" to "whole viewport". */
.open__win { position: absolute; inset: 0; clip-path: inset(var(--wt, 0px) var(--wr, 0px) var(--wb, 0px) var(--wl, 0px) round var(--wrad, 0px)); }
.stage { position: absolute; left: 50%; top: 50%; width: max(100vw, calc(100svh * 16 / 9), calc(560px * 16 / 9)); aspect-ratio: 16 / 9; transform: translate(calc(-50% + var(--fx, 0px)), -50%); }
.stage > * { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage__seq { display: block; }
/* The chip's patch of frame 0, rendered on its own at full density: the film
   is 1280 px wide, far too coarse for a window this small. Same picture, so
   it hands over to the film without a seam as the window starts to grow. */
.stage > .stage__sharp { inset: auto; left: 52.9948%; top: 26.0185%; width: 27.9948%; height: 53.9815%; opacity: var(--sharp, 1); }
.stage__img { object-fit: cover; opacity: 0; transition: opacity .35s ease; }
.stage__img[data-on="1"] { opacity: 1; }
.stage__img.stage__night { opacity: var(--night, 0); transition: none; }
.stage__w { position: absolute; inset: auto; left: 43.5%; top: 20.4444%; width: 26.1667%; height: 53.8519%; }
.stage__w img { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage__w img.is-in { animation: door .8s cubic-bezier(.6, 0, .2, 1) both; }
@keyframes door { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.stage__w--night { opacity: var(--night, 0); }
.live { border: 0; opacity: 0; transition: opacity .6s ease; background: transparent; }
.live[data-on="1"] { opacity: 1; }

.open__scrim { position: absolute; inset: 0; pointer-events: none; opacity: var(--hero, 0);
  background:
    linear-gradient(90deg, rgba(10, 8, 6, 0.84) 0%, rgba(10, 8, 6, 0.55) 26%, rgba(10, 8, 6, 0) 50%),
    linear-gradient(0deg, rgba(10, 8, 6, 0.55) 0%, rgba(10, 8, 6, 0) 26%),
    linear-gradient(180deg, rgba(10, 8, 6, 0.5) 0%, rgba(10, 8, 6, 0) 15%); }
html.home[data-live="1"] .open__scrim { opacity: calc(var(--hero, 0) * 0.55); }
/* While the room is live the copy must not swallow drags meant for it. */
html.home[data-live="1"] .open .hero { pointer-events: none; }
html.home[data-live="1"] .open .hero a { pointer-events: auto; }

/* chip dressing: shadow, punched hole, sticker — fades as the window grows */
.chipfx { position: absolute; left: var(--cx); top: var(--cy); width: var(--cw); height: var(--ch); pointer-events: none; opacity: var(--chip, 1); }
.chipfx--shadow { border-radius: 14px; box-shadow: 0 40px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(243, 237, 226, 0.14); }
.chipfx__hole { position: absolute; left: 50%; top: 9%; width: 11%; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; background: var(--bg); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.9), 0 1px 0 rgba(255, 255, 255, 0.18); }
.chipfx__label { position: absolute; left: 8%; right: 8%; bottom: 7%; background: #f3ede2; color: #17110b; border-radius: 4px; padding: 7px 9px 8px; font-size: 0.6rem; line-height: 1.35; letter-spacing: 0.04em; }
.chipfx__label b { display: block; font-family: var(--display); font-size: 0.78rem; letter-spacing: 0; }
.chipfx__size { position: absolute; left: calc(100% + 14px); top: 50%; transform: translateY(-50%); writing-mode: vertical-rl; font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.chipfx__size::before { content: ""; display: inline-block; width: 1px; height: 26px; background: var(--ink-3); margin-bottom: 8px; vertical-align: middle; }

/* intro copy beside the chip */
.open__intro { position: absolute; left: var(--gut); top: 50%; width: min(520px, 44vw); transform: translateY(calc(-50% + (1 - var(--intro, 1)) * -40px)); opacity: var(--intro, 1); pointer-events: none; }
.open__line { font-family: var(--display); font-weight: 600; font-size: clamp(2.4rem, 5.2vw, 4.8rem); letter-spacing: -0.035em; line-height: 0.98; text-wrap: balance; font-variation-settings: "opsz" 96; }
.open__line em { font-style: normal; }
.open__sub { margin-top: 20px; color: var(--ink-2); font-size: clamp(1rem, 1.5vw, 1.18rem); max-width: 34ch; }
.open__cue { margin-top: 34px; display: inline-flex; align-items: center; gap: 12px; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); }
.open__cue i { width: 22px; height: 36px; border: 1.5px solid currentColor; border-radius: 12px; position: relative; flex: none; }
.open__cue i::after { content: ""; position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: currentColor; animation: cue 1.6s ease-in-out infinite; }
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(12px); opacity: 0; } 100% { transform: translateY(0); opacity: 0; } }

.open__mid { position: absolute; inset: auto 0 12svh; text-align: center; font-family: var(--display); font-weight: 600; font-size: clamp(1.6rem, 3.6vw, 3rem); letter-spacing: -0.03em; color: #fff; text-shadow: 0 2px 30px rgba(0, 0, 0, 0.75); opacity: var(--mid, 0); transform: translateY(calc((1 - var(--mid, 0)) * 18px)); pointer-events: none; padding-inline: var(--gut); }

/* hero copy, once the room has arrived */
.open .hero { position: absolute; display: block; left: var(--gut); bottom: clamp(40px, 9svh, 96px); width: min(560px, 46vw); max-width: none; margin: 0; padding: 0; background: none; opacity: var(--hero, 0); transform: translateY(calc((1 - var(--hero, 0)) * 26px)); }
.open .hero[data-off="1"], .tray[data-off="1"], .clock[data-off="1"] { visibility: hidden; }
.open .hero h1 { font-size: clamp(2.5rem, 4.9vw, 4.7rem); max-width: 11ch; color: #fff; }
.open .hero .eyebrow { color: var(--accent); }
.open .hero .lede { color: #ded5c6; max-width: 46ch; margin-top: 20px; font-size: clamp(0.98rem, 1.25vw, 1.1rem); }
.open .hero__cta { margin-top: 28px; }
.open .hero .btn--ghost { background: rgba(12, 10, 8, 0.45); border-color: rgba(243, 237, 226, 0.34); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.open .hero .btn--ghost:hover { background: rgba(12, 10, 8, 0.7); border-color: #fff; }
.open .hero__note { color: #b9af9f; }

/* the shade tray */
.tray { position: absolute; right: var(--gut); bottom: clamp(86px, 12svh, 104px); width: min(440px, 40vw); padding: 16px 18px 18px; border-radius: 18px; background: rgba(14, 11, 9, 0.66); border: 1px solid rgba(243, 237, 226, 0.14); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); box-shadow: var(--shadow-lg); opacity: var(--hero, 0); transform: translateY(calc((1 - var(--hero, 0)) * 40px)); }
.tray__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tray__label { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); }
.tray__now { font-size: 0.8rem; color: var(--ink-2); text-align: right; }
.tray__now b { color: var(--ink); font-weight: 600; }
.tray__chips { display: grid; grid-template-columns: repeat(6, 1fr); gap: 9px; margin-top: 14px; }
.chip { position: relative; padding: 0; border: 0; background: none; cursor: pointer; aspect-ratio: 22 / 29; border-radius: 7px; overflow: visible; transition: transform .25s cubic-bezier(.3, 1.4, .5, 1); }
.chip img { width: 100%; height: 100%; object-fit: cover; border-radius: 7px; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.12); }
.chip::before { content: ""; position: absolute; z-index: 1; left: 50%; top: 8%; width: 14%; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; background: #0e0b09; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.9), 0 1px 0 rgba(255, 255, 255, 0.2); }
.chip::after { content: ""; position: absolute; inset: -4px; border-radius: 10px; border: 2px solid var(--cta); opacity: 0; transition: opacity .2s; }
.chip:hover { transform: translateY(-5px) rotate(-2deg); }
.chip[aria-pressed="true"] { transform: translateY(-7px); }
.chip[aria-pressed="true"]::after { opacity: 1; }
.chip:focus-visible { outline: none; }
.chip:focus-visible::after { opacity: 1; border-color: #fff; }
.tray__foot { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(243, 237, 226, 0.12); }
.livebtn { display: inline-flex; align-items: center; gap: 10px; font: 600 0.86rem var(--body); color: var(--ink); background: none; border: 1px solid var(--line-2); border-radius: 999px; padding: 10px 16px 10px 12px; cursor: pointer; transition: border-color .15s, background .15s; white-space: nowrap; }
.livebtn:hover { border-color: var(--cta); background: rgba(243, 237, 226, 0.06); }
.livebtn i { width: 10px; height: 10px; border-radius: 50%; background: var(--cta); box-shadow: 0 0 0 0 color-mix(in srgb, var(--cta) 70%, transparent); animation: pulse 1.8s ease-out infinite; flex: none; }
.livebtn[data-state="loading"] i { animation: none; border: 2px solid var(--cta); border-right-color: transparent; background: none; width: 14px; height: 14px; animation: spin .8s linear infinite; }
.livebtn[data-state="on"] i { animation: none; background: #fff; border-radius: 2px; }
@keyframes pulse { to { box-shadow: 0 0 0 10px transparent; } }
.tray__hint { font-size: 0.74rem; color: var(--ink-3); line-height: 1.35; }

/* time of day, top right of the stage */
.clock { position: absolute; right: var(--gut); top: 92px; display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px 8px 10px; border-radius: 999px; background: rgba(14, 11, 9, 0.6); border: 1px solid rgba(243, 237, 226, 0.14); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font-size: 0.76rem; font-weight: 600; letter-spacing: 0.04em; color: var(--ink); opacity: var(--hero, 0); }
.clock__dial { position: relative; width: 22px; height: 22px; border-radius: 50%; background: color-mix(in srgb, #ffd27a, #b9c6ff calc(var(--night, 0) * 100%)); box-shadow: 0 0 calc(14px - var(--night, 0) * 8px) color-mix(in srgb, #ffb84d, #8fa2ff calc(var(--night, 0) * 100%)); overflow: hidden; }
.clock__dial::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #17130f; transform: translate(calc(100% - var(--night, 0) * 62%), calc(-100% + var(--night, 0) * 78%)); }
.clock__txt { min-width: 13ch; }

.open__skip { position: absolute; left: var(--gut); bottom: 26px; font-size: 0.74rem; color: var(--ink-3); letter-spacing: 0.08em; text-decoration: underline; text-underline-offset: 3px; opacity: var(--intro, 1); }
.open__skip:hover { color: var(--ink); }

@media (max-width: 860px) {
  .open__intro { top: 96px; transform: translateY(calc((1 - var(--intro, 1)) * -30px)); width: auto; right: var(--gut); }
  .open__line { font-size: clamp(2.1rem, 9.6vw, 3.2rem); }
  .open__sub { margin-top: 12px; font-size: 0.98rem; }
  .open__cue { position: absolute; top: calc(100svh - 96px - 140px); margin: 0; }
  .open__skip { left: auto; right: var(--gut); }
  .chipfx__size { display: none; }
  .open__scrim { background: linear-gradient(180deg, rgba(10, 8, 6, 0.9) 0%, rgba(10, 8, 6, 0.72) 30%, rgba(10, 8, 6, 0) 52%), linear-gradient(0deg, rgba(10, 8, 6, 0.86) 0%, rgba(10, 8, 6, 0) 36%); }
  .open .hero { left: var(--gut); right: var(--gut); top: 88px; bottom: auto; width: auto; }
  .open .hero h1 { font-size: clamp(2rem, 8.6vw, 3rem); max-width: 13ch; }
  .open .hero .eyebrow { display: none; }
  .open .hero .lede { margin-top: 12px; font-size: 0.92rem; line-height: 1.5; }
  .open .hero__cta { margin-top: 16px; gap: 8px; }
  .open .hero__cta .btn { padding: 12px 18px; font-size: 0.88rem; }
  .open .hero__note { display: none; }
  .tray { left: 12px; right: 12px; bottom: 84px; width: auto; padding: 12px 14px 14px; }
  .tray__chips { gap: 7px; margin-top: 10px; }
  .tray__foot { margin-top: 12px; padding-top: 10px; }
  .tray__hint { display: none; }
  .clock { display: none; }
}
@media (max-height: 640px) and (min-width: 861px) {
  .open .hero .lede { display: none; }
  .open .hero { bottom: 30px; }
}

/* No scripting, or reduced motion: the room, the headline and the tray, still. */
html:not(.js) .open, html.home[data-static="1"] .open { height: auto; }
html:not(.js) .open__pin, html.home[data-static="1"] .open__pin { position: relative; }
html:not(.js) .open__win, html.home[data-static="1"] .open__win { clip-path: none; }
html:not(.js) .stage__seq, html:not(.js) .stage__sharp, html:not(.js) .open__intro, html:not(.js) .chipfx, html:not(.js) .open__mid, html:not(.js) .open__skip, html:not(.js) .open__glow, html:not(.js) .livebtn,
html.home[data-static="1"] .stage__seq, html.home[data-static="1"] .stage__sharp, html.home[data-static="1"] .open__intro, html.home[data-static="1"] .chipfx, html.home[data-static="1"] .open__mid, html.home[data-static="1"] .open__skip, html.home[data-static="1"] .open__glow { display: none; }
html:not(.js) .stage__day { opacity: 1; }
html:not(.js) .open, html.home[data-static="1"] .open { --hero: 1; --night: 0; }

/* ── gallery: every room, morning turning to evening as it scrolls by ── */
.mosaic { display: grid; gap: 14px; grid-template-columns: repeat(6, 1fr); }
.mosaic .shot { --n: 0; grid-column: span 3; aspect-ratio: 16 / 10; border: 0; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.mosaic .shot--lead { grid-column: span 6; aspect-ratio: 21 / 10; }
@media (min-width: 900px) {
  .mosaic .shot { grid-column: span 2; }
  .mosaic .shot--lead { grid-column: span 4; grid-row: span 2; aspect-ratio: auto; }
  .mosaic .shot--wide { grid-column: span 3; aspect-ratio: 16 / 9; }
}
.mosaic .shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mosaic .shot__night { opacity: var(--n); }
.mosaic .shot__tag { display: inline-flex; align-items: center; gap: 8px; }
.mosaic .shot__tag::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: color-mix(in srgb, #ffd27a, #aab8ff calc(var(--n) * 100%)); box-shadow: 0 0 8px color-mix(in srgb, #ffb84d, #8fa2ff calc(var(--n) * 100%)); }
.mosaic .shot__time { position: absolute; right: 14px; bottom: 14px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; color: var(--hero-ink); background: rgba(22, 17, 13, 0.6); border-radius: 999px; padding: 5px 12px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

@media (prefers-reduced-motion: reduce) {
  .open__cue i::after, .livebtn i { animation: none; }
  .stage__w img.is-in { animation: none; }
}
