/*
  Lumen: smart home app (Screenery template)
  Liquid glass over a drifting aurora: thick frosted panels with a tinted body (text never sits on raw blur),
  a specular rim drawn with a masked gradient border, and an inner light pooled at the bottom edge.

  Contents
   1. Tokens (palette, scene aurora colours, glass recipe, type, space, shape, motion)
   2. Base and browser surfaces
   3. Aurora
   4. Glass recipe and fallback
   5. Components: buttons, switch, icon button, range, field, segmented, toasts
   6. Header and intro
   7. App: bar, offline alert, grid, panels
   8. Scenes, rooms and the drawn room art
   9. Thermostat dial
  10. Front door lock
  11. Energy chart
  12. Room sheet
  13. Marketing: how it works, plans, download, phone, questions, footer
  14. App states: loading, offline
  15. Motion and reduced motion
  16. Narrow screens
*/

/* ---------- 1. Tokens ---------- */
@property --a1 { syntax: "<color>"; inherits: true; initial-value: #2fb7b0; }
@property --a2 { syntax: "<color>"; inherits: true; initial-value: #6a5cf0; }
@property --a3 { syntax: "<color>"; inherits: true; initial-value: #ff7f6a; }
@property --a4 { syntax: "<color>"; inherits: true; initial-value: #2b5fd9; }

:root {
  /* Palette */
  --night: #0b1024;          /* ground behind the aurora */
  --ink: #f3f5ff;            /* text on glass */
  --ink-soft: #c9cfee;       /* secondary text on glass (AA on the tint) */
  --ink-faint: #a5acd3;      /* tertiary, only at 15px+ */
  --mint: #93e6dc;           /* the Lumen accent: focus, active, positive */
  --amber: #ffd29a;          /* lamplight */
  --coral: #ff9a7f;          /* heating, warnings */
  --deep: #121735;           /* text on light buttons */

  /* Aurora fields for the evening (no scene). [data-scene] on <html> swaps them. */
  --a1: #2fb7b0;
  --a2: #6a5cf0;
  --a3: #ff7f6a;
  --a4: #2b5fd9;

  /* Glass recipe */
  --glass-tint: rgb(17 22 50 / 0.58);       /* the body that carries the text */
  --glass-tint-strong: rgb(15 19 44 / 0.78);
  --glass-sheen: linear-gradient(150deg, rgb(255 255 255 / 0.16), rgb(255 255 255 / 0.04) 42%, rgb(255 255 255 / 0.02) 70%, rgb(255 255 255 / 0.07));
  --glass-blur: blur(26px) saturate(175%);
  --rim: linear-gradient(160deg, rgb(255 255 255 / 0.75), rgb(255 255 255 / 0.14) 30%, rgb(255 255 255 / 0.05) 60%, rgb(255 255 255 / 0.4));
  --glass-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.32),
    inset 0 -12px 28px -18px rgb(180 220 255 / 0.35),
    0 2px 6px rgb(3 5 18 / 0.25),
    0 28px 60px -24px rgb(3 5 18 / 0.7);
  --chip: rgb(255 255 255 / 0.09);
  --chip-hover: rgb(255 255 255 / 0.15);
  --hairline: rgb(255 255 255 / 0.14);

  /* Type */
  --sans: "Urbanist", "Avenir Next", "Segoe UI", sans-serif;
  --fs-xs: 0.875rem;    /* 14 */
  --fs-sm: 0.9375rem;   /* 15 */
  --fs-md: 1.0625rem;   /* 17 body */
  --fs-lg: 1.25rem;
  --fs-xl: 1.625rem;
  --fs-h2: clamp(2rem, 1.2rem + 2.6vw, 3.25rem);
  --fs-h1: clamp(2.5rem, 1.2rem + 4.4vw, 4.75rem);

  /* Space */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 80px;
  --s-9: 128px;
  --gutter: clamp(16px, 3vw, 40px);
  --wrap: 1240px;

  /* Shape */
  --r-app: 40px;
  --r-panel: 28px;
  --r-chip: 20px;
  --r-pill: 999px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 160ms;
  --t-mid: 360ms;
  --t-scene: 1400ms;
}

/* Scene aurora colours */
:root[data-scene="morning"] { --a1: #ffb36b; --a2: #ff8fa3; --a3: #ffd36e; --a4: #4fa3e0; }
:root[data-scene="away"]    { --a1: #3f5a8c; --a2: #2d3a6b; --a3: #4f7d96; --a4: #23305e; }
:root[data-scene="film"]    { --a1: #b0306a; --a2: #5a2ea6; --a3: #e2534a; --a4: #2a1f6b; }
:root[data-scene="sleep"]   { --a1: #1f3a7a; --a2: #3b2f86; --a3: #2b6b8a; --a4: #141c4a; }

/* ---------- 2. Base and browser surfaces ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  scrollbar-color: rgb(147 230 220 / 0.55) var(--night);
  -webkit-text-size-adjust: 100%;
  background: var(--night);
  transition: --a1 var(--t-scene) var(--ease-out), --a2 var(--t-scene) var(--ease-out), --a3 var(--t-scene) var(--ease-out), --a4 var(--t-scene) var(--ease-out);
}

body {
  margin: 0;
  min-width: 320px;
  font-family: var(--sans);
  font-size: var(--fs-md);
  font-weight: 500;
  line-height: 1.55;
  color: var(--ink);
  background: transparent;
  accent-color: var(--mint);
  caret-color: var(--mint);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

::selection { background: rgb(147 230 220 / 0.38); color: #fff; }
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--night); }
::-webkit-scrollbar-thumb { background: rgb(147 230 220 / 0.4); border-radius: 99px; border: 3px solid var(--night); }

h1, h2, h3 { margin: 0; line-height: 1.08; text-wrap: balance; font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--mint); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2.5px solid var(--mint); outline-offset: 3px; border-radius: 12px; }
.num { font-variant-numeric: tabular-nums; }
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
[hidden] { display: none !important; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon--lg { width: 26px; height: 26px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 16px; border-radius: 12px; background: var(--ink); color: var(--deep); font-weight: 700; }
.skip:focus { top: 12px; }

/* ---------- 3. Aurora ---------- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--night);
}
.aurora__blob {
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  opacity: 0.62;
  will-change: transform;
}
.aurora__blob--1 { left: -18vmax; top: -22vmax; background: radial-gradient(closest-side, var(--a1), transparent); }
.aurora__blob--2 { right: -24vmax; top: -10vmax; background: radial-gradient(closest-side, var(--a2), transparent); }
.aurora__blob--3 { left: 18vmax; top: 30vh; width: 56vmax; height: 56vmax; background: radial-gradient(closest-side, var(--a3), transparent); opacity: 0.42; }
.aurora__blob--4 { left: -20vmax; bottom: -30vmax; background: radial-gradient(closest-side, var(--a4), transparent); }

/* ---------- 4. Glass recipe ---------- */
.glass {
  position: relative;
  isolation: isolate;
  background: var(--glass-sheen), var(--glass-tint);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
  border-radius: var(--r-panel);
}
/* Specular rim: a gradient border, brightest at the top-left edge where the light hits */
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  padding: 1.25px;
  border-radius: inherit;
  background: var(--rim);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}
/* Refracted light: a soft caustic pooled inside the bottom edge, coloured by the aurora */
.glass::after {
  content: "";
  position: absolute;
  inset: auto 8% 0;
  height: 46%;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(60% 70% at 50% 100%, color-mix(in srgb, var(--a1) 30%, transparent), transparent 70%);
  pointer-events: none;
}
.glass--warn { --glass-tint: rgb(58 22 30 / 0.7); }

/* Where backdrop-filter is missing, the glass becomes a solid tinted pane with the same rim */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass-tint: rgb(20 25 56 / 0.95); --glass-tint-strong: rgb(18 22 50 / 0.97); }
  .glass--warn { --glass-tint: rgb(62 24 32 / 0.96); }
}

/* ---------- 5. Components ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 48px;
  padding: 0 var(--s-5);
  border: 0;
  border-radius: var(--r-pill);
  font-weight: 700;
  font-size: var(--fs-sm);
  text-decoration: none;
  transition: background var(--t-fast), transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast);
}
.btn:active { transform: scale(0.97); }
.btn--light {
  color: var(--deep);
  background: linear-gradient(180deg, #ffffff, #dfe6ff);
  box-shadow: inset 0 -2px 0 rgb(18 23 53 / 0.12), 0 8px 20px -10px rgb(0 0 0 / 0.6);
}
.btn--light:hover { background: linear-gradient(180deg, #ffffff, #cbf2ec); }
.btn--ghost { background: var(--chip); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hairline); }
.btn--ghost:hover { background: var(--chip-hover); }
.btn--warm { color: #2a1208; background: linear-gradient(180deg, #ffd9b0, #ffb07f); }
.btn--warm:hover { background: linear-gradient(180deg, #ffe4c6, #ffbf95); }
.btn--wide { width: 100%; }
.btn[disabled], .btn[aria-busy="true"] { opacity: 0.7; cursor: progress; }

.iconbtn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: var(--chip);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.18), inset 0 0 0 1px var(--hairline);
  transition: background var(--t-fast);
}
.iconbtn:hover { background: var(--chip-hover); }

/* Switch: a glass capsule with a bead of light */
.switch {
  position: relative;
  width: 56px;
  height: 32px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: var(--r-pill);
  background: rgb(255 255 255 / 0.12);
  box-shadow: inset 0 1px 3px rgb(0 0 0 / 0.35), inset 0 0 0 1px var(--hairline);
  transition: background var(--t-mid) var(--ease-out);
}
.switch::before { content: ""; position: absolute; inset: -6px; } /* 44px touch target */
.switch__knob {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #cfd6f5);
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.4);
  transition: transform var(--t-mid) var(--ease-out), background var(--t-mid);
}
.switch[aria-checked="true"] { background: linear-gradient(90deg, rgb(255 210 154 / 0.85), rgb(255 186 120 / 0.95)); }
.switch[aria-checked="true"] .switch__knob { transform: translateX(24px); background: radial-gradient(circle at 35% 30%, #fff, #fff3e0); box-shadow: 0 2px 6px rgb(0 0 0 / 0.3); }

/* Range: a glass groove filled with lamplight up to the value */
.range {
  --fill: 80%;
  width: 100%;
  height: 44px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.range::-webkit-slider-runnable-track {
  height: 14px;
  border-radius: 99px;
  background: linear-gradient(90deg, rgb(255 214 160 / 0.95) var(--fill), rgb(255 255 255 / 0.12) var(--fill));
  box-shadow: inset 0 1px 3px rgb(0 0 0 / 0.4), inset 0 0 0 1px var(--hairline);
}
.range::-moz-range-track { height: 14px; border-radius: 99px; background: rgb(255 255 255 / 0.12); box-shadow: inset 0 0 0 1px var(--hairline); }
.range::-moz-range-progress { height: 14px; border-radius: 99px; background: rgb(255 214 160 / 0.95); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 30px;
  height: 30px;
  margin-top: -8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #ffe9cc);
  box-shadow: 0 0 0 4px rgb(255 255 255 / 0.18), 0 4px 10px rgb(0 0 0 / 0.4);
}
.range::-moz-range-thumb { width: 30px; height: 30px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgb(255 255 255 / 0.18), 0 4px 10px rgb(0 0 0 / 0.4); }
.range:focus-visible { outline: none; }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--night), 0 0 0 6px var(--mint); }
.range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--night), 0 0 0 6px var(--mint); }
.range:disabled { opacity: 0.45; cursor: not-allowed; }

.field__label { display: block; margin-bottom: var(--s-2); font-weight: 700; font-size: var(--fs-sm); }
.field {
  width: 100%;
  min-height: 52px;
  padding: 0 var(--s-4);
  border: 0;
  border-radius: 16px;
  background: rgb(8 11 30 / 0.55);
  box-shadow: inset 0 1px 3px rgb(0 0 0 / 0.4), inset 0 0 0 1px var(--hairline);
  font-size: var(--fs-md);
  font-variant-numeric: tabular-nums;
}
.field::placeholder { color: var(--ink-faint); }
.field:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--mint); }
.field[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--coral); }
.field__msg { margin-top: var(--s-2); font-size: var(--fs-xs); color: var(--ink-soft); min-height: 1.5em; }
.field__msg.is-error { color: #ffc2b2; font-weight: 600; }
.field__msg.is-ok { color: var(--mint); font-weight: 600; }

/* Segmented control */
.seg {
  display: inline-flex;
  padding: 4px;
  border-radius: var(--r-pill);
  background: var(--glass-tint-strong);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.seg button {
  min-height: 44px;
  padding: 0 var(--s-4);
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: var(--fs-sm);
  transition: background var(--t-mid) var(--ease-out), color var(--t-fast);
}
.seg button[aria-checked="true"] { background: rgb(255 255 255 / 0.92); color: var(--deep); }

/* Toasts */
.toasts {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 40;
  display: grid;
  gap: var(--s-2);
  width: min(440px, calc(100% - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-chip);
  --glass-tint: var(--glass-tint-strong);
  font-size: var(--fs-sm);
  pointer-events: auto;
}
.toast .icon { color: var(--mint); }

/* ---------- 6. Header and intro ---------- */
.top { position: sticky; top: 0; z-index: 20; padding: var(--s-3) var(--gutter) 0; }
.top__in {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  width: min(100%, var(--wrap));
  margin-inline: auto;
  padding: var(--s-2) var(--s-2) var(--s-2) var(--s-4);
  border-radius: var(--r-pill);
  background: rgb(14 18 44 / 0.62);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.2), inset 0 0 0 1px var(--hairline), 0 14px 30px -18px rgb(0 0 0 / 0.7);
}
.mark { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 800; font-size: 1.375rem; letter-spacing: -0.02em; text-decoration: none; color: var(--ink); }
.mark__logo { width: 30px; height: 30px; color: var(--mint); }
.nav { display: flex; gap: var(--s-1); margin-left: auto; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s-4); border-radius: var(--r-pill); color: var(--ink-soft); font-weight: 600; font-size: var(--fs-sm); text-decoration: none; transition: background var(--t-fast), color var(--t-fast); }
.nav a:hover { background: var(--chip); color: var(--ink); }
.top__cta { min-height: 44px; }

.intro {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin: var(--s-8) auto var(--s-6);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: var(--s-6);
  align-items: end;
}
.intro h1 { font-size: var(--fs-h1); font-weight: 800; letter-spacing: -0.035em; line-height: 0.98; }
.intro p { max-width: 46ch; color: var(--ink-soft); font-size: var(--fs-lg); line-height: 1.5; padding: var(--s-4) var(--s-5); border-radius: var(--r-chip); background: rgb(11 16 36 / 0.5); }

/* ---------- 7. App ---------- */
.app {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
  padding: clamp(16px, 2.4vw, 32px);
  border-radius: var(--r-app);
  --glass-tint: rgb(14 18 44 / 0.34);
  outline: none;
}
.app__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: var(--s-2) var(--s-2) var(--s-5); }
.app__hello { font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.5rem); font-weight: 700; }
.app__sub { margin-top: var(--s-1); color: var(--ink-soft); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.hub {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 40px;
  padding: 0 var(--s-4) 0 var(--s-3);
  border-radius: var(--r-pill);
  background: rgb(147 230 220 / 0.14);
  box-shadow: inset 0 0 0 1px rgb(147 230 220 / 0.35);
  color: var(--mint);
  font-weight: 700;
  font-size: var(--fs-xs);
  white-space: nowrap;
}
.hub.is-off { background: rgb(255 154 127 / 0.16); box-shadow: inset 0 0 0 1px rgb(255 154 127 / 0.45); color: #ffc2b2; }
.hub.is-wait { background: rgb(255 255 255 / 0.1); box-shadow: inset 0 0 0 1px var(--hairline); color: var(--ink-soft); }

.alert { display: flex; align-items: center; gap: var(--s-4); margin: 0 0 var(--s-4); padding: var(--s-4) var(--s-5); color: #ffe4dc; }
.alert > .icon { color: var(--coral); }
.alert__body { flex: 1; }
.alert__title { font-weight: 800; font-size: var(--fs-lg); color: #fff; }
.alert__body p + p { margin-top: var(--s-1); font-size: var(--fs-sm); max-width: 70ch; }

.app__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  grid-template-areas:
    "scenes scenes"
    "rooms heat"
    "rooms lock"
    "energy energy";
  gap: var(--s-4);
}
.panel { padding: var(--s-5); }
.group { position: relative; padding: var(--s-2) 0 0; }
.group .panel__head { padding-inline: var(--s-2); }
.panel--scenes { grid-area: scenes; }
.panel--rooms { grid-area: rooms; }
.panel--heat { grid-area: heat; }
.panel--lock { grid-area: lock; }
.panel--energy { grid-area: energy; }
.panel__head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: var(--s-1) var(--s-4); margin-bottom: var(--s-4); }
.panel__head h3 { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -0.01em; }
.panel__note { color: var(--ink-soft); font-size: var(--fs-sm); }
.panel__note b { color: var(--ink); font-weight: 700; }

/* ---------- 8. Scenes and rooms ---------- */
.scenes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-3); }
.scene {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: var(--s-3);
  align-items: center;
  min-height: 76px;
  padding: var(--s-3) var(--s-4);
  border: 0;
  border-radius: var(--r-chip);
  text-align: left;
  transition: background var(--t-mid) var(--ease-out), box-shadow var(--t-mid) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.scene:hover { --glass-tint: rgb(30 36 76 / 0.6); }
.scene:active { transform: scale(0.98); }
.scene .icon { grid-row: span 2; color: var(--amber); }
.scene__name { font-weight: 700; font-size: var(--fs-md); line-height: 1.2; }
.scene__what { color: var(--ink-soft); font-size: var(--fs-xs); line-height: 1.3; }
.scene[aria-pressed="true"] {
  background: linear-gradient(160deg, rgb(255 255 255 / 0.95), rgb(225 232 255 / 0.88));
  color: var(--deep);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgb(255 255 255 / 0.6), 0 12px 26px -12px rgb(0 0 0 / 0.6);
}
.scene[aria-pressed="true"] .scene__what { color: #3a4170; }
.scene[aria-pressed="true"] .icon { color: #b2551d; }

.rooms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); margin: 0; padding: 0; list-style: none; }
.room {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "art art" "open temp" "open switch";
  row-gap: var(--s-1);
  padding: var(--s-2) var(--s-2) var(--s-4);
  border-radius: var(--r-panel);
  transition: transform var(--t-mid) var(--ease-out);
}
.room:hover { --glass-tint: rgb(30 36 76 / 0.6); }
.room-art { grid-area: art; display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; border-radius: 14px; margin-bottom: var(--s-2); }
.room__open { grid-area: open; display: grid; align-content: start; gap: 2px; padding: 0 var(--s-2); border: 0; background: none; text-align: left; position: static; }
.room__open::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-chip); } /* the whole card opens the room */
.room__open:focus-visible { outline: none; }
.room__open:focus-visible::after { outline: 2.5px solid var(--mint); outline-offset: 2px; }
.room__name { font-weight: 700; font-size: var(--fs-lg); line-height: 1.2; }
.room__meta { color: var(--ink-soft); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.room__temp { grid-area: temp; justify-self: end; padding-right: var(--s-2); font-weight: 700; color: var(--ink-soft); font-size: var(--fs-sm); }
.room__switch { grid-area: switch; justify-self: end; margin-right: var(--s-2); z-index: 1; }

/* Drawn rooms: night palette; lamps and their light are driven by --b (brightness) and --w (wall wash) */
.room-art { --wall: #1b2246; overflow: hidden; }
.art-wall { fill: #19203f; }
.art-wash { fill: #ffcf96; opacity: calc(var(--w, 0) * 0.42); transition: opacity 0.6s var(--ease-out); }
.art-floor { fill: #10152d; }
.art-window { fill: #0a1030; stroke: #343e74; stroke-width: 3; }
.art-frame { stroke: #343e74; stroke-width: 2.5; fill: none; }
.art-moon { fill: #dfe5ff; opacity: 0.85; }
.art-star { fill: #dfe5ff; opacity: 0.7; }
.art-rug { fill: #1c2347; }
.art-shelf, .art-counter { fill: #3a447d; }
.art-book { fill: #4b5596; }
.art-book--b { fill: #6b5aa8; }
.art-pot { fill: #5a4f8c; }
.art-cord, .art-stand, .art-leg, .art-arm { stroke: #3a447d; stroke-width: 2.5; fill: none; stroke-linecap: round; }
.art-leg { stroke-width: 4; }
.art-leg--thin { stroke-width: 3; }
.art-base { fill: #3a447d; }
.art-sofa-back { fill: #2c3466; }
.art-sofa { fill: #353e78; }
.art-sofa-arm { fill: #303971; }
.art-cushion { fill: #5b4f95; }
.art-cab { fill: #252d5a; }
.art-cab-line { stroke: #39427a; stroke-width: 2; fill: none; stroke-linecap: round; }
.art-tile { fill: #1e2650; }
.art-kettle { fill: #4b5596; stroke: #4b5596; stroke-width: 2.5; stroke-linecap: round; }
.art-island { fill: #2a3263; }
.art-bowl { fill: #5b4f95; }
.art-frame-pic { fill: #232b58; stroke: #3a447d; stroke-width: 2; }
.art-hill { fill: #3a447d; }
.art-head { fill: #2c3466; }
.art-mattress { fill: #3b4479; }
.art-pillow { fill: #59639e; }
.art-duvet { fill: #464f8c; }
.art-table { fill: #2a3263; }
.art-monitor { fill: #232b58; }
.art-screen { fill: #2a3a7a; }
.art-drawer { fill: #2a3263; }
.art-plant { fill: #2f6b67; stroke: #2f6b67; stroke-width: 2; }
.lamp { fill: #3d4682; transition: fill 0.6s var(--ease-out); }
.lamp.is-on { fill: #fff0d6; }
.glow { opacity: 0; mix-blend-mode: screen; transition: opacity 0.6s var(--ease-out); pointer-events: none; }
.glow.is-on { opacity: calc(0.3 + var(--b, 1) * 0.7); }
.is-dragging .glow, .is-dragging .art-wash { transition-duration: 0.12s; }

/* ---------- 9. Thermostat dial ---------- */
.dial { position: relative; width: min(100%, 300px); margin: 0 auto; aspect-ratio: 1; touch-action: none; }
.dial__svg { display: block; width: 100%; height: 100%; overflow: visible; }
.dial__track, .dial__value { fill: none; stroke-width: 14; stroke-linecap: round; }
.dial__track { stroke: rgb(255 255 255 / 0.1); }
.dial__value { filter: drop-shadow(0 0 8px rgb(255 190 130 / 0.45)); }
.dial__ticks line { stroke: rgb(255 255 255 / 0.24); stroke-width: 1.5; stroke-linecap: round; }
.dial__ticks line.is-major { stroke: rgb(255 255 255 / 0.5); stroke-width: 2; }
.dial__knob { cursor: grab; outline: none; }
.dial__knob-hit { fill: transparent; }
.dial__knob-dot { fill: #fff; stroke: rgb(255 255 255 / 0.35); stroke-width: 6; paint-order: stroke; filter: drop-shadow(0 3px 6px rgb(0 0 0 / 0.5)); transition: r var(--t-fast); }
.dial__knob:focus-visible .dial__knob-dot { stroke: var(--mint); stroke-width: 5; }
.dial.is-dragging .dial__knob { cursor: grabbing; }
.dial__face {
  position: absolute;
  inset: 22%;
  display: grid;
  place-content: center;
  justify-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, rgb(255 255 255 / 0.16), rgb(14 18 44 / 0.6) 70%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.35), inset 0 -10px 24px -10px rgb(255 255 255 / 0.18), 0 16px 30px -18px rgb(0 0 0 / 0.8);
  pointer-events: none;
  text-align: center;
}
.dial__mode { color: var(--ink-soft); font-size: var(--fs-xs); font-weight: 700; }
.dial__value-num { font-size: clamp(2.5rem, 2rem + 1.6vw, 3.25rem); font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.dial__now { margin-top: 6px; color: var(--ink-soft); font-size: var(--fs-xs); }
.dial__now b { color: var(--ink); }
.dial__steps { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-top: var(--s-3); }
.dial__hint { color: var(--ink-faint); font-size: var(--fs-xs); text-align: center; }

/* ---------- 10. Front door lock ---------- */
.panel--lock { display: flex; flex-direction: column; }
.lock__log { display: none; margin: auto 0 0; padding: var(--s-4) 0 0; list-style: none; font-size: var(--fs-sm); color: var(--ink-soft); }
.lock__log li { padding: var(--s-2) 0; border-top: 1px solid var(--hairline); }
.lock__log .num { display: inline-block; min-width: 3.4em; color: var(--ink); font-weight: 700; }
.lock { display: flex; align-items: center; gap: var(--s-4); margin-bottom: var(--s-4); }
.lock__ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 50%;
  background: rgb(147 230 220 / 0.16);
  box-shadow: inset 0 0 0 1.5px rgb(147 230 220 / 0.5), 0 6px 14px -6px rgb(0 0 0 / 0.5);
  color: var(--mint);
  transition: background var(--t-mid), box-shadow var(--t-mid), color var(--t-mid);
}
.lock__icon { position: absolute; width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; transition: opacity var(--t-mid), transform var(--t-mid) var(--ease-out); }
.lock__icon--open { opacity: 0; transform: translateY(3px); }
.lock__state { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.lock__sub { color: var(--ink-soft); font-size: var(--fs-sm); }
[data-lock-state="unlocked"] .lock__ring { background: rgb(255 154 127 / 0.16); box-shadow: inset 0 0 0 1.5px rgb(255 154 127 / 0.55), 0 6px 14px -6px rgb(0 0 0 / 0.5); color: var(--coral); }
[data-lock-state="unlocked"] .lock__icon--shut { opacity: 0; transform: translateY(-3px); }
[data-lock-state="unlocked"] .lock__icon--open { opacity: 1; transform: none; }
[data-lock-state="busy"] .lock__ring { animation: lock-pulse 1s var(--ease-out) infinite; }
.lock__confirm { padding-top: var(--s-4); border-top: 1px solid rgb(255 154 127 / 0.45); }
.lock__confirm p { font-size: var(--fs-sm); color: #ffe4dc; }
.lock__row { display: flex; gap: var(--s-2); margin-top: var(--s-3); }
.lock__row .btn { flex: 1; padding: 0 var(--s-3); }

/* ---------- 11. Energy ---------- */
.energy__read { margin-bottom: var(--s-3); color: var(--ink-soft); font-size: var(--fs-sm); min-height: 1.6em; }
.energy__read b { color: var(--ink); }
.bars {
  --max: 1.4;
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  align-items: end;
  gap: clamp(3px, 0.5vw, 8px);
  height: 130px;
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--hairline);
  border-radius: 6px;
}
.bars li {
  position: relative;
  height: calc(var(--v) / var(--max) * 100%);
  min-height: 6px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.55), rgb(255 255 255 / 0.18));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.6);
  font-size: 0;
  color: transparent;
  cursor: pointer;
  transition: background var(--t-fast), transform var(--t-mid) var(--ease-out);
  transform-origin: bottom;
}
.bars li.is-now { background: rgb(147 230 220 / 0.5); box-shadow: inset 0 1.5px 0 var(--mint); }
.bars li.is-sel { background: linear-gradient(180deg, #ffe0ad, #ffb07f); box-shadow: inset 0 1px 0 #fff; }
.bars:focus-visible { outline-offset: 6px; }
.bars__axis { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); margin-top: var(--s-2); color: var(--ink-faint); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.bars__axis span:nth-child(1) { grid-column: 1 / span 4; }
.bars__axis span:nth-child(2) { grid-column: 7 / span 4; }
.bars__axis span:nth-child(3) { grid-column: 13 / span 4; }
.bars__axis span:nth-child(4) { grid-column: 19 / span 1; }
.bars__axis span:nth-child(5) { grid-column: 20 / span 4; }
.split { display: flex; gap: 3px; height: 12px; margin-top: var(--s-5); }
.split__part { flex: var(--p) 1 0; border-radius: 99px; }
.split__part--heat, .dot--heat { background: var(--coral); }
.split__part--kit, .dot--kit { background: #a99cff; }
.split__part--other, .dot--other { background: #7d8bc2; }
.split__part--light, .dot--light { background: var(--amber); }
.legend { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); margin: var(--s-3) 0 0; padding: 0; list-style: none; font-size: var(--fs-sm); color: var(--ink-soft); }
.legend li { display: inline-flex; align-items: center; gap: var(--s-2); }
.legend b { color: var(--ink); }
.dot { width: 10px; height: 10px; border-radius: 50%; }

/* ---------- 12. Room sheet ---------- */
.sheet {
  width: min(720px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: var(--s-5);
  border: 0;
  color: var(--ink);
  --glass-tint: rgb(16 20 48 / 0.72);
  border-radius: 34px;
  overflow: auto;
  overscroll-behavior: contain;
}
.sheet::backdrop { background: rgb(5 8 24 / 0.45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sheet__grab { display: none; width: 44px; height: 5px; margin: -8px auto 12px; border-radius: 9px; background: rgb(255 255 255 / 0.3); }
.sheet__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-4); }
.sheet__title { font-size: var(--fs-xl); font-weight: 800; }
.sheet__sub { margin-top: 2px; color: var(--ink-soft); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.sheet__art .room-art { aspect-ratio: 16 / 10; height: auto; margin: 0; border-radius: 22px; box-shadow: inset 0 0 0 1px var(--hairline); }
.sheet__controls { margin-top: var(--s-5); display: grid; gap: var(--s-4); }
.bri__top { display: flex; align-items: center; justify-content: space-between; }
.bri__label { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 700; }
.bri__label .icon { color: var(--amber); }
.bri output { font-weight: 800; font-size: var(--fs-lg); }
.bri__hint { color: var(--ink-soft); font-size: var(--fs-xs); }
.lights { display: grid; gap: var(--s-2); margin: 0; padding: 0; list-style: none; }
.light { display: flex; align-items: center; gap: var(--s-3); min-height: 60px; padding: var(--s-2) var(--s-3) var(--s-2) var(--s-4); border-radius: 18px; background: var(--chip); box-shadow: inset 0 0 0 1px var(--hairline); }
.light .icon { color: var(--ink-faint); transition: color var(--t-mid); }
.light.is-on .icon { color: var(--amber); }
.light__name { flex: 1; font-weight: 700; }
.light__w { color: var(--ink-soft); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.sheet__foot { color: var(--ink-soft); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }

/* ---------- 13. Marketing ---------- */
.how, .plans, .download, .faq { margin-top: var(--s-9); }
.how { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: var(--s-7); align-items: center; }
.how h2, .plans h2, .download h2, .faq h2 { font-size: var(--fs-h2); font-weight: 800; letter-spacing: -0.03em; }
.lede { margin-top: var(--s-4); max-width: 54ch; font-size: var(--fs-lg); color: var(--ink-soft); }
.facts { margin: var(--s-6) 0 0; display: grid; gap: var(--s-5); }
.facts div { padding-top: var(--s-4); border-top: 1px solid var(--hairline); }
.facts dt { font-weight: 800; font-size: var(--fs-lg); }
.facts dd { margin: var(--s-1) 0 0; max-width: 60ch; color: var(--ink-soft); }
.how__fig { margin: 0; padding: var(--s-5); border-radius: 36px; }
.how__fig svg { display: block; width: 100%; height: auto; }
.fig-lines path { stroke: rgb(147 230 220 / 0.6); stroke-width: 2; fill: none; }
.fig-lines .fig-dash { stroke: rgb(255 255 255 / 0.4); stroke-dasharray: 4 6; }
.fig-node rect { fill: #262d60; stroke: rgb(255 255 255 / 0.35); stroke-width: 1.2; }
.fig-node text, .fig-cloud text { fill: var(--ink); font: 700 15px var(--sans); text-anchor: middle; }
.fig-node--hub rect { fill: #24506a; stroke: var(--mint); stroke-width: 1.5; }
.fig-node--hub text { font-size: 18px; font-weight: 800; }
.fig-cloud rect { fill: rgb(11 16 36 / 0.8); stroke: rgb(255 255 255 / 0.4); stroke-dasharray: 3 4; }
.fig-cloud text { font-size: 13px; fill: var(--ink-soft); }
.fig-label { fill: var(--ink-soft); font: 600 13px var(--sans); text-anchor: middle; paint-order: stroke; stroke: #11163a; stroke-width: 5px; }

.plans__head { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: var(--s-4); margin-bottom: var(--s-6); }
.plans__head h2 { max-width: 18ch; }
.plans__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.plan { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-6); border-radius: 34px; }
.plan h3 { font-size: var(--fs-xl); }
.plan__price { font-size: var(--fs-lg); color: var(--ink-soft); }
.plan__price .num { font-size: 3rem; font-weight: 800; letter-spacing: -0.03em; color: var(--ink); }
.plan__small { color: var(--ink-soft); font-size: var(--fs-sm); }
.plan__list { display: grid; gap: var(--s-2); margin: var(--s-3) 0 var(--s-4); padding: 0; list-style: none; flex: 1; }
.plan__list li { display: flex; gap: var(--s-3); align-items: flex-start; }
.plan__list .icon { color: var(--mint); margin-top: 3px; }
.plan--plus { --glass-tint: rgb(28 26 70 / 0.62); }
.plan--plus::after { background: radial-gradient(70% 80% at 50% 100%, color-mix(in srgb, var(--a3) 34%, transparent), transparent 70%); }

.download__card { position: relative; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr); gap: var(--s-7); align-items: center; padding: clamp(8px, 2vw, 24px) 0; }
.download__text > p { margin-top: var(--s-3); max-width: 52ch; color: var(--ink-soft); font-size: var(--fs-lg); }
.send { margin-top: var(--s-5); max-width: 520px; }
.send__row { display: flex; gap: var(--s-2); }
.send__row .btn { flex: none; min-height: 52px; }
.download__text > .download__small { margin-top: var(--s-4); color: var(--ink-faint); font-size: var(--fs-sm); }
.send.is-sent .send__row, .send.is-sent .field__label { display: none; }

/* A phone drawn in CSS: glass bezel, lock-screen widget mirroring the app */
.phone {
  justify-self: center;
  width: 220px;
  aspect-ratio: 9 / 18.5;
  padding: 10px;
  border-radius: 40px;
  background: linear-gradient(150deg, rgb(255 255 255 / 0.35), rgb(255 255 255 / 0.06) 40%, rgb(255 255 255 / 0.18));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.6), 0 40px 60px -30px rgb(0 0 0 / 0.9);
  transform: rotate(6deg);
}
.phone__screen {
  height: 100%;
  padding: 44px 14px 14px;
  border-radius: 31px;
  background:
    radial-gradient(80% 50% at 20% 10%, color-mix(in srgb, var(--a1) 70%, transparent), transparent),
    radial-gradient(80% 50% at 90% 60%, color-mix(in srgb, var(--a2) 70%, transparent), transparent),
    #0b1024;
  text-align: center;
}
.phone__time { font-size: 3.25rem; font-weight: 700; line-height: 1; letter-spacing: -0.03em; }
.phone__date { margin-top: 4px; font-size: var(--fs-xs); color: var(--ink); }
.phone__widget + .phone__widget { margin-top: 10px; }
.phone__widget { margin-top: 26px; padding: 12px; border-radius: 20px; background: rgb(12 16 40 / 0.62); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.3); text-align: left; font-size: 0.8125rem; }
.phone__w-title { display: flex; align-items: center; gap: 6px; font-weight: 800; margin-bottom: 6px; }
.phone__w-title .icon { width: 16px; height: 16px; color: var(--mint); }
.phone__w-row { display: flex; justify-content: space-between; padding: 4px 0; border-top: 1px solid var(--hairline); color: var(--ink); }

.faq { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); gap: var(--s-7); align-items: start; }
.faq__intro { position: sticky; top: 110px; }
.faq__intro p { margin-top: var(--s-4); max-width: 40ch; color: var(--ink-soft); font-size: var(--fs-lg); }
.faq__list { display: grid; gap: var(--s-3); }
.q { border-radius: 24px; }
.q summary { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: 64px; padding: var(--s-3) var(--s-5); font-weight: 700; font-size: var(--fs-lg); cursor: pointer; list-style: none; border-radius: 24px; }
.q summary::-webkit-details-marker { display: none; }
.q summary .icon { transition: transform var(--t-mid) var(--ease-out); color: var(--mint); }
.q[open] summary .icon { transform: rotate(180deg); }
.q p { padding: 0 var(--s-5) var(--s-5); max-width: 68ch; color: var(--ink-soft); }

.foot { margin-top: var(--s-9); padding: var(--s-7) 0 var(--s-8); background: rgb(8 11 28 / 0.72); box-shadow: inset 0 1px 0 var(--hairline); }
.foot__in { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--s-6); }
.foot__brand p { margin-top: var(--s-2); max-width: 34ch; color: var(--ink-soft); }
.foot__nav { display: grid; grid-template-columns: repeat(2, max-content); gap: 0 var(--s-6); align-content: start; }
.foot__nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-soft); text-decoration: none; font-weight: 600; }
.foot__nav a:hover { color: var(--ink); }
.foot__contact { color: var(--ink-soft); line-height: 2; }
.foot__small { grid-column: 1 / -1; padding-top: var(--s-5); border-top: 1px solid var(--hairline); color: var(--ink-faint); font-size: var(--fs-sm); }

/* ---------- 14. App states ---------- */
/* Loading: panels keep their size, contents give way to a slow light sweep */
.app[data-state="loading"] :is(.panel, .room, .scene) > * { visibility: hidden; }
.app[data-state="loading"] :is(.panel, .room, .scene)::after {
  content: "";
  position: absolute;
  inset: var(--s-4);
  height: auto;
  border-radius: 16px;
  background:
    linear-gradient(100deg, transparent 30%, rgb(255 255 255 / 0.1) 50%, transparent 70%) 0 0 / 300% 100%,
    rgb(255 255 255 / 0.06);
  animation: sweep 1.6s linear infinite;
}
.app[data-state="loading"] .scenes, .app[data-state="loading"] .rooms { pointer-events: none; }
.app[data-state="loading"] .group .panel__note { visibility: hidden; }

/* Offline: the glass frosts over, controls are inert, last known values stay readable */
.app[data-state="offline"] .app__grid { filter: saturate(0.4); }
.app[data-state="offline"] :is(.panel, .room, .scene) { --glass-tint: rgb(24 28 52 / 0.72); }
.app[data-state="offline"] .lamp.is-on { fill: #c9c3b8; }
.app[data-state="offline"] .glow.is-on { opacity: 0.18; }

/* ---------- 15. Motion ---------- */
@keyframes drift-1 { to { transform: translate(14vmax, 10vmax) scale(1.12); } }
@keyframes drift-2 { to { transform: translate(-12vmax, 14vmax) scale(0.9); } }
@keyframes drift-3 { to { transform: translate(-16vmax, -8vmax) scale(1.18); } }
@keyframes drift-4 { to { transform: translate(18vmax, -10vmax) scale(1.05); } }
@keyframes sweep { to { background-position: -300% 0; } }
@keyframes lock-pulse { 50% { transform: scale(0.94); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(0.98); filter: blur(4px); } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(28px) scale(0.97); filter: blur(8px); } }

@media (prefers-reduced-motion: no-preference) {
  .aurora__blob--1 { animation: drift-1 38s ease-in-out infinite alternate; }
  .aurora__blob--2 { animation: drift-2 46s ease-in-out infinite alternate; }
  .aurora__blob--3 { animation: drift-3 53s ease-in-out infinite alternate; }
  .aurora__blob--4 { animation: drift-4 61s ease-in-out infinite alternate; }
  .toast { animation: toast-in 0.5s var(--ease-out); }
  .sheet[open] { animation: sheet-in 0.55s var(--ease-out); }
  .app.is-scene-change .room-art { animation: scene-breathe 1.1s var(--ease-out); }
}
@keyframes scene-breathe { 40% { filter: brightness(1.15) saturate(1.2); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; transition: none; }
  .aurora__blob { animation: none; }
  .app[data-state="loading"] :is(.panel, .room, .scene)::after { animation: none; }
  [data-lock-state="busy"] .lock__ring { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

/* ---------- 16. Narrow screens ---------- */
@media (max-width: 1080px) {
  .app__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "scenes scenes" "rooms rooms" "heat lock" "energy energy"; }
  .scenes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intro { grid-template-columns: 1fr; gap: var(--s-4); }
  .lock__log { display: block; }
  .how, .faq { grid-template-columns: 1fr; }
  .faq { gap: var(--s-5); }
  .faq__intro { position: static; }
  .how__fig { max-width: 560px; }
}
@media (max-width: 760px) {
  .nav { display: none; }
  .top__cta { margin-left: auto; }
  .app__grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "scenes" "rooms" "heat" "lock" "energy"; }
  .rooms { grid-template-columns: minmax(0, 1fr); }
  .room { grid-template-columns: minmax(0, 120px) 1fr auto; grid-template-areas: "art open temp" "art open switch"; column-gap: var(--s-3); padding: var(--s-2); align-items: center; }
  .room-art { margin: 0; aspect-ratio: 4 / 3; height: 100%; object-fit: cover; }
  .room__open { padding: 0; }
  .plans__grid { grid-template-columns: 1fr; }
  .download__card { grid-template-columns: 1fr; }
  .phone { width: 190px; }
  .foot__in { grid-template-columns: 1fr; }
  .bars__axis span:nth-child(4) { display: none; }
}
@media (max-width: 560px) {
  :root { --r-app: 30px; --r-panel: 24px; }
  .intro { margin-top: var(--s-6); }
  .intro p { font-size: var(--fs-md); padding: var(--s-3) var(--s-4); }
  .app { width: calc(100% - 16px); padding: 10px; }
  .app__bar { flex-wrap: wrap; padding: var(--s-3) var(--s-2) var(--s-4); }
  .panel { padding: var(--s-4); }
  .scenes { gap: var(--s-2); }
  .scene { grid-template-columns: 1fr; grid-template-rows: auto auto auto; row-gap: 2px; padding: var(--s-3); }
  .scene .icon { grid-row: auto; margin-bottom: 4px; }
  .alert { flex-wrap: wrap; padding: var(--s-4); }
  .alert .btn { width: 100%; }
  .send__row { flex-direction: column; }
  .bars { height: 110px; gap: 2px; }
  .sheet { width: 100%; max-width: 100%; max-height: 92dvh; margin: auto 0 0; padding: var(--s-4); border-radius: 30px 30px 0 0; }
  .sheet__grab { display: block; }
  .lock__row { flex-direction: column; }
  .plan { padding: var(--s-5); }
  .q summary { font-size: var(--fs-md); padding: var(--s-3) var(--s-4); }
  .q p { padding: 0 var(--s-4) var(--s-4); }
}
