.home-experience {
  --experience-gold: #e0c393;
  padding-block: clamp(36px, 4vw, 56px);
  background: var(--ivory, #f7f5ef);
  color: var(--ink, #0c0e0d);
}
.home-experience-heading {
  margin-bottom: 25px;
  text-align: center;
}
.home-experience-heading .section-kicker { margin: 0 0 8px; color: #8d7041; }
.home-experience-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 3.5vw, 3.2rem);
  font-weight: 600;
  letter-spacing: -.045em;
  line-height: 1.08;
}
.home-experience-heading > p:last-child { margin: 10px 0 0; color: var(--muted, #595d56); }
.home-experience-layout {
  display: grid;
  grid-template-columns: minmax(0, 74fr) minmax(265px, 26fr);
  align-items: stretch;
  overflow: hidden;
  background: #131616;
}
/* Keep the photo, device overlays and glass mask in the same coordinate space. */
.home-experience-room { position: relative; isolation: isolate; overflow: hidden; aspect-ratio: 1672 / 941; }
.home-experience-image { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.home-experience-devices, .room-frost { position: absolute; inset: 0; width: 100%; height: 100%; }
.home-experience-devices { overflow: hidden; }
.home-experience-devices [data-room-device] { cursor: pointer; }
.room-frost {
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(120deg, #eeeae17a, #dededb49 56%, #d2d0c571);
  backdrop-filter: blur(18px) saturate(.48);
  transition: opacity .65s ease;
}
.room-light, .room-tv-picture, .room-ac-display, .room-airflow, .room-chandelier-spill { opacity: 0; transition: opacity .42s ease; }
.room-curtain {
  transform-box: view-box;
  transition: transform 1.4s cubic-bezier(.55,.12,.25,1);
}
.room-curtain-left { transform-origin: 454px 0; transform: scaleX(.16); }
.room-curtain-right { transform-origin: 1157px 0; transform: scaleX(.16); }
.curtains-on .room-curtain { transform: scaleX(1); }
.glass-on .room-frost, .tv-on .room-tv-picture, .air-on .room-ac-display,
.air-on .room-airflow, .chandelier-on .room-chandelier-spill { opacity: 1; }
.lighting-on .room-light { opacity: var(--room-focus-brightness, .75); }
.room-cove, .room-downlights, .room-qube-led, .room-chandelier-emitter {
  transition: stroke .42s ease, fill .42s ease, filter .42s ease, opacity .42s ease;
}
.room-focus-emitter { opacity: 0; transition: opacity .42s ease; }
.lighting-on .room-focus-emitter { opacity: var(--room-focus-brightness, .75); }
.chandelier-on .room-chandelier-emitter { stroke: #ffedae; filter: drop-shadow(0 0 8px #ffb960); }
.room-fan-rotor { animation: room-fan-turn .48s linear infinite paused; }
.fan-on .room-fan-rotor { animation-play-state: running; }
@keyframes room-fan-turn { to { transform: rotate(360deg); } }
.tv-on .room-tv-led { fill: #73b79e; }
.room-ac-display { fill: #fff; font: 700 21px system-ui, sans-serif; filter: drop-shadow(0 0 2px #d8f1ff); }
.room-ac-louver { transition: stroke .42s ease; }
.air-on .room-ac-louver { stroke: #77766e; }
.room-airflow path { stroke-dasharray: 7 10; }
.air-on .room-airflow path { animation: room-air-drift 1.8s linear infinite; }
.room-airflow path:nth-child(even) { animation-delay: -.7s; }
@keyframes room-air-drift { to { stroke-dashoffset: -34; } }
.qube-on .room-qube-led { fill: #68ed81; filter: drop-shadow(0 0 5px #8bff83); }

.home-experience-view {
  position: relative;
  align-self: center;
  min-width: 0;
}
.experience-annotations {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}
.experience-annotations path {
  stroke: #fff0cd;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.experience-annotations rect { fill: #1c1915e8; stroke: #ebc991a8; stroke-width: 1.2; }
.experience-annotations text {
  fill: #fff4df;
  font: 600 21px system-ui, sans-serif;
  text-anchor: middle;
  dominant-baseline: middle;
}
.experience-fan-running, .experience-callout {
  opacity: 0;
  transition: opacity .2s ease;
}
.home-experience-room.fan-on + .experience-annotations .experience-fan-running,
.experience-callout.is-visible { opacity: 1; }

.experience-controls-panel {
  --experience-gold: #e4c291;
  align-self: stretch;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: clamp(16px, 2.1vw, 37px) clamp(14px, 2vw, 38px);
  border-left: 1px solid #c6a47b55;
  background: radial-gradient(ellipse at 84% 3%, #3c3328, transparent 59%), #201e1a;
  color: #f8f0e3;
}
.experience-app-header {
  margin-bottom: clamp(15px, 1.5vw, 24px);
}
.experience-app-header .section-kicker {
  margin: 0 0 7px;
  color: var(--experience-gold);
  font-size: .63rem;
  letter-spacing: .19em;
}
.experience-app-header h3 {
  margin: 0;
  color: inherit;
  font-size: clamp(1.25rem, 2vw, 2rem);
  font-weight: 590;
  letter-spacing: -.045em;
}
.experience-app-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(6px, .7vw, 11px);
}
.experience-app-device {
  display: grid;
  min-width: 0;
  justify-items: start;
  grid-template-rows: auto 1fr auto;
  gap: 6px;
  padding: clamp(8px, .95vw, 15px);
  border: 1px solid #665a48;
  border-radius: 7px;
  background: #292620;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}
.experience-app-device:hover { border-color: #ab906d; }
.experience-app-device[aria-pressed="true"] { border-color: #cba374; background: #3e3224; }
.experience-app-ring {
  grid-row: 1;
  width: clamp(18px, 1.55vw, 26px);
  color: #e2bd8a;
}
.experience-app-ring svg { display: block; width: 100%; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; }
.experience-app-device-name { grid-row: 2; font-size: clamp(.67rem, .77vw, .86rem); font-weight: 570; line-height: 1.22; }
.home-experience-state { grid-row: 3; color: #c9c0b1; font-size: .63rem; letter-spacing: .025em; line-height: 1.1; }
.experience-app-device[aria-pressed="true"] .home-experience-state { color: var(--experience-gold); }
.experience-app-dimming {
  display: grid;
  gap: 4px;
  margin-top: clamp(13px, 1.3vw, 22px);
  padding: 8px 1px 3px;
}
.experience-app-dimming label { display: flex; justify-content: space-between; gap: 8px; font-size: .78rem; font-weight: 550; }
.experience-app-dimming output { color: var(--experience-gold); font-variant-numeric: tabular-nums; }
.experience-app-dimming input {
  --app-level: 75%;
  appearance: none;
  width: 100%;
  height: 6px;
  margin: 8px 0;
  border-radius: 9px;
  background: linear-gradient(to right, #e9c794, #bc8b54 var(--app-level), #594a3a var(--app-level));
  cursor: pointer;
}
.experience-app-dimming input::-webkit-slider-thumb { appearance: none; width: 15px; height: 15px; border: 1px solid #bf986b; border-radius: 50%; background: #fff3dc; }
.experience-app-dimming input::-moz-range-thumb { width: 13px; height: 13px; border: 1px solid #bf986b; border-radius: 50%; background: #fff3dc; }
.experience-controls-panel :is(button, input):focus-visible { outline: 2px solid #f0c892; outline-offset: 2px; }
@media (max-width: 1150px) {
  .home-experience-layout { grid-template-columns: 1fr; }
  .experience-controls-panel { border-left: 0; border-top: 1px solid #c6a47b55; }
  .experience-app-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 580px) {
  .experience-app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .experience-annotations text { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .fan-on .room-fan-rotor { transform: rotate(32deg); }
  .experience-annotations * { animation: none !important; transition: none !important; }
}

/* Smart Timer stays inside the phone so it does not change the room layout. */
.experience-phone-frame { position: relative; }
.experience-app-header { position: relative; padding-right: 41px; }
.experience-timer__icon {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  cursor: pointer;
  list-style: none;
  border: 1px solid #547b82;
  border-radius: 7px;
  background: #1c3034;
  color: #9ceaf4;
}
.experience-timer__icon::-webkit-details-marker { display: none; }
.experience-timer__icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.experience-timer__icon:hover,
.experience-timer[open] .experience-timer__icon { background: #2d474e; }
.experience-timer__count {
  display: inline-block;
  margin-top: 5px;
  color: #9ceaf4;
  font-size: .67rem;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.experience-timer__count[hidden], .experience-timer__cancel[hidden] { display: none !important; }
.experience-timer__form {
  position: absolute;
  z-index: 4;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid #5e8890;
  border-radius: 8px;
  background: #1c2628;
  color: #eaf5f4;
  font-size: .72rem;
  box-shadow: 0 9px 18px #0006;
}
.experience-timer__intro :is(strong, small) { display: block; }
.experience-timer__intro strong { color: #9ceaf4; }
.experience-timer__intro small { margin-top: 2px; color: #c5d7da; font-size: .61rem; }
.experience-timer__device { display: grid; gap: 3px; }
.experience-timer__device select {
  width: 100%;
  min-height: 28px;
  border: 1px solid #587479;
  border-radius: 4px;
  background: #162023;
  color: inherit;
  font: inherit;
}
.experience-timer__durations {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.experience-timer__durations legend { width: 100%; margin-bottom: 3px; font-size: inherit; }
.experience-timer__durations label { position: relative; }
.experience-timer__durations input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.experience-timer__durations span, .experience-timer__actions button {
  display: inline-block;
  padding: 4px 6px;
  border: 1px solid #557981;
  border-radius: 4px;
  background: #162023;
  color: #eaf5f4;
  font: inherit;
  cursor: pointer;
}
.experience-timer__durations input:checked + span, .experience-timer__actions button[type="submit"] {
  border-color: #8be4f1;
  background: #29464c;
  color: #c9f9ff;
}
.experience-timer__actions { display: flex; flex-wrap: wrap; gap: 5px; }
.experience-timer :is(summary, select, button):focus-visible, .experience-timer__durations input:focus-visible + span {
  outline: 2px solid #9ceaf4;
  outline-offset: 2px;
}

.experience-timer:not([open]) .experience-timer__form { display: none; }

/* Keep the daylight exposure readable with all three lighting circuits off. */
.home-experience-room > .home-experience-image { filter: brightness(.81) saturate(.92); }
.home-experience-room .room-surface-light {
  position: absolute;
  inset: 0;
  background: url("../images/home-experience-room.jpg") center / cover no-repeat;
  pointer-events: none;
  opacity: 0;
  transition: opacity .42s ease;
  mix-blend-mode: screen;
  filter: brightness(.63) saturate(1.13);
}
.home-experience-room .room-surface-light--profile {
  mask-image:
    radial-gradient(ellipse 64% 29% at 51% 23%, #000 4%, #000c 35%, #0005 62%, transparent 100%),
    radial-gradient(ellipse 18% 45% at 10% 44%, #0008, transparent 100%),
    radial-gradient(ellipse 35% 13% at 48% 94%, #0004, transparent 100%);
}
.home-experience-room .room-surface-light--cob {
  filter: brightness(.65) saturate(1.05);
  mask-image:
    radial-gradient(ellipse 28% 31% at 36% 77%, #000d 4%, #0008 39%, transparent 100%),
    radial-gradient(ellipse 25% 26% at 52% 84%, #000b 4%, #0006 42%, transparent 100%),
    radial-gradient(ellipse 29% 28% at 64% 81%, #000e 4%, #0008 43%, transparent 100%),
    radial-gradient(ellipse 20% 17% at 39% 99%, #0009, transparent 100%),
    radial-gradient(ellipse 19% 15% at 66% 99%, #0009, transparent 100%);
}
/* Two directional wall washes and the softer bounce from the cabinet and floor. */
.home-experience-room .room-surface-light--spot {
  filter: brightness(.85) saturate(1.23);
  clip-path: polygon(70% 28%, 100% 24%, 100% 100%, 70% 100%);
  mask-image:
    radial-gradient(ellipse 10% 22% at 77% 44%, #000e 5%, #0009 34%, #0004 65%, transparent 100%),
    radial-gradient(ellipse 11% 29% at 92% 48%, #000 5%, #000b 33%, #0003 67%, transparent 100%),
    radial-gradient(ellipse 17% 13% at 90% 86%, #0008 8%, transparent 100%);
}
.home-experience-room .room-profile-emitter { opacity: 0; transition: opacity .42s ease; }
.home-experience-room.lighting-on :is(.room-surface-light--profile, .room-profile-emitter),
.home-experience-room.cob-on .room-surface-light--cob,
.home-experience-room.spot-on .room-surface-light--spot { opacity: var(--room-light-opacity, .75); }
.home-experience-room .experience-recess-lens { transition: fill .42s ease; }
.home-experience-room.cob-on .experience-cob-fixtures,
.home-experience-room.spot-on .experience-spot-fixtures { --experience-recess-color: color-mix(in srgb, #fff4dd var(--room-light-level, 75%), #968068); }

@media (prefers-reduced-motion: reduce) {
  .home-experience-room :is(.room-surface-light, .room-profile-emitter, .experience-recess-lens) { transition: none; }
}
