/* Fonts: the app's own self-hosted subsets (fonts/ in the repo). */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('/assets/fonts/plus-jakarta-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('/assets/fonts/plus-jakarta-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;
  --bg: #0a0c10;
  --bg-raised: #0f1217;
  --surface: rgba(255, 255, 255, 0.028);
  --surface-2: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #eef1f5;
  --muted: #9aa3b2;
  --faint: #667085;
  --warm: #f0a868;

  /* The demo's accent swatches rewrite these three at runtime. */
  --accent: #64b5f6;
  --accent-rgb: 100, 181, 246;
  --accent-hover: #90caf9;

  --radius: 20px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font-display: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', 'JetBrains Mono', Menlo, monospace;
  --max: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font-body);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
/* A single soft glow behind the hero, tinted by the current accent. */
body::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 900px;
  background:
    radial-gradient(50% 60% at 50% 0%, rgba(var(--accent-rgb), 0.13), transparent 70%),
    radial-gradient(30% 40% at 80% 10%, rgba(240, 168, 104, 0.05), transparent 70%);
  pointer-events: none;
  z-index: -1;
  transition: background 600ms ease;
}
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: rgba(var(--accent-rgb), 0.35); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.ico {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ico-lg { width: 30px; height: 30px; stroke-width: 1.5; }

code {
  font: 0.86em var(--font-mono);
  padding: 0.14em 0.42em;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

/* ---------------- Nav ---------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 12, 16, 0.72);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: border-color 300ms ease;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font: 600 15px/1 var(--font-display);
  letter-spacing: -0.01em;
}
.brand img { border-radius: 7px; }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  padding: 7px 12px;
  border-radius: 999px;
  transition: color 160ms ease, background 160ms ease;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a[aria-current='page'] { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  color: var(--muted);
  transition: color 160ms ease, background 160ms ease;
}
.nav-icon:hover { color: var(--text); background: var(--surface-2); }
.btn.btn-sm { height: 36px; padding: 0 16px; font-size: 14px; gap: 7px; }
.btn.btn-sm .ico { width: 16px; height: 16px; }

/* ---------------- Buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  font: 600 15px/1 var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 160ms var(--ease), background 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--text);
  color: #0a0c10;
  box-shadow: 0 8px 30px -8px rgba(var(--accent-rgb), 0.55), inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}
.btn-primary:hover { background: #fff; box-shadow: 0 10px 38px -8px rgba(var(--accent-rgb), 0.75); }
.btn-quiet {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--text);
}
.btn-quiet:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.075); }
.btn .ext { opacity: 0.55; font-weight: 500; margin-left: 1px; }
.ico-heart { color: #f48fb1; }

/* ---------------- Hero ---------------- */

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 72px 24px 40px;
  text-align: center;
}
h1, h2, h3 { font-family: var(--font-display); margin: 0; }
h1 {
  font-size: clamp(2.6rem, 6.6vw, 5.1rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.042em;
}
.h1-soft {
  background: linear-gradient(180deg, #aab3c2 0%, #6c7586 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede {
  max-width: 600px;
  margin: 24px auto 0;
  font-size: clamp(1.02rem, 1.6vw, 1.18rem);
  line-height: 1.6;
  color: var(--muted);
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 34px;
}
.facts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 22px;
  margin: 26px 0 0;
  padding: 0;
  font-size: 13.5px;
  color: var(--faint);
}
.facts li { display: flex; align-items: center; gap: 8px; }
.facts li::before {
  content: '';
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  color: rgba(var(--accent-rgb), 0.9);
}

/* ---------------- Stage (the demo desktop) ---------------- */

.stage-wrap { margin-top: 56px; }
.stage {
  position: relative;
  isolation: isolate;
  height: clamp(660px, 56vw, 720px);
  border-radius: 24px;
  overflow: hidden;
  text-align: left;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(55% 75% at 12% 18%, rgba(98, 78, 178, 0.55), transparent 62%),
    radial-gradient(45% 65% at 88% 92%, rgba(232, 128, 82, 0.32), transparent 62%),
    radial-gradient(65% 85% at 72% 6%, rgba(38, 108, 162, 0.5), transparent 66%),
    linear-gradient(160deg, #161c33 0%, #0d1220 52%, #1a1422 100%);
  box-shadow:
    0 60px 120px -40px rgba(0, 0, 0, 0.9),
    0 0 0 8px rgba(255, 255, 255, 0.02),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
/* Film grain, so the gradient reads as a wallpaper rather than a CSS gradient. */
.stage::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.18;
  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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
#weather-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  transition: opacity 450ms ease;
}
.stage-bar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  height: 30px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(8, 10, 16, 0.32);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.stage-bar-left { display: flex; align-items: center; gap: 7px; }
.stage-bar-left img { border-radius: 3px; }
.stage-hint {
  position: absolute;
  z-index: 2;
  left: 48px;
  top: 50%;
  max-width: 280px;
  margin: 0;
  transform: translateY(-50%);
  font: 500 clamp(1.1rem, 1.7vw, 1.4rem)/1.35 var(--font-display);
  letter-spacing: -0.015em;
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
  transition: opacity 500ms ease;
}
.stage-hint.dim { opacity: 0; }

/* ---------------- The widget (matches the 4.0 main window) ---------------- */

.widget {
  position: absolute;
  z-index: 3;
  right: clamp(24px, 7%, 100px);
  top: calc(50% - 22px);
  transform: translateY(-50%);
  width: 430px;
  padding: 0 12px 12px;
  border-radius: 18px;
  background: rgba(17, 21, 28, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  box-shadow:
    0 40px 80px -24px rgba(0, 0, 0, 0.75),
    0 2px 6px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.widget .ico { width: 16px; height: 16px; }
.widget-head {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  margin: 0 -12px 12px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 13.5px;
}
.conn {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 50%;
}
.conn span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.18), 0 0 10px rgba(74, 222, 128, 0.5);
}
.widget-title { font-weight: 600; letter-spacing: -0.005em; }
.widget-meta {
  display: none;
  margin-left: auto;
  font: 11px var(--font-mono);
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.win-ctrls { display: flex; gap: 14px; margin-left: auto; color: rgba(255, 255, 255, 0.5); }
.widget-head.show-meta .widget-meta { display: block; }
.widget-head.show-meta .win-ctrls { display: none; }

/* Panes: the primary cards share one, the media card is another. */
.primary, .media {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.primary { display: grid; grid-template-columns: 1fr 1fr; min-height: 96px; }
.pc-weather, .pc-clock { display: flex; align-items: center; justify-content: center; padding: 12px; }
.pc-clock { flex-direction: column; border-left: 1px solid rgba(255, 255, 255, 0.07); }
.pc-weather { gap: 14px; }
.wx-icon .ico { width: 40px; height: 40px; fill: rgba(226, 231, 238, 0.9); stroke: none; }
.wx-main { text-align: center; }
.wx-temp { font: 600 26px/1 var(--font-display); letter-spacing: -0.03em; }
.wx-cond { font-size: 12.5px; color: rgba(255, 255, 255, 0.6); margin-top: 3px; }
.wx-chips { display: flex; gap: 10px; margin-top: 8px; font-size: 11.5px; color: rgba(255, 255, 255, 0.7); }
.wx-chips span { display: inline-flex; align-items: center; gap: 4px; }
.wx-chips .ico { width: 12px; height: 12px; color: rgba(255, 255, 255, 0.55); }
.clock-time {
  font: 600 30px/1 var(--font-display);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.clock-date {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  transition: color 300ms ease;
}

.media {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 12px 10px 10px;
}
.media-art {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.55);
}
.media-art .ico { width: 18px; height: 18px; }
.media-info { min-width: 0; }
.media-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.media-artist { font-size: 12px; color: rgba(255, 255, 255, 0.55); }
.media-progress {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.55);
  font-variant-numeric: tabular-nums;
}
.media-track { width: 48px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
#media-bar { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.media-ctrls { display: flex; align-items: center; gap: 2px; }
.media-ctrls button {
  display: grid;
  place-items: center;
  width: 26px;
  height: 30px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  cursor: pointer;
  border-radius: 8px;
}
.media-ctrls button:hover { background: rgba(255, 255, 255, 0.06); }
.media-ctrls .ico { width: 14px; height: 14px; }
.media-play .ico { width: 20px; height: 20px; }

.pages-row { display: flex; align-items: center; margin: 12px 2px 10px; }
.page-tabs {
  --pill-x: 0%;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.page-tabs::before {
  content: '';
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(var(--pill-x));
  transition: transform 320ms var(--ease);
}
.page-tabs button {
  position: relative;
  height: 26px;
  padding: 0 14px;
  border: 0;
  background: none;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: color 200ms ease;
}
.page-tabs button.is-on { color: #fff; }
.row-ctrls { display: flex; gap: 14px; margin-left: auto; padding-right: 6px; color: rgba(255, 255, 255, 0.45); }

.qa-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.qa-slot { position: relative; }
.qa {
  width: 100%;
  height: 94px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 6px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.04);
  text-align: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: background 200ms ease, border-color 200ms ease, transform 160ms var(--ease);
}
div.qa { cursor: default; }
button.qa:hover { background: rgba(255, 255, 255, 0.07); }
button.qa:active { transform: scale(0.96); }
.qa-icon { display: grid; margin-bottom: 4px; color: rgba(255, 255, 255, 0.78); transition: color 200ms ease, filter 200ms ease; }
.qa-icon .ico { width: 22px; height: 22px; }
.qa-name { font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.qa-state { font-size: 11.5px; color: rgba(255, 255, 255, 0.5); min-height: 14px; }
.qa-value { display: flex; align-items: baseline; gap: 2px; }
.qa-num { font: 600 18px/1.1 var(--font-display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.qa-unit { font-size: 11px; color: rgba(255, 255, 255, 0.55); }
.qa[aria-pressed='true'] {
  background: rgba(var(--accent-rgb), 0.14);
  border-color: rgba(var(--accent-rgb), 0.45);
}
.qa[aria-pressed='true'] .qa-icon {
  color: var(--accent);
  filter: drop-shadow(0 0 8px rgba(var(--accent-rgb), 0.6));
}
.qa[aria-pressed='true'] .qa-state { color: rgba(255, 255, 255, 0.85); }

/* The controls button always sits in the tile corner, like the app. */
.tile-ctl, .pin-btn {
  position: absolute;
  top: 6px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 7px;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: opacity 160ms ease, background 160ms ease, color 160ms ease;
}
.tile-ctl { right: 6px; }
.tile-ctl:hover, .pin-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.tile-ctl .ico, .pin-btn .ico { width: 14px; height: 14px; }
.pin-btn { left: 6px; opacity: 0; }
.qa-slot:hover .pin-btn, .pin-btn:focus-visible { opacity: 1; }
.qa-slot.pinned .pin-btn { opacity: 0.85; }
.qa-slot.pinned .tile-ctl { display: none; }

/* Pinned tiles live on the stage wallpaper, draggable, clamped to its edges. */
.qa-slot.pinned {
  position: absolute;
  z-index: 4;
  width: 112px;
  animation: pin-in 360ms var(--ease);
}
.qa-slot.pinned .qa {
  cursor: grab;
  background: rgba(17, 21, 28, 0.62);
  border-color: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: 0 20px 44px -12px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.qa-slot.pinned .qa[aria-pressed='true'] {
  background: rgba(var(--accent-rgb), 0.2);
  border-color: rgba(var(--accent-rgb), 0.5);
}
.qa-slot.pinned .qa:active { cursor: grabbing; transform: none; }
@keyframes pin-in {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: none; }
}

/* Brightness dialog, the same layout as the app's light controls. */
.bright-pop {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(6, 8, 12, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fade-in 200ms ease;
}
.bright-card {
  width: 84%;
  border-radius: 16px;
  background: rgba(24, 28, 36, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.85);
  animation: pop-in 260ms var(--ease);
  overflow: hidden;
}
.bright-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font: 600 15px var(--font-display);
}
.bright-x {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
}
.bright-body { display: flex; flex-direction: column; align-items: center; padding: 18px 20px 20px; }
.bright-bulb {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #f0b86a;
}
.bright-bulb .ico { width: 22px; height: 22px; }
.bright-pop.is-off .bright-bulb { color: rgba(255, 255, 255, 0.45); }
.bright-value { margin-top: 10px; font: 600 32px/1.1 var(--font-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.bright-label { margin-top: 2px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255, 255, 255, 0.5); }
#bright-slider {
  --fill: 80%;
  width: 100%;
  height: 6px;
  margin: 18px 0 0;
  border-radius: 999px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(90deg, #6f5a3c, #f5c77e) 0 / var(--fill) 100% no-repeat, rgba(255, 255, 255, 0.12);
  cursor: pointer;
}
#bright-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
#bright-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.bright-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; width: 100%; margin-top: 16px; }
.bright-presets button, .bright-btn {
  height: 32px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.bright-presets button:hover, .bright-btn:hover { background: rgba(255, 255, 255, 0.1); }
.bright-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.bright-btn { padding: 0 16px; height: 34px; }
.bright-primary { background: var(--accent); border-color: transparent; color: #0a0c10; }
.bright-primary:hover { background: var(--accent-hover); }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(6px) scale(0.97); } }

/* ---------------- Dock ---------------- */

.dock {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 10px 8px 16px;
  border-radius: 999px;
  background: rgba(12, 15, 22, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}
.dock-group { display: flex; align-items: center; gap: 10px; }
.dock-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}
.dock-sep { width: 1px; height: 20px; background: rgba(255, 255, 255, 0.1); }
.swatches { display: flex; gap: 7px; }
.swatch {
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 50%;
  border: 0;
  background: var(--c);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
  transition: transform 160ms var(--ease), box-shadow 160ms ease;
}
.swatch:hover { transform: scale(1.12); }
.swatch.is-on { box-shadow: 0 0 0 2px rgba(12, 15, 22, 0.9), 0 0 0 3.5px var(--c); }
.seg {
  display: flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}
.seg button {
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: none;
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}
.seg button:hover { color: #fff; }
.seg button.is-on { background: rgba(255, 255, 255, 0.14); color: #fff; }

/* ---------------- Ghost cursor ---------------- */

.ghost-cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
  transition: transform 1000ms var(--ease), opacity 350ms ease;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.55));
}
.ghost-cursor.show { opacity: 1; }
.ghost-inner { transition: transform 140ms var(--ease); }
.ghost-cursor.press .ghost-inner { transform: scale(0.78); }
.ghost-inner svg { display: block; }
.ghost-tap {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.22);
}
.ghost-ripple {
  position: fixed;
  z-index: 59;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  border: 2px solid rgba(var(--accent-rgb), 0.75);
  pointer-events: none;
  animation: ghost-ripple 550ms var(--ease) forwards;
}
@keyframes ghost-ripple {
  from { transform: scale(0.35); opacity: 1; }
  to { transform: scale(1.15); opacity: 0; }
}

/* ---------------- Sections ---------------- */

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 120px 24px 0;
}
.section-head { max-width: 640px; margin-bottom: 48px; }
h2 {
  font-size: clamp(1.9rem, 3.8vw, 2.9rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.035em;
}
.section-sub { margin: 16px 0 0; font-size: 1.05rem; color: var(--muted); }
.section-sub a { color: var(--text); text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.section-sub a:hover { text-decoration-color: var(--accent); }
#version-label { color: var(--text); font-weight: 500; }

/* ---------------- Bento ---------------- */

.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}
.tile {
  grid-column: span 2;
  position: relative;
  padding: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
  overflow: hidden;
  transition: border-color 250ms ease;
}
.tile:hover { border-color: var(--line-strong); }
.tile.t-wide {
  grid-column: span 4;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 28px;
  align-items: center;
}
.tile.t-half { grid-column: span 3; }
.tile-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.1);
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  transition: color 300ms ease, background 300ms ease, border-color 300ms ease;
}
.tile h3 {
  margin: 20px 0 8px;
  font-size: 1.12rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.tile p { margin: 0; font-size: 0.95rem; line-height: 1.6; color: var(--muted); }

.chart {
  padding: 16px 16px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
}
.chart svg { width: 100%; height: 150px; display: block; overflow: visible; }
.chart-grid path { stroke: rgba(255, 255, 255, 0.06); stroke-dasharray: 3 5; vector-effect: non-scaling-stroke; }
.chart-area { fill: url(#g-area); }
.chart-line { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.chart-line.l1 { stroke: var(--accent); }
.chart-line.l2 { stroke: var(--warm); }
.chart-line.l3 { stroke: #8b95a5; }
.chart-cross { stroke: rgba(255, 255, 255, 0.25); stroke-dasharray: 2 4; vector-effect: non-scaling-stroke; }
.chart-dot { fill: var(--bg); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-dot.d1 { stroke: var(--accent); }
.chart-dot.d2 { stroke: var(--warm); }
.chart-dot.d3 { stroke: #8b95a5; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lg { display: flex; align-items: center; gap: 7px; }
.lg::before { content: ''; width: 10px; height: 3px; border-radius: 2px; background: currentColor; }
.lg1::before { background: var(--accent); }
.lg2::before { background: var(--warm); }
.lg3::before { background: #8b95a5; }

.keys { display: flex; align-items: center; gap: 8px; margin-top: 22px; color: var(--faint); }
kbd {
  min-width: 38px;
  height: 36px;
  padding: 0 11px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  font: 500 13px var(--font-body);
  color: var(--text);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--line-strong);
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.05), inset 0 -2px 0 rgba(0, 0, 0, 0.25);
}
.presets { display: flex; gap: 6px; margin-top: 22px; }
.presets span {
  flex: 1;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.presets .on { color: var(--text); background: rgba(var(--accent-rgb), 0.16); border-color: rgba(var(--accent-rgb), 0.42); }

/* ---------------- Screenshots ---------------- */

.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: start; }
.shot { margin: 0; }
.shot-frame {
  padding: 10px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
  transition: transform 400ms var(--ease), border-color 300ms ease;
}
.shot:hover .shot-frame { transform: translateY(-4px); border-color: var(--line-strong); }
.shot img { width: 100%; height: auto; border-radius: 12px; }
.shot figcaption { margin-top: 16px; padding: 0 4px; font-size: 14px; color: var(--muted); }
.shot figcaption strong { display: block; color: var(--text); font-weight: 600; margin-bottom: 2px; }

/* ---------------- Setup ---------------- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.steps li {
  padding: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}
.step-n {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font: 600 13px/1 var(--font-display);
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  background: rgba(var(--accent-rgb), 0.08);
}
.steps h3 { margin: 18px 0 8px; font-size: 1.08rem; font-weight: 650; letter-spacing: -0.02em; }
.steps p { margin: 0; font-size: 0.95rem; color: var(--muted); }
.callout {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-top: 16px;
  padding: 24px 28px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}
.callout p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.callout strong { color: var(--text); font-weight: 600; }
.callout a { color: var(--text); text-underline-offset: 3px; text-decoration-color: rgba(var(--accent-rgb), 0.6); }

/* ---------------- Closing + footer ---------------- */
.cloud-sync-info { max-width: 760px; }
.cloud-sync-info p { color: var(--muted); }
.cloud-sync-info a { color: var(--text); text-underline-offset: 3px; }
.legal-page { max-width: 820px; margin: 0 auto; padding: 96px 28px 24px; }
.legal-page h1 { font: 700 clamp(2.2rem, 5vw, 3.6rem)/1.12 var(--font-display); letter-spacing: -0.04em; }
.legal-page h2 { margin: 48px 0 12px; font: 650 1.45rem/1.25 var(--font-display); }
.legal-page p, .legal-page li { color: var(--muted); }
.legal-page a { color: var(--text); text-underline-offset: 3px; }
.legal-page ul { padding-left: 22px; }
.legal-meta { color: var(--faint); font-size: 14px; }

.closing {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 160px;
}
.closing img { border-radius: 16px; margin-bottom: 28px; box-shadow: 0 20px 50px -12px rgba(var(--accent-rgb), 0.35); }
.closing h2 { max-width: 780px; }
.closing .cta-row { margin-top: 28px; }

.footer {
  margin-top: 140px;
  border-top: 1px solid var(--line);
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 24px 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.footer-brand { display: flex; align-items: center; gap: 10px; font: 600 14px var(--font-display); }
.footer-brand img { border-radius: 5px; }
.footer-version { font: 12px var(--font-mono); color: var(--faint); font-weight: 400; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.footer-links a { font-size: 14px; color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); }
.fine-print {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px 40px;
  font-size: 12.5px;
  color: var(--faint);
}

/* ---------------- Inner pages ---------------- */

.page-hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 88px 24px 0;
  text-align: center;
}
.page-hero h1 { font-size: clamp(2.3rem, 5.2vw, 4rem); }
.page-hero .lede { max-width: 640px; }

/* Download: one button for this device, everything else in a quiet list. */
.dl-hero { padding-bottom: 8px; }
.rec { display: flex; flex-direction: column; align-items: center; margin-top: 40px; }
.btn.btn-lg { height: 56px; padding: 0 32px; font-size: 16px; }
.rec-sub, .rec-arch { margin: 16px 0 0; font-size: 13.5px; color: var(--faint); }
.rec-arch { margin-top: 4px; }
.rec-beta { margin: 6px 0 0; font-size: 13.5px; color: var(--faint); }
.rec-beta a { color: var(--accent); text-underline-offset: 3px; }
.install-help { width: 100%; max-width: 460px; margin-top: 22px; font-size: 14.5px; color: var(--muted); text-align: left; }
.install-help summary {
  width: max-content;
  margin: 0 auto;
  cursor: pointer;
  list-style: none;
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}
.install-help summary::-webkit-details-marker { display: none; }
.install-help summary:hover { color: var(--text); }
.install-help[open] summary { color: var(--text); text-decoration: none; font-weight: 600; }
.install-help[open] {
  padding: 20px 24px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  animation: pop-in 280ms var(--ease);
}
.install-started { margin: 12px 0 0; text-align: center; color: var(--muted); }
.install-steps { margin: 16px 0 0; padding: 0; list-style: none; counter-reset: step; }
.install-steps li { position: relative; padding-left: 36px; line-height: 1.55; counter-increment: step; }
.install-steps li + li { margin-top: 12px; }
.install-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font: 600 12px/1 var(--font-display);
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.1);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
}
.install-steps b { color: var(--text); font-weight: 600; }
.install-foot { margin: 16px 0 0; font-size: 13px; color: var(--faint); text-align: center; }
.install-foot a { color: var(--muted); }
.no-detect { max-width: 440px; margin: 32px auto 0; color: var(--muted); }
.dl-all { max-width: 560px; padding-top: 96px; }
.dl-all h2 { font-size: 1.1rem; letter-spacing: -0.01em; color: var(--muted); font-weight: 600; margin-bottom: 12px; }
.dl-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.dl-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 2px;
  border-bottom: 1px solid var(--line);
}
.dl-os { font-weight: 600; }
.dl-links { display: flex; gap: 20px; }
.dl-links a { color: var(--muted); font-size: 14.5px; text-decoration: none; }
.dl-links a:hover { color: var(--accent); }
.dl-foot { margin: 20px 0 0; font-size: 13.5px; color: var(--faint); }
.dl-foot a { color: var(--muted); text-underline-offset: 3px; }

/* Companion: a Home Assistant device card mock. */
.ha-device {
  max-width: 420px;
  margin: 56px auto 0;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: #14171d;
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.9);
  text-align: left;
  overflow: hidden;
}
.ha-device-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.ha-device-head .tile-icon { width: 34px; height: 34px; border-radius: 10px; }
.ha-device-head strong { display: block; font-size: 15px; font-weight: 600; }
.ha-device-head span { font-size: 12.5px; color: var(--faint); }
.ha-rows { list-style: none; margin: 0; padding: 6px 0; }
.ha-rows li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  font-size: 14px;
}
.ha-rows .ico { color: var(--muted); }
.ha-rows .v { margin-left: auto; color: var(--muted); }
.ha-rows .v.on { color: #4ade80; }
.toggle {
  margin-left: auto;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: var(--accent);
  position: relative;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
}


.code {
  position: relative;
  margin: 0;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #0d1015;
  overflow: hidden;
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 10px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--faint);
}
.copy-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid transparent;
  background: none;
  color: var(--faint);
  cursor: pointer;
}
.copy-btn:hover { color: var(--text); background: var(--surface-2); }
.copy-btn .ico { width: 15px; height: 15px; }
.copy-btn .ico-done { display: none; color: #4ade80; }
.copy-btn[data-state='done'] .ico-copy { display: none; }
.copy-btn[data-state='done'] .ico-done { display: block; }
.code pre {
  margin: 0;
  padding: 18px;
  overflow-x: auto;
  font: 13px/1.7 var(--font-mono);
  color: #cfd6e0;
}
.code .k { color: #8ab4f8; }
.code .s { color: #f0c38e; }
.code .c { color: var(--faint); }


.example { margin: 0; }
.fine { margin: 24px 0 0; font-size: 14px; color: var(--faint); }
.fine a { color: var(--muted); text-underline-offset: 3px; }

/* ---------------- Scroll reveal ---------------- */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 800ms var(--ease), transform 800ms var(--ease);
  transition-delay: var(--d, 0ms);
}
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}

/* ---------------- Responsive ---------------- */

@media (max-width: 1020px) {
  .stage-hint { display: none; }
  .widget { right: 50%; transform: translate(50%, -50%); }
  .tile.t-wide { grid-column: span 6; }
  .tile { grid-column: span 3; }
  .tile.t-half { grid-column: span 3; }
  .bento > .tile:nth-child(2) { grid-column: span 6; }
}

@media (max-width: 420px) {
  .brand span { display: none; }
}

@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-actions { margin-left: auto; }
  .brand { white-space: nowrap; }
  .hero { padding-top: 56px; }
  .stage-wrap { margin: 48px -12px 0; }
  .stage {
    height: auto;
    padding: 46px 12px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    border-radius: 20px;
  }
  .widget {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    width: 100%;
    max-width: 430px;
    padding: 0 10px 10px;
  }
  .widget-head { margin: 0 -10px 10px; }
  .pin-btn { display: none; }
  .media-progress { display: none; }
  .media-ctrls { margin-left: auto; }
  .clock-time { font-size: 24px; }
  .wx-icon { display: none; }
  .dock {
    position: relative;
    left: auto;
    bottom: auto;
    transform: none;
    width: 100%;
    max-width: 390px;
    flex-direction: column;
    gap: 14px;
    padding: 14px;
    border-radius: 18px;
  }
  .dock-group { flex-direction: column; gap: 8px; }
  .seg button { padding: 0 11px; }
  .dock-sep { display: none; }
  .section { padding-top: 88px; }
  .section-head { margin-bottom: 32px; }
  .bento, .steps, .shots { grid-template-columns: 1fr; }
  .tile, .tile.t-wide, .tile.t-half, .bento > .tile:nth-child(2) { grid-column: auto; }
  .tile.t-wide { grid-template-columns: 1fr; }
  .tile, .steps li { padding: 22px; }
  .shots { max-width: 420px; margin: 0 auto; }
  .page-hero { padding-top: 56px; }
  .callout { flex-direction: column; padding: 22px; }
  .closing { padding-top: 112px; }
  .footer { margin-top: 100px; }
}
