/* Halo Battery website
   Tokens: light-dark() colours keyed off color-scheme, which follows the
   <meta name="color-scheme"> override set by the theme toggle.
   Shape rule: big surfaces 20px, small tiles 14px, inputs 12px, buttons and chips pill. */

@font-face { font-family: "Outfit"; src: url("assets/fonts/outfit-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; 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: "Outfit"; src: url("assets/fonts/outfit-latin-ext.woff2") format("woff2"); font-weight: 100 900; font-display: swap; 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: "Geist"; src: url("assets/fonts/geist-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; 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: "Geist"; src: url("assets/fonts/geist-latin-ext.woff2") format("woff2"); font-weight: 100 900; font-display: swap; 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: "Geist Mono"; src: url("assets/fonts/geist-mono-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; 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: "Geist Mono"; src: url("assets/fonts/geist-mono-latin-ext.woff2") format("woff2"); font-weight: 100 900; font-display: swap; 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; }

/* ------------------------------------------------------------------ tokens */
:root {
  color-scheme: light dark;
  &:has(> head > meta[name="color-scheme"][content="dark"]) { color-scheme: dark; }
  &:has(> head > meta[name="color-scheme"][content="light"]) { color-scheme: light; }

  /* raw pairs (light, dark) */
  --bg-l: oklch(0.972 0.005 155);   --bg-d: oklch(0.155 0.008 165);
  --bg2-l: oklch(0.952 0.007 155);  --bg2-d: oklch(0.182 0.009 165);
  --surf-l: oklch(0.993 0.003 155); --surf-d: oklch(0.205 0.01 165);
  --surf2-l: oklch(0.938 0.009 155);--surf2-d: oklch(0.24 0.012 165);
  --ink-l: #1b1b1b;                 --ink-d: oklch(0.955 0.008 160);
  --ink2-l: oklch(0.43 0.014 165);  --ink2-d: oklch(0.77 0.014 160);
  --ink3-l: oklch(0.53 0.012 165);  --ink3-d: oklch(0.64 0.012 160);
  --acc-l: #467d48;                 --acc-d: #b7e68d;
  --accink-l: #f7fbf5;              --accink-d: #12180f;

  --bg: var(--bg-l); --bg-2: var(--bg2-l); --surface: var(--surf-l); --surface-2: var(--surf2-l);
  --ink: var(--ink-l); --ink-2: var(--ink2-l); --ink-3: var(--ink3-l);
  --accent: var(--acc-l); --accent-ink: var(--accink-l);
  @media (prefers-color-scheme: dark) {
    --bg: var(--bg-d); --bg-2: var(--bg2-d); --surface: var(--surf-d); --surface-2: var(--surf2-d);
    --ink: var(--ink-d); --ink-2: var(--ink2-d); --ink-3: var(--ink3-d);
    --accent: var(--acc-d); --accent-ink: var(--accink-d);
  }
  @supports (color: light-dark(white, black)) {
    --bg: light-dark(var(--bg-l), var(--bg-d));
    --bg-2: light-dark(var(--bg2-l), var(--bg2-d));
    --surface: light-dark(var(--surf-l), var(--surf-d));
    --surface-2: light-dark(var(--surf2-l), var(--surf2-d));
    --ink: light-dark(var(--ink-l), var(--ink-d));
    --ink-2: light-dark(var(--ink2-l), var(--ink2-d));
    --ink-3: light-dark(var(--ink3-l), var(--ink3-d));
    --accent: light-dark(var(--acc-l), var(--acc-d));
    --accent-ink: light-dark(var(--accink-l), var(--accink-d));
  }
  --line: color-mix(in oklab, var(--ink) 10%, transparent);
  --line-2: color-mix(in oklab, var(--ink) 17%, transparent);
  --accent-soft: color-mix(in oklab, var(--accent) 13%, transparent);
  --shadow-tint: light-dark(oklch(0.35 0.03 160 / 0.14), oklch(0.05 0.01 160 / 0.55));

  /* the app's own state colours (halo/icons.py) */
  --red: rgb(232 17 35);
  --amber: rgb(255 185 0);
  --green: rgb(16 196 80);

  --font-display: "Outfit", "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --font-win: "Segoe UI Variable Text", "Segoe UI", "Geist", system-ui, sans-serif;

  --wrap: 1240px;
  --gutter: clamp(1.1rem, 4vw, 2.5rem);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* non-colour theme branches */
  --show-on-dark: none; --show-on-light: inline;
  --wall: image-set(url("assets/img/wall-light.webp") type("image/webp"), url("assets/img/wall-light.jpg") type("image/jpeg"));

  accent-color: var(--accent);
  scrollbar-color: color-mix(in oklab, var(--ink) 30%, transparent) transparent;
}
@media (prefers-color-scheme: dark) {
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) {
    --show-on-dark: inline; --show-on-light: none;
    --wall: image-set(url("assets/img/wall-dark.webp") type("image/webp"), url("assets/img/wall-dark.jpg") type("image/jpeg"));
  }
}
:root:has(> head > meta[name="color-scheme"][content="dark"]) {
  --show-on-dark: inline; --show-on-light: none;
  --wall: image-set(url("assets/img/wall-dark.webp") type("image/webp"), url("assets/img/wall-dark.jpg") type("image/jpeg"));
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-synthesis: none;
  overflow-x: clip;
}
/* fine grain over everything, fixed so it never repaints on scroll */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 100; pointer-events: none;
  opacity: 0.045;
  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='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { color: var(--ink); font-family: var(--font-display); margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.75rem, 1.55rem + 3.7vw, 4.75rem); line-height: 1.02; letter-spacing: -0.035em; font-weight: 600; }
h2 { font-size: clamp(2rem, 1.35rem + 2.1vw, 3.15rem); line-height: 1.06; letter-spacing: -0.03em; font-weight: 600; }
h3 { font-size: 1.25rem; line-height: 1.25; letter-spacing: -0.015em; font-weight: 600; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
code, kbd, pre { font-family: var(--font-mono); font-size: 0.9em; }
:not(pre) > code, kbd {
  padding: 0.08em 0.4em; border-radius: 6px;
  background: var(--surface-2); color: var(--ink); border: 1px solid var(--line);
  font-size: 0.85em;
}
::selection { background: color-mix(in oklab, var(--accent) 35%, transparent); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 200; background: var(--ink); color: var(--bg); padding: 0.6rem 1rem; border-radius: 999px; text-decoration: none; }
.skip:focus { top: 1rem; }
.ico { width: 1.15em; height: 1.15em; flex: none; }
.logo-on-dark { display: var(--show-on-dark); }
.logo-on-light { display: var(--show-on-light); }
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.section { padding-block: clamp(4.5rem, 9vw, 8rem); }
.section-lead { margin-top: 1rem; font-size: 1.0625rem; max-width: 56ch; }

/* ------------------------------------------------------------------ buttons */
.btn {
  --h: 2.75rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  min-height: var(--h); padding: 0 1.15rem;
  border-radius: 999px; border: 1px solid transparent;
  font: 500 0.95rem/1 var(--font-body); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform 0.2s var(--ease-out), background-color 0.2s, border-color 0.2s, box-shadow 0.25s;
}
.btn:active { transform: translateY(1px) scale(0.985); }
.btn-sm { --h: 2.25rem; padding: 0 0.95rem; font-size: 0.875rem; }
.btn-lg { --h: 3.25rem; padding: 0 1.4rem; font-size: 1rem; }
.btn-primary {
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 1px 0 color-mix(in oklab, white 30%, transparent) inset, 0 1px 2px var(--shadow-tint);
}
.btn-primary:hover { background: color-mix(in oklab, var(--accent) 88%, var(--ink)); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface); border-color: color-mix(in oklab, var(--ink) 30%, transparent); }
.btn-meta {
  font: 500 0.75rem/1 var(--font-mono); padding: 0.3rem 0.45rem; border-radius: 999px;
  background: light-dark(rgb(0 0 0 / 0.26), rgb(0 0 0 / 0.1));
}
.text-link {
  display: inline-flex; align-items: center; gap: 0.3rem;
  color: var(--ink); font-weight: 500; text-decoration: underline; text-decoration-color: var(--line-2);
  text-underline-offset: 0.25em; transition: text-decoration-color 0.2s;
}
.text-link:hover { text-decoration-color: var(--accent); }
.text-link .ico { width: 1em; height: 1em; }
.icon-btn {
  display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer;
  transition: background-color 0.2s;
}
.icon-btn:hover { background: var(--surface); }
.icon-btn .ico { width: 1.05rem; height: 1.05rem; }
.theme-toggle .when-dark { display: var(--show-on-dark); }
.theme-toggle .when-light { display: var(--show-on-light); }
.theme-toggle .sr-only.when-dark, .theme-toggle .sr-only.when-light { position: absolute; }

/* ------------------------------------------------------------------ header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.site-header.is-stuck { border-bottom-color: var(--line); }
@media (prefers-reduced-transparency: reduce) { .site-header { background: var(--bg); backdrop-filter: none; } }
.header-row { display: flex; align-items: center; gap: 2rem; height: 4rem; }
.brand { display: flex; align-items: center; }
.brand .logo { height: 26px; width: auto; }
.nav { display: flex; gap: 0.25rem; margin-right: auto; }
.nav a {
  padding: 0.4rem 0.75rem; border-radius: 999px; text-decoration: none; color: var(--ink-2);
  font-size: 0.9rem; font-weight: 500; transition: color 0.2s, background-color 0.2s;
}
.nav a:hover { color: var(--ink); background: var(--surface); }
.header-actions { display: flex; align-items: center; gap: 0.5rem; }
.gh-pill {
  display: inline-flex; align-items: center; gap: 0.4rem; height: 2.25rem; padding: 0 0.8rem;
  border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--ink);
  font: 500 0.85rem/1 var(--font-mono); transition: background-color 0.2s;
}
.gh-pill:hover { background: var(--surface); }
.gh-pill .ico { width: 1rem; height: 1rem; }
@media (max-width: 860px) {
  .nav { display: none; }
  .header-row { justify-content: space-between; gap: 1rem; }
}
@media (max-width: 420px) { .gh-pill { display: none; } }

/* ------------------------------------------------------------------ hero
   The first screen is a desktop: wallpaper behind the copy, a real-width
   taskbar along the bottom with the Halo Battery icons in its tray. */
.hero {
  --tb-h: clamp(56px, 4.4vw, 70px);
  position: relative; isolation: isolate; overflow: clip;
  min-height: clamp(620px, calc(100dvh - 4rem), 920px);
  display: grid; align-content: center;
  padding-block: clamp(3rem, 7vw, 6rem) calc(var(--tb-h) + clamp(3.5rem, 7vw, 6rem));
}
.hero-wall { position: absolute; inset: 0; z-index: -1; background: var(--surface-2) var(--wall) 70% 30% / cover no-repeat; }
.hero-wave {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  background: var(--surface-2); opacity: 0; transition: opacity 1.2s var(--ease-out, ease-out);
}
.hero-wave.is-ready { opacity: 1; }
.hero-wall::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, var(--bg) 0, transparent 20%),
    linear-gradient(90deg, var(--bg) 0%, color-mix(in oklab, var(--bg) 90%, transparent) 26%, color-mix(in oklab, var(--bg) 35%, transparent) 54%, transparent 76%);
}
.hero h1 { max-width: 11ch; }
.hero .lead { margin-top: 1.5rem; font-size: clamp(1.05rem, 0.98rem + 0.3vw, 1.2rem); max-width: 38ch; color: var(--ink-2); }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.25rem; }
@media (max-width: 760px) {
  .hero { align-content: start; }
  .hero-wall { background-position: 78% 100%; }
  .hero-wall::after {
    background: linear-gradient(to bottom, var(--bg) 0, color-mix(in oklab, var(--bg) 86%, transparent) 52%, color-mix(in oklab, var(--bg) 20%, transparent) 100%);
  }
}
@media (max-width: 480px) {
  .cta-row .btn { width: 100%; }
}

/* ------------------------------------------------------------------ the taskbar (hero preview) */
.desk {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--tb-h);
  container-type: inline-size;
  font-family: var(--font-win);
}
.taskbar {
  --tb-ink: light-dark(rgb(0 0 0 / 0.9), rgb(255 255 255 / 0.9));
  position: absolute; inset: 0;
  display: flex; justify-content: space-between; align-items: center;
  background: light-dark(rgb(238 241 239 / 0.8), rgb(24 27 26 / 0.8));
  backdrop-filter: blur(28px) saturate(1.6); -webkit-backdrop-filter: blur(28px) saturate(1.6);
  border-top: 1px solid light-dark(rgb(0 0 0 / 0.08), rgb(255 255 255 / 0.08));
  color: var(--tb-ink);
}
@media (prefers-reduced-transparency: reduce) { .taskbar { background: light-dark(rgb(238 241 239), rgb(24 27 26)); } }
.taskbar-hint {
  margin-left: max(var(--gutter), (100cqi - var(--wrap)) / 2);
  font: 400 0.8125rem/1.3 var(--font-win); opacity: 0.6;
}
@container (max-width: 720px) { .taskbar-hint { display: none; } }
.tray { display: flex; align-items: center; gap: 2px; height: 100%; margin-left: auto; padding-inline: 0.5rem 0.75rem; }
.tray-sys { display: inline-flex; align-items: center; gap: 12px; padding-inline: 10px; }
.tray-sys .ico { width: calc(var(--tb-h) * 0.28); height: calc(var(--tb-h) * 0.28); stroke-width: 1.75; }
.tray-chev { padding-inline: 4px; }
.tray-icon {
  --s: calc(var(--tb-h) * 0.74);
  display: grid; place-items: center; width: var(--s); height: var(--s);
  border: 0; border-radius: 8px; background: transparent; color: var(--tb-ink); cursor: pointer;
  transition: background-color 0.15s;
}
.tray-icon .ring { width: 62%; height: 62%; }
.tray-icon:hover, .tray-icon.is-active { background: light-dark(rgb(0 0 0 / 0.055), rgb(255 255 255 / 0.075)); }
.tray-icon:focus-visible { outline-offset: -2px; }
.tray-icon[hidden] { display: none; }
/* Settings → Tray icons → Icon colour */
.desk[data-ink="white"] .tray-icon { color: #fff; }
.desk[data-ink="black"] .tray-icon { color: #000; }
.tray-clock {
  display: grid; justify-items: end; gap: 1px; padding-left: 6px;
  font-size: calc(var(--tb-h) * 0.18); line-height: 1.3; font-variant-numeric: tabular-nums; padding-right: 4px;
}
@container (max-width: 400px) { .tray-chev, .tray-sys:not(.tray-chev) .ico:first-child { display: none; } }

/* Windows 11 tooltip */
.w-tip {
  position: absolute; left: var(--x, 50%); bottom: calc(100% + 10px);
  translate: -50% 0; max-width: calc(100% - 24px);
  padding: 6px 10px; border-radius: 6px;
  background: light-dark(rgb(249 249 249 / 0.96), rgb(43 43 43 / 0.96));
  border: 1px solid light-dark(rgb(0 0 0 / 0.08), rgb(255 255 255 / 0.08));
  box-shadow: 0 6px 18px -6px rgb(0 0 0 / 0.35);
  color: light-dark(#1b1b1b, #f3f3f3);
  font: 400 0.8125rem/1.35 var(--font-win);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: opacity 0.2s, left 0.35s var(--ease-out);
}
.w-tip.is-hidden { opacity: 0; }

/* Windows 11 context menu, in the top layer via popover */
.w-menu {
  position: fixed; inset: auto; margin: 0;
  top: var(--my, 50%); left: var(--mx, 50%);
  width: max-content; min-width: 250px; padding: 4px;
  border-radius: 8px; border: 1px solid light-dark(rgb(0 0 0 / 0.1), rgb(255 255 255 / 0.09));
  background: light-dark(rgb(249 249 249 / 0.9), rgb(44 44 44 / 0.9));
  backdrop-filter: blur(30px) saturate(1.6); -webkit-backdrop-filter: blur(30px) saturate(1.6);
  box-shadow: 0 16px 40px -12px rgb(0 0 0 / 0.45);
  color: light-dark(#1b1b1b, #f3f3f3);
  font: 400 0.875rem/1.2 var(--font-win);
  opacity: 1; translate: 0 0;
  transition: opacity 0.16s, translate 0.2s var(--ease-out), overlay 0.2s allow-discrete, display 0.2s allow-discrete;
}
.w-menu:not(:popover-open) { opacity: 0; translate: 0 6px; }
@starting-style { .w-menu:popover-open { opacity: 0; translate: 0 6px; } }
.w-menu::backdrop { background: transparent; }
.w-menu button {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  width: 100%; padding: 8px 12px; border: 0; border-radius: 4px; background: none;
  color: inherit; font: inherit; text-align: left; cursor: default;
}
.w-menu button:hover, .w-menu button:focus-visible { background: light-dark(rgb(0 0 0 / 0.05), rgb(255 255 255 / 0.07)); outline: none; }
.w-menu .ico { width: 14px; height: 14px; opacity: 0.7; }
.w-menu hr { border: 0; border-top: 1px solid light-dark(rgb(0 0 0 / 0.08), rgb(255 255 255 / 0.08)); margin: 4px -4px; }
.w-menu-head { display: grid; gap: 1px; padding: 8px 12px 8px; max-width: 30ch; }
.w-menu-head strong { font-weight: 600; }
.w-menu-head span { opacity: 0.68; font-size: 0.92em; }
.w-menu .is-default { font-weight: 600; }

/* ------------------------------------------------------------------ the ring (shared) */
.ring { --arc: currentColor; overflow: visible; color: inherit; }
.ring-track { fill: none; stroke: currentColor; stroke-width: 4; stroke-opacity: 0.27; }
.ring-arc {
  fill: none; stroke: var(--arc); stroke-width: 4; stroke-linecap: round; stroke-opacity: 0.9;
  stroke-dasharray: max(var(--lvl, 0), 2) 200;
  transition: stroke-dasharray 0.45s var(--ease-out), stroke 0.3s;
}
.ring-glyph { color: currentColor; opacity: 0.9; }
.ring-pct { display: none; fill: currentColor; opacity: 0.9; font: 700 34px var(--font-body); letter-spacing: -0.04em; }
.ring.is-full .ring-arc { stroke-dasharray: 100 200; }
.ring.is-amber { --arc: var(--amber); }
.ring.is-red { --arc: var(--red); }
.ring.is-amber .ring-arc, .ring.is-red .ring-arc, .ring.is-charging .ring-arc { stroke-opacity: 1; }
.ring.is-amber .ring-pct { fill: var(--amber); }
.ring.is-red .ring-pct { fill: var(--red); }
.ring.is-charging { --arc: var(--green); }
.ring.is-asleep { opacity: 0.43; }
.ring.is-asleep .ring-track { stroke-opacity: 0.4; }
.ring.is-asleep .ring-arc { visibility: hidden; }
.ring.show-pct .ring-glyph, .ring.ring-only .ring-glyph { display: none; }
.ring.show-pct .ring-pct { display: block; }
@media (prefers-reduced-motion: no-preference) {
  .ring.is-charging:not(.is-asleep, .no-anim) .ring-arc { animation: breathe 3s ease-in-out infinite; }
}
@keyframes breathe { 0%, 100% { stroke-opacity: 1; } 50% { stroke-opacity: 0.12; } }

/* ------------------------------------------------------------------ brands */
.brands { border-block: 1px solid var(--line); background: var(--bg-2); }
.brands-row { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); align-items: center; gap: 2.5rem; padding-block: 1.75rem; }
.brands-title { font: 500 0.95rem/1.4 var(--font-body); color: var(--ink); }
.brands-title span { color: var(--ink-3); display: block; }
.marquee {
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track { display: flex; align-items: center; gap: clamp(2.25rem, 4vw, 3.5rem); width: max-content; margin: 0; padding: 0.4rem 0; list-style: none; }
.brand-logo { width: 30px; height: 30px; color: var(--ink-3); transition: color 0.2s; }
.brand-logo:hover { color: var(--ink); }
@media (prefers-reduced-motion: no-preference) {
  .marquee.is-running .marquee-track { animation: marquee 48s linear infinite; }
  .marquee:hover .marquee-track { animation-play-state: paused; }
}
@media (prefers-reduced-motion: reduce) { .marquee { mask-image: none; } .marquee-track { flex-wrap: wrap; width: auto; } }
@keyframes marquee { to { transform: translateX(calc(-50% - var(--gap-half, 1.5rem))); } }
@media (max-width: 760px) { .brands-row { grid-template-columns: 1fr; gap: 1.25rem; } }

/* ------------------------------------------------------------------ ring lab */
.lab-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(2.5rem, 6vw, 6rem); align-items: center; }
.lab-stage {
  position: relative; display: grid; place-items: center; gap: 1.75rem;
  padding: clamp(2rem, 5vw, 3.5rem); border-radius: 28px;
  background:
    radial-gradient(closest-side, color-mix(in oklab, var(--surface) 100%, transparent), transparent) center / 90% 90% no-repeat,
    var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink);
}
.ring-xl { width: min(100%, 340px); height: auto; aspect-ratio: 1; }
.lab-sizes { display: flex; align-items: flex-end; gap: 1.1rem; padding: 0.75rem 1.1rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.lab-sizes-label { font-size: 0.75rem; color: var(--ink-3); margin-right: 0.25rem; align-self: center; }
.lab-size { display: grid; justify-items: center; gap: 0.3rem; }
.lab-size small { font: 0.6875rem/1 var(--font-mono); color: var(--ink-3); }
/* tiny sizes need a heavier glyph to stay legible, as the app's own masks do */
.lab-size .ring-glyph { stroke-width: 2.9; }
.lab-copy h2 { max-width: 14ch; }
.lab-controls { margin-top: 2rem; display: grid; gap: 1.35rem; }
.field-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.4rem; }
.field label, .seg legend, .chips legend, .dev-search label { font-size: 0.875rem; font-weight: 500; color: var(--ink); }
.field output { font: 500 0.875rem/1 var(--font-mono); color: var(--ink); }
input[type="range"] { width: 100%; margin: 0; height: 1.5rem; cursor: pointer; }
.seg { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.seg legend { margin-bottom: 0.5rem; padding: 0; }
.seg label, .chips label {
  position: relative; display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer;
  padding: 0.5rem 0.9rem; border-radius: 999px; border: 1px solid var(--line-2);
  font-size: 0.875rem; color: var(--ink-2); transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.seg label:hover, .chips label:hover { color: var(--ink); border-color: color-mix(in oklab, var(--ink) 30%, transparent); }
.seg input, .chips input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg label:has(input:checked), .chips label:has(input:checked) { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.seg label:has(input:focus-visible), .chips label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg .ico { width: 1rem; height: 1rem; }
.switches { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; }
.switch { display: inline-flex; align-items: center; gap: 0.6rem; cursor: pointer; font-size: 0.9rem; color: var(--ink); }
.switch input {
  appearance: none; -webkit-appearance: none; margin: 0; flex: none; cursor: pointer;
  width: 2.35rem; height: 1.35rem; border-radius: 999px; position: relative;
  background: var(--surface-2); border: 1px solid var(--line-2);
  transition: background-color 0.2s, border-color 0.2s;
}
.switch input::before {
  content: ""; position: absolute; top: 50%; left: 0.18rem; width: 0.9rem; height: 0.9rem; border-radius: 50%;
  background: var(--ink-2); translate: 0 -50%; transition: translate 0.25s var(--ease-out), background-color 0.2s;
}
.switch input:checked { background: var(--accent); border-color: var(--accent); }
.switch input:checked::before { translate: 1rem -50%; background: var(--accent-ink); }
.legend { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 0.15rem; }
.legend li {
  display: grid; grid-template-columns: 1.25rem 1fr; gap: 0.85rem; align-items: start;
  padding: 0.6rem 0.8rem; border-radius: 12px; font-size: 0.9375rem; color: var(--ink-3);
  transition: background-color 0.25s, color 0.25s;
}
.legend li.is-on { background: var(--surface); color: var(--ink-2); box-shadow: 0 0 0 1px var(--line) inset; }
.legend strong { color: var(--ink); font-weight: 600; }
.legend li:not(.is-on) strong { color: inherit; }
.sw { width: 1.1rem; height: 1.1rem; margin-top: 0.2rem; border-radius: 50%; border: 3px solid currentColor; }
.sw-neutral { color: var(--ink); }
.sw-amber { color: var(--amber); }
.sw-red { color: var(--red); }
.sw-green { color: var(--green); }
.sw-asleep { color: color-mix(in oklab, var(--ink) 35%, transparent); }
@media (max-width: 900px) {
  .lab-grid { grid-template-columns: 1fr; gap: 2rem; }
  /* keep the ring in view while the controls below it are used */
  .lab-stage {
    position: sticky; top: 4.25rem; z-index: 2; padding: 1rem;
    grid-template-columns: auto 1fr; gap: 1rem; justify-items: start;
    background: color-mix(in oklab, var(--bg-2) 92%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
  }
  .ring-xl { width: 112px; }
  .lab-sizes { padding: 0.6rem 0.8rem; gap: 0.8rem; }
  .lab-sizes-label { display: none; }
}

/* ------------------------------------------------------------------ features (bento) */
.features { background: var(--bg-2); border-block: 1px solid var(--line); }
.features-title { max-width: 16ch; }
.bento { margin-top: clamp(2.5rem, 5vw, 3.75rem); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.cell {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
  padding: clamp(1.4rem, 2.5vw, 2rem); border-radius: 20px;
  background: var(--surface); border: 1px solid var(--line);
  min-height: 300px;
}
.cell-text { max-width: 44ch; }
.cell-text p { margin-top: 0.55rem; font-size: 0.9375rem; }
.cell-vendor { grid-column: span 7; background: linear-gradient(160deg, var(--accent-soft), transparent 60%), var(--surface); flex-direction: row; align-items: stretch; }
.cell-vendor .cell-text { align-self: flex-end; flex: 1 1 22ch; }
.cell-quiet { grid-column: span 5; padding: 0; gap: 0; }
.cell-quiet .cell-text { padding: 0 clamp(1.4rem, 2.5vw, 2rem) clamp(1.4rem, 2.5vw, 2rem); }
.cell-lang { grid-column: span 5; }
.cell-json { grid-column: span 7; background: var(--surface-2); }
.cell-time { grid-column: span 7; flex-direction: row; align-items: flex-end; }
.cell-update { grid-column: span 5; }
@media (max-width: 960px) {
  .cell-vendor, .cell-quiet, .cell-lang, .cell-json, .cell-time, .cell-update { grid-column: span 12; }
}
@media (max-width: 620px) {
  .cell-vendor, .cell-time { flex-direction: column; align-items: stretch; }
}

.struck { list-style: none; margin: 0; padding: 0; display: grid; align-content: start; gap: 0.1rem; flex: 0 1 auto; text-align: right; }
.struck li { font: 600 clamp(1.5rem, 1.1rem + 1.4vw, 2.3rem)/1.15 var(--font-display); letter-spacing: -0.03em; color: color-mix(in oklab, var(--ink) 46%, transparent); }
.struck s { text-decoration: none; position: relative; }
.struck s::after {
  content: ""; position: absolute; left: -4%; right: -4%; top: 54%; height: 3px; border-radius: 3px;
  background: var(--accent); transform-origin: left;
}
.struck.will-strike s::after { transform: scaleX(0); transition: transform 0.55s var(--ease-out); }
.struck.will-strike.is-struck s::after { transform: none; }
.struck li:nth-child(2) s::after { transition-delay: 0.12s; }
.struck li:nth-child(3) s::after { transition-delay: 0.24s; }
.struck li:nth-child(4) s::after { transition-delay: 0.36s; }
.struck li:nth-child(5) s::after { transition-delay: 0.48s; }

.quiet-scene {
  position: relative; display: grid; place-items: center; align-content: center; gap: 0.9rem;
  min-height: 210px; padding: 1.75rem 1.25rem; margin-bottom: 1.5rem;
  background: var(--wall) center 30% / cover no-repeat;
  border-bottom: 1px solid var(--line);
}
.toast {
  display: grid; gap: 0.2rem; width: min(100%, 330px); padding: 0.85rem 1rem 1rem;
  border-radius: 8px; font: 400 0.82rem/1.4 var(--font-win);
  background: light-dark(rgb(246 246 246 / 0.9), rgb(38 40 39 / 0.9));
  border: 1px solid light-dark(rgb(0 0 0 / 0.08), rgb(255 255 255 / 0.08));
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  color: light-dark(#1b1b1b, #f1f1f1);
  box-shadow: 0 18px 40px -16px rgb(0 0 0 / 0.5);
}
.toast-app { display: flex; align-items: center; gap: 0.45rem; font-size: 0.74rem; opacity: 0.75; margin-bottom: 0.35rem; }
.toast-app img { width: 14px; height: 14px; }
.toast strong { font-weight: 600; font-size: 0.86rem; }
.held {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.75rem; border-radius: 999px;
  font-size: 0.78rem; font-weight: 500; color: var(--ink);
  background: color-mix(in oklab, var(--surface) 82%, transparent); border: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.held .ico { width: 0.95rem; height: 0.95rem; }

.lang-list { list-style: none; margin: 0; padding: 0; display: grid; }
.lang-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.42rem 0; border-bottom: 1px solid var(--line); }
.lang-list li:last-child { border-bottom: 0; }
.lang-list span { font: 500 1.05rem/1.3 var(--font-display); color: var(--ink); }
.lang-list li:lang(ja) span, .lang-list li:lang(zh) span { font-family: system-ui, "Yu Gothic UI", "Microsoft YaHei UI", "Microsoft JhengHei UI", sans-serif; }
.lang-list code { font: 500 0.7rem/1 var(--font-mono); color: var(--ink-3); background: none; border: 0; padding: 0; }

.code {
  margin: 0; padding: 1.1rem 1.2rem; border-radius: 14px; overflow-x: auto;
  background: light-dark(oklch(0.985 0.004 155), oklch(0.17 0.01 165));
  color: light-dark(oklch(0.3 0.015 160), oklch(0.88 0.01 160));
  border: 1px solid var(--line);
  font-size: 0.8rem; line-height: 1.6; tab-size: 2;
}
.code .c { color: light-dark(oklch(0.55 0.012 160), oklch(0.6 0.01 160)); }
.code .k { color: light-dark(#3d6f3f, #b7e68d); }
.code .s { color: light-dark(oklch(0.5 0.11 60), oklch(0.85 0.08 75)); }
.code .n { color: light-dark(oklch(0.48 0.13 250), oklch(0.82 0.08 230)); }
.code .b { color: light-dark(oklch(0.5 0.15 330), oklch(0.8 0.1 330)); }

.time-tip { flex: 1 1 auto; display: grid; align-content: end; }
.time-big { font: 600 clamp(3rem, 2rem + 4vw, 5.4rem)/0.95 var(--font-display); letter-spacing: -0.045em; color: var(--ink); white-space: nowrap; }
.time-small { font: 500 1.05rem/1.4 var(--font-display); color: var(--ink-3); margin-top: 0.35rem; }
.cell-time .cell-text { flex: 0 1 34ch; }

.update-menu {
  display: grid; width: min(100%, 280px); padding: 4px; border-radius: 8px;
  background: light-dark(rgb(249 249 249), rgb(44 44 44)); color: light-dark(#1b1b1b, #f3f3f3);
  border: 1px solid light-dark(rgb(0 0 0 / 0.09), rgb(255 255 255 / 0.08));
  box-shadow: 0 16px 36px -18px var(--shadow-tint);
  font: 400 0.85rem/1.2 var(--font-win);
}
.update-row { display: flex; align-items: center; gap: 0.55rem; padding: 8px 12px; border-radius: 4px; opacity: 0.55; }
.update-row.is-hot { opacity: 1; font-weight: 600; background: light-dark(rgb(0 0 0 / 0.05), rgb(255 255 255 / 0.07)); }
.update-row .ico { width: 15px; height: 15px; color: var(--accent); }

/* ------------------------------------------------------------------ devices */
.devices-head h2 { max-width: 18ch; }
.dev-controls { margin-top: 2.5rem; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1.25rem 2rem; }
.dev-search { flex: 1 1 320px; max-width: 460px; display: grid; gap: 0.45rem; }
.input-wrap { position: relative; }
.input-wrap .ico { position: absolute; left: 0.95rem; top: 50%; translate: 0 -50%; width: 1.1rem; height: 1.1rem; color: var(--ink-3); pointer-events: none; }
.dev-search input {
  width: 100%; height: 3rem; padding: 0 1rem 0 2.75rem; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font: 400 1rem/1 var(--font-body); transition: border-color 0.2s, box-shadow 0.2s;
}
.dev-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.help { font-size: 0.8125rem; color: var(--ink-3); }
.chips { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chips legend { padding: 0; margin-bottom: 0.45rem; }
.dev-verified { margin-bottom: 0.7rem; }
.dev-count { margin-top: 2rem; font-size: 0.875rem; color: var(--ink-3); }
.dev-grid { list-style: none; margin: 0.85rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 10px; }
.dev {
  display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 0.85rem; align-items: start;
  padding: 0.95rem 1rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
}
.dev-ico { grid-row: span 2; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 10px; background: var(--bg-2); color: var(--ink-2); }
.dev-ico .ico { width: 1.1rem; height: 1.1rem; }
.dev-name { color: var(--ink); font-weight: 500; font-size: 0.9375rem; line-height: 1.35; }
.dev-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.6rem; font-size: 0.78rem; color: var(--ink-3); }
.dev-status { display: inline-flex; align-items: center; gap: 0.25rem; font-weight: 500; }
.dev-status.is-verified { color: var(--accent); }
.dev-status .ico { width: 0.9rem; height: 0.9rem; }
.dev-skel .dev-name, .dev-skel .dev-meta { border-radius: 6px; background: var(--bg-2); color: transparent; }
.dev-skel .dev-meta { width: 60%; }
@media (prefers-reduced-motion: no-preference) { .dev-skel { animation: skel 1.2s ease-in-out infinite alternate; } }
@keyframes skel { to { opacity: 0.55; } }
.dev-empty { margin-top: 1rem; padding: 2.5rem 1.5rem; border-radius: 20px; border: 1px dashed var(--line-2); text-align: center; }
.dev-empty-title { font: 600 1.25rem/1.3 var(--font-display); color: var(--ink); margin-bottom: 0.4rem; }
.dev-empty a { color: var(--ink); }
.dev-foot { margin-top: 1.75rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem; }

/* ------------------------------------------------------------------ install */
.install { background: var(--bg-2); border-block: 1px solid var(--line); }
.install-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: stretch; }
.install-intro { padding-right: clamp(0rem, 3vw, 2.5rem); align-self: center; }
.install-intro h2 { max-width: 12ch; }
.dl-card {
  position: relative; display: grid; align-content: start; gap: 0.7rem;
  padding: clamp(1.4rem, 2.5vw, 2rem); border-radius: 20px;
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink-2);
  transition: transform 0.35s var(--ease-out), border-color 0.25s, box-shadow 0.35s;
}
.dl-card:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: 0 24px 48px -28px var(--shadow-tint); }
.dl-primary { border-color: color-mix(in oklab, var(--accent) 45%, transparent); background: linear-gradient(170deg, var(--accent-soft), transparent 55%), var(--surface); }
.dl-primary:hover { border-color: var(--accent); }
.dl-icon { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 12px; background: var(--bg-2); color: var(--ink); margin-bottom: 0.5rem; }
.dl-primary .dl-icon { background: var(--accent); color: var(--accent-ink); }
.dl-icon .ico { width: 1.3rem; height: 1.3rem; }
.dl-kind { font: 600 1.25rem/1.2 var(--font-display); color: var(--ink); display: flex; align-items: center; gap: 0.6rem; }
.dl-kind em { font: 500 0.72rem/1 var(--font-body); font-style: normal; padding: 0.3rem 0.55rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.dl-file { font-size: 0.8rem; color: var(--ink); word-break: break-all; }
.dl-desc { font-size: 0.9375rem; }
.dl-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 0.75rem; padding-top: 1rem; border-top: 1px solid var(--line); font: 500 0.8rem/1 var(--font-mono); color: var(--ink-3); }
.dl-meta .ico { color: var(--ink); width: 1.1rem; height: 1.1rem; transition: translate 0.3s var(--ease-out); }
.dl-card:hover .dl-meta .ico { translate: 0 2px; }
.smartscreen {
  grid-column: 2 / -1; display: flex; gap: 0.85rem; align-items: flex-start;
  padding: 1.1rem 1.25rem; border-radius: 14px; font-size: 0.875rem; color: var(--ink-2);
  border: 1px solid var(--line);
}
.smartscreen .ico { width: 1.25rem; height: 1.25rem; color: var(--accent); margin-top: 0.1rem; }
.smartscreen strong { color: var(--ink); font-weight: 600; }
.smartscreen a { color: var(--ink); text-underline-offset: 0.2em; }
@media (max-width: 960px) {
  .install-grid { grid-template-columns: 1fr 1fr; }
  .install-intro { grid-column: 1 / -1; padding: 0 0 1.5rem; }
  .smartscreen { grid-column: 1 / -1; }
}
@media (max-width: 620px) { .install-grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ community */
.community-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(2.5rem, 6vw, 6rem) clamp(2.5rem, 6vw, 6rem); }
.community-rail { align-self: start; position: sticky; top: 6rem; }
.community-rail h2 { max-width: 13ch; }
.community-rail .text-link { margin-top: 1.5rem; }
.flow { list-style: none; margin: 0; padding: 0; display: grid; counter-reset: flow; }
.flow li {
  counter-increment: flow; position: relative;
  padding: 0 0 2.25rem 4rem;
}
.flow li::before {
  /* a small ring that fills a third per action */
  content: ""; position: absolute; left: 0; top: -0.1rem; width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background:
    radial-gradient(closest-side, var(--bg) calc(100% - 4px), transparent calc(100% - 3px)),
    conic-gradient(var(--accent) var(--fill), color-mix(in oklab, var(--ink) 14%, transparent) 0);
}
.flow li:nth-child(1) { --fill: 33.3%; }
.flow li:nth-child(2) { --fill: 66.6%; }
.flow li:nth-child(3) { --fill: 100%; padding-bottom: 0; }
.flow li::after {
  content: ""; position: absolute; left: calc(1.25rem - 0.5px); top: 2.9rem; bottom: 0.4rem; width: 1px; background: var(--line-2);
}
.flow li:last-child::after { display: none; }
.flow h3 { padding-top: 0.35rem; }
.flow p { margin-top: 0.45rem; max-width: 52ch; }
.stats {
  grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, auto) minmax(0, 1fr); gap: 2rem clamp(2rem, 5vw, 4.5rem); align-items: end;
  padding-top: clamp(2.5rem, 5vw, 3.5rem); border-top: 1px solid var(--line);
}
.stat { display: grid; gap: 0.3rem; }
.stat-n { font: 600 clamp(2.4rem, 1.8rem + 2vw, 3.6rem)/1 var(--font-display); letter-spacing: -0.04em; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-l { font-size: 0.875rem; color: var(--ink-3); }
.people { justify-self: end; max-width: 30rem; display: grid; gap: 0.9rem; font-size: 0.875rem; }
.people a { color: var(--ink); text-underline-offset: 0.2em; }
.avatars { list-style: none; margin: 0; padding: 0 0 0 10px; display: flex; flex-wrap: wrap; min-height: 36px; }
.avatars li { margin-left: -10px; }
.avatars a { display: block; border-radius: 50%; transition: translate 0.25s var(--ease-out); }
.avatars a:hover { translate: 0 -3px; }
.avatars img { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--bg); background: var(--surface-2); }
@media (max-width: 960px) {
  .community-grid { grid-template-columns: 1fr; }
  .community-rail { position: static; }
  .stats { grid-template-columns: repeat(3, auto); }
  .people { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 520px) { .stats { grid-template-columns: 1fr 1fr; } }

/* ------------------------------------------------------------------ final */
.final { padding-block: clamp(5rem, 11vw, 9rem); text-align: center; position: relative; isolation: isolate; overflow: hidden; }
.final::before {
  content: ""; position: absolute; z-index: -1; left: 50%; top: 100%; width: min(1100px, 140vw); aspect-ratio: 1; translate: -50% -42%;
  border-radius: 50%; border: 1px solid var(--line);
  box-shadow: 0 0 0 90px color-mix(in oklab, var(--ink) 1.6%, transparent), 0 0 0 180px color-mix(in oklab, var(--ink) 1.2%, transparent);
}
.final-inner { display: grid; justify-items: center; }
.final-mark { width: 96px; height: 96px; }
.final h2 { margin-top: 2rem; max-width: 17ch; font-size: clamp(2.2rem, 1.4rem + 2.8vw, 3.8rem); }
.cta-center { justify-content: center; }

/* ------------------------------------------------------------------ footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 3.5rem 2rem; font-size: 0.9rem; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 2rem; }
.footer-brand .logo { height: 30px; width: auto; }
.footer-brand p { margin-top: 1rem; max-width: 32ch; color: var(--ink-3); }
.footer-brand a { color: var(--ink-2); }
.site-footer nav { display: grid; align-content: start; gap: 0.55rem; }
.site-footer nav h3 { font: 600 0.875rem/1.4 var(--font-body); margin-bottom: 0.3rem; }
.site-footer nav a { color: var(--ink-3); text-decoration: none; transition: color 0.2s; }
.site-footer nav a:hover { color: var(--ink); }
.footer-legal { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: 0.8125rem; color: var(--ink-3); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* ------------------------------------------------------------------ motion */
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise 0.9s var(--ease-out) both; animation-delay: calc(var(--d, 0) * 90ms + 60ms); }
  @keyframes rise { from { opacity: 0; translate: 0 18px; } }

  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    .reveal {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
    @keyframes reveal { from { opacity: 0; translate: 0 32px; } }



    .final-mark .fm-arc { animation: fill-ring linear both; animation-timeline: view(); animation-range: entry 20% cover 50%; }
    @keyframes fill-ring { from { stroke-dasharray: 0.5 200; } }
  }
}
/* the logo mark, rebuilt so its 75% arc can charge up as it scrolls in */
.fm-track { fill: none; stroke: light-dark(#acccbd, #d5eae2); stroke-opacity: 0.96; stroke-width: 110; }
.fm-arc { fill: none; stroke-width: 110; stroke-linecap: round; stroke-dasharray: 75 200; }
.fm-bolt { fill: light-dark(#9cc0aa, #dceee6); }

/* view transition for the theme switch */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { animation: theme-reveal 0.55s var(--ease-out); }
@keyframes theme-reveal { from { clip-path: circle(0 at var(--vt-x, 90%) var(--vt-y, 2rem)); } to { clip-path: circle(var(--vt-r, 150vmax) at var(--vt-x, 90%) var(--vt-y, 2rem)); } }

@media (forced-colors: active) {
  .ring-arc { stroke: CanvasText; }
  .btn-primary { border-color: ButtonText; }
}


/* ------------------------------------------------------------------ settings window preview
   Colours, radii and sizes from the pre-release WinUI settings (ui/HaloBattery.Settings):
   Mica #202020/#F3F3F3, content card #181818/#FFF r12, cards r20 with 24x16 padding,
   30px pill buttons and combo boxes, 40x22 toggles, 40px navigation rows r10. */
.settings-head { display: grid; justify-items: start; margin-bottom: clamp(2rem, 4vw, 3rem); }
.settings-head h2 { max-width: 18ch; }
.pre-pill {
  display: inline-flex; align-items: center; height: 26px; padding-inline: 0.75rem; margin-bottom: 1.1rem;
  border-radius: 999px; font: 600 0.78rem/1 var(--font-body); letter-spacing: 0.02em; text-decoration: none;
  gap: 0.5rem; color: var(--ink); background: var(--accent-soft); box-shadow: 0 0 0 1px color-mix(in oklab, var(--accent) 30%, transparent) inset;
}
.pre-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.pre-pill:hover { background: color-mix(in oklab, var(--accent) 20%, transparent); }

.win-stage {
  position: relative; isolation: isolate; padding: clamp(1rem, 4vw, 3.5rem); border-radius: 28px; overflow: clip;
  background: var(--surface-2) var(--wall) 60% 40% / cover no-repeat;
}
.win {
  --w-text: light-dark(#1b1b1b, #fff);
  --w-sub: light-dark(#646464, #b5b5b5);
  --w-card: light-dark(#fff, #242424);
  --w-card-hover: light-dark(#f6f6f6, #2d2d2d);
  --w-field: light-dark(#ececec, #303030);
  --w-field-hover: light-dark(#e0e0e0, #3a3a3a);
  --w-line: light-dark(#e3e3e3, #333);
  --w-off: light-dark(#c6c6c6, #4a4a4a);
  --w-accent: var(--accent);
  max-width: 1040px; margin-inline: auto; display: grid; grid-template-rows: auto 1fr;
  height: min(680px, 84vh); min-height: 540px;
  border-radius: 9px; overflow: clip; color: var(--w-text); font: 400 14px/1.4 var(--font-win);
  /* Mica: the wallpaper, heavily blurred and tinted */
  background: light-dark(rgb(243 243 243 / 0.86), rgb(32 32 32 / 0.84));
  -webkit-backdrop-filter: blur(60px) saturate(1.6); backdrop-filter: blur(60px) saturate(1.6);
  box-shadow: 0 0 0 1px light-dark(rgb(0 0 0 / 0.1), rgb(255 255 255 / 0.08)), 0 32px 64px -12px rgb(0 0 0 / 0.42), 0 2px 21px rgb(0 0 0 / 0.16);
}
.win-bar { display: flex; align-items: center; justify-content: space-between; height: 48px; padding-left: 16px; }
.win-brand { display: inline-flex; align-items: center; gap: 10px; font: 600 16px/1 var(--font-display); letter-spacing: -0.012em; }
.win-brand img { display: var(--show-on-dark); }
.win-brand img.logo-on-light { display: var(--show-on-light); }
.win-brand span { font-weight: 500; }
.win-brand b { font-weight: 600; color: light-dark(#467d48, #c2e3a4); }
.win-ctl { display: flex; height: 100%; }
.win-ctl .ico { width: 46px; height: 100%; padding: 16px 16px; stroke-width: 1.4; opacity: 0.85; }
.win-body { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 0; }
.win-nav { display: flex; flex-direction: column; gap: 3px; padding: 4px 8px; }
.wn-item {
  display: grid; grid-template-columns: 20px 1fr; align-items: center; gap: 14px; height: 40px; padding: 0 10px;
  border: 0; border-radius: 10px; background: none; color: var(--w-sub); font: inherit; text-align: left; cursor: pointer;
  position: relative; transition: background-color 0.15s, color 0.15s;
}
.wn-item .ico { width: 20px; height: 20px; stroke-width: 1.5; }
.wn-item:hover { background: light-dark(rgb(0 0 0 / 0.04), rgb(255 255 255 / 0.05)); color: var(--w-text); }
.wn-item[aria-selected="true"] { background: light-dark(rgb(0 0 0 / 0.06), rgb(255 255 255 / 0.07)); color: var(--w-text); }
.wn-item[aria-selected="true"]::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 3px; height: 16px; translate: 0 -50%;
  border-radius: 3px; background: var(--w-accent);
}
.wn-item:focus-visible { outline: 2px solid var(--w-text); outline-offset: -2px; }
.win-content {
  position: relative; margin: 0 8px 8px 0; border-radius: 12px; overflow: auto; overscroll-behavior: contain;
  background: light-dark(#fff, #181818); box-shadow: 0 8px 16px light-dark(rgb(0 0 0 / 0.08), rgb(0 0 0 / 0.3));
  scrollbar-width: thin;
}
.wp[hidden] { display: none; }
.wp { display: flex; flex-direction: column; gap: 8px; min-height: 100%; padding: 28px clamp(16px, 3vw, 36px) 32px; }
.wp-title { margin: 0 0 12px; font: 600 28px/1.2 var(--font-display); letter-spacing: -0.02em; color: var(--w-text); }
.w-sec { margin: 14px 0 2px; font-weight: 600; }
.wp.is-entering { animation: wp-in 0.32s var(--ease-out); }
@keyframes wp-in { from { opacity: 0; translate: 0 14px; } }
@media (prefers-reduced-motion: reduce) { .wp.is-entering { animation: none; } }
.wc {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; column-gap: 16px;
  min-height: 68px; padding: 14px 24px; border-radius: 20px;
  background: var(--w-card); box-shadow: 0 0 0 1px var(--w-line) inset; transition: background-color 0.15s;
}
.wc[hidden] { display: none; }
.wc:hover { background: var(--w-card-hover); }
.wc > .ico { width: 20px; height: 20px; stroke-width: 1.5; color: var(--w-text); }
.wc-text { display: grid; gap: 2px; min-width: 0; }
.wc-title { color: var(--w-text); }
.wc-hint { font-size: 12px; color: var(--w-sub); }
.wbtn {
  display: inline-flex; align-items: center; justify-content: center; height: 30px; padding: 0 14px; border: 0;
  border-radius: 15px; background: var(--w-field); color: var(--w-text); font: 13px/1 var(--font-win);
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.wbtn:hover { background: var(--w-field-hover); }
.wbtn:focus-visible, .wfield:focus-visible, .wcombo:has(select:focus-visible) { outline: 2px solid var(--w-text); outline-offset: 2px; }
.wfield {
  width: min(240px, 42vw); height: 30px; padding: 0 14px; border: 0; border-radius: 15px;
  background: var(--w-field); color: var(--w-text); font: 13px/1 var(--font-win);
}
.wfield:focus { outline: none; box-shadow: 0 -2px 0 var(--w-accent) inset; }
.wcombo { position: relative; display: inline-flex; align-items: center; }
.wcombo select {
  appearance: none; -webkit-appearance: none; min-width: 240px; max-width: 44vw; height: 30px; padding: 0 36px 0 14px;
  border: 0; border-radius: 15px; background: var(--w-field); color: var(--w-text); font: 13px/1 var(--font-win);
  cursor: pointer; text-overflow: ellipsis;
}
.wcombo select:hover { background: var(--w-field-hover); }
.wcombo select:focus-visible { outline: none; }
.wcombo .ico { position: absolute; right: 12px; width: 14px; height: 14px; pointer-events: none; opacity: 0.8; }
.wcombo select option { background: light-dark(#fcfcfc, #2c2c2c); color: var(--w-text); }
.wt { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.wt-state { min-width: 2ch; text-align: right; color: var(--w-text); }
.wt input {
  appearance: none; -webkit-appearance: none; margin: 0; flex: none; cursor: pointer; position: relative;
  width: 40px; height: 22px; border-radius: 11px; background: var(--w-off); transition: background-color 0.15s;
}
.wt input::before {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.28); transition: translate 0.22s var(--ease-out);
}
.wt input:checked { background: var(--w-accent); }
.wt input:checked::before { translate: 18px 0; }
.wt input:focus-visible { outline: 2px solid var(--w-text); outline-offset: 2px; }

.wc-device { grid-template-columns: 52px minmax(0, 1fr); min-height: 84px; }
.wc-device .ring { width: 52px; height: 52px; color: var(--w-text); }
.wc-device .wc-title { font-size: 16px; font-weight: 600; }
.wc-preview { grid-template-columns: 20px minmax(0, 1fr) auto; }
.wc-previews { display: inline-flex; align-items: flex-end; gap: 18px; }
.wc-px80 .ring { display: block; width: 80px; height: 80px; color: var(--w-text); }
.wc-px16 { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 6px; background: light-dark(rgb(0 0 0 / 0.05), rgb(255 255 255 / 0.06)); }
.wc-px16 .ring { display: block; width: 16px; height: 16px; color: var(--w-text); }

.w-warn {
  display: grid; grid-template-columns: 16px 1fr; gap: 12px; align-items: center; padding: 12px 24px 12px 20px;
  border-radius: 16px; background: light-dark(#fff4ce, #433519);
}
.w-warn p { margin: 0; color: var(--w-text); }
.w-warn strong { font-weight: 600; margin-right: 0.4em; }
.w-warn-mark { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 8px; font: 700 11px/1 var(--font-win); color: light-dark(#fff, #000); background: light-dark(#9d5d00, #fce100); }

.wx { display: block; padding: 0; }
.wx summary {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) 14px; align-items: center; column-gap: 16px;
  min-height: 68px; padding: 14px 24px; list-style: none; cursor: pointer;
}
.wx summary::-webkit-details-marker { display: none; }
.wx summary > .ico:first-child { width: 20px; height: 20px; stroke-width: 1.5; }
.wx summary > .ico:last-child { width: 14px; height: 14px; transition: rotate 0.2s; }
.wx[open] summary > .ico:last-child { rotate: 180deg; }
.wx summary:focus-visible { outline: 2px solid var(--w-text); outline-offset: -2px; border-radius: 20px; }
.wx-list { list-style: none; margin: 0; padding: 0 24px 12px 60px; display: grid; }
.wx-list li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 44px; border-top: 1px solid var(--w-line); }

.wp-foot { position: sticky; bottom: -32px; margin: auto -36px -32px; padding: 14px 36px 18px; display: flex; justify-content: flex-start;
  background: linear-gradient(to bottom, transparent, light-dark(#fff, #181818) 30%); }

@media (max-width: 820px) {
  .win-stage { padding: 0.75rem; border-radius: 20px; }
  .win { height: 620px; }
  .win-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .win-nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; padding: 0 8px 8px; gap: 4px; }
  .wn-item { grid-template-columns: 18px auto; gap: 8px; height: 36px; flex: none; }
  .wn-item[aria-selected="true"]::before { left: 50%; top: auto; bottom: 0; width: 16px; height: 3px; translate: -50% 0; }
  .win-content { margin: 0 8px 8px; }
  .wc { grid-template-columns: 20px minmax(0, 1fr); row-gap: 10px; padding: 14px 18px; }
  .wc > :last-child:not(.wc-text):not(.ico) { grid-column: 2; justify-self: start; }
  .wc-device { grid-template-columns: 52px minmax(0, 1fr); }
  .wcombo select { min-width: 0; max-width: 100%; width: 100%; }
  .wcombo { width: min(100%, 260px); }
  .wfield { width: min(100%, 260px); }
  .wp-foot { margin-inline: -16px; padding-inline: 16px; }
  .win-ctl .ico { width: 40px; padding: 15px 13px; }
}

/* install: pointer to the pre-release */
.pre-note { grid-column: 1 / -1; display: flex; gap: 0.75rem; align-items: start; margin: 0; padding: 1rem 1.25rem; border-radius: 14px; background: var(--accent-soft); color: var(--ink-2); font-size: 0.9375rem; }
.pre-note .ico { flex: none; width: 1.1rem; height: 1.1rem; margin-top: 0.15rem; color: var(--accent); }
