/* Shared styles for every page: fonts, colour tokens, background, nav, footer, tooltips. */

@font-face { font-family: 'MyFont'; src: url('/assets/fonts/BlackItalic.woff2') format('woff2'); font-weight: 900; font-display: swap; }
@font-face { font-family: 'MyFont'; src: url('/assets/fonts/Light.woff2') format('woff2'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'MyFont'; src: url('/assets/fonts/Medium.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
  --bg: #e6edfa;
  --bar: #d3e1f7;
  --sky-a: #8fbaf3;
  --sky-b: #ffc39b;
  --sky-c: #d4c2f6;
  --sky-d: #a8e6e0;
  --stars: 0;
  --aurora: 0;
  --text: #111a2c;
  --text-2: #3b4d6a;
  --muted: #6a7c99;
  --accent: #2451d6;
  --accent-soft: rgba(36, 81, 214, 0.08);
  --glass: rgba(250, 250, 252, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.8);
  --glass-read: rgba(252, 252, 254, 0.8);
  --glass-border: rgba(255, 255, 255, 0.75);
  --line: rgba(17, 26, 44, 0.1);
  --line-strong: rgba(36, 81, 214, 0.35);
  --shadow: 0 1px 2px rgba(17, 26, 44, 0.05), 0 24px 60px rgba(17, 26, 44, 0.12);
  --shadow-sm: 0 1px 2px rgba(17, 26, 44, 0.06), 0 6px 18px rgba(17, 26, 44, 0.07);
  --tip-bg: #ffffff;
  --tip-text: #3b4d6a;
  --code-bg: #0e1628;
  --code-text: #d6e2f5;
  --ok: #10b981;
  --bad: #ef4444;
  --idle: #94a3b8;
  --logo-glow: rgba(36, 81, 214, 0.2);
  --radius: 16px;
  --warn: #f59e0b;
  --info: #38bdf8;
  --solar: #eab308;
  --battery: #10b981;
  --grid: #8b5cf6;
  --house: #2a78d6;
  --car: #eb6834;
  --font-display: 'MyFont', sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #04070e;
  --bar: #081630;
  --sky-a: #0d2350;
  --sky-b: #1a1045;
  --sky-c: #07262e;
  --sky-d: #0b1a3a;
  --stars: 1;
  --aurora: 1;
  --text: #e8edf5;
  --text-2: #a9bbd6;
  --muted: #7189ad;
  --accent: #6fa9f4;
  --accent-soft: rgba(111, 169, 244, 0.1);
  --glass: rgba(14, 20, 34, 0.55);
  --glass-strong: rgba(18, 26, 44, 0.78);
  --glass-read: rgba(9, 14, 26, 0.84);
  --glass-border: rgba(140, 180, 240, 0.14);
  --line: rgba(140, 180, 240, 0.14);
  --line-strong: rgba(111, 169, 244, 0.45);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 30px 70px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 20px rgba(0, 0, 0, 0.3);
  --tip-bg: #0d1629;
  --tip-text: #b9c9e2;
  --code-bg: #070c18;
  --code-text: #d6e2f5;
  --ok: #34d399;
  --bad: #f87171;
  --idle: #4a6fa5;
  --logo-glow: rgba(59, 130, 246, 0.45);
  --warn: #fbbf24;
  --info: #7dd3fc;
  --house: #3987e5;
  --car: #d95926;
  color-scheme: dark;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
/* --safe-* keep the nav and content clear of the notch and home indicator (0 unless the page opts in to viewport-fit=cover). */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

html { background-color: var(--bar); scroll-behavior: smooth; scroll-padding-top: calc(100px + var(--safe-top)); transition: background-color 0.6s ease; }

/* Like the original site: a solid page colour Safari can sample for its status bar and toolbar. */
body {
  min-height: 100vh;
  background-color: var(--bar);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.6s ease, color 0.6s ease;
}

main { position: relative; z-index: 1; }
site-footer { display: block; position: relative; z-index: 1; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Backdrop: drifting colour glows, aurora (night), stars (night) ---------- */
/* Safari (iOS 26+) tints its status bar and toolbar from fixed elements touching the screen edges,
   so the backdrop needs a solid colour of its own — --bar is picked to match the top of the page. */
.backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; background-color: var(--bar); transition: background-color 0.6s ease; }

.sky { position: absolute; inset: 0; background: var(--bg); transition: background 0.6s ease; }

/* Colour glows in each corner, drifting inwards and back. --dx/--dy point each one towards the middle. */
.glows span {
  position: absolute;
  width: 90vmax;
  height: 90vmax;
  border-radius: 50%;
  animation: drift 9s ease-in-out infinite alternate;
}

.glows span:nth-child(1) { top: -45vmax; left: -45vmax; --dx: 1; --dy: 1; background: radial-gradient(closest-side, var(--sky-a), transparent); }
.glows span:nth-child(2) { top: -45vmax; right: -45vmax; --dx: -1; --dy: 1; background: radial-gradient(closest-side, var(--sky-c), transparent); animation-duration: 11s; animation-delay: -4s; }
.glows span:nth-child(3) { bottom: -45vmax; left: -45vmax; --dx: 1; --dy: -1; background: radial-gradient(closest-side, var(--sky-b), transparent); animation-duration: 12s; animation-delay: -7s; }
.glows span:nth-child(4) { bottom: -45vmax; right: -45vmax; --dx: -1; --dy: -1; background: radial-gradient(closest-side, var(--sky-d), transparent); animation-duration: 10s; animation-delay: -2s; }

@keyframes drift {
  0%   { translate: 0 0; scale: 1; }
  50%  { translate: calc(var(--dx) * 14vw) calc(var(--dy) * 6vh); scale: 1.12; }
  100% { translate: calc(var(--dx) * 4vw) calc(var(--dy) * 16vh); scale: 0.92; }
}

/* Aurora: blurred, slowly swaying curtains of light. Only visible in dark mode. */
.aurora {
  position: absolute;
  inset: -10%;
  opacity: var(--aurora);
  transition: opacity 1s ease;
  filter: blur(48px) saturate(140%);
}

.aurora span {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: screen;
  opacity: 0.75;
  animation: sway 11s ease-in-out infinite alternate;
}

.aurora span:nth-child(1) {
  width: 90%; height: 24%; left: 5%; top: 36%;
  background: linear-gradient(100deg, transparent 5%, #1fe0a0 35%, #22c7c9 60%, transparent 95%);
  transform: rotate(-12deg);
}

.aurora span:nth-child(2) {
  width: 70%; height: 20%; left: 22%; top: 30%;
  background: linear-gradient(95deg, transparent 5%, #2dd4bf 30%, #6d5cf6 70%, transparent 95%);
  transform: rotate(8deg);
  animation-duration: 14s;
  animation-delay: -5s;
}

.aurora span:nth-child(3) {
  width: 55%; height: 16%; left: 38%; top: 46%;
  background: linear-gradient(90deg, transparent 5%, #a855f7 40%, #ec4899 65%, transparent 95%);
  transform: rotate(-6deg);
  opacity: 0.5;
  animation-duration: 17s;
  animation-delay: -8s;
}

.aurora span:nth-child(4) {
  width: 50%; height: 16%; left: 8%; top: 50%;
  background: linear-gradient(90deg, transparent 5%, #34d399 45%, transparent 95%);
  transform: rotate(14deg);
  opacity: 0.45;
  animation-duration: 13s;
  animation-delay: -2s;
}

@keyframes sway {
  0%   { translate: 0 0; scale: 1 1; }
  50%  { translate: 6% 4%; scale: 1.15 0.85; }
  100% { translate: -5% -3%; scale: 0.9 1.2; }
}

.stars {
  position: absolute;
  inset: 0;
  opacity: var(--stars);
  /* Also hidden outright in light mode: Safari can let a child's own opacity animation (the twinkle)
     show through a transparent parent. The delay lets the fade-out finish first. */
  visibility: hidden;
  transition: opacity 0.8s ease, visibility 0s linear 0.8s;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 27% 62%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 41% 9%, #cfe0ff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 58% 38%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 73% 74%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 86% 46%, #cfe0ff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 93% 88%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 6% 84%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 49% 91%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 34% 30%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 20% 45%, #cfe0ff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 64% 82%, #fff 50%, transparent 51%);
}

/* Dense field of faint stars, tiled across the screen */
:root[data-theme="dark"] .stars { visibility: visible; transition: opacity 0.8s ease, visibility 0s; }

.stars::before,
.stars::after {
  content: '';
  position: absolute;
  inset: 0;
}

.stars::before {
  opacity: calc(var(--stars) * 0.75);
  background-size: 260px 260px;
  background-image:
    radial-gradient(1px 1px at 20px 30px, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 90px 140px, #dce8ff 50%, transparent 51%),
    radial-gradient(1px 1px at 160px 60px, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 230px 200px, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 50px 220px, #dce8ff 50%, transparent 51%),
    radial-gradient(1px 1px at 200px 110px, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 130px 250px, #fff 50%, transparent 51%);
}

/* Fewer, brighter stars with a soft glow that twinkle */
.stars::after {
  background-size: 420px 420px;
  background-image:
    radial-gradient(circle at 60px 80px, #fff 0 1.2px, rgba(190, 215, 255, 0.35) 1.6px, transparent 5px),
    radial-gradient(circle at 300px 40px, #fff 0 1px, rgba(190, 215, 255, 0.3) 1.4px, transparent 4px),
    radial-gradient(circle at 210px 260px, #fff 0 1.4px, rgba(190, 215, 255, 0.4) 1.8px, transparent 6px),
    radial-gradient(circle at 380px 330px, #fff 0 1px, rgba(190, 215, 255, 0.3) 1.4px, transparent 4px),
    radial-gradient(circle at 110px 370px, #fff 0 1.2px, rgba(190, 215, 255, 0.35) 1.6px, transparent 5px);
  animation: twinkle 3.5s ease-in-out infinite alternate;
}

@keyframes twinkle {
  0%   { opacity: var(--stars); }
  50%  { opacity: calc(var(--stars) * 0.45); }
  100% { opacity: calc(var(--stars) * 0.9); }
}

/* ---------- Glass surface ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  transition: background 0.6s ease, border-color 0.6s ease;
}

/* ---------- Top card: the big rounded panel the nav sits inside ---------- */
.top-wrap { padding: calc(20px + var(--safe-top)) calc(20px + var(--safe-right)) 0 calc(20px + var(--safe-left)); }

.top-card {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- Nav (sits inside the top card, then floats as you scroll) ---------- */
.nav {
  position: fixed;
  top: calc(44px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: min(640px, calc(100vw - 64px));
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 6px 6px 8px;
  border-radius: 999px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  backdrop-filter: blur(18px) saturate(170%);
  box-shadow: var(--shadow-sm);
  transition: top 0.3s ease, box-shadow 0.3s ease, background 0.6s ease, border-color 0.6s ease;
}

.nav.scrolled { top: calc(16px + var(--safe-top)); box-shadow: var(--shadow); }

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  margin-right: auto;
  text-decoration: none;
  color: var(--text);
  border-radius: 999px;
}

.nav-brand img { width: 26px; height: 26px; display: block; }
.nav-brand span { font-family: var(--font-display); font-weight: 900; font-size: 0.9rem; text-transform: uppercase; }

.nav-link {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-2);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover, .nav-link.active { background: var(--accent-soft); color: var(--text); }

/* ---------- Nav menus (Projects, Picks) ---------- */
.nav-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.nav-menu-btn[aria-expanded="true"] { background: var(--accent-soft); color: var(--text); }
.nav-chevron { width: 14px; height: 14px; transition: transform 0.2s ease; }
.nav-menu-btn[aria-expanded="true"] .nav-chevron { transform: rotate(180deg); }

.nav-menu {
  position: fixed;
  z-index: 51;
  width: min(300px, calc(100vw - 48px));
  display: grid;
  gap: 2px;
  padding: 6px;
  border-radius: var(--radius);
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  backdrop-filter: blur(18px) saturate(170%);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.nav-menu[hidden] { display: none; }
.nav-menu.open { opacity: 1; transform: none; }

.nav-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 8px 8px;
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s ease;
}

.nav-menu-item:hover, .nav-menu-item:focus-visible, .nav-menu-item[aria-current="page"] { background: var(--accent-soft); }
.nav-menu-item img { width: 36px; height: 36px; border-radius: 10px; flex: none; }
.nav-menu-item span { display: grid; min-width: 0; }
.nav-menu-item strong { font-size: 0.9rem; font-weight: 600; }
.nav-menu-item small { font-size: 0.78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-menu-item:not(:has(img, .icon-tile)) { padding-left: 14px; }

/* Icon in a glass tile, sized like the project app icons: black by day, white by night
   (Spotify's logo may only be green, black or white, so every icon follows that) */
.icon-tile {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--text) 6%, transparent);
  color: #000;
}
:root[data-theme="dark"] .icon-tile { color: #fff; }
.icon-tile svg { width: 20px; height: 20px; }
.brand-tile svg { width: 22px; height: 22px; }
.nav-menu-item.is-soon { opacity: 0.55; cursor: default; }

/* Long menus (Mission Control's Services): two columns, group headings, scroll when taller than the screen */
.nav-menu { overflow-y: auto; overscroll-behavior: contain; }
.nav-menu.wide { width: min(560px, calc(100vw - 48px)); grid-template-columns: 1fr 1fr; }
.nav-menu-heading {
  grid-column: 1 / -1;
  padding: 10px 12px 4px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-menu-heading:first-child { padding-top: 6px; }
.nav-menu-item[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
@media (max-width: 600px) { .nav-menu.wide { grid-template-columns: 1fr; } }
/* Mission Control's nav has an extra menu: drop Picks on phones so it fits */
@media (max-width: 420px) { .nav:has([aria-controls="servicesMenu"]) [aria-controls="picksMenu"] { display: none; } }
.nav-menu-item.is-soon:hover { background: none; }

.theme-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.theme-btn:hover { background: var(--accent-soft); color: var(--text); }
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn .i-moon { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-moon { display: block; }

/* ---------- Tooltips ---------- */
.has-tip { position: relative; cursor: help; }
.has-tip.underline { border-bottom: 1px dotted var(--line-strong); }

.tip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  width: max-content;
  max-width: min(240px, calc(100vw - 48px));
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius);
  background: var(--tip-bg);
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.55;
  color: var(--tip-text);
  text-align: left;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 20;
}

.tip.right { left: auto; right: 0; transform: translate(0, 6px); }

@media (hover: hover) and (pointer: fine) {
  .has-tip:hover > .tip { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
  .has-tip:hover > .tip.right { transform: translate(0, 0); }
}

.has-tip.tip-open > .tip { opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, 0); }
.has-tip.tip-open > .tip.right { transform: translate(0, 0); }

/* ---------- Footer ---------- */
.site-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px calc(24px + var(--safe-right)) calc(40px + var(--safe-bottom)) calc(24px + var(--safe-left));
  display: flex;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.footer-links { display: flex; gap: 1rem; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }

/* ---------- Small screens ---------- */
@media (max-width: 600px) {
  .top-wrap { padding: calc(12px + var(--safe-top)) calc(12px + var(--safe-right)) 0 calc(12px + var(--safe-left)); }
  .nav { top: calc(26px + var(--safe-top)); width: calc(100vw - 48px - var(--safe-left) - var(--safe-right)); }
  .nav.scrolled { top: calc(12px + var(--safe-top)); }
}

@media (max-width: 420px) {
  .nav-brand span { display: none; }
  .nav-link { padding: 8px 11px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .aurora span, .glows span, .stars::after { animation: none; }
  .nav, .nav-menu, .nav-chevron { transition: none; }
}

/* ---------- Page transitions (cross-document View Transitions) ----------
   The old page fades out, the nav stays perfectly still, and the new page's cards zoom in from
   90% (html.vt-enter, added by theme.js only when arriving by a same-site link). The cards
   themselves animate, not their wrappers, because fading a wrapper would switch off the glass
   blur inside it. Browsers without support simply load the page. */
@view-transition { navigation: auto; }

.nav { view-transition-name: site-nav; }
::view-transition-group(site-nav) { animation: none; }
::view-transition-old(site-nav) { display: none; }
::view-transition-new(site-nav) { animation: none; }

::view-transition-old(root) { animation-duration: 0.25s; }
::view-transition-new(root) { animation-duration: 0.25s; }

.vt-enter main .glass, .vt-enter main .section-head {
  animation: vt-zoom-in 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) 0.05s both;
}

@keyframes vt-zoom-in { from { opacity: 0; transform: scale(0.9); } }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* =====================================================================================
   Brand components (themisto.app/brand). One definition each; pages use these instead of
   their own copies. Boxes take --radius, anything pressed or read as a tag is a pill.
   ===================================================================================== */

/* ---------- Type: three display sizes. .fig keeps a figure's own case ---------- */
.t-page, .t-section, .t-card { font-family: var(--font-display); font-weight: 900; text-transform: uppercase; }
.t-page { font-size: clamp(2.4rem, 7vw, 4.5rem); line-height: 1; padding-block: 0.12em; }
.t-section { font-size: clamp(1.4rem, 3vw, 1.7rem); line-height: 1.1; }
.t-card { font-size: 1.1rem; line-height: 1.15; }
.fig { text-transform: none; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Small capitals: .label names a value or chart, .eyebrow introduces a title */
.label { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.eyebrow { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.label strong, .eyebrow strong { color: var(--text); font-weight: 600; letter-spacing: 0; text-transform: none; }

/* ---------- Pills: --k sets the colour (grey if unset) ---------- */
.dot, .pill > i { --k-dot: var(--k, var(--idle)); width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; background: var(--k-dot); }
.dot.live, .pill > i.live { animation: ping 2.4s ease-in-out infinite; }
@keyframes ping {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--k-dot) 45%, transparent); }
  60% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--k-dot) 0%, transparent); }
}
.pill { --k: var(--idle); display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.7rem; border-radius: 999px; background: color-mix(in srgb, var(--k) 16%, transparent); font-family: var(--font-body); font-size: 0.8rem; font-weight: 600; line-height: 1.2; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pill svg { width: 13px; height: 13px; flex: none; color: var(--k); }
.hero-pill { --k: var(--accent); display: inline-flex; align-items: center; gap: 0.55rem; max-width: 100%; padding: 0.5rem 1rem; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--k) 40%, transparent); background: color-mix(in srgb, var(--k) 14%, transparent); font-size: 0.95rem; font-weight: 500; line-height: 1.35; color: var(--text); text-align: left; }
.hero-pill > i { width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; background: var(--k); }
.hero-pill b, .hero-pill strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.hero-pill .hero-pill-score { font-family: var(--font-mono); font-size: 0.78rem; font-weight: 600; color: var(--text-2); white-space: nowrap; }
/* Signals: the same green, orange, red everywhere */
[data-signal="ok"] { --k: var(--ok); } [data-signal="warn"] { --k: var(--warn); } [data-signal="bad"] { --k: var(--bad); }
[data-signal="info"] { --k: var(--info); } [data-signal="idle"] { --k: var(--idle); } [data-signal="accent"] { --k: var(--accent); }

/* ---------- Surfaces ---------- */
/* .card is a glass card on the page; .panel is the solid reading surface inside one */
.card { display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; padding: 1.5rem; border-radius: var(--radius); box-shadow: var(--shadow-sm); color: inherit; text-decoration: none; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.6s ease; }
a.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.panel { min-width: 0; padding: 0.9rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--glass-read); }
.panel.compact { padding: 0.6rem 0.8rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 1rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-width: 0; }
.card-desc { font-size: 0.9rem; line-height: 1.6; color: var(--text-2); }

/* ---------- Page sections and the app hero ---------- */
.section { max-width: 1140px; margin: 0 auto; padding: 0 20px 56px; }
.section:first-of-type { padding-top: 56px; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; margin-bottom: 1.25rem; padding: 0 4px; }
.hero { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 112px 24px 64px; }
.logo { width: 120px; height: 120px; display: block; object-fit: contain; margin-bottom: 1.5rem; animation: glow-pulse 5s ease-in-out infinite; }
@keyframes glow-pulse {
  0%, 100% { filter: drop-shadow(0 0 26px var(--logo-glow)); }
  50%      { filter: drop-shadow(0 0 54px var(--logo-glow)); }
}
.chevron { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); width: 56px; height: 40px; display: grid; place-items: center; border-radius: var(--radius); background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: var(--shadow-sm); color: var(--text-2); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); transition: transform 0.2s ease, color 0.15s ease; }
.chevron:hover { transform: translateX(-50%) translateY(2px); color: var(--text); }
.chevron svg { width: 20px; height: 20px; }

/* ---------- Buttons: one size, so every one clears the 32px tap target ---------- */
.btn, .btn-soft, .btn-quiet, .btn-outline, .btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-height: 36px; padding: 0.45rem 1rem;
  border: 1px solid transparent; border-radius: 999px; background: transparent; font: inherit; font-size: 0.85rem; font-weight: 600; line-height: 1.2;
  text-decoration: none; white-space: nowrap; cursor: pointer; transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, filter 0.15s ease, transform 0.1s ease;
}
.btn { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
:root[data-theme="dark"] .btn { color: #06101f; }
.btn:hover { filter: brightness(1.08); }
.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-soft:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.btn-quiet { color: var(--muted); }
.btn-quiet:hover { color: var(--text); }
.btn-outline { border-color: var(--line); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); }
.btn-danger { border-color: var(--bad); color: var(--bad); }
.btn-danger:hover { background: color-mix(in srgb, var(--bad) 12%, transparent); }
.btn:active, .btn-soft:active, .btn-outline:active, .btn-danger:active { transform: scale(0.97); }
.btn:disabled, .btn-soft:disabled, .btn-outline:disabled, .btn-danger:disabled { opacity: 0.45; cursor: not-allowed; transform: none; filter: none; }
.icon-btn { width: 36px; height: 36px; flex: none; display: inline-grid; place-items: center; border: 0; border-radius: 999px; background: transparent; color: var(--text-2); cursor: pointer; transition: background 0.15s ease, color 0.15s ease; }
.icon-btn:hover { background: var(--accent-soft); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- Segmented: switch between views of the same thing ---------- */
.segmented { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass-strong); }
.segmented button { display: inline-flex; align-items: center; justify-content: center; min-height: 28px; padding: 0.25rem 0.8rem; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 0.78rem; font-weight: 500; line-height: 1.2; white-space: nowrap; cursor: pointer; transition: background 0.15s ease, color 0.15s ease; }
.segmented button[aria-pressed="true"], .segmented button[aria-checked="true"] { background: var(--accent-soft); color: var(--accent); }

/* ---------- Choice chips: pick one item from a set (filters, previews) ---------- */
.choices { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.choice { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 36px; padding: 0.4rem 0.85rem; border-radius: 999px; border: 1px solid var(--line); background: transparent; font: inherit; font-size: 0.8rem; line-height: 1.2; color: var(--text-2); white-space: nowrap; cursor: pointer; transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease; }
.choice:hover { border-color: var(--line-strong); color: var(--text); }
.choice.active, .choice[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--line-strong); color: var(--text); }
.choice.pinned { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="dark"] .choice.pinned { color: #06101f; }

@media (max-width: 600px) {
  .section { padding: 0 12px 48px; }
  .hero { padding: 100px 16px 60px; }
  .logo { width: 100px; height: 100px; }
}

@media (prefers-reduced-motion: reduce) {
  .dot.live, .pill > i.live, .logo { animation: none; }
  .card, .chevron, .choice, .btn, .btn-soft, .btn-quiet, .btn-outline, .btn-danger, .icon-btn, .segmented button { transition: none; }
}
