:root {
  color-scheme: dark;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #eef5fb;
  background: #0b141d;
  --surface: #111e2b;
  --muted: #a8bbcc;
  --line: #2b4053;
  --accent: #72e6da;
  --curve: 19px;
  --quick: 155ms;
  --relaxed: 280ms;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
* { box-sizing: border-box; }
html { scroll-padding-top: 1rem; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 73% -4%, #24526a65, transparent 45rem),
    radial-gradient(ellipse at 5% 36%, #15354160, transparent 33rem),
    repeating-linear-gradient(90deg, #8fd1ee0b 0 1px, transparent 1px 52px),
    repeating-linear-gradient(0deg, #8fd1ee0b 0 1px, transparent 1px 52px), #0b141d;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid #9cf9ee; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
.sr-only { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.shell { width: min(100%, 1240px); margin-inline: auto; padding-inline: clamp(.88rem, 4vw, 2.75rem); }
.topbar { border-bottom: 1px solid #2e4055; background: #0e1924e6; }
.top-inner { min-height: 4rem; display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.brand { display: inline-grid; place-items: center; min-width: 2.75rem; min-height: 2.75rem; border-radius: .72rem; }
.home-mark { width: 2.35rem; height: 2.35rem; position: relative; display: grid; place-items: center; color: #162e38; border-radius: .65rem; background: linear-gradient(155deg, #bcfaec, #67c8d0); box-shadow: inset 0 1px 1px #ffffff80, 0 4px 20px #53d2de38; }
.home-mark::before, .home-mark::after { content: ""; position: absolute; transform: rotate(45deg); border: 1.5px solid currentColor; border-radius: .22rem; }
.home-mark::before { width: .95rem; height: .95rem; }
.home-mark::after { width: .45rem; height: .45rem; }
nav { display: flex; align-items: center; gap: clamp(.68rem, 4vw, 2.15rem); color: #c2d1de; font-size: .94rem; }
nav a { display: inline-grid; place-items: center; min-height: 2.75rem; padding-block: .65rem; border-bottom: 1px solid transparent; transition: color var(--quick) ease, border-color var(--quick) ease; }
nav a:hover, nav a[aria-current="location"] { color: var(--accent); }
nav a[aria-current="location"] { border-bottom-color: var(--accent); }
main { padding-block: clamp(1.08rem, 3.2vw, 2.2rem) 3rem; }
.intro {
  display: flex;
  align-items: center;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: clamp(7rem, 15vw, 10.5rem);
  margin-bottom: .95rem;
  border: 1px solid #3d5f71;
  border-radius: calc(var(--curve) + 4px);
  background:
    linear-gradient(100deg, #152b3c 4%, #142b3dd4 27%, #1b406387 64%, #22546b72),
    repeating-linear-gradient(0deg, #9bdbe622 0 1px, transparent 1px 26px),
    repeating-linear-gradient(90deg, #9bdbe622 0 1px, transparent 1px 26px), #172938;
  box-shadow: inset 0 1px 0 #aae6ff20;
}
.intro::after { content: ""; position: absolute; inset: 0 42% 0 0; z-index: -1; background: linear-gradient(90deg, #11283be6, #11283b66 80%, transparent); }
.blueprint {
  position: absolute;
  z-index: -2;
  top: 50%;
  right: clamp(1.4rem, 12vw, 11rem);
  width: clamp(14rem, 43vw, 33rem);
  aspect-ratio: 2.5;
  transform: translateY(-50%) rotate(-12deg) skewX(-32deg);
  background: linear-gradient(120deg, #7cefe019, #b4eaff07);
  border: 1px solid #b3e9ff8a;
  border-radius: 1rem .1rem;
  box-shadow: 0 0 18px #77e7da22, inset 0 0 33px #6ee5e92e, 0 11px 0 #7ddfe035, 0 19px 0 #87d3f01e, 0 27px 0 #7be0e215;
}
.blueprint::before, .blueprint::after, .blueprint i, .blueprint b { position: absolute; content: ""; border: 1px solid #9cdbf96e; }
.blueprint::before { inset: 10% 6%; background: repeating-linear-gradient(90deg, #9bf2ed22 0 1px, transparent 1px 10%); }
.blueprint::after { inset: -10% -5%; border-style: dashed; border-color: #b0def94e; }
.blueprint i:first-child { inset: 10% auto 10% 34%; width: 15%; border-block: 0; }
.blueprint i:nth-child(2) { inset: auto 6% 43% 34%; height: 0; }
.blueprint i:nth-child(3) { inset: 18% 13% auto auto; width: 24%; height: 24%; box-shadow: 3px 3px #70dce63e; }
.blueprint b { inset: auto auto 18% 12%; width: 15%; height: 35%; border-radius: 2px; box-shadow: inset 0 0 22px #72e6da31; }
.clock { display: grid; gap: .12rem; white-space: nowrap; margin-inline: clamp(1.2rem, 5vw, 3.35rem); }
.clock time { font-size: clamp(2.2rem, 6.2vw, 4.7rem); font-weight: 630; line-height: 1; letter-spacing: -.08em; color: #f4fcff; text-shadow: 0 3px 25px #92fff749; font-variant-numeric: tabular-nums; }
.clock span { color: #c1d6e6; font-size: .92rem; text-transform: lowercase; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .86rem; margin-bottom: .9rem; }
.card { min-width: 0; border: 1px solid var(--line); border-radius: var(--curve); padding: clamp(.9rem, 2.25vw, 1.4rem); background: linear-gradient(130deg, #1b2e3e66, transparent 78%), var(--surface); box-shadow: inset 0 1px 0 #d7edff09, 0 10px 28px #02070e4a; }
.stat { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .3rem .55rem; position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; inset: 0 0 auto; height: 1px; background: linear-gradient(90deg, var(--tone), transparent 75%); opacity: .58; }
.stat h2 { color: var(--muted); font-size: .91rem; font-weight: 550; grid-row: 1; grid-column: 1; }
.stat p { display: flex; flex-wrap: wrap; gap: .25rem; align-items: baseline; color: var(--muted); font-size: .85rem; grid-row: 2; grid-column: 1; }
.stat p strong { font-size: clamp(1.75rem, 4.25vw, 2.6rem); font-weight: 700; line-height: 1.08; color: #f3faff; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.stat-mark, .device-icon { display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; color: var(--tone); background: var(--tone-background); border: 1px solid color-mix(in srgb, var(--tone) 29%, transparent); border-radius: .58rem; font-size: 1.13rem; font-weight: 750; }
.stat-mark { grid-area: 1 / 2 / 3 / 3; }
.warm { --tone: #ffca9a; --tone-background: #47382b; }
.aqua { --tone: #9ae8df; --tone-background: #214744; }
.lime { --tone: #d4ec91; --tone-background: #39472f; }
.blue { --tone: #bbd7fe; --tone-background: #2c4160; }
.main-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: .9rem; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .7rem; align-items: start; margin-bottom: 1rem; }
.card-head h2 { font-size: 1.15rem; font-weight: 680; letter-spacing: -.022em; }
.thermostat p { color: var(--muted); font-size: .88rem; margin-top: .23rem; }
.floor { display: grid; grid-template-columns: minmax(0, 1.13fr) minmax(0, 1fr) minmax(0, 1.04fr); grid-template-rows: repeat(2, minmax(5.1rem, auto)); gap: .35rem; padding: .5rem; border: 1px solid #345166; border-radius: .8rem; background: repeating-linear-gradient(90deg, #87bfd02b 0 1px, transparent 1px 18px), repeating-linear-gradient(0deg, #87bfd02b 0 1px, transparent 1px 18px), #132332; }
.room { position: relative; isolation: isolate; border: 2px solid #486b81; border-radius: .25rem; padding: .68rem; min-width: 0; background: #20384a; text-align: left; display: flex; flex-direction: column; align-items: start; overflow-wrap: anywhere; transition: background-color var(--relaxed) var(--ease), border-color var(--relaxed) var(--ease), box-shadow var(--relaxed) var(--ease); }
.room:hover { background-color: #2b4758; }
.room::before { position: absolute; z-index: -1; inset: 0; content: ""; background: radial-gradient(ellipse at 90% 90%, #c1a37b56, transparent 64%); opacity: 0; transition: opacity var(--relaxed) ease; pointer-events: none; }
.room[data-lit="true"]::before { opacity: 1; }
.room[aria-pressed="true"] { border-color: #7de6dd; background-color: #294f5c; box-shadow: inset 0 0 22px #79e6e525, 0 0 13px #89ffed30; }
.room span { font-size: .9rem; color: #d8e9f1; }
.room strong { display: block; margin-top: .28rem; font-variant-numeric: tabular-nums; }
.living { grid-area: 1 / 1 / 3 / 2; }
.kitchen { grid-area: 1 / 2 / 2 / 3; }
.bedroom { grid-area: 1 / 3 / 3 / 4; }
.hall { grid-area: 2 / 2 / 3 / 3; }
.window { position: absolute; left: 39%; top: -2px; width: 42%; height: .3rem; border-block: 1px solid #acf0ffad; background: #618ca3; }
.furniture { position: absolute; z-index: -1; width: 45%; max-width: 4.1rem; height: 1.1rem; right: 11%; bottom: 10%; border: 1px solid #acdaee87; border-radius: .22rem; background: #91c7d81b; }
.couch { height: 1.55rem; border-bottom-width: .35rem; border-inline-width: .3rem; }
.table { width: 28%; right: 23%; bottom: 29%; height: 1rem; border-radius: 50%; }
.bed { height: 2.9rem; width: 38%; border-top-width: .55rem; }
.bed::after { content: ""; position: absolute; width: 58%; height: .56rem; top: .15rem; left: 21%; border: 1px solid #acdaee68; border-radius: .19rem; }
.counter { height: .56rem; width: 42%; background: repeating-linear-gradient(90deg, #acdaee65 0 1px, transparent 1px 24%); }
.mat { border-style: dashed; background-image: repeating-linear-gradient(45deg, transparent 0 4px, #acdaee28 4px 5px); }
.thermostat { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: .65rem; padding-top: .9rem; }
.thermostat h3, .scenes h3 { font-size: .96rem; }
.stepper, .controls { display: flex; align-items: center; gap: .35rem; }
.stepper { border: 1px solid var(--line); border-radius: .62rem; padding: .2rem; }
.stepper button, .controls button { border: 1px solid #3b576c; border-radius: .55rem; background: #203447; padding: .48rem .68rem; min-height: 2.75rem; transition: color var(--quick) ease, border-color var(--quick) ease, background-color var(--quick) ease, transform var(--quick) var(--ease); }
.stepper button { width: 2.75rem; padding: 0; }
.stepper button:hover, .controls button:hover { border-color: #6ba8b7; }
.stepper button:disabled { opacity: .45; cursor: default; }
.stepper button:not(:disabled):active, .controls button:active { transform: translateY(1px) scale(.96); }
.stepper output { text-align: center; min-width: 4.5rem; font-size: .95rem; color: var(--accent); font-variant-numeric: tabular-nums; }
.devices, .events { padding: 0; margin: 0; list-style: none; }
.devices li, .events li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .68rem; border-bottom: 1px solid var(--line); padding-block: .46rem; }
.devices li:first-child, .events li:first-child { padding-top: .16rem; }
.events li:last-child { border-bottom: 0; }
.devices strong, .events strong { font-size: .94rem; }
.devices small, .events small { display: block; margin-top: .15rem; color: var(--muted); font-size: .84rem; }
.device-icon::before { content: ""; box-sizing: border-box; width: .74rem; height: .82rem; border: 1.5px solid currentColor; }
.light::before { border-radius: 60% 60% 40% 40%; border-bottom-width: 4px; }
.humid::before { border-radius: 70% 12% 60% 60%; transform: rotate(-45deg); }
.plug::before { border-radius: .22rem; border-top-width: 4px; }
.device-state { white-space: nowrap; }
.devices li:has([aria-checked="true"]) .device-state { color: var(--accent); }
.switch { position: relative; width: 3.25rem; height: 2.75rem; border: 0; border-radius: .6rem; background: transparent; padding: 0; }
.switch::before, .switch::after { content: ""; position: absolute; top: 50%; }
.switch::before { inset-inline: .2rem; height: 1.62rem; border: 1px solid #58748a; border-radius: 999px; background: #253a4e; transform: translateY(-50%); transition: background-color var(--quick) ease, border-color var(--quick) ease; }
.switch::after { left: .46rem; width: 1.08rem; height: 1.08rem; border-radius: 50%; background: #a8c0d1; transform: translateY(-50%); transition: background-color var(--quick) ease, transform var(--relaxed) var(--ease); }
.switch:hover::before { border-color: #8eb8ce; }
.switch[aria-checked="true"]::before { background: #6bd8ca; border-color: #85eddf; }
.switch[aria-checked="true"]::after { background: #193840; transform: translate(1.24rem, -50%); }
.scenes { padding-top: .73rem; }
.scenes .controls { margin-top: .45rem; flex-wrap: wrap; }
.controls button { font-size: .87rem; font-weight: 650; white-space: nowrap; }
.controls button[aria-pressed="true"] { color: #12313b; border-color: var(--accent); background: #9ceee0; }
.energy-total { color: var(--muted); margin-top: .45rem; }
.energy-total strong { color: #f1fbff; font-size: 1.94rem; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.energy-graph { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .33rem; }
.energy-axis { color: var(--muted); font-size: .8rem; min-width: 1.42rem; font-variant-numeric: tabular-nums; display: flex; justify-content: space-between; flex-direction: column; padding-bottom: 1.4rem; }
.energy-bars { display: flex; justify-content: space-around; gap: .13rem; margin: 0; padding: 0; list-style: none; position: relative; isolation: isolate; }
.energy-bars::before { content: ""; position: absolute; inset: 0 .1rem 1.4rem; z-index: -1; border-block: 1px solid #45667a84; background: repeating-linear-gradient(0deg, transparent 0 calc(25% - 1px), #45667a60 calc(25% - 1px) 25%); }
.energy-bars li { flex: 1; min-width: 0; text-align: center; }
.energy-bars .bar-track { height: 6rem; width: 100%; position: relative; overflow: hidden; display: block; border: 0; border-radius: .2rem; background: transparent; transition: background-color var(--quick) ease; }
.energy-bars .bar-track:hover, .energy-bars .bar-track[aria-pressed="true"] { background: #82dbed13; }
.energy-bars .bar-track:focus-visible { outline-offset: -2px; }
.energy-bars meter { position: absolute; bottom: 0; left: 50%; width: 6rem; height: clamp(.95rem, 2.8vw, 1.7rem); appearance: none; border: 0; margin: 0; transform: translateY(50%) rotate(-90deg); transform-origin: left center; pointer-events: none; }
.energy-bars meter::-webkit-meter-bar { border: 0; background: none; }
.energy-bars meter::-webkit-meter-optimum-value { border-radius: .1rem .29rem .29rem .1rem; background: linear-gradient(90deg, #2d7c89, #67c7cc); }
.energy-bars .bar-track[aria-pressed="true"] meter::-webkit-meter-optimum-value { background: linear-gradient(90deg, #3a9799, #a2f7e4); }
.energy-bars meter::-moz-meter-bar { border: 0; border-radius: .1rem .29rem .29rem .1rem; background: linear-gradient(90deg, #2d7c89, #67c7cc); }
.energy-bars .bar-track[aria-pressed="true"] meter::-moz-meter-bar { background: linear-gradient(90deg, #3a9799, #a2f7e4); }
.energy-bars span, .events time { color: var(--muted); font-size: .82rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.energy-bars span { display: block; padding-top: .3rem; }
.energy-reading { color: var(--accent); font-size: .89rem; margin-top: .7rem; }
.event-mark { width: .7rem; height: .7rem; margin-inline: .27rem; border-radius: 50%; background: var(--tone); box-shadow: 0 0 0 .22rem var(--tone-background); }
@keyframes reveal-content {
  from { opacity: .72; transform: translateY(5px); }
}
@keyframes grow-bar {
  from { opacity: .35; transform: translateY(50%) rotate(-90deg) scaleX(.16); }
}
@keyframes reveal-event {
  from { opacity: .4; transform: translateY(-5px); background-color: #224352; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .intro, .stats, .main-grid { animation: reveal-content 310ms var(--ease); }
  .energy-bars meter { animation: grow-bar var(--relaxed) var(--ease); }
  .events .event-new { animation: reveal-event var(--relaxed) var(--ease); }
}
@media (max-width: 760px) {
  .main-grid { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top-inner { min-height: 3.4rem; }
  .intro { margin-bottom: .8rem; }
  .energy-bars span { font-size: .73rem; }
}
@media (max-width: 380px) {
  .stat { gap: .25rem; }
  .stat .stat-mark { width: 1.55rem; height: 1.55rem; font-size: .84rem; }
  .stat p span { font-size: .77rem; }
  .room { padding-inline: .29rem; }
  .room span { font-size: .75rem; }
  .energy-bars span { font-size: .68rem; }
}
@media (prefers-reduced-motion: reduce) {
  :root { --quick: 0s; --relaxed: 0s; }
  .stepper button:not(:disabled):active, .controls button:active { transform: none; }
}
