/* Demo Home — Concept D lighting hero + A scene tiles + B drag-to-dim wells.
   Namespaced .lp-* so this does not collide with legacy .light-head / .light-card styles. */

.lp-section {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 4px;
  min-width: 0;
}
.lp-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}
.lp-kicker {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
  margin: 0;
}
.lp-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  flex-wrap: wrap;
  justify-content: flex-end;
}
.lp-tool {
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: rgba(237,244,250,.78);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
}
.lp-tool:hover, .lp-tool:focus-visible {
  border-color: rgba(114,217,248,.35);
  color: var(--text);
}
.lp-tool:disabled { opacity: .4; cursor: default; }

.lp-hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 12px;
  min-height: 0;
}
.lp-hero, .lp-scene {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(255,255,255,.08);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
  background: #0c1118;
}
.lp-hero {
  min-height: 200px;
  height: 200px;
  box-shadow: 0 12px 28px rgba(0,0,0,.28);
}
.lp-hero.is-active, .lp-scene.is-active {
  border-color: rgba(114,217,248,.7);
  box-shadow:
    0 0 0 2px rgba(114,217,248,.35),
    0 0 28px rgba(114,217,248,.16),
    0 10px 24px rgba(0,0,0,.35);
}
.lp-hero.art-relax, .lp-scene.art-relax { border-color: rgba(246,197,106,.28); }
.lp-hero.art-relax.is-active { box-shadow: 0 0 40px rgba(246,197,106,.10), 0 0 0 2px rgba(114,217,248,.35); }

.lp-art { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.lp-art::after { content: ""; position: absolute; inset: 0; }

.art-relax .lp-art {
  background:
    radial-gradient(80% 90% at 70% 110%, rgba(255,180,70,.55), transparent 55%),
    radial-gradient(40% 50% at 20% 80%, rgba(255,140,40,.25), transparent 60%),
    linear-gradient(180deg, #1a140e 0%, #3a2414 45%, #c47a2a 100%);
}
.art-relax .lp-art::after {
  background:
    radial-gradient(circle at 22% 30%, rgba(255,220,140,.40), transparent 18%),
    radial-gradient(circle at 78% 24%, rgba(255,200,100,.22), transparent 14%),
    radial-gradient(circle at 60% 40%, rgba(255,180,80,.12), transparent 20%);
  animation: lp-bokeh 7s ease-in-out infinite;
}
.art-everyday .lp-art {
  background:
    radial-gradient(50% 60% at 82% 18%, rgba(255,244,210,.55), transparent 42%),
    radial-gradient(90% 80% at 50% 120%, rgba(230,210,150,.4), transparent 50%),
    linear-gradient(180deg, #151c28 0%, #3a4656 42%, #b7a888 78%, #e8d7b0 100%);
}
.art-everyday .lp-art::after {
  background:
    radial-gradient(circle at 18% 30%, rgba(255,220,150,.16), transparent 22%),
    radial-gradient(circle at 78% 12%, rgba(255,255,240,.35), transparent 24%);
}
.art-bright .lp-art {
  background:
    radial-gradient(80% 70% at 50% 0%, rgba(255,255,255,.45), transparent 50%),
    linear-gradient(180deg, #9bb4cc 0%, #d7e4f0 40%, #f4f7fb 100%);
}
.art-movie .lp-art {
  background:
    radial-gradient(60% 80% at 85% 70%, rgba(80,140,255,.28), transparent 50%),
    radial-gradient(40% 50% at 15% 80%, rgba(180,40,40,.18), transparent 50%),
    linear-gradient(180deg, #07080c 0%, #12151c 60%, #1a1e28 100%);
}
.art-movie .lp-art::after {
  background:
    linear-gradient(180deg, rgba(120,170,255,.18), transparent 70%),
    radial-gradient(ellipse at 78% 55%, rgba(80,140,255,.35), transparent 55%);
  right: -8%; top: 10%; left: 40%; bottom: 8%;
  inset: auto;
  width: 55%; height: 70%;
  border-radius: 8px;
  filter: blur(2px);
  top: 18%; right: -8%;
  position: absolute;
}
.art-clean .lp-art {
  background:
    radial-gradient(70% 70% at 50% 0%, rgba(220,240,255,.55), transparent 55%),
    linear-gradient(180deg, #1c2a38 0%, #4a6578 50%, #dce8f0 100%);
}
.art-off .lp-art {
  background: linear-gradient(180deg, #12151a, #0a0c10);
}
.art-custom .lp-art {
  background:
    radial-gradient(70% 80% at 60% 120%, rgba(255,180,70, calc(var(--lp-avg, 40) / 180)), transparent 55%),
    linear-gradient(180deg, #12151a, #1a140e 60%, #3a2414);
}
.art-saved .lp-art {
  background:
    radial-gradient(60% 70% at 50% 100%, rgba(114,217,248,.22), transparent 55%),
    linear-gradient(180deg, #10161f, #1a2430 60%, #2a3a48);
}

@keyframes lp-bokeh {
  0%, 100% { opacity: .85; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}
@media (prefers-reduced-motion: reduce) {
  .art-relax .lp-art::after { animation: none; }
}

.lp-copy {
  position: absolute;
  left: 20px; right: 18px; bottom: 16px;
  z-index: 2;
  pointer-events: none;
}
.lp-hero .lp-copy { left: 22px; bottom: 18px; }
.lp-now {
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(255,230,180,.8);
  margin: 0 0 4px;
}
.lp-hero h3, .lp-scene h3 {
  font-family: "Oswald", sans-serif;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1;
  margin: 0;
  text-shadow: 0 2px 12px rgba(0,0,0,.45);
}
.lp-hero h3 { font-size: 42px; }
.lp-scene h3 { font-size: 20px; }
.lp-hero p, .lp-scene p {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 550;
  color: rgba(255,255,255,.85);
  line-height: 1.25;
}
.lp-scene p { font-size: 11.5px; color: rgba(255,255,255,.78); margin-top: 3px; }

.art-bright .lp-copy h3,
.art-bright .lp-now,
.art-clean .lp-copy h3 { color: #15202b; text-shadow: none; }
.art-bright .lp-copy p,
.art-clean .lp-copy p { color: rgba(21,32,43,.7); }
.art-bright .lp-now, .art-clean .lp-now { color: rgba(21,32,43,.55); }

.lp-live {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 2;
  background: rgba(8,12,18,.45);
  border: 1px solid rgba(114,217,248,.4);
  color: #72d9f8;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .14em;
  padding: 3px 8px;
  border-radius: 999px;
  pointer-events: none;
}

.lp-minis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.lp-minis .lp-scene { height: 95px; min-height: 95px; }
.lp-hero-grid.lp-five .lp-minis { grid-template-columns: 1fr 1fr; }
.lp-minis .lp-scene:nth-child(n+5) { height: 72px; min-height: 72px; }

/* Fixture wells — Concept B drag-to-dim */
.lp-wells {
  display: grid;
  grid-template-columns: repeat(var(--lp-n, 3), minmax(0, 1fr));
  gap: 10px;
  min-height: 148px;
  height: 148px;
}
.lp-well, .lp-fan {
  position: relative;
  border-radius: 18px;
  background: linear-gradient(180deg, #141a24, #0c1118);
  border: 1px solid rgba(255,255,255,.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  touch-action: pan-y; /* locked: let a vertical scroll pass through; unlocked CSS sets none */
  user-select: none;
  -webkit-user-select: none;
  min-width: 0;
}
.lp-well { cursor: ns-resize; }
.lp-well.on {
  border-color: rgba(246,197,106,.22);
}
.lp-ico {
  width: 36px; height: 36px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.45);
  border: 0;
  padding: 0;
  cursor: pointer;
  z-index: 3;
  position: relative;
  flex-shrink: 0;
}
.lp-ico svg { width: 18px; height: 18px; display: block; }
.lp-well.on .lp-ico, .lp-fan.on .lp-ico {
  background: radial-gradient(circle at 50% 40%, #ffe7b0, #f0b44a);
  color: #2a1c08;
  box-shadow: 0 0 16px rgba(246,197,106,.55);
}
.lp-well-top {
  padding: 12px 12px 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  pointer-events: none;
}
.lp-well-top .lp-ico { pointer-events: auto; }
.lp-well-name, .lp-fan-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: .01em;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lp-fill {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 1;
  height: calc(var(--lvl, 0) * 1%);
  background: linear-gradient(180deg, rgba(255,230,170,1) 0%, rgba(255,196,90,.95) 18%, rgba(196,120,30,.85) 100%);
  box-shadow: 0 0 40px rgba(255,180,60,.35) inset, 0 -10px 40px rgba(255,200,80,.25);
  border-top: 1px solid rgba(255,244,210,.7);
  transition: height .18s var(--ease, cubic-bezier(.2,.8,.2,1));
  pointer-events: none;
}
.lp-fill::after {
  content: "";
  position: absolute;
  left: 10%; right: 10%;
  top: -18px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255,230,170,.55), transparent 70%);
  pointer-events: none;
}
.lp-well:not(.on) .lp-fill { height: 0; opacity: 0; }
.lp-well.dragging .lp-fill { transition: none; }
.lp-pct {
  position: absolute;
  left: 0; right: 0; bottom: 12px;
  z-index: 2;
  text-align: center;
  font-family: "Oswald", sans-serif;
  font-weight: 600;
  font-size: 32px;
  letter-spacing: .02em;
  text-shadow: 0 2px 10px rgba(0,0,0,.35);
  pointer-events: none;
  line-height: 1;
}
.lp-well.on .lp-pct { color: #1a1208; }
.lp-well:not(.on) .lp-pct {
  color: rgba(255,255,255,.28);
  font-size: 22px;
  bottom: 14px;
}

.lp-fan { touch-action: manipulation; cursor: default; padding: 12px; gap: 8px; }
.lp-fan .lp-well-top { padding: 0; }
.lp-fan-body { z-index: 2; display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.lp-fan-state {
  font-family: "Oswald", sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: rgba(255,255,255,.32);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.lp-fan.on .lp-fan-state { color: #ffe1a0; }
.lp-fan-timers { display: flex; flex-wrap: wrap; gap: 6px; }
.lp-fan-timers .btn, .lp-fan-timers button {
  min-height: 32px;
  height: 32px;
  padding: 0 8px;
  font-size: 10px;
  letter-spacing: .04em;
}

.lp-banner { margin: 0; }
.lp-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 12px 4px;
}

/* Overview compact room heroes */
.lp-ov {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.lp-ov-card {
  position: relative;
  height: 128px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  text-align: left;
  padding: 0;
  background: #0c1118;
}
.lp-ov-card .lp-copy { left: 16px; right: 14px; bottom: 12px; }
.lp-ov-card h3 { font-family: "Oswald", sans-serif; font-size: 22px; letter-spacing: .05em; text-transform: uppercase; margin: 0; }
.lp-ov-card p { margin: 4px 0 0; font-size: 12px; color: rgba(255,255,255,.8); }
.lp-ov-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.lp-ov-wrap { display: flex; flex-direction: column; gap: 10px; }
.lp-ov-wrap > .unreachable-banner { margin: 0; }

@media (max-width: 1100px) {
  .lp-hero { height: 180px; min-height: 180px; }
  .lp-hero h3 { font-size: 36px; }
  .lp-minis .lp-scene { height: 85px; min-height: 85px; }
  .lp-wells { height: 136px; min-height: 136px; }
  .lp-pct { font-size: 28px; }
}
@media (orientation: portrait), (max-width: 820px) {
  .lp-hero-grid { grid-template-columns: 1fr; }
  .lp-hero { height: 160px; min-height: 160px; }
  .lp-hero h3 { font-size: 34px; }
  .lp-minis .lp-scene { height: 88px; min-height: 88px; }
  .lp-wells {
    height: auto;
    min-height: 0;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  }
  .lp-well, .lp-fan { height: 150px; }
}

.lp-well.high .lp-well-name { color: #1a1208; text-shadow: none; }


/* Keep the fixture name, level, and icon readable at any brightness, including
   full, when the amber fill rises to cover the top of the tile. */
.lp-well.on .lp-well-name,
.lp-well.on .lp-pct {
  color: #1c1206;
  text-shadow: 0 0 4px rgba(255,247,226,.95), 0 1px 2px rgba(255,247,226,.75);
}
.lp-well.on.full .lp-ico {
  background: rgba(24,16,6,.82);
  color: #ffe9bd;
  box-shadow: 0 0 0 1px rgba(255,247,226,.40), 0 2px 10px rgba(0,0,0,.35);
}


/* Hold-to-arm lock: lights stay inert during a scroll or a quick tap.
   A still 1s press fills the ring/glow, then the control unlocks briefly. */
body.lp-lights-unlocked .lp-well,
body.lp-lights-unlocked .lp-fan {
  touch-action: none;
}

.is-arming {
  position: relative;
  z-index: 4;
  box-shadow: 0 0 0 2px rgba(114,217,248,.55), 0 0 22px rgba(114,217,248,.32);
}
.lp-arm-ring {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 8;
  overflow: hidden;
}
.lp-arm-ring .lp-arm-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(114,217,248,.42), rgba(114,217,248,.10));
  transform: scaleY(0);
  transform-origin: bottom center;
  animation: lp-arm-fill 1s linear forwards;
}
.lp-ico.is-arming .lp-arm-ring,
.lp-tool.is-arming .lp-arm-ring,
.light-head.is-arming .lp-arm-ring {
  inset: -3px;
  border-radius: 14px;
}
@keyframes lp-arm-fill {
  to { transform: scaleY(1); }
}

body:not(.lp-lights-unlocked) .lp-kicker::after {
  content: " · Hold 1s to unlock";
  letter-spacing: 0.08em;
  font-weight: 650;
  opacity: 0.72;
}
body.lp-lights-unlocked .lp-kicker::after {
  content: " · Unlocked";
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #8be4ff;
  opacity: 1;
}
body.lp-lights-unlocked .lp-section,
body.lp-lights-unlocked .lp-ov-wrap,
body.lp-lights-unlocked .lights-sheet,
body.lp-lights-unlocked .lights-block,
body.lp-lights-unlocked .whole-house {
  box-shadow: 0 0 0 1px rgba(114,217,248,.30), 0 0 28px rgba(114,217,248,.14);
  transition: box-shadow .25s ease;
}

#roomLightsTitle::after {
  letter-spacing: 0.08em;
  font-weight: 650;
  font-size: 0.72em;
  margin-left: 8px;
  text-transform: uppercase;
}
body:not(.lp-lights-unlocked) #roomLightsTitle::after { content: "Hold 1s to unlock"; opacity: .7; }
body.lp-lights-unlocked #roomLightsTitle::after { content: "Unlocked"; color: #8be4ff; opacity: 1; }

.lp-hero, .lp-scene, .lp-well, .lp-fan, .lp-ico, .lp-tool, .light-head,
[data-act="caseta-toggle"], [data-act="caseta-all-off"], [data-act="caseta-scene"],
[data-act="caseta-room-all"], [data-act="caseta-level"], [data-act="dash-scene"],
[data-act="fan-sleep"], [data-act="lp-toggle"], [data-act="lp-scene"],
[data-act="lp-all-off"], [data-act="lp-save"] {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
