/* The page's two modes. The TV and the "always dark" section use their own fixed colors further down. */
:root {
  color-scheme: light;
  --bg: #f3f0ea;
  --bg-2: #eae6dd;
  --card: #fbfaf6;
  --ink: #1b1a1f;
  --muted: #5d5a63;
  --line: rgba(27, 26, 31, .13);
  --accent: #1e3a8a;
  --accent-2: #2f55c4;
  --wall-a: #ece8df;
  --wall-b: #dfd9cd;
  --sun: 1;
  --tv-light: 0;
  --tv-shadow: 0 30px 60px -18px rgba(44, 36, 24, .45), 0 8px 16px rgba(44, 36, 24, .18);
  --card-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 18px 40px -28px rgba(44, 36, 24, .35);
  --display: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --body: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121115;
    --bg-2: #18171c;
    --card: #1b1a20;
    --ink: #eeecf0;
    --muted: #a5a2ab;
    --line: rgba(255, 255, 255, .11);
    --accent: #8dbcfc;
    --accent-2: #60a5fa;
    --wall-a: #17161b;
    --wall-b: #0e0d11;
    --sun: 0;
    --tv-light: 1;
    --tv-shadow: 0 30px 60px -18px rgba(0, 0, 0, .8);
    --card-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121115;
  --bg-2: #18171c;
  --card: #1b1a20;
  --ink: #eeecf0;
  --muted: #a5a2ab;
  --line: rgba(255, 255, 255, .11);
  --accent: #8dbcfc;
  --accent-2: #60a5fa;
  --wall-a: #17161b;
  --wall-b: #0e0d11;
  --sun: 0;
  --tv-light: 1;
  --tv-shadow: 0 30px 60px -18px rgba(0, 0, 0, .8);
  --card-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  transition: background-color .5s, color .5s;
  overflow-x: hidden;
}
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
img, svg { display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ico { width: 1em; height: 1em; fill: currentColor; flex: none; }
kbd {
  font: 600 .82em var(--body);
  padding: .08em .45em;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--card);
}
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: 16px; top: -60px; z-index: 30; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }

h1, h2 { font-family: var(--display); font-weight: 650; letter-spacing: -.025em; text-wrap: balance; }
h2 { font-size: clamp(30px, 4.6vw, 54px); line-height: 1.04; }
h3 { font: 620 21px/1.2 var(--display); letter-spacing: -.012em; }
.eyebrow { font-size: 14px; font-weight: 600; color: var(--accent); margin-bottom: 14px; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 28px;
  padding: 12px clamp(16px, 4vw, 44px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
  transition: background-color .5s;
}
.brand { display: flex; align-items: center; gap: 10px; font: 680 19px var(--display); letter-spacing: -.015em; text-decoration: none; }
.nav-links { display: flex; gap: 24px; margin-left: auto; font-size: 15px; }
.nav-links a { text-decoration: none; color: var(--muted); transition: color .2s; }
.nav-links a:hover { color: var(--ink); }
.nav-github { display: inline-flex; align-items: center; gap: 6px; }
.nav-github svg { width: 16px; height: 16px; }

.theme { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin: 0; min-width: 0; background: var(--card); }
.theme label {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  font-size: 13px; font-weight: 550; color: var(--muted);
  cursor: pointer; transition: background-color .2s, color .2s;
}
.theme input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.theme svg { width: 16px; height: 16px; fill: currentColor; }
.theme label:hover { color: var(--ink); }
.theme label:has(input:checked) { background: var(--ink); color: var(--bg); }
.theme label:has(input:focus-visible) { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* Hero: a wall in daylight or at night. The TV is the same in both. */
.hero { position: relative; overflow: hidden; padding: clamp(40px, 7vw, 84px) clamp(16px, 4vw, 44px) 34px; isolation: isolate; border-bottom: 1px solid var(--line); }
.wall { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, var(--wall-a), var(--wall-b)); transition: background .6s; }
.wall::after {
  content: ""; position: absolute; left: 50%; top: 66%;
  width: min(1500px, 170vw); height: 950px;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(var(--glow, 96, 165, 250), .24), rgba(var(--glow, 96, 165, 250), .07) 58%, transparent);
  opacity: var(--tv-light);
  transition: opacity .7s;
  pointer-events: none;
}
/* Light from a window, falling across the wall */
.sunlight {
  position: absolute; right: -6%; top: -18%;
  width: min(760px, 90vw); aspect-ratio: 1 / 1.05;
  transform: rotate(14deg) skewX(-14deg);
  opacity: calc(var(--sun) * .85);
  transition: opacity .7s;
  filter: blur(7px);
  background:
    linear-gradient(rgba(255, 252, 240, .95), rgba(255, 252, 240, .95)) 0 0 / 47% 47% no-repeat,
    linear-gradient(rgba(255, 252, 240, .95), rgba(255, 252, 240, .95)) 100% 0 / 47% 47% no-repeat,
    linear-gradient(rgba(255, 252, 240, .95), rgba(255, 252, 240, .95)) 0 100% / 47% 47% no-repeat,
    linear-gradient(rgba(255, 252, 240, .95), rgba(255, 252, 240, .95)) 100% 100% / 47% 47% no-repeat;
  mask-image: linear-gradient(200deg, #000 30%, transparent 92%);
  -webkit-mask-image: linear-gradient(200deg, #000 30%, transparent 92%);
}

.hero-copy { max-width: 1240px; margin: 0 auto clamp(34px, 5vw, 58px); position: relative; }
h1 { font-size: clamp(42px, 7vw, 96px); line-height: 1.05; letter-spacing: -.03em; max-width: 17ch; font-weight: 700; }
.hero-side { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 48px; margin-top: 26px; }
.lede { font-size: clamp(18px, 2vw, 22px); line-height: 1.42; max-width: 34em; color: var(--muted); }
.hero-note { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; font-size: 15px; color: var(--muted); }
.hero-install { display: inline-flex; align-items: center; gap: 16px; padding: 10px 28px 10px 10px; border-radius: 22px; background: var(--accent); color: var(--card); font: 680 23px var(--display); letter-spacing: -.012em; text-decoration: none; box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--accent) 80%, transparent); transition: background-color .2s, transform .2s; }
.hero-install img { flex: none; border-radius: 12px; }
.hero-install::after { content: "↓"; font-weight: 600; }
.hero-install:hover { background: var(--accent-2); transform: translateY(-1px); }
.hero-note > :not(.hero-install) { margin-left: 22px; }
.hero-github { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-size: 16px; font-weight: 600; text-underline-offset: 3px; }
.hero-github svg { flex: none; width: 18px; height: 18px; }

.set { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 138px; gap: clamp(20px, 3vw, 44px); align-items: end; max-width: 1240px; margin: 0 auto; }
.tv-wrap { min-width: 0; }
.tv {
  --glow: 96, 165, 250;
  position: relative; padding: clamp(4px, .7vw, 9px);
  background: linear-gradient(#26252a, #0c0c0e);
  border-radius: clamp(6px, 1vw, 12px);
  box-shadow: var(--tv-shadow);
  transition: box-shadow .6s;
}
.tv::before {
  content: ""; position: absolute; inset: 8%; z-index: -1; border-radius: 40px;
  box-shadow: 0 0 150px 60px rgba(var(--glow), .3);
  opacity: var(--tv-light);
  transition: opacity .7s, box-shadow .7s;
}
.screen { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 2px; background: #1e1d22; }
.noscript { color: #c4c1c6; display: grid; place-items: center; height: 100%; }

/* The remote. Dark in both modes, like the TV. */
.remote {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding: 24px 12px 28px;
  border-radius: 34px;
  background: linear-gradient(160deg, #2f2e34, #17161a 70%);
  box-shadow: 0 26px 40px -16px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .1);
  color: #c4c1c6;
  position: relative;
}
/* A note scribbled above the remote, in the page's ink */
.try-me {
  position: absolute; left: 50%; bottom: calc(100% + 4px);
  width: 120px; margin-left: -60px;
  display: flex; flex-direction: column; align-items: center;
  color: var(--accent);
  pointer-events: none;
  transition: color .5s;
}
.try-me span { font: 700 34px/1 Caveat, "Segoe Print", "Bradley Hand", cursive; white-space: nowrap; transform: rotate(-7deg); }
.try-me svg { width: 42px; height: 40px; margin: 2px 0 0 18px; fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.dpad {
  display: grid; grid-template: repeat(3, 38px) / repeat(3, 38px);
  border-radius: 50%; background: #0f0f12;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.dpad button, .remote-row button { display: grid; place-items: center; transition: background-color .12s, color .12s, transform .08s; }
.dpad svg, .remote-row svg { width: 22px; height: 22px; fill: currentColor; }
.dpad [data-key="up"] { grid-area: 1 / 2; }
.dpad [data-key="left"] { grid-area: 2 / 1; }
.dpad .ok { grid-area: 2 / 2; font: 700 12px var(--body); background: #2b2a2f; border-radius: 50%; }
.dpad [data-key="right"] { grid-area: 2 / 3; }
.dpad [data-key="down"] { grid-area: 3 / 2; }
.dpad button:hover, .remote-row button:hover { color: #fff; }
.dpad button:active, .remote-row button:active { transform: scale(.9); background: #3d3c42; border-radius: 50%; }
.remote-row { display: flex; gap: 12px; }
.remote-row button { width: 42px; height: 42px; border-radius: 50%; background: #2b2a2f; }

.demo-hint { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 22px; font-size: 15px; color: var(--muted); text-align: center; }
.hint-touch { display: none; }
@media (hover: none) { .hint-mouse { display: none; } .hint-touch { display: inline; } }
.pulse-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); animation: pulse 2.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-2) 55%, transparent); } 80%, 100% { box-shadow: 0 0 0 10px transparent; } }

/* The launcher, in dp on a 960x540 stage. Always dark. */
.stage {
  --bg: #1e1d22; --surface: #2b2a2f; --raised: #3d3c42; --on: #c4c1c6; --onv: #9a979d; --faint: #6e6c72; --err: #ffb4ab; --inv: #1e1d22;
  position: absolute; left: 0; top: 0; width: 960px; height: 540px;
  transform-origin: 0 0; transform: scale(var(--s, 1));
  background: var(--bg); color: var(--on);
  font: 400 14px/1.3 Roboto, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: .01em;
  overflow: hidden;
  cursor: default;
  outline: none;
}
.tv:has(.stage:focus-visible) { outline: 2px solid var(--accent-2); outline-offset: 4px; }
.stage button { display: block; text-align: left; font: inherit; letter-spacing: inherit; cursor: pointer; }

.topbar { position: absolute; left: 24px; right: 24px; top: 24px; height: 40px; display: flex; align-items: center; gap: 12px; }
.tab { height: 40px; padding: 0 12px; border-radius: 8px; color: var(--onv); font-size: 16px !important; font-weight: 500; transition: background-color .12s, color .12s; }
.tab span { display: inline-block; padding-bottom: 2px; border-bottom: 3px solid transparent; }
.tab.open { color: var(--on); }
.tab.open span { border-color: currentColor; }
.tab.focus { background: var(--on); color: var(--inv); }
.top-right { flex: 1; display: flex; justify-content: flex-end; align-items: center; gap: 12px; height: 40px; }
.round { position: relative; width: 40px; height: 40px; border-radius: 50%; background: var(--surface); color: var(--onv); display: grid !important; place-items: center; font-size: 20px !important; transition: background-color .12s, color .12s; }
.round em { position: absolute; top: 44px; left: 50%; transform: translateX(-50%); font: 500 10.5px Roboto, sans-serif; color: var(--on); white-space: nowrap; opacity: 0; pointer-events: none; }
.round.focus { background: var(--on); color: var(--inv); }
.round.focus em { opacity: 1; }
.clock { font-size: 22px; color: var(--onv); white-space: nowrap; }

.views { position: absolute; left: 24px; right: 24px; top: 88px; height: 320px; }
.view { display: none; position: absolute; inset: 0; }
.view.open { display: block; }
.view-grid.open { display: grid; grid-template: repeat(2, 1fr) / repeat(3, 1fr); gap: 12px; }

.maincam { position: absolute; left: 0; top: 0; width: 570px; height: 320px; background: #000; border-radius: 12px; overflow: hidden; }
.maincam::after { content: ""; position: absolute; inset: 0; border-radius: 12px; border: 3px solid transparent; transition: border-color .12s; pointer-events: none; }
.maincam.focus::after { border-color: var(--on); }
.cam-picture { position: absolute; inset: 0; }
.scene, .cam-picture svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene.flip { transform: scaleX(-1); }
.maincam::before, .gtile::before, .clip::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: .13; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
.cam-name { position: absolute; z-index: 2; left: 12px; bottom: 10px; font-size: 14px; font-weight: 500; color: #fff; text-shadow: 0 1px 3px #000; }
.cam-time { position: absolute; z-index: 2; right: 12px; top: 10px; font: 500 11px ui-monospace, Menlo, monospace; color: #fff; opacity: .78; text-shadow: 0 1px 2px #000; font-variant-numeric: tabular-nums; }
.chev { position: absolute; z-index: 2; top: 50%; margin-top: -18px; font-size: 36px; color: #fff; filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, .7)); opacity: 0; transition: opacity .15s; line-height: 0; }
.chev.left { left: 4px; } .chev.right { right: 4px; }
.maincam.focus .chev { opacity: 1; }

.side { position: absolute; left: 594px; right: 0; top: 0; height: 320px; display: flex; flex-direction: column; gap: 12px; }
.panel { background: var(--surface); border-radius: 12px; padding: 12px 16px; overflow: hidden; }
.weather { flex: none; }
.now { display: flex; align-items: center; gap: 12px; }
.now .w { font-size: 30px; }
.now .t { font-size: 24px; }
.now div span { display: block; font-size: 14px; }
.now small { font-size: 12px; color: var(--onv); }
.hours { display: flex; justify-content: space-between; margin-top: 8px; }
.hour { display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 13.500px; }
.hour small { font-size: 10.5px; color: var(--onv); min-height: 13px; }
.hour .ico { font-size: 18px; }
.sensors { flex: 1; min-height: 0; position: relative; padding-top: 8px; }
.sensors::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 36px; background: linear-gradient(transparent, var(--surface)); }
.sensors h6 { margin: 7px 0 3px; font: 500 11.5px Roboto, sans-serif; color: var(--onv); }
.sensor { display: flex; align-items: center; gap: 12px; height: 26px; font-size: 14px; color: var(--onv); }
.sensor .ico { font-size: 18px; }
.sensor b { margin-left: auto; font-weight: 500; color: var(--on); font-size: 15px; }
.sensor i { font-style: normal; font-weight: 400; color: var(--onv); font-size: 14px; }

.gtile { position: relative; border-radius: 10px; overflow: hidden; background: #000; transition: transform .14s; }
.gtile::after { content: ""; position: absolute; inset: 0; border-radius: 10px; border: 3px solid transparent; z-index: 4; pointer-events: none; }
.gtile.focus { transform: scale(1.025); z-index: 3; }
.gtile.focus::after { border-color: var(--on); }
.shade { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; margin: 0; padding: 18px 10px 7px; background: linear-gradient(transparent, rgba(0, 0, 0, .8)); }
.shade b { display: block; font-weight: 500; font-size: 13.5px; color: var(--on); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shade small { font-size: 11.5px; color: var(--onv); }
.noshot { position: absolute; inset: 0; display: grid; place-items: center; background: #101012; color: var(--faint); font-size: 13px; }
.bbox { position: absolute; z-index: 2; border: 1.500px solid #ffd66b; border-radius: 2px; }
.fig { position: absolute; z-index: 1; }

.rows { position: absolute; left: 0; right: 0; top: 420px; height: 120px; overflow: hidden; }
.rows-inner { position: absolute; inset: 0; transition: transform .28s cubic-bezier(.2, .7, .2, 1); }
.rows-inner.down { transform: translateY(-120px); }
.row { position: absolute; left: 24px; right: 0; top: 12px; height: 84px; }
.row-inner { display: flex; gap: 24px; transition: transform .26s cubic-bezier(.2, .7, .2, 1); }
.row.watch { top: 132px; }
.tile {
  position: relative; flex: none; width: 148.4px; height: 83.5px; border-radius: 8px; color: #fff;
  display: grid !important; place-items: center;
  font: 650 18px var(--display) !important; letter-spacing: -.01em !important;
  transition: transform .14s, box-shadow .14s;
}
.tile.focus { transform: scale(1.1); box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px #8e8c92; z-index: 3; }
.tile-ico { font-size: 40px; color: #dcdcdc; }
.poster-tile { display: block !important; padding: 10px 10px; overflow: hidden; font: 400 12px Roboto, sans-serif !important; letter-spacing: 0 !important; }
.poster-tile strong { display: block; margin-top: 24px; font: 600 13.5px Roboto, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.poster-tile small { font-size: 11px; opacity: .85; }
.poster-tile i { position: absolute; left: 0; bottom: 0; height: 4px; background: #fff; border-radius: 0 2px 2px 0; }

.toast { position: absolute; z-index: 6; left: 50%; bottom: 28px; transform: translate(-50%, 16px); padding: 9px 18px; border-radius: 22px; background: #e8e6ea; color: #1e1d22; font-size: 13px; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.dialog-shade { position: absolute; inset: 0; z-index: 5; background: rgba(0, 0, 0, .55); display: flex; justify-content: center; padding-top: 24px; }
.dialog { width: 520px; align-self: flex-start; background: var(--surface); border-radius: 16px; padding: 18px; box-shadow: 0 20px 50px rgba(0, 0, 0, .6); }
.dialog h5 { margin: 0 0 10px 6px; font: 500 18px Roboto, sans-serif; }
.set-row { display: flex !important; width: 100%; align-items: center; justify-content: space-between; gap: 18px; padding: 9px 12px; border-radius: 10px; transition: background-color .12s, color .12s; }
.set-row b { display: block; font-weight: 500; font-size: 14px; }
.set-row small { display: block; font-size: 11.5px; line-height: 1.3; color: var(--onv); margin-top: 1px; }
.set-row.focus { background: var(--on); color: var(--inv); }
.set-row.focus small { color: #4a494f; }
.sw { position: relative; flex: none; width: 38px; height: 22px; border-radius: 11px; background: #8e8c92; transition: background-color .15s; }
.sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #1e1d22; transition: transform .15s; }
.sw.on { background: #5a595f; }
.sw.on::after { transform: translateX(16px); background: #e8e6ea; }
.dialog-buttons { display: flex; gap: 8px; margin-top: 12px; padding: 0 6px; }
.btn { padding: 8px 14px; border-radius: 18px; background: var(--raised); font-size: 13px; font-weight: 500; transition: background-color .12s, color .12s; }
.btn[data-close] { margin-left: auto; }
.btn.focus { background: var(--on); color: var(--inv); }

.clip { position: absolute; inset: 0; z-index: 5; background: #000; overflow: hidden; }
.clip .fig.walk { animation: walk 6s linear forwards; }
@keyframes walk { from { left: 12%; } to { left: 72%; } }
.clip-bar { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 40px 24px 18px; background: linear-gradient(transparent, rgba(0, 0, 0, .85)); display: grid; grid-template-columns: 1fr auto; column-gap: 12px; }
.clip-bar b { font-weight: 500; font-size: 16px; }
.clip-bar small { grid-row: 2; font-size: 12px; color: var(--onv); }
.clip-status { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: 13px; color: var(--on); }
.clip-track { grid-column: 1 / -1; height: 3px; margin-top: 10px; background: rgba(255, 255, 255, .22); border-radius: 2px; overflow: hidden; }
.clip-track i { display: block; height: 100%; background: var(--on); animation: fill 6s linear forwards; }
@keyframes fill { from { width: 0; } to { width: 100%; } }
.clip-focus { position: absolute; inset: 0; z-index: 3; }

/* Sections */
.section { max-width: 1240px; margin: 0 auto; padding: clamp(64px, 9vw, 120px) clamp(16px, 4vw, 44px); }
.section-head { max-width: 780px; margin-bottom: clamp(32px, 4.5vw, 56px); }

.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: clamp(20px, 2.4vw, 30px); display: flex; flex-direction: column; gap: 22px; box-shadow: var(--card-shadow); transition: background-color .5s, border-color .5s; }
.card-text p { margin-top: 9px; color: var(--muted); font-size: 16px; max-width: 46em; }
.card-cams { grid-column: span 7; }
.card-ha { grid-column: span 5; }
.card-alerts { grid-column: span 5; }
.card-watch { grid-column: span 7; }
.card-foot { font-size: 14px; color: var(--muted); margin-top: -8px; }

/* Pieces of the app inside cards: dark in both modes */
.ui {
  --on: #c4c1c6; --onv: #9a979d; --sf: #2b2a2f;
  margin-top: auto; background: #1e1d22; color: var(--on); border-radius: 14px; padding: 12px;
  font-family: Roboto, ui-sans-serif, system-ui, sans-serif; font-size: 13.5px; line-height: 1.3;
}
.ui-cams { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ui-cam { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #000; }
.ui-cam svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ui-cam b { position: absolute; left: 9px; bottom: 7px; font-weight: 500; color: #fff; text-shadow: 0 1px 3px #000; font-size: 13px; }
.ui-cam i { position: absolute; right: 9px; top: 9px; width: 7px; height: 7px; border-radius: 50%; background: #7bd88f; box-shadow: 0 0 6px #7bd88f; }
.ui-offline { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; text-align: center; padding: 8px 12px; }
.ui-offline strong { font-weight: 500; font-size: 13px; }
.ui-offline span { font-size: 11.5px; color: var(--onv); }
.ui-offline em { font-style: normal; font-size: 11px; color: #ffb4ab; margin-top: 2px; line-height: 1.25; }

.ui-ha { display: flex; flex-direction: column; gap: 8px; }
.ui-panel { background: var(--sf); border-radius: 10px; padding: 12px 14px; }
.ui-weather { display: flex; align-items: center; gap: 12px; }
.ui-weather .big { width: 32px; height: 32px; }
.ui-weather .temp { font-size: 26px; }
.ui-weather span { display: block; }
.ui-weather small { color: var(--onv); font-size: 12px; }
.ui-sensors .room { display: block; color: var(--onv); font-size: 11.5px; font-weight: 500; margin: 8px 0 3px; }
.ui-sensors .room:first-child { margin-top: 0; }
.ui-sensors .row { position: static; height: auto; display: flex; align-items: center; gap: 10px; padding: 3px 0; color: var(--onv); }
.ui-sensors .ico { width: 18px; height: 18px; }
.ui-sensors b { margin-left: auto; color: var(--on); font-weight: 500; }
.ui-sensors i { font-style: normal; font-weight: 400; color: var(--onv); }

.ui-alerts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ui-alert { position: relative; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; background: #000; }
.ui-alert .scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.ui-alert .box { position: absolute; border: 1.5px solid #ffd66b; border-radius: 2px; }
.ui-alert p { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 8px 6px; background: linear-gradient(transparent, rgba(0, 0, 0, .82)); }
.ui-alert b { display: block; font-weight: 500; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-alert small { font-size: 11px; color: var(--onv); }

.ui-watch { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.poster { position: relative; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; padding: 9px; display: flex; flex-direction: column; justify-content: flex-end; color: #fff; background: linear-gradient(150deg, var(--a), var(--b)); }
.poster b { font-weight: 600; font-size: 12.5px; line-height: 1.15; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.poster small { font-size: 10.5px; opacity: .85; margin-bottom: 3px; }
.poster i { position: absolute; left: 0; bottom: 0; height: 3px; width: var(--p); background: #fff; }

.buttons-band { background: var(--bg-2); border-block: 1px solid var(--line); padding: clamp(64px, 9vw, 120px) clamp(16px, 4vw, 44px); transition: background-color .5s; }
.buttons-inner { max-width: 1152px; margin: 0 auto; }
.buttons-inner .section-head p:not(.eyebrow) { margin-top: 18px; color: var(--muted); }
.button-notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 4vw, 56px); }
.button-notes dt { margin-bottom: 12px; font-size: 19px; }
.button-notes dd { color: var(--muted); font-size: 16px; }

.tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: clamp(24px, 4vw, 56px); row-gap: 8px; }
.tool-grid li { padding: 26px 0; border-top: 1px solid var(--line); }
.tool-grid .ico { width: 26px; height: 26px; color: var(--accent); margin-bottom: 14px; }
.tool-grid p { margin-top: 7px; color: var(--muted); font-size: 16px; }

.privacy { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 88px); align-items: center; border-top: 1px solid var(--line); }
.privacy-copy > p:not(.eyebrow) { margin-top: 18px; color: var(--muted); }
.plain { margin-top: 26px; display: grid; gap: 16px; }
.plain li { padding-left: 18px; border-left: 2px solid var(--line); color: var(--muted); font-size: 16px; }
.plain strong { color: var(--ink); font-weight: 600; }
.privacy-map { position: relative; aspect-ratio: 1; max-width: 480px; width: 100%; margin: 0 auto; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent-2) 11%, transparent), transparent); }
.wires { position: absolute; inset: 0; width: 100%; height: 100%; }
.wires path { fill: none; stroke: var(--accent-2); stroke-width: 1.5; stroke-dasharray: 3 7; stroke-linecap: round; vector-effect: non-scaling-stroke; animation: flow 1.6s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -20; } }
.node { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 12px 12px 10px; width: 112px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); font-size: 13px; font-weight: 550; line-height: 1.2; text-align: center; box-shadow: var(--card-shadow); transition: background-color .5s; }
.node .ico { width: 22px; height: 22px; color: var(--accent); }
.node.hub { --x: 50%; --y: 50%; width: auto; padding: 0; border: 0; background: none; border-radius: 16px; box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent-2) 16%, transparent); }
.node.hub img { width: 64px; height: 64px; }
.node.nope { --x: 50%; --y: 103%; width: auto; flex-direction: row; padding: 6px 12px; border-radius: 999px; border-style: dashed; color: var(--muted); font-weight: 500; white-space: nowrap; background: var(--bg); }
.node.nope .ico { width: 16px; height: 16px; color: var(--muted); }

.road { margin-top: 6px; display: grid; }
.road li { display: flex; gap: 16px; padding-bottom: 20px; position: relative; }
.road li:last-child { padding-bottom: 0; }
.road li:not(:last-child)::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: -4px; width: 2px; background: var(--line); }
.road span { flex: none; width: 14px; height: 14px; margin-top: 5px; border-radius: 50%; border: 2px solid var(--muted); background: var(--card); z-index: 1; }
.road .done span { background: var(--accent-2); border-color: var(--accent-2); }
.road b { font-weight: 620; display: block; }
.road small { color: var(--muted); font-size: 14.5px; }
.needs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); margin-bottom: 28px; }
.needs dt { font-size: 14px; font-weight: 600; color: var(--accent); margin-bottom: 4px; }
.needs dd { font-size: 16px; }
.road small a { color: var(--accent); }

.install { padding-top: 0; }
.install .section-head p:not(.eyebrow) { margin-top: 18px; color: var(--muted); }
.install-get { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 12px 0 8px; }
.download { padding: 13px 24px; border-radius: 999px; background: var(--accent); color: var(--card); font: 650 17px var(--display); text-decoration: none; transition: background-color .2s; }
.download:hover { background: var(--accent-2); }
.install-links { display: flex; gap: 20px; font-size: 16px; }
.install-links a { color: var(--accent); }
.install-note { color: var(--muted); font-size: 14px; }
.install code { font: 13.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.install-ways { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.quick { display: grid; gap: 10px; margin-top: 12px; }
.quick > div { padding: 14px 16px; border-radius: 12px; background: var(--bg-2); }
.quick dt { font-size: 14px; font-weight: 600; color: var(--accent); }
.quick dd { font-size: 15px; }
.quick-value { margin: 2px 0 4px; color: var(--ink); font: 700 clamp(24px, 2.6vw, 32px)/1.15 var(--display) !important; letter-spacing: -.02em; overflow-wrap: anywhere; }
.quick-value a { color: inherit; text-decoration: none; }
.quick-value a:hover { text-decoration: underline; text-underline-offset: 4px; }
.install-ways .card { gap: 14px; }
.install-col { display: grid; gap: 16px; min-width: 0; }
.install-ways .card > p { color: var(--muted); font-size: 16px; }
.install-ways .card > p a { color: var(--accent); }
.steps { display: grid; gap: 12px; padding-left: 1.4em; list-style: decimal; font-size: 16px; color: var(--muted); }
.steps li::marker { color: var(--accent); font-weight: 600; }
.steps b { color: var(--ink); font-weight: 600; }
.steps pre { margin-top: 8px; padding: 10px 14px; border-radius: 10px; background: var(--bg-2); color: var(--ink); overflow-x: auto; }
.install-after { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, .8fr); gap: clamp(20px, 3vw, 40px); margin-top: 36px; }
.install-after dt { margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--accent); }
.install-after dd { font-size: 16px; color: var(--muted); }
.install-after b { color: var(--ink); font-weight: 600; }

.faq { padding-top: 0; display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); gap: clamp(20px, 5vw, 70px); }
.faq .section-head { margin: 0; }
details { border-top: 1px solid var(--line); }
details:last-child { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 18px; padding: 18px 0; font: 600 18.5px/1.3 var(--display); letter-spacing: -.008em; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; flex: none; font: 400 24px/1 var(--body); color: var(--accent); transition: transform .2s; }
details[open] summary::after { transform: rotate(45deg); }
details p { padding: 0 34px 20px 0; color: var(--muted); }

.foot { border-top: 1px solid var(--line); padding: 36px clamp(16px, 4vw, 44px) 44px; max-width: 1240px; margin: 0 auto; font-size: 14.5px; color: var(--muted); display: grid; grid-template-columns: auto 1fr auto; gap: 6px 26px; align-items: center; }
.foot-brand { display: flex; align-items: center; gap: 9px; font: 660 17px var(--display); color: var(--ink); }
.foot-github { display: inline-flex; align-items: center; gap: 8px; }
.foot-github svg { flex: none; width: 18px; height: 18px; }
.fine { grid-column: 1 / -1; margin-top: 8px; font-size: 13px; max-width: 76em; }

/* Scroll reveals, only with scripts on */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1), background-color .5s, border-color .5s; }
.js .reveal.in { opacity: 1; transform: none; }

@media (max-width: 1080px) {
  .set { grid-template-columns: minmax(0, 1fr); }
  .remote { flex-direction: row; justify-content: center; gap: 30px; padding: 14px 26px; border-radius: 26px; margin: 72px auto 0; width: fit-content; }
  .remote-row { flex-direction: column; }
}

@media (max-width: 900px) {
  .card-cams, .card-ha, .card-alerts, .card-watch { grid-column: 1 / -1; }
  .privacy, .faq, .needs, .install-ways, .install-after { grid-template-columns: minmax(0, 1fr); }
  .button-notes { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .privacy-map { max-width: 400px; margin-bottom: 26px; }
}

@media (max-width: 680px) {
  .nav { gap: 12px; }
  .nav-links { display: none; }
  .theme { margin-left: auto; }
  .theme label span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .theme label { padding: 6px 9px; }
  .tool-grid { grid-template-columns: minmax(0, 1fr); }
  .ui-watch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot { grid-template-columns: minmax(0, 1fr); }
  .node { width: 92px; font-size: 12px; padding: 9px 8px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .clip .fig.walk { left: 42%; }
  .clip-track i { width: 100%; }
}
