/* Feature previews: each card opens the finished app screen (demo data) in a sheet styled like the Casa app. */
.card.pv { cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; position: relative; }
.card.pv:hover, .card.pv:focus-visible { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(14, 42, 59, .14); border-color: #cdbfa9; outline: none; }
.pv-hint { display: inline-block; margin-top: 12px; font-size: 14px; font-weight: 700; color: var(--ocean); }

.pv-dlg { border: 0; padding: 0; background: transparent; width: min(760px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: visible; }
.pv-dlg::backdrop { background: rgba(8, 18, 28, .62); backdrop-filter: blur(3px); }
.pv-dlg[open] .app { animation: pv-up .28s cubic-bezier(.2, .8, .2, 1); }
@keyframes pv-up { from { transform: translateY(28px); opacity: 0; } }

/* the app sheet */
.app { --bg: #16233a; --card: #22344f; --raised: #2c4264; --txt: #f1f4f8; --sub: #a9b6c8; --on: #f5c26b; --onfill: rgba(245, 194, 107, .26);
  --act: #ece3d2; --acttxt: #16233a; --ok: #6fd3a0; --warn: #f0a05a; --water: #4fb6c4; --gas: #e5734a;
  background: var(--bg); color: var(--txt); border-radius: 28px; padding: 14px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
  font: 15px/1.4 Inter, system-ui, sans-serif; max-height: calc(100dvh - 24px); overflow: auto; }
.app-head { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 22px; padding: 8px 8px 8px 10px; margin-bottom: 12px; }
.app-head .hi { width: 44px; height: 44px; border-radius: 50%; background: var(--raised); display: grid; place-items: center; flex: none; }
.app-head .hi svg { width: 22px; height: 22px; }
.app-head h3 { margin: 0; font: 800 19px Outfit, Inter, sans-serif; color: var(--txt); }
.app-head .st { font-size: 13px; color: var(--on); font-weight: 600; }
.app-head .x { margin-left: auto; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--raised); color: var(--txt); font-size: 20px; cursor: pointer; flex: none; }
.demo-note { text-align: center; font-size: 12px; color: var(--sub); margin: 10px 0 2px; }
.g { display: grid; gap: 10px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 560px) { .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { background: var(--card); border-radius: 18px; padding: 12px 14px; position: relative; overflow: hidden; }
.tile b { display: block; font-weight: 700; } .tile small { color: var(--sub); font-size: 13px; }
.big { font: 800 26px Outfit, Inter, sans-serif; line-height: 1.1; }
.pill { border: 0; border-radius: 999px; padding: 10px 14px; background: var(--raised); color: var(--txt); font: 700 14px Inter, sans-serif; cursor: pointer; transition: background .2s, color .2s; }
.pill.on { background: var(--act); color: var(--acttxt); }
.sec-label { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--sub); margin: 14px 4px 8px; }

/* lights */
.room { min-height: 92px; cursor: pointer; transition: background .35s; user-select: none; }
.room .fill { position: absolute; inset: auto 0 0 0; background: var(--onfill); transition: height .5s; height: 0; }
.room.on { background: #2e3a4a; } .room.on b { color: var(--on); }
.room > * { position: relative; }
.room .bulb { display: block; width: 26px; height: 26px; margin-bottom: 8px; color: var(--sub); transition: color .3s; } .room .bulb svg { width: 26px; height: 26px; display: block; } .room.on .bulb { color: var(--on); }

/* security */
.cam { aspect-ratio: 16 / 10; border-radius: 16px; overflow: hidden; position: relative; background: linear-gradient(180deg, #2a3e5c 0%, #1d2b40 55%, #31414f 56%, #3c4b57 100%); }
.cam svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cam .lab { position: absolute; left: 10px; top: 8px; background: rgba(0, 0, 0, .45); padding: 2px 8px; border-radius: 8px; font-size: 12px; font-weight: 700; }
.cam .live { position: absolute; right: 10px; top: 8px; font-size: 11px; font-weight: 800; color: #fff; display: flex; align-items: center; gap: 5px; }
.cam .live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #ff5b5b; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.event { display: flex; align-items: center; gap: 12px; } .event .dot { width: 36px; height: 36px; border-radius: 50%; background: var(--raised); display: grid; place-items: center; flex: none; }
.ok { color: var(--ok); } .warn { color: var(--warn); }

/* gate */
.gate-wrap { display: grid; grid-template-columns: 1.2fr 1fr; gap: 12px; } @media (max-width: 560px) { .gate-wrap { grid-template-columns: 1fr; } }
.gate-vis { aspect-ratio: 16 / 10; border-radius: 16px; background: linear-gradient(180deg, #3a5578, #24364f 60%, #4a5560 61%, #55606a); position: relative; overflow: hidden; }
.gate-vis .bars { position: absolute; left: 10%; right: 10%; bottom: 18%; height: 44%; display: flex; justify-content: space-between; transition: transform 2.4s ease-in-out; }
.gate-vis .bars i { width: 6px; background: #c9d2dc; border-radius: 3px; } .gate-vis .rail { position: absolute; left: 8%; right: 8%; bottom: 18%; height: 6px; background: #c9d2dc; border-radius: 3px; transition: transform 2.4s ease-in-out; }
.gate-vis.open .bars, .gate-vis.open .rail { transform: translateX(78%); }
.gate-btn { width: 100%; padding: 18px; font-size: 17px; border-radius: 18px; }
.key { display: flex; align-items: center; gap: 12px; } .qr { width: 44px; height: 44px; border-radius: 8px; background:
  conic-gradient(from 90deg at 30% 30%, #fff 25%, #16233a 0 50%, #fff 0 75%, #16233a 0) 0 0 / 11px 11px; flex: none; border: 3px solid #fff; }

/* water */
.app .flow { background: var(--card); box-shadow: none; padding: 10px; border-radius: 18px; }
.bar { height: 8px; border-radius: 4px; background: var(--raised); overflow: hidden; margin-top: 8px; } .bar i { display: block; height: 100%; border-radius: 4px; }

/* energy */
.chart { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding-top: 6px; }
.chart i { flex: 1; background: linear-gradient(180deg, #f5c26b, #e5734a); border-radius: 4px 4px 2px 2px; transform-origin: bottom; animation: grow .8s ease-out both; }
.chart i.now { background: #fff; }
@keyframes grow { from { transform: scaleY(0); } }
.axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--sub); margin-top: 4px; }
.use { display: flex; align-items: center; gap: 10px; } .use .bar { flex: 1; margin: 0; }

/* audio & video */
.np { display: flex; gap: 14px; align-items: center; }
.art { width: 84px; height: 84px; border-radius: 14px; flex: none; background: radial-gradient(circle at 30% 30%, #f2b04c, transparent 55%), linear-gradient(135deg, #1f7a8c, #2a1f4f); position: relative; overflow: hidden; }
.art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .25), transparent); animation: shine 3s infinite; transform: translateX(-100%); }
@keyframes shine { 60%, 100% { transform: translateX(100%); } }
.prog { height: 5px; border-radius: 3px; background: var(--raised); margin-top: 8px; overflow: hidden; } .prog i { display: block; height: 100%; width: 38%; background: var(--on); animation: prog 30s linear infinite; }
@keyframes prog { to { width: 80%; } }
.apps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.apps span { border-radius: 14px; padding: 12px 4px; text-align: center; font-weight: 800; font-size: 13px; color: #fff; }
.remote { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; margin-top: 12px; }
.pad { width: 168px; height: 168px; border-radius: 50%; background: var(--raised); position: relative; }
.pad button { position: absolute; width: 56px; height: 56px; border: 0; background: none; color: var(--txt); font-size: 22px; cursor: pointer; border-radius: 50%; }
.pad button:active, .pad button.hit { background: rgba(255, 255, 255, .12); }
.pad .u { left: 56px; top: 0; } .pad .d { left: 56px; bottom: 0; } .pad .l { left: 0; top: 56px; } .pad .r { right: 0; top: 56px; }
.pad .ok { left: 46px; top: 46px; width: 76px; height: 76px; background: var(--card); font: 800 16px Inter, sans-serif; color: var(--txt); }
.keys { display: grid; gap: 10px; } .keys .pill { padding: 12px 16px; }
@media (max-width: 560px) { .remote { grid-template-columns: 1fr; justify-items: center; } .keys { grid-template-columns: repeat(3, auto); } }

.gate-vis.cam { background: #1d2b40; aspect-ratio: 528 / 400; }
.gate-vis.cam img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gate-state { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%) translateY(8px); opacity: 0; transition: opacity .3s, transform .3s;
  background: rgba(22, 35, 58, .88); color: #fff; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; white-space: nowrap; }
.gate-vis.open .gate-state { opacity: 1; transform: translateX(-50%); }

/* entry screen */
.console { display: grid; grid-template-columns: 1.1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .console { grid-template-columns: 1fr; } }
.clock { font: 800 46px Outfit, Inter, sans-serif; line-height: 1; } .clock small { font-size: 18px; color: var(--sub); }
.c-wx { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--on); } .c-wx svg { width: 22px; height: 22px; }
.c-photo { padding: 0; min-height: 130px; } .c-photo .ph { position: absolute; inset: 0; background:
  radial-gradient(circle at 75% 30%, #f6c27a 0 12%, transparent 13%), linear-gradient(180deg, #f2a66a 0%, #d9707a 45%, #4a5d8c 46%, #2c4a6e 100%); animation: kb 14s ease-in-out infinite alternate; }
@keyframes kb { to { transform: scale(1.12) translate(-3%, 2%); } }
.row-i { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; } .row-i svg { width: 18px; height: 18px; color: var(--on); }
.ev { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-top: 1px solid rgba(255, 255, 255, .06); font-size: 14px; }
.scene { min-height: 64px; display: flex; align-items: flex-end; } .scene.s0 { background: linear-gradient(135deg, #4b2f6b, #2b2d55); }
.scene.s1 { background: linear-gradient(135deg, #6b4a24, #3e2f22); } .scene.s2 { background: linear-gradient(135deg, #1f3a5f, #182a44); } .scene.s3 { background: linear-gradient(135deg, #6b2f45, #3f2236); }
.bye { width: 100%; margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 16px; border-radius: 18px; font-size: 17px; }
.bye svg { width: 22px; height: 22px; } .bye small { font-weight: 500; opacity: .7; } .bye.done { background: var(--ok); }
/* weather */
.w-alert { display: flex; align-items: center; gap: 12px; background: rgba(240, 160, 90, .16); box-shadow: inset 0 0 0 1px rgba(240, 160, 90, .5); }
.w-alert svg { width: 24px; height: 24px; color: var(--warn); flex: none; } .w-alert b { color: #ffd2a8; }
.w-now { display: flex; align-items: center; gap: 14px; } .w-ic svg { width: 30px; height: 30px; color: var(--on); display: block; }
.w-now .w-ic svg { width: 54px; height: 54px; animation: spin 24s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }
.w-days { grid-template-columns: repeat(5, minmax(0, 1fr)); } .day { text-align: center; display: grid; justify-items: center; gap: 4px; padding: 10px 4px; }
/* voice */
.chat { display: grid; gap: 8px; padding: 4px 2px; }
.msg { max-width: 80%; padding: 10px 14px; border-radius: 18px; font-size: 15px; opacity: 0; animation: pop .35s ease-out forwards; }
.msg.me { justify-self: end; background: var(--act); color: var(--acttxt); border-bottom-right-radius: 6px; font-weight: 600; }
.msg.house { justify-self: start; background: var(--card); border-bottom-left-radius: 6px; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.mic { display: grid; place-items: center; margin: 14px 0 4px; } .mic span { width: 64px; height: 64px; border-radius: 50%; background: var(--on); color: var(--acttxt); display: grid; place-items: center;
  animation: ping 1.6s ease-out infinite; } .mic svg { width: 28px; height: 28px; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(245, 194, 107, .55); } 100% { box-shadow: 0 0 0 18px rgba(245, 194, 107, 0); } }
/* appliances */
.apl, .robot { display: flex; align-items: center; gap: 12px; } .apl small, .robot small { display: block; }
.ring { --p: 0; width: 54px; height: 54px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--on) calc(var(--p) * 1%), var(--raised) 0); }
.ring span { width: 44px; height: 44px; border-radius: 50%; background: var(--card); display: grid; place-items: center; } .ring svg { width: 22px; height: 22px; }
.apl.done .ring { background: conic-gradient(var(--ok) 100%, var(--raised) 0); } .apl.done small { color: var(--ok); } .apl.ok .ring { background: conic-gradient(var(--ok) 100%, var(--raised) 0); }
.ring.run svg { animation: spin 2.4s linear infinite; }
.pill.mini { padding: 6px 12px; font-size: 13px; margin-top: 6px; }
.chips2 { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; } .chips2 span { padding: 4px 10px; border-radius: 999px; background: var(--raised); font-size: 13px; }
.chips2 span.on { background: var(--act); color: var(--acttxt); font-weight: 700; }
