/* tokens.css: dark is the default palette; light overrides via system pref or [data-theme] */
:root {
  color-scheme: dark light;

  /* shared / non-color */
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r-sm: 10px;
  --r-md: 12px;
  --r-lg: 14px;
  --maxw: min(1040px, calc(100% - 80px));
  --navw: min(1120px, calc(100% - 48px));
  --accent-grad: linear-gradient(90deg, var(--accent-from), var(--accent-to));
  --bg-solid: #14171c;
  --stage-bg: #07080b;
  --stage-mid: #11141b;
  --stage-border: rgba(255,255,255,0.13);
  --stage-red: rgba(255,95,86,0.18);
  --stage-blue: rgba(92,125,255,0.30);
  --hero-text: #ffffff;
  --hero-muted: rgba(255,255,255,0.68);
  --hero-soft: rgba(255,255,255,0.52);
  --hero-eyebrow: rgba(255,255,255,0.62);
  --hero-fade-from: rgba(7,8,11,0);
  --hero-primary-bg: #ffffff;
  --hero-primary-fg: #0b0c10;
  --hero-secondary-bg: rgba(255,255,255,0.08);
  --hero-secondary-border: rgba(255,255,255,0.16);
  --hero-secondary-fg: #ffffff;
  --nav-bg: rgba(7,8,11,0.72);
  --nav-border: rgba(255,255,255,0.08);
  --nav-text: #f4f8ff;
  --nav-muted: rgba(244,248,255,0.72);
  --nav-control-bg: rgba(255,255,255,0.08);
  --nav-control-border: rgba(255,255,255,0.14);
  --nav-control-hover: rgba(255,255,255,0.14);
  --widget-bg: rgba(40,44,52,0.42);
  --widget-bg-strong: rgba(40,44,52,0.5);
  --widget-border: rgba(232,238,244,0.24);
  --widget-muted: #bac2cd;
  --widget-text: #f3fbf7;
  --widget-shadow: 0 34px 90px rgba(0,0,0,0.52), inset 0 1px 0 rgba(255,255,255,0.13);

  /* DARK palette (default + no-preference) */
  --bg: #14171c;
  --chrome: #14171c;
  --bg-glow: radial-gradient(circle at 82% -10%, rgba(42,51,64,0.9), transparent 60%);
  --surface: rgba(255,255,255,0.05);
  --surface-2: rgba(255,255,255,0.08);
  --surface-border: rgba(255,255,255,0.10);
  --text: #eaf2ff;
  --text-strong: #f4f8ff;
  --muted: #9aa7b8;
  --accent: #5b9dff;
  --accent-from: #22d3ee;
  --accent-to: #5b9dff;
  --link: #7fb0ff;
  --warn: #f59e0b;
  --warn-text: #fbbf24;
  --danger: #ef4444;
  --success: #34d399;
  --meter-track: rgba(255,255,255,0.12);
  --shadow: 0 14px 34px rgba(0,0,0,0.22);
  --accent-ink: #07111f;
  --btn-primary-bg: #ffffff;
  --btn-primary-fg: #14171c;
  --btn-secondary-bg: transparent;
  --btn-secondary-border: rgba(255,255,255,0.25);
  --btn-secondary-fg: #eaf2ff;
  --on-strong: #14171c; /* text on an ink/light pill (solid; never a gradient) */
}

@media (max-width: 680px) {
  :root {
    --maxw: min(980px, calc(100% - 32px));
    --navw: min(1080px, calc(100% - 20px));
  }
}

/* LIGHT palette: applied when OS prefers light AND user has not forced dark */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: linear-gradient(180deg, #fbfcfe, #eef2f7);
    --bg-solid: #eef2f7;
    --chrome: #fbfcfe;
    --bg-glow: radial-gradient(circle at 85% -10%, rgba(91,157,255,0.12), transparent 60%);
    --stage-bg: #f8fbff;
    --stage-mid: #edf3fb;
    --stage-red: rgba(255,95,86,0.08);
    --stage-blue: rgba(59,130,246,0.16);
    --hero-text: #101722;
    --hero-muted: #4f5d70;
    --hero-soft: #5f6b7d;
    --hero-eyebrow: #0e7490;
    --hero-fade-from: rgba(248,251,255,0);
    --hero-primary-bg: #111827;
    --hero-primary-fg: #ffffff;
    --hero-secondary-bg: rgba(255,255,255,0.72);
    --hero-secondary-border: rgba(15,23,42,0.12);
    --hero-secondary-fg: #111827;
    --nav-bg: rgba(248,250,252,0.78);
    --nav-border: rgba(15,23,42,0.08);
    --nav-text: #101722;
    --nav-muted: #526070;
    --nav-control-bg: rgba(255,255,255,0.74);
    --nav-control-border: rgba(15,23,42,0.10);
    --nav-control-hover: rgba(15,23,42,0.05);
    --surface: #ffffff;
    --surface-2: #ffffff;
    --surface-border: rgba(15,23,42,0.08);
    --text: #131a22;
    --text-strong: #0f1722;
    --muted: #64748b;
    --accent: #3b82f6;
    --accent-from: #06b6d4;
    --accent-to: #3b82f6;
    --link: #0e7490;
    --warn: #f59e0b;
    --warn-text: #b45309;
    --danger: #dc2626;
    --success: #15803d;
    --meter-track: #e2e8f0;
    --shadow: 0 8px 8px rgba(15,23,42,0.06);
    --accent-ink: #07111f;
    --btn-primary-bg: #131a22;
    --btn-primary-fg: #ffffff;
    --btn-secondary-bg: #ffffff;
    --btn-secondary-border: rgba(15,23,42,0.14);
    --btn-secondary-fg: #131a22;
    --on-strong: #ffffff;
  }
}

/* LIGHT palette: applied when user manually forces light (wins over system) */
:root[data-theme="light"] {
  --bg: linear-gradient(180deg, #fbfcfe, #eef2f7);
  --bg-solid: #eef2f7;
  --chrome: #fbfcfe;
  --bg-glow: radial-gradient(circle at 85% -10%, rgba(91,157,255,0.12), transparent 60%);
  --stage-bg: #f8fbff;
  --stage-mid: #edf3fb;
  --stage-red: rgba(255,95,86,0.08);
  --stage-blue: rgba(59,130,246,0.16);
  --hero-text: #101722;
  --hero-muted: #4f5d70;
  --hero-soft: #5f6b7d;
  --hero-eyebrow: #0e7490;
  --hero-fade-from: rgba(248,251,255,0);
  --hero-primary-bg: #111827;
  --hero-primary-fg: #ffffff;
  --hero-secondary-bg: rgba(255,255,255,0.72);
  --hero-secondary-border: rgba(15,23,42,0.12);
  --hero-secondary-fg: #111827;
  --nav-bg: rgba(248,250,252,0.78);
  --nav-border: rgba(15,23,42,0.08);
  --nav-text: #101722;
  --nav-muted: #526070;
  --nav-control-bg: rgba(255,255,255,0.74);
  --nav-control-border: rgba(15,23,42,0.10);
  --nav-control-hover: rgba(15,23,42,0.05);
  --surface: #ffffff;
  --surface-2: #ffffff;
  --surface-border: rgba(15,23,42,0.08);
  --text: #131a22;
  --text-strong: #0f1722;
  --muted: #64748b;
  --accent: #3b82f6;
  --accent-from: #06b6d4;
  --accent-to: #3b82f6;
  --link: #0e7490;
  --warn: #f59e0b;
  --warn-text: #b45309;
  --danger: #dc2626;
  --success: #15803d;
  --meter-track: #e2e8f0;
  --shadow: 0 8px 8px rgba(15,23,42,0.06);
  --accent-ink: #07111f;
  --btn-primary-bg: #131a22;
  --btn-primary-fg: #ffffff;
  --btn-secondary-bg: #ffffff;
  --btn-secondary-border: rgba(15,23,42,0.14);
  --btn-secondary-fg: #131a22;
  --on-strong: #ffffff;
}

/* base.css: reset, typography, layout primitives, motion */
* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  overflow-x: clip;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 0%, rgba(255,95,86,0.08), transparent 28rem),
    var(--bg-glow),
    var(--bg);
  background-attachment: fixed;
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin-top: 0; }

.shell { width: var(--maxw); margin-inline: auto; }
.section { padding: clamp(3.25rem, 6vw, 5.5rem) 0; }

.eyebrow {
  margin: 0 0 0.9rem;
  color: var(--link);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 1.25rem;
  font-size: 4.9rem;
  line-height: 0.95;
  letter-spacing: 0;
  color: var(--text-strong);
}
h2 {
  margin: 0 0 1rem;
  font-size: 2.65rem;
  line-height: 1.08;
  letter-spacing: 0;
  color: var(--text-strong);
}
h3 { margin: 0 0 0.5rem; font-size: 1.15rem; letter-spacing: 0; }
h1, h2, h3 { text-wrap: balance; }
.lede, .tour-item-text { text-wrap: pretty; }

.section-head { max-width: 720px; margin-bottom: 2.5rem; }
.lede { max-width: 640px; color: var(--muted); font-size: 1.08rem; }
.num { font-family: var(--mono); font-weight: 800; letter-spacing: 0; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 20;
  background: var(--text-strong); color: var(--on-strong);
  padding: 0.75rem 1rem; border-radius: 999px;
}
.skip-link:focus { top: 1rem; }

/* reveal-on-scroll */
.reveal { opacity: 1; transform: none; }
.js .reveal { opacity: .96; transform: translateY(10px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

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

@media (max-width: 900px) {
  h1 { font-size: 3.85rem; }
  h2 { font-size: 2.25rem; }
}

@media (max-width: 560px) {
  h1 { font-size: 2.85rem; line-height: 1; }
  h2 { font-size: 1.9rem; }
  .lede { font-size: 1rem; }
}

/* components.css: nav, switches, buttons, cards, meters, windows, icons */

/* header / nav */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0.85rem 0 0.35rem;
  background: transparent;
  border-bottom: 0;
  color: #f4f8ff;
  pointer-events: none;
}
.nav {
  width: var(--navw);
  min-height: 60px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(250px, 1fr);
  align-items: center;
  gap: 1rem;
  padding: 0.48rem 0.58rem 0.48rem 0.62rem;
  border: 1px solid var(--nav-border);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.025)),
    var(--nav-bg);
  box-shadow: 0 14px 34px rgba(0,0,0,0.20), inset 0 1px 0 rgba(255,255,255,0.10);
  backdrop-filter: blur(22px) saturate(145%);
  pointer-events: auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.62rem;
  min-width: 0;
  text-decoration: none;
  font-weight: 850;
  letter-spacing: 0;
  color: var(--text-strong);
}
.brand-mark {
  width: 36px;
  height: 36px;
  margin: -4px 0; /* the glyph has built-in glow padding; pull it back to the cap height */
  object-fit: contain;
  flex: none;
}
.nav-menu {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 0.08rem;
  min-height: 40px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.nav-menu a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 0.78rem;
  border-radius: 12px;
  color: var(--nav-muted);
  font-weight: 750;
  font-size: 0.88rem;
  text-decoration: none;
  transition: color .18s ease, background .18s ease;
}
.nav-menu a:hover {
  color: #f4f8ff;
  background: var(--nav-control-hover);
}
.nav-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.52rem;
}
/* circular icon buttons in the nav (theme toggle + GitHub), identical size, icon only */
.nav-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--nav-control-border);
  border-radius: 999px;
  background: var(--nav-control-bg);
  color: var(--nav-muted);
  text-decoration: none;
  cursor: pointer;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.nav-icon-btn:hover { color: var(--nav-text); background: var(--nav-control-hover); }
.site-header .brand { color: var(--nav-text); }
.site-header .nav-menu a:hover { color: var(--nav-text); }

/* icons */
.ico { width: 1.1em; height: 1.1em; display: inline-block; flex: none; }
.nav-icon-btn .ico { width: 18px; height: 18px; }

/* language dropdown — a <details> popover so it still toggles without JS;
   main.js adds outside-click and Escape closing on top */
.lang-menu { position: relative; }
.lang-btn {
  width: auto;
  gap: 0.42rem;
  padding: 0 0.78rem 0 0.66rem;
  font-weight: 800;
  font-size: 0.8rem;
  list-style: none;
  user-select: none;
}
.lang-btn::-webkit-details-marker { display: none; }
.lang-btn .ico { width: 16px; height: 16px; }
.lang-cur { line-height: 1; }
.lang-menu[open] .lang-btn { color: var(--nav-text); background: var(--nav-control-hover); }
.lang-pop {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  min-width: 164px;
  padding: 6px;
  border: 1px solid var(--nav-control-border);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02)),
    var(--nav-bg);
  box-shadow: 0 18px 44px rgba(0,0,0,0.36), inset 0 1px 0 rgba(255,255,255,0.08);
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
}
.lang-pop button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  min-height: 38px;
  padding: 0 0.75rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--nav-muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: color .15s ease, background .15s ease;
}
.lang-pop button:hover { color: var(--nav-text); background: var(--nav-control-hover); }
.lang-pop button::after { content: "\2713"; font-size: 0.78rem; opacity: 0; }
.lang-pop button[aria-checked="true"] { color: var(--nav-text); }
.lang-pop button[aria-checked="true"]::after { opacity: 1; }
.lang-pop button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: -3px;
}

.theme-toggle { font-size: 1rem; line-height: 1; }
.theme-toggle .i-sun { display: none; }
.theme-toggle .i-moon { display: inline; }
.theme-toggle[data-state="light"] .i-sun { display: inline; }
.theme-toggle[data-state="light"] .i-moon { display: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem; min-height: 48px; padding: 0 1.25rem; border-radius: var(--r-md); font-weight: 800; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--btn-primary-bg); color: var(--btn-primary-fg); box-shadow: var(--shadow); }
.btn-secondary { background: var(--btn-secondary-bg); border: 1px solid var(--btn-secondary-border); color: var(--btn-secondary-fg); }

/* focus */
.btn:focus-visible, .brand:focus-visible, .nav-icon-btn:focus-visible, .nav-menu a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 3px;
}

/* generic card */
.card {
  border: 1px solid var(--surface-border);
  border-radius: var(--r-lg);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  box-shadow: none;
}

/* window (frames product panels as the real app window) */
.window {
  border: 1px solid var(--surface-border);
  border-radius: var(--r-md);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(8px);
}
.window-bar { display: flex; align-items: center; gap: 0.75rem; padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--surface-border); }
.window-dots { display: flex; gap: 0.4rem; }
.window-dots i { width: 11px; height: 11px; border-radius: 50%; }
.window-dots .r { background: #ff5f57; }
.window-dots .a { background: #febc2e; }
.window-dots .g { background: #28c840; }
.window-title { font-family: var(--mono); font-size: 0.7rem; color: var(--muted); letter-spacing: 0; }
.window-body { padding: 1.1rem 1.2rem; }

/* small uppercase label reused by the iOS surface mock */
.panel-label { font-size: 0.62rem; font-weight: 800; letter-spacing: 0; text-transform: uppercase; color: var(--muted); }

/* hero product stack — three real widget replicas at staggered 3D depths.
   setupHeroTilt in main.js sets --rx/--ry (main-card tilt) and --px/--py
   (parallax shift; outer cards consume them at opposite signs/strengths) on
   .product-stack. Without JS the stack is a clean static product shot. */
.product-stack {
  position: relative;
  min-height: 610px;
  perspective: 1200px;
}
.product-stack::before { /* soft accent glow behind the stack */
  content: "";
  position: absolute;
  inset: 4% -4% 2% 6%;
  z-index: 0;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent-from) 16%, transparent), transparent 72%);
  filter: blur(12px);
  pointer-events: none;
}

.app-widget {
  position: absolute;
  overflow: hidden;
  border: 1px solid var(--widget-border);
  border-radius: 23px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.022)),
    linear-gradient(135deg, rgba(255,255,255,0.035), rgba(0,0,0,0.09)),
    var(--widget-bg);
  box-shadow: var(--widget-shadow);
  backdrop-filter: blur(28px) saturate(116%);
  -webkit-backdrop-filter: blur(28px) saturate(116%);
  color: var(--widget-text);
  font-family: var(--mono);
  will-change: transform;
}

.app-widget-main {
  inset: 44px 18px 18px 52px;
  z-index: 3;
  transform: rotateY(calc(-7deg + var(--ry, 0deg))) rotateX(calc(3deg + var(--rx, 0deg)));
}
.app-widget-main .tm-total { font-size: 50px; }

.app-widget-back {
  inset: 18px 86px 176px 2px;
  z-index: 1;
  opacity: 0.62;
  transform: translate3d(calc(var(--px, 0px) * -0.6), calc(var(--py, 0px) * -0.6), 0) rotateY(-12deg) rotateX(5deg) rotateZ(-5deg);
}

.app-widget-front {
  right: 0;
  bottom: 20px;
  z-index: 4;
  width: 55%;
  min-height: 190px;
  transform: translate3d(calc(var(--px, 0px) * 1.6), calc(var(--py, 0px) * 1.6), 0) rotateY(-5deg) rotateZ(3deg);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.022)),
    linear-gradient(135deg, rgba(255,255,255,0.035), rgba(0,0,0,0.09)),
    var(--widget-bg-strong);
}

/* specular sheen that sweeps the main card once after it lands */
.app-widget-main::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,0.13) 50%, transparent 60%);
  transform: translateX(-130%);
  pointer-events: none;
}

/* staged entrance once the hero reveals. The keyframes only declare `from`,
   so each card settles into its var-driven base transform (no frozen value to
   fight the pointer parallax that starts afterwards). */
@media (prefers-reduced-motion: no-preference) {
  .js .hero-visual:not(.is-visible) .app-widget { opacity: 0; }
  .js .hero-visual.is-visible .app-widget-main { animation: stack-in-main 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.08s backwards; }
  .js .hero-visual.is-visible .app-widget-back { animation: stack-in-back 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.34s backwards; }
  .js .hero-visual.is-visible .app-widget-front { animation: stack-in-front 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.58s backwards; }
  .js .hero-visual.is-visible .app-widget-main::before { animation: stack-sheen 1.3s ease-in-out 1.3s both; }
}
@keyframes stack-in-main {
  from { opacity: 0; transform: rotateY(-7deg) rotateX(3deg) translate3d(0, 54px, -60px) scale(0.965); filter: blur(10px); }
}
@keyframes stack-in-back {
  from { opacity: 0; transform: rotateY(-12deg) rotateX(5deg) rotateZ(-5deg) translate3d(-64px, 26px, -90px); filter: blur(12px); }
}
@keyframes stack-in-front {
  from { opacity: 0; transform: rotateY(-5deg) rotateZ(3deg) translate3d(34px, 46px, 30px) scale(0.94); filter: blur(8px); }
}
@keyframes stack-sheen {
  from { transform: translateX(-130%); }
  to { transform: translateX(135%); }
}

/* bars inside the stack fill in sequence after their card lands */
@media (prefers-reduced-motion: no-preference) {
  .js .hero-visual .app-widget-main .tm-row:nth-child(1) .tm-bar span { transition-delay: 0.8s; }
  .js .hero-visual .app-widget-main .tm-row:nth-child(2) .tm-bar span { transition-delay: 0.92s; }
  .js .hero-visual .app-widget-main .tm-row:nth-child(3) .tm-bar span { transition-delay: 1.04s; }
  .js .hero-visual .app-widget-main .tm-row:nth-child(4) .tm-bar span { transition-delay: 1.16s; }
  .js .hero-visual .app-widget-back .tm-bar span { transition-delay: 1.1s; }
  .js .hero-visual .app-widget-front .tm-bar span { transition-delay: 1.35s; }
}

.tm-inner { padding: 20px 22px 21px; }

.tm-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 30px;
}

.tm-title {
  display: inline-flex;
  align-items: baseline;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 1px 10px rgba(0,0,0,0.30);
  white-space: nowrap;
}

.tm-title-icon {
  flex: none;
  color: #dbeafe;
  font-size: 25px;
}

.tm-title-icon .tm-live {
  margin-left: 7px;
  vertical-align: baseline;
}

.tm-live {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 5px;
  border-radius: 50%;
  background: #b7ead4;
  box-shadow: 0 0 7px rgba(183,234,212,0.85);
  vertical-align: middle;
  animation: live-pulse 2.6s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
@media (prefers-reduced-motion: reduce) {
  .tm-live { animation: none; }
}

.tm-tabs {
  display: inline-flex;
  padding: 4px;
  border: 1px solid rgba(232,238,244,0.16);
  border-radius: 17px;
  background: rgba(255,255,255,0.045);
}

.tm-tabs span {
  border-radius: 12px;
  padding: 9px 14px;
  color: var(--widget-muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.tm-tabs .active {
  color: #c8f7df;
  background: rgba(255,255,255,0.10);
  box-shadow: inset 0 0 0 1px rgba(232,238,244,0.16);
}

.tm-label {
  color: var(--widget-muted);
  font-size: 15px;
  font-weight: 800;
}

.tm-total {
  margin-top: 12px;
  color: var(--widget-text);
  /* The real widget gives only this number a tuned sans face; everything else stays mono. */
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  font-size: 60px;
  line-height: 0.96;
  font-weight: 700;
}

.tm-cost {
  margin-top: 8px;
  color: #b8c0ce;
  font-size: 16px;
  font-weight: 800;
}

.tm-breakdown { margin-top: 30px; }

.tm-row {
  padding: 0 0 15px;
  margin-top: 16px;
  border-bottom: 1px solid rgba(232,238,244,0.12);
}

.tm-row:first-child { margin-top: 0; }

/* stale device rows grey out but stay listed, exactly like the app */
.tm-row.is-stale .tm-row-head,
.tm-row.is-stale .tm-bar { opacity: 0.55; }

/* the app's click-to-expand cache accordion under a usage row: open by
   default; the tour pins it shut on inactive screens so the reveal replays */
.tm-acc {
  display: grid;
  grid-template-rows: 1fr;
  width: 100%;
}
.tm-acc-inner {
  overflow: hidden;
  min-height: 0;
  margin-left: 4px;
  padding-left: 12px;
  border-left: 1px solid rgba(232,238,244,0.1);
}
.tm-acc-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 8px;
  padding-bottom: 2px;
}
.tm-acc-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 11px;
}
.tm-acc-row .lbl {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  color: var(--widget-muted);
  white-space: nowrap;
}
.tm-acc-row .lbl i {
  font-style: normal;
  font-size: 10px;
  opacity: 0.6;
}
.tm-acc-row .val {
  flex: none;
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}

.tm-row-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 11px;
}

.tm-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
}

.tm-icon img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.94;
}

.tm-row-name,
.tm-row-value {
  font-size: 18px;
  font-weight: 800;
}

.tm-row-value {
  text-align: right;
}

.tm-row-value span {
  display: block;
  margin-top: 4px;
  color: #b8c0ce;
  font-size: 13px;
}

.tm-bar {
  height: 7px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(14,17,21,0.55);
}

.tm-bar span {
  display: block;
  width: var(--w, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--bar, #58bfca);
}

.tm-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 23px;
}

.tm-footer span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(232,238,244,0.16);
  border-radius: 13px;
  background: rgba(255,255,255,0.045);
  color: #b8c0ce;
  font-weight: 800;
}

.tm-footer span:last-child {
  width: 44px;
  padding: 0;
  color: var(--widget-text);
}

/* mini widgets riding the back/front of the hero stack */
.mini-widget {
  padding: 17px;
}

.mini-top,
.mini-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.mini-top {
  color: rgba(255,255,255,0.78);
  font-weight: 800;
}

.mini-line {
  margin-top: 15px;
  color: rgba(255,255,255,0.64);
  font-size: 13px;
}

.mini-line strong { color: #fff; }

.mini-session-widget {
  padding: 14px 16px 15px;
}

.mini-session-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.mini-back {
  color: var(--widget-muted);
  font-size: 13px;
  font-weight: 800;
}

.mini-pill {
  flex: none;
  padding: 5px 9px;
  border: 1px solid rgba(232,238,244,0.16);
  border-radius: 999px;
  background: rgba(255,255,255,0.055);
  color: var(--widget-muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.mini-session-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 13px;
  margin-top: 13px;
}

.mini-session-copy {
  min-width: 0;
  color: rgba(255,255,255,0.66);
}

.mini-session-title,
.mini-session-meta,
.mini-session-value span {
  display: block;
}

.mini-session-title {
  overflow: hidden;
  color: rgba(255,255,255,0.72);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.22;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-session-meta {
  margin-top: 3px;
  overflow: hidden;
  color: #8b94a1;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-session-value {
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
  text-align: right;
  white-space: nowrap;
}

.mini-session-value span {
  margin-top: 3px;
  color: #b8c0ce;
  font-size: 10.5px;
}

.mini-session-widget .tm-bar {
  height: 6px;
  margin-top: 7px;
}

/* flat glass app widget — the tour screens' surface; same .tm-* type system
   as the hero stack so every mock mirrors a real view of the desktop app */
.app-frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 432px;
  margin-inline: auto;
  border: 1px solid var(--widget-border);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.022)),
    linear-gradient(135deg, rgba(255,255,255,0.035), rgba(0,0,0,0.09)),
    var(--widget-bg);
  box-shadow: var(--widget-shadow);
  backdrop-filter: blur(42px) saturate(132%);
  -webkit-backdrop-filter: blur(42px) saturate(132%);
  color: var(--widget-text);
  font-family: var(--mono);
}

/* the hero widget runs large; the feature widgets are tuned for the ~432px slot */
.app-frame .tm-inner { padding: 18px 20px 19px; }
.app-frame .tm-titlebar { margin-bottom: 18px; }
.app-frame .tm-title { font-size: 21px; }
.app-frame .tm-tabs { padding: 3px; border-radius: 14px; }
.app-frame .tm-tabs span { padding: 7px 11px; font-size: 11px; border-radius: 10px; }
.app-frame .tm-label { font-size: 13px; }
/* matches the desktop widget's .total-number (SF Pro Display 500, up to 46px) */
.app-frame .tm-total { margin-top: 9px; font-size: 42px; }
.app-frame .tm-cost { margin-top: 6px; font-size: 14px; }
.app-frame .tm-breakdown { margin-top: 18px; }
.app-frame .tm-row { margin-top: 13px; padding-bottom: 13px; }
.app-frame .tm-row:last-child { padding-bottom: 0; border-bottom: 0; }
.app-frame .tm-row-name,
.app-frame .tm-row-value { font-size: 15px; }
.app-frame .tm-row-value span { margin-top: 3px; font-size: 11px; }
.app-frame .tm-icon { width: 18px; height: 18px; }
.app-frame .tm-icon img { width: 16px; height: 16px; }
.app-frame .tm-bar { height: 6px; margin-top: 11px; }
/* every view keeps the real footer: current view pill + settings gear */
.app-frame .tm-footer { margin-top: 19px; }
.app-frame .tm-footer span { min-height: 36px; padding: 0 12px; border-radius: 11px; font-size: 13px; }
.app-frame .tm-footer span:last-child { width: 36px; padding: 0; }
/* the view body sits below the always-visible total panel, like the app */
.app-frame .tm-limits,
.app-frame .tm-statuslist,
.app-frame .tm-trends-cap { margin-top: 19px; }
.app-frame .tm-crumb { margin-top: 17px; }

/* in-widget Trends preview (mirrors the app's .trends-* panel) */
.tm-trends-cap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--widget-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tm-trends-hint { font-size: 13px; }
.tm-spark { margin-top: 10px; padding: 4px 2px; border-radius: 8px; }
.tm-spark svg { display: block; width: 100%; height: 92px; }
.tm-spark rect { fill: #6ab4f0; opacity: 0.5; }
.tm-spark rect:last-child { opacity: 1; }
.tm-axis {
  display: flex;
  justify-content: space-between;
  padding: 0 3px;
  margin-top: 4px;
  color: var(--widget-muted);
  font-size: 10px;
}
.tm-trend-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 13px; }
.tm-trend-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.05);
}
.tm-trend-stat .v { color: var(--widget-text); font-size: 16px; font-weight: 800; line-height: 1; }
.tm-trend-stat .k { color: var(--widget-muted); font-size: 10px; font-weight: 700; }

/* bars fill as their .reveal container scrolls into view (main.js adds .is-visible) */
.js .reveal .tm-bar span { width: 0; transition: width 1s cubic-bezier(.2,.8,.2,1) .2s; }
.js .reveal.is-visible .tm-bar span { width: var(--w, 0%); }
@media (prefers-reduced-motion: reduce) {
  .js .reveal .tm-bar span { transition: none; }
}

/* AI Tool Limits view */
.tm-limit { margin-top: 13px; padding-bottom: 12px; border-bottom: 1px solid rgba(232,238,244,0.12); }
.tm-limit:first-child { margin-top: 0; }
.tm-limit:last-child { padding-bottom: 0; border-bottom: 0; }
.tm-limit-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tm-limit-name { display: inline-flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 800; }
.tm-plan { color: var(--widget-muted); font-size: 11px; font-weight: 800; }
.tm-updated { margin-top: 4px; color: #8b94a1; font-size: 11px; }
.tm-windows { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 16px; margin-top: 9px; }
.tm-windows.single { grid-template-columns: 1fr; }
.tm-windows.stacked { grid-template-columns: 1fr; gap: 10px; }
.app-frame .tm-windows .tm-bar { margin-top: 6px; }
.tm-window-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 800; }
.tm-window-top .lbl { color: var(--widget-muted); }
.tm-window-top .pct { color: var(--widget-text); }
.tm-reset { margin-top: 4px; color: #8b94a1; font-size: 11px; }
.tm-balance { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: 12px; font-weight: 800; }
.tm-balance .lbl { color: var(--widget-muted); }
.tm-balance .val { color: var(--widget-text); }

/* per-session detail view */
.tm-crumb { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.tm-pill { padding: 6px 11px; border: 1px solid rgba(232,238,244,0.16); border-radius: 999px; background: rgba(255,255,255,0.045); color: var(--widget-muted); font-size: 11px; font-weight: 800; }
.tm-back { color: var(--widget-muted); font-size: 14px; font-weight: 800; }

/* detail page — one session, expanded; caret in a left gutter, body indented past it */
.tm-sess { display: grid; grid-template-columns: auto 1fr; align-items: start; column-gap: 9px; padding: 2px 0 0; }
.tm-caret { padding-top: 2px; color: #8b94a1; font-size: 10px; }
.tm-caret::before { content: "\25BE"; }
.tm-caret-closed::before { content: "\25B8"; }
.tm-sess + .tm-sess { margin-top: 13px; }
.tm-sess-body { min-width: 0; }
.tm-sess-head { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 8px; }
.tm-sess-title { min-width: 0; overflow: hidden; font-size: 14px; font-weight: 800; white-space: nowrap; text-overflow: ellipsis; }
.tm-sess-title .you { color: #a99bf5; }
.tm-sess-title .sep { margin: 0 5px; color: #8b94a1; }
.tm-sess-val { font-size: 14px; font-weight: 800; text-align: right; white-space: nowrap; }
/* time · turns · tools on the left, cost on the right — one line, like the app */
.tm-sess-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 2px; color: #8b94a1; font-size: 11px; }
.tm-sess-cost { color: #b8c0ce; }
.tm-sess-body .tm-bar { margin-top: 6px; }
.tm-replies { margin-top: 11px; padding-left: 12px; border-left: 1px solid rgba(232,238,244,0.12); }
.tm-reply { margin-top: 10px; }
.tm-reply:first-child { margin-top: 0; }
.tm-reply-head { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 8px; }
.tm-reply-name { font-size: 13px; font-weight: 800; }
.tm-reply-val { font-size: 13px; font-weight: 800; text-align: right; white-space: nowrap; }
.tm-reply-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 2px; color: #8b94a1; font-size: 10.5px; }
.tm-reply-cost { color: #b8c0ce; }
.tm-tool-line { color: #8b94a1; font-size: 10.5px; line-height: 1.25; }

/* terminal (always-dark window for shell commands) */
.window.term { background: #0d1117; border-color: rgba(255,255,255,0.08); backdrop-filter: none; }
.window.term .window-bar { border-color: rgba(255,255,255,0.07); }
.window.term .window-title { color: #8b949e; }
.term-body { margin: 0; padding: 1rem 1.2rem; font-family: var(--mono); font-size: 0.9rem; line-height: 1.8; color: #c9d1d9; overflow-x: auto; }
.term-body .tok-prompt { color: #7ee787; user-select: none; margin-right: 0.5rem; }

/* supported-tool marks */
.tool-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--surface-border) 72%, #000 10%);
  flex: none;
}

.tool-mark img {
  display: block;
  width: 17px;
  height: 17px;
  object-fit: contain;
}

@media (max-width: 980px) {
  .nav {
    grid-template-columns: minmax(170px, 1fr) auto;
  }
  .nav-menu { display: none; }
}

@media (max-width: 680px) {
  .site-header { padding: 0.6rem 0 0.3rem; }
  .nav {
    width: var(--navw);
    grid-template-columns: auto 1fr;
    min-height: 54px;
    padding: 0.34rem 0.38rem;
    gap: 0.45rem;
  }
  .brand span { display: none; }
  .brand-mark { width: 34px; height: 34px; }
  .nav-menu { display: none; }
  .nav-actions { gap: 0.4rem; }
}

/* sections.css: per-section layout */

/* hero */
.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0,0.88fr) minmax(440px,1.12fr);
  align-items: center;
  align-content: center; /* keep copy + cards + marquee as one centered block, no stretched mid-gap */
  column-gap: clamp(1.6rem,4.4vw,3rem);
  row-gap: clamp(0.4rem,1.2vw,0.7rem);
  min-height: 100svh;
  margin-top: 0;
  /* asymmetric padding biases the centered block downward (more top, less bottom) */
  padding-top: clamp(6.25rem,9vw,8rem);
  padding-bottom: clamp(0.75rem,2vw,1.5rem);
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--hero-text);
}
.hero::before {
  content: "";
  position: absolute;
  z-index: -2;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background:
    radial-gradient(circle at 75% 12%, var(--stage-blue), transparent 28%),
    radial-gradient(circle at 24% 20%, var(--stage-red), transparent 22%),
    linear-gradient(140deg, var(--stage-bg) 0%, var(--stage-mid) 56%, var(--stage-bg) 100%);
}
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  bottom: 0;
  width: 100vw;
  height: 8rem;
  transform: translateX(-50%);
  background: linear-gradient(180deg, var(--hero-fade-from), var(--bg));
  pointer-events: none;
}
.hero-copy { max-width: 560px; }
.hero-copy h1 {
  max-width: 11ch;
  color: var(--hero-text);
  font-size: 4.7rem;
  overflow-wrap: normal;
  word-break: keep-all;
}
.hero-copy .lede {
  max-width: 42ch;
  color: var(--hero-muted);
}
.hero .eyebrow { color: var(--hero-eyebrow); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin: 1.45rem 0 0; }
.hero-platforms { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem 1.4rem; margin: 1.15rem 0 0; color: var(--muted); }
.hero-os { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.88rem; font-weight: 600; }
.hero-os img { width: 16px; height: 16px; object-fit: contain; filter: brightness(0) invert(1); opacity: 0.72; }
:root[data-theme="light"] .hero-os img { filter: brightness(0); opacity: 0.6; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .hero-os img { filter: brightness(0); opacity: 0.6; } }
.hero .btn-primary { background: var(--hero-primary-bg); color: var(--hero-primary-fg); box-shadow: none; }
.hero .btn-secondary { background: var(--hero-secondary-bg); border-color: var(--hero-secondary-border); color: var(--hero-secondary-fg); }
@media (max-width: 1120px) {
  .hero {
    grid-template-columns: minmax(0,0.86fr) minmax(0,1.14fr);
    column-gap: 2rem;
  }
  .hero-copy h1 { font-size: 4rem; }
  .hero-copy .lede { max-width: 38ch; }
  .product-stack { min-height: 560px; }
  .app-widget-main { inset: 58px 0 26px 18px; }
  .app-widget-back { inset: 30px 70px 190px 0; }
  .app-widget-front { width: 52%; bottom: 34px; }
  .product-stack .tm-inner { padding: 18px; }
  .product-stack .tm-title { font-size: 20px; }
  .product-stack .tm-tabs span { padding: 8px 11px; font-size: 11px; }
  .product-stack .tm-titlebar { margin-bottom: 25px; }
  .product-stack .tm-label { font-size: 13px; }
  .product-stack .tm-total { font-size: 46px; }
  .product-stack .tm-row-name, .product-stack .tm-row-value { font-size: 15px; }
  .product-stack .tm-row-value span { font-size: 12px; }
}

@media (min-width: 861px) and (max-height: 820px) {
  .hero {
    column-gap: clamp(1.4rem, 3.5vw, 2.4rem);
    padding-top: clamp(5rem, 7vw, 5.8rem);
    padding-bottom: 1.45rem;
  }
  .hero-copy h1 {
    max-width: 10.6ch;
    font-size: clamp(3.75rem, 5.2vw, 4.25rem);
  }
  .hero-copy .lede {
    max-width: 38ch;
    font-size: 1rem;
  }
  .hero .eyebrow { margin-bottom: 0.65rem; }
  .hero-actions { margin-top: 1.15rem; }
  .product-stack { min-height: 510px; }
  .app-widget-main { inset: 34px 8px 14px 38px; }
  .app-widget-back { inset: 16px 72px 158px 0; }
  .app-widget-front { width: 51%; min-height: 160px; bottom: 14px; }
  .product-stack .tm-inner { padding: 17px 19px 18px; }
  .product-stack .tm-titlebar { margin-bottom: 24px; }
  .product-stack .tm-title { font-size: 19px; }
  .product-stack .tm-tabs span { padding: 8px 11px; font-size: 11px; }
  .product-stack .tm-label { font-size: 13px; }
  .product-stack .tm-total { margin-top: 10px; font-size: 47px; }
  .product-stack .tm-cost { font-size: 13px; }
  .product-stack .tm-breakdown { margin-top: 24px; }
  .product-stack .tm-row { margin-top: 13px; padding-bottom: 12px; }
  .product-stack .tm-row-name, .product-stack .tm-row-value { font-size: 15px; }
  .product-stack .tm-row-value span { font-size: 11px; }
  .product-stack .tm-footer { display: none; }
  .hero-tools {
    margin-top: 0;
    padding-top: 0.5rem;
  }
  .hero-tools .eyebrow { margin-bottom: 0.42rem; }
  .tool-chip {
    min-height: 34px;
    padding: 0.25rem 0.58rem 0.25rem 0.34rem;
    font-size: 0.82rem;
  }
  .tool-mark {
    width: 24px;
    height: 24px;
  }
  .tool-mark img {
    width: 15px;
    height: 15px;
  }
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: minmax(0,0.82fr) minmax(250px,0.9fr);
    column-gap: 1.25rem;
    padding-top: clamp(5.4rem, 9vw, 6.8rem);
    padding-bottom: clamp(2.4rem, 6vw, 4.5rem);
  }
  .hero-copy h1 {
    max-width: 8.6ch;
    font-size: 3.15rem;
  }
  .hero-copy .lede {
    max-width: 31ch;
    font-size: 0.96rem;
  }
  .hero-actions {
    gap: 0.65rem;
    margin-top: 1.2rem;
  }
  .hero .btn {
    min-height: 42px;
    padding: 0 0.95rem;
    font-size: 0.9rem;
  }
  .product-stack { min-height: 460px; }
  .app-widget-main {
    inset: 40px 0 18px 0;
    transform: rotateY(calc(-4deg + var(--ry, 0deg))) rotateX(calc(2deg + var(--rx, 0deg)));
  }
  .app-widget-back,
  .app-widget-front { display: none; }
  .product-stack .tm-inner { padding: 14px; }
  .product-stack .tm-titlebar { align-items: center; gap: 8px; margin-bottom: 20px; }
  .product-stack .tm-title { font-size: 17px; }
  .product-stack .tm-tabs { padding: 3px; }
  .product-stack .tm-tabs span { padding: 7px 8px; font-size: 10px; }
  .product-stack .tm-label { font-size: 11px; }
  .product-stack .tm-total { margin-top: 9px; font-size: 34px; }
  .product-stack .tm-cost { margin-top: 6px; font-size: 12px; }
  .product-stack .tm-breakdown { margin-top: 20px; }
  .product-stack .tm-row { margin-top: 12px; padding-bottom: 11px; }
  .product-stack .tm-row-head { grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; }
  .product-stack .tm-row-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .product-stack .tm-row-name, .product-stack .tm-row-value { font-size: 13px; }
  .product-stack .tm-row-value { text-align: right; white-space: nowrap; }
  .product-stack .tm-row-value span { font-size: 10px; }
  .product-stack .tm-icon { width: 16px; height: 16px; }
  .product-stack .tm-icon img { width: 15px; height: 15px; }
  .product-stack .tm-bar { height: 5px; margin-top: 9px; }
  .product-stack .tm-row:nth-child(4),
  .product-stack .tm-footer { display: none; }
}

@media (max-width: 680px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    row-gap: 1.8rem;
    overflow: visible;
  }
  .hero-copy,
  .hero-visual {
    min-width: 0;
  }
  .hero-copy {
    width: 100%;
    max-width: none;
  }
  .hero-visual {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
    overflow: hidden;
    justify-self: start;
  }
  .hero-copy h1 {
    max-width: 11ch;
    font-size: clamp(2.85rem, 9.4vw, 3.45rem);
    line-height: 1;
  }
  .product-stack {
    min-width: 0;
    min-height: clamp(405px, 78vw, 455px);
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
  }
  .app-widget-main {
    inset: 18px 0 0 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    transform: none;
  }
  .app-widget-back,
  .app-widget-front { display: none; }
}
@media (max-width: 560px) {
  .hero {
    padding-top: clamp(7.6rem, 26vw, 8.1rem);
    padding-bottom: 2.8rem;
  }
  .hero .eyebrow {
    display: block;
    margin-bottom: 0.58rem;
    font-size: 0.68rem;
    line-height: 1.25;
  }
  .hero-copy h1 {
    max-width: 11.2ch;
    font-size: clamp(2.45rem, 8vw, 2.7rem);
    line-height: 1.04;
  }
  .product-stack { min-height: 410px; }
  .product-stack .tm-inner { padding: 17px; }
  .product-stack .tm-titlebar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
  }
  .product-stack .tm-total { font-size: 36px; }
  .product-stack .tm-row-name, .product-stack .tm-row-value { font-size: 15px; }
  .product-stack .tm-row:nth-child(4) { display: none; }
}

/* supported tools marquee */
.hero-tools {
  grid-column: 1 / -1;
  min-width: 0;
  margin-top: 0; /* spacing to content handled by the hero row-gap */
  padding-top: 0.65rem;
  overflow: hidden;
  border-top: 1px solid color-mix(in srgb, var(--hero-text) 10%, transparent);
}
.hero-tools .eyebrow {
  margin-bottom: 0.6rem;
  color: var(--hero-soft);
}
.tool-marquee {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  padding: 0.18rem 0;
  mask-image: linear-gradient(to right, transparent 0, #000 56px, #000 calc(100% - 56px), transparent 100%);
  mask-repeat: no-repeat;
  mask-size: 100% 100%;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 56px, #000 calc(100% - 56px), transparent 100%);
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
}
.tool-track {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: max-content;
  will-change: transform;
  animation: tool-marquee 30s linear infinite;
}
.tool-marquee:hover .tool-track { animation-play-state: paused; }
.tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.58rem;
  min-height: 40px;
  padding: 0.34rem 0.68rem 0.34rem 0.42rem;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--hero-text) 10%, transparent);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--hero-text) 7%, transparent);
  color: var(--hero-muted);
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0;
  backdrop-filter: blur(10px);
}
.tool-chip:hover {
  border-color: color-mix(in srgb, var(--hero-text) 18%, transparent);
  color: var(--hero-text);
  background: color-mix(in srgb, var(--hero-text) 11%, transparent);
}
@keyframes tool-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-50% - 0.275rem)); }
}
@media (prefers-reduced-motion: reduce) {
  .tool-marquee {
    mask-image: none;
    -webkit-mask-image: none;
  }
  .tool-track {
    flex-wrap: wrap;
    width: auto;
    animation: none;
  }
}

@media (max-width: 560px) {
  .tool-marquee {
    mask-image: linear-gradient(to right, transparent 0, #000 38px, #000 calc(100% - 38px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 38px, #000 calc(100% - 38px), transparent 100%);
  }
}

/* features — product tour: the feature rail on the left drives one glass widget
   stage on the right. setupTour in main.js moves .is-active; the active item's
   progress-bar animation paces the auto-advance (animationend → next screen). */
.features {
  padding-top: clamp(3rem, 6vw, 5rem);
}
.tour {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(1.6rem, 4.5vw, 3.6rem);
  align-items: center;
}
.tour-nav {
  display: flex;
  flex-direction: column;
  scroll-behavior: smooth;
}
.tour-item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 1.05rem 0.2rem 1.1rem;
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--surface-border) 82%, transparent);
  border-radius: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.tour-item:last-child { border-bottom: 1px solid color-mix(in srgb, var(--surface-border) 82%, transparent); }
.tour-item:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: -3px;
  border-radius: 10px;
}
.tour-item strong {
  display: block;
  color: var(--text);
  font-size: 1.06rem;
  font-weight: 800;
  letter-spacing: 0;
  transition: color .3s ease;
}
.tour-item:hover strong,
.tour-item.is-active strong { color: var(--text-strong); }
/* only the active item unfolds its description */
.tour-item-body {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows .5s cubic-bezier(.2,.8,.2,1), opacity .4s ease;
}
.tour-item.is-active .tour-item-body { grid-template-rows: 1fr; opacity: 1; }
.tour-item-text {
  display: block;
  overflow: hidden;
  min-height: 0;
  padding-top: 0.42rem;
  max-width: 46ch;
  font-size: 0.93rem;
  line-height: 1.55;
}
/* the accent line doubles as active marker and auto-advance progress */
.tour-progress {
  display: block;
  height: 2px;
  margin-top: 0.9rem;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface-border) 85%, transparent);
  opacity: 0;
  transition: opacity .3s ease;
}
.tour-item.is-active .tour-progress { opacity: 1; }
.tour-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}
.tour:not(.is-auto) .tour-item.is-active .tour-progress i { width: 100%; }
.tour.is-auto .tour-item.is-active .tour-progress i { animation: tour-progress 7s linear forwards; }
.tour.is-auto:hover .tour-item.is-active .tour-progress i,
.tour.is-auto:focus-within .tour-item.is-active .tour-progress i { animation-play-state: paused; }
@keyframes tour-progress {
  from { width: 0; }
  to { width: 100%; }
}

/* the stage: all screens share one grid cell and crossfade */
.tour-stage {
  position: relative;
  display: grid;
  align-items: center;
}
.tour-stage::before { /* soft accent glow behind the active screen */
  content: "";
  position: absolute;
  inset: 6% 4%;
  z-index: 0;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent-from) 14%, transparent), transparent 72%);
  filter: blur(12px);
  pointer-events: none;
}
.tour-screen {
  grid-area: 1 / 1;
  z-index: 1;
  align-self: center;
  opacity: 0;
  transform: translateY(22px) scale(0.975);
  filter: blur(7px);
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity .55s cubic-bezier(.16,1,.3,1),
    transform .55s cubic-bezier(.16,1,.3,1),
    filter .55s cubic-bezier(.16,1,.3,1),
    visibility 0s linear .55s;
}
.tour-screen.is-active {
  z-index: 2;
  opacity: 1;
  transform: none;
  filter: none;
  visibility: visible;
  pointer-events: auto;
  transition-delay: .08s, .08s, .08s, 0s;
}
/* bars and the trends sparkline re-run their entrance every time a screen
   activates: while inactive they're pinned to zero, so flipping .is-active
   replays them */
.js .tour .tour-screen:not(.is-active) .tm-bar span { width: 0; transition: none; }
.js .tour .tour-screen .tm-spark svg { transition: clip-path 0.9s cubic-bezier(.2,.8,.2,1) 0.3s; }
.js .tour .tour-screen:not(.is-active) .tm-spark svg { clip-path: inset(0 100% 0 0); transition: none; }
.js .tour .tour-screen.is-active .tm-spark svg { clip-path: inset(0 0 0 0); }
/* the cache accordion springs open a beat after its screen lands, same
   pin-while-inactive trick (the app animates grid-template-rows 0fr→1fr too) */
.js .tour .tour-screen .tm-acc { transition: grid-template-rows 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.9s; }
.js .tour .tour-screen .tm-acc-inner { transition: opacity 0.5s ease 0.9s; }
.js .tour .tour-screen:not(.is-active) .tm-acc { grid-template-rows: 0fr; transition: none; }
.js .tour .tour-screen:not(.is-active) .tm-acc-inner { opacity: 0; transition: none; }

@media (max-width: 920px) {
  .tour { grid-template-columns: 1fr; gap: 1.5rem; align-items: start; }
  .tour-nav {
    flex-direction: row;
    gap: 0.45rem;
    overflow-x: auto;
    padding-bottom: 0.4rem;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .tour-nav::-webkit-scrollbar { display: none; }
  .tour-item {
    flex: none;
    width: auto;
    padding: 0.5rem 0.95rem;
    border: 1px solid var(--surface-border);
    border-radius: 999px;
    scroll-snap-align: start;
  }
  .tour-item:last-child { border-bottom: 1px solid var(--surface-border); }
  .tour-item.is-active {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--surface-border));
    background: color-mix(in srgb, var(--accent) 10%, transparent);
  }
  .tour-item strong { font-size: 0.92rem; white-space: nowrap; }
  .tour-item-body, .tour-progress { display: none; }
}

/* Service Status mock — provider cards inside the narrow .app-frame widget.
   Sits directly under the title bar like the AI Tool Limits view. */
.tm-status { margin-top: 13px; padding-bottom: 12px; border-bottom: 1px solid rgba(232,238,244,0.12); }
.tm-status:first-child { margin-top: 0; }
.tm-status:last-child { padding-bottom: 0; border-bottom: 0; }
.tm-status-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tm-status-name { display: inline-flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 800; }
.tm-badge {
  flex: none;
  font-size: 10px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px;
}
.tm-badge.is-ok { color: var(--success); background: color-mix(in srgb, var(--success) 18%, transparent); }
.tm-badge.is-degraded { color: var(--warn-text); background: color-mix(in srgb, var(--warn) 22%, transparent); }
.tm-status-title { margin-top: 6px; font-size: 12.5px; font-weight: 700; color: var(--widget-text); }
.tm-status-meta { margin-top: 4px; color: #8b94a1; font-size: 11px; }

/* dashboard — replica of the app's dedicated dashboard window. The two panes
   share one grid cell and crossfade like the tour screens; heatmap cells, bars,
   and candles are pinned while their pane is inactive so the entrances replay
   on every visit. setupDashboard() in main.js draws the SVGs. */
.dashboard {
  border-top: 1px solid color-mix(in srgb, var(--surface-border) 72%, transparent);
}
.dash-frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 1060px;
  margin-inline: auto;
  border: 1px solid var(--widget-border);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02)),
    linear-gradient(135deg, rgba(255,255,255,0.03), rgba(0,0,0,0.09)),
    var(--widget-bg);
  box-shadow: var(--widget-shadow);
  backdrop-filter: blur(42px) saturate(132%);
  -webkit-backdrop-filter: blur(42px) saturate(132%);
  color: var(--widget-text);
}
.dash-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid rgba(232,238,244,0.12);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.dash-win { display: flex; gap: 6px; color: #b8c0ce; }
.dash-win i {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: rgba(255,255,255,0.05);
  font-style: normal;
  font-size: 13px;
  line-height: 1;
}
.dash-tabs { display: flex; gap: 4px; padding: 10px 16px 0; }
.dash-tab {
  margin: 0;
  border: 0;
  background: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.55;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 13px;
  border-radius: 9px 9px 0 0;
  transition: opacity .18s ease, background .18s ease;
}
.dash-tab:hover { opacity: 0.85; }
.dash-tab.is-active { opacity: 1; background: rgba(255,255,255,0.06); }
.dash-tab:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: -3px; }
.dash-stage { display: grid; }
.dash-pane {
  grid-area: 1 / 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 16px 18px;
  opacity: 0;
  transform: translateY(10px);
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity .45s cubic-bezier(.16,1,.3,1),
    transform .45s cubic-bezier(.16,1,.3,1),
    visibility 0s linear .45s;
}
.dash-pane.is-active {
  opacity: 1;
  transform: none;
  visibility: visible;
  pointer-events: auto;
  transition-delay: .06s, .06s, 0s;
}

.dash-cards {
  display: grid;
  grid-template-columns: repeat(8, minmax(0,1fr));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  overflow: hidden;
}
.dash-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 13px 15px;
  border-right: 1px solid rgba(255,255,255,0.06);
}
.dash-card:last-child { border-right: 0; }
.dash-card-v { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-card-k { font-size: 10px; opacity: 0.55; text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dash-cap { font-size: 13px; font-weight: 600; opacity: 0.9; margin-bottom: 10px; }
.dash-heat { overflow-x: auto; scrollbar-width: none; }
.dash-heat::-webkit-scrollbar { display: none; }
.dash-heat svg { display: block; width: 100%; min-width: 660px; height: auto; }
.dash-heat .heat-month { fill: rgba(232,238,244,0.5); font-size: 10px; font-family: var(--sans); }
.dash-heat .heat.lvl-0 { fill: rgba(255,255,255,0.04); }
.dash-heat .heat.lvl-1 { fill: rgba(90,170,255,0.18); }
.dash-heat .heat.lvl-2 { fill: rgba(120,190,255,0.45); }
.dash-heat .heat.lvl-3 { fill: rgba(150,210,255,0.8); }
.dash-heat .heat.lvl-4 { fill: rgba(180,230,255,1); }

.dash-breakdown { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 32px; }
.dash-bd-title { font-size: 12px; font-weight: 600; opacity: 0.6; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.04em; }
.dash-bd-row {
  display: grid;
  grid-template-columns: 128px 1fr auto 46px;
  align-items: center;
  gap: 12px;
  padding: 3px 0;
  font-size: 12px;
}
.dash-bd-name { min-width: 0; opacity: 0.9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-bd-track { height: 4px; border-radius: 2px; background: rgba(255,255,255,0.06); overflow: hidden; }
.dash-bd-track i { display: block; height: 100%; width: var(--w, 0%); border-radius: inherit; background: var(--bar, #58bfca); }
.dash-bd-val { font-variant-numeric: tabular-nums; opacity: 0.8; text-align: right; }
.dash-bd-pct { font-variant-numeric: tabular-nums; opacity: 0.55; text-align: right; }

.dash-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dash-seg { display: inline-flex; background: rgba(255,255,255,0.05); border-radius: 8px; padding: 2px; }
.dash-seg button {
  margin: 0;
  border: 0;
  background: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 6px;
  transition: opacity .15s ease, background .15s ease;
}
.dash-seg button:hover { opacity: 0.9; }
.dash-seg button.is-active { opacity: 1; background: rgba(255,255,255,0.12); }
.dash-seg button:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: -3px; }
/* the real dashboard hides the stack toggle in K-line mode */
.dash-seg.is-hidden { display: none; }
.dash-ranges { display: flex; align-items: center; gap: 4px; margin-left: auto; font-size: 11.5px; font-weight: 600; }
.dash-ranges span { opacity: 0.5; padding: 4px 10px; border-radius: 7px; }
.dash-ranges .is-active { opacity: 1; background: rgba(255,255,255,0.12); }

.dash-chart svg { display: block; width: 100%; height: auto; }
.dash-chart .axis-base { stroke: rgba(232,238,244,0.18); stroke-width: 1; }
.dash-chart .grid-line { stroke: rgba(232,238,244,0.07); stroke-width: 1; }
.dash-chart .axis-label { fill: rgba(232,238,244,0.5); font-size: 10px; font-family: var(--sans); }
.dash-chart .candle-up { stroke: #4ec77f; fill: #4ec77f; }
.dash-chart .candle-down { stroke: #f06a7b; fill: #f06a7b; }
.dash-chart .candle-wick { stroke-width: 1.5; }
.dash-chart .candle-body { stroke: none; }

.dash-legend { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 2px 24px; }
.dash-legend.is-hidden { display: none; }
.dash-legend-row {
  display: grid;
  grid-template-columns: 1fr auto 50px;
  gap: 12px;
  align-items: center;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 12px;
}
.dash-legend-name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; opacity: 0.9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-legend-swatch { width: 11px; height: 11px; border-radius: 3px; flex: none; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18); }
.dash-legend-val { font-variant-numeric: tabular-nums; opacity: 0.8; text-align: right; }
.dash-legend-pct { font-variant-numeric: tabular-nums; opacity: 0.55; text-align: right; }

/* cursor tooltip + column highlight, same anatomy as the app's dashboard */
.dash-chart .bar-hover { fill: transparent; pointer-events: all; }
.dash-chart .bar-hover:hover { fill: rgba(255,255,255,0.07); }
.dash-tooltip {
  position: fixed;
  z-index: 120; /* above the z-100 nav: tooltips top the stack */
  pointer-events: none;
  min-width: 130px;
  padding: 9px 11px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 9px;
  background: rgba(21,26,34,0.96);
  box-shadow: 0 10px 28px rgba(0,0,0,0.45);
  color: var(--widget-text);
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.45;
}
.dash-tooltip.hidden { display: none; }
.tt-head { margin-bottom: 6px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tt-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.tt-dot { flex: none; width: 9px; height: 9px; border-radius: 2px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18); }
.tt-name { flex: 1; opacity: 0.85; white-space: nowrap; }
.tt-val { padding-left: 12px; font-variant-numeric: tabular-nums; opacity: 0.95; }

@media (prefers-reduced-motion: no-preference) {
  .js .dash-frame.is-visible .dash-pane.is-active .dash-heat .heat {
    animation: heat-in 0.5s ease both;
    animation-delay: var(--d, 0s);
  }
  .js .dash-pane.is-active .dash-chart .bar-day {
    transform-box: fill-box;
    transform-origin: bottom;
    animation: bar-in 0.55s cubic-bezier(.2,.8,.2,1) both;
    animation-delay: var(--d, 0s);
  }
  .js .dash-pane.is-active .dash-chart .candle {
    animation: candle-in 0.4s ease both;
    animation-delay: var(--d, 0s);
  }
}
@keyframes heat-in { from { opacity: 0; } }
@keyframes bar-in { from { transform: scaleY(0); } }
@keyframes candle-in { from { opacity: 0; transform: translateY(7px); } }

@media (max-width: 900px) {
  .dash-cards { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .dash-card:nth-child(4n) { border-right: 0; }
  .dash-card:nth-child(-n+4) { border-bottom: 1px solid rgba(255,255,255,0.06); }
  .dash-breakdown { grid-template-columns: 1fr; }
  .dash-legend { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .dash-cards { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dash-card { padding: 11px 13px; }
  .dash-card:nth-child(4n) { border-right: 1px solid rgba(255,255,255,0.06); }
  .dash-card:nth-child(2n) { border-right: 0; }
  .dash-card:nth-child(-n+6) { border-bottom: 1px solid rgba(255,255,255,0.06); }
  .dash-bd-row { grid-template-columns: 96px 1fr auto 40px; gap: 8px; }
  .dash-ranges { display: none; }
  .dash-pane { padding: 13px 12px 15px; }
}

/* surfaces */
.surfaces {
  border-top: 1px solid color-mix(in srgb, var(--surface-border) 72%, transparent);
}
.surface-grid { display: grid; grid-template-columns: repeat(24, minmax(0,1fr)); gap: 1rem; }
.surface-card {
  padding: 1rem 0 0;
  border: 0;
  border-top: 1px solid var(--surface-border);
  border-radius: 0;
  background: transparent;
}
.surface-card:nth-child(1) { grid-column: span 6; }
.surface-card:nth-child(2) { grid-column: span 6; }
.surface-card:nth-child(3) { grid-column: span 7; }
.surface-card:nth-child(4) { grid-column: span 5; }
.surface-card h3 { margin-top: 0.9rem; font-size: 1rem; }
.surface-card p { color: var(--muted); font-size: 0.86rem; margin: 0; }
.surface-mock {
  border-radius: var(--r-sm);
  border: 1px solid var(--surface-border);
  background: var(--surface-2);
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
  padding: 0.8rem;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.3rem;
}
.surface-mock .num { font-size: 1.1rem; color: var(--text-strong); }

/* Tray glyphs (tray-codex / tray-claude) are macOS template images: monochrome, system-tinted.
   Mask them so they render as a single light ink on the dark surfaces, like the real tray. */
.surface-mock .tray-mark {
  display: block; flex: none;
  -webkit-mask: var(--m) center / contain no-repeat;
  mask: var(--m) center / contain no-repeat;
  background-color: #f4f8ff;
}

/* Menu bar: the real tray shows the top tool's icon + the value on a dark macOS menu-bar pill. */
.surface-mock.mb { align-items: center; }
.surface-mock.mb .mb-pill {
  display: inline-flex; align-items: center; gap: 0.28rem;
  padding: 0.32rem 0.62rem 0.32rem 0.5rem;
  border-radius: 9px;
  background: rgba(18,22,31,0.92);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}
.surface-mock.mb .mb-mark { width: 20px; height: 20px; }
.surface-mock.mb .num { color: #f3f7ff; font-size: 0.95rem; font-weight: 600; }

/* Floating Bubble: a dark glass capsule, the top tool's icon beside two limit bars
   (track .22 / fill .92, matching BUBBLE_BARS_COLORS in the app). */
.surface-mock.bubble { align-items: center; }
.surface-mock.bubble .bub-glass {
  display: inline-flex; align-items: center; gap: 11px;
  padding: 11px 16px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(62,68,84,0.92), rgba(34,38,52,0.94));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.16), 0 12px 26px rgba(0,0,0,0.38);
}
/* the Claude Code glyph only fills ~62% of its box height, so the box is oversized to land the
   visible mark at the same height as the two-bar stack (≈25px) */
.surface-mock.bubble .bub-mark { display: block; flex: none; width: 40px; height: 40px; }
.surface-mock.bubble .bub-bars { display: inline-flex; flex-direction: column; gap: 7px; }
.surface-mock.bubble .bub-bar {
  width: 38px; height: 9px; border-radius: 999px;
  background: rgba(255,255,255,0.22);
  overflow: hidden;
}
.surface-mock.bubble .bub-bar i {
  display: block; height: 100%; width: var(--w);
  border-radius: 999px; background: rgba(255,255,255,0.92);
}

/* Discord: a 1:1 of the real presence card — status line on top, then a large app logo (with the
   top tool's icon badged in the corner) beside a text column: app name / details / state / timer. */
.surface-mock.discord { align-items: stretch; gap: 0.16rem; padding: 0.54rem 0.72rem 0.62rem; }
.surface-mock.discord .d-status { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 0.67rem; line-height: 1.25; transform: translateY(-2px); }
.surface-mock.discord .d-status .d-dots { letter-spacing: 1px; line-height: 1.25; opacity: 0.6; }
/* icon is top-aligned and tall enough that its bottom reaches into the timer line below */
.surface-mock.discord .d-body { display: flex; align-items: flex-start; gap: 0.88rem; }
.surface-mock.discord .d-icon { position: relative; flex: none; width: 55px; height: 55px; margin-top: 1px; }
.surface-mock.discord .d-logo {
  width: 55px; height: 55px;
  border-radius: 14px;
  object-fit: contain;
}
.surface-mock.discord .d-badge {
  position: absolute; right: -8px; bottom: -8px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
}
.surface-mock.discord .d-badge img { display: block; width: 24px; height: 24px; }
.surface-mock.discord .d-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; line-height: 1.18; padding-top: 0.08rem; }
.surface-mock.discord .d-app { color: var(--text-strong); font-weight: 700; font-size: 0.9rem; }
.surface-mock.discord .d-detail { color: var(--text); font-size: 0.73rem; white-space: nowrap; }
.surface-mock.discord small { color: var(--text); font-size: 0.73rem; white-space: nowrap; }
/* timer is the 4th line of the text column; the icon above spans down into it */
.surface-mock.discord .d-time { display: flex; align-items: center; gap: 0.28rem; margin-top: 3px; color: #3ba55c; font-size: 0.7rem; font-family: var(--mono); }
.surface-mock.discord .d-time .d-pad { flex: none; width: 12px; height: 12px; }

.surface-mock.ios { align-items: flex-start; }
.surface-mock.ios .ios-sub { color: var(--muted); font-size: 0.78rem; }
@media (max-width: 980px) {
  .surface-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .surface-card:nth-child(n) { grid-column: auto; }
}
@media (max-width: 520px) { .surface-grid { grid-template-columns: 1fr; } }

/* how it works */
.how {
  position: relative;
  border-top: 1px solid color-mix(in srgb, var(--surface-border) 72%, transparent);
}
.how .section-head {
  max-width: 820px;
  margin-bottom: clamp(1.55rem, 3.6vw, 2.45rem);
}
.how-lede {
  max-width: 690px;
  margin: 0;
}
/* one continuous mode story on the left (Local → the Hub URL field → Sync),
   the widget's real Devices view on the right (the payoff of syncing: every
   machine's share of one merged total). No cards: the app has no mode toggle,
   the Hub URL setting is the actual switch, so the field is the pivot. */
.how-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  gap: clamp(1.4rem, 4vw, 3rem);
  align-items: center;
}
.how-widget { min-width: 0; }
.mode-flow {
  position: relative;
  display: grid;
  gap: clamp(1.55rem, 3.2vw, 2.2rem);
  padding-left: clamp(1.5rem, 2.8vw, 2rem);
  align-content: center;
}
.mode-flow::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.7rem;
  bottom: 0.7rem;
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent,
    color-mix(in srgb, var(--accent) 45%, var(--surface-border)) 16%,
    color-mix(in srgb, var(--accent) 45%, var(--surface-border)) 84%,
    transparent
  );
}
.mode-step,
.mode-pivot {
  position: relative;
}
.mode-step::before,
.mode-pivot::before {
  content: "";
  position: absolute;
  left: calc(0.5px - clamp(1.5rem, 2.8vw, 2rem));
  top: 0.42rem;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--bg-solid);
  border: 1px solid color-mix(in srgb, var(--accent) 62%, var(--surface-border));
}
.mode-pivot::before {
  top: 0.55rem;
  background: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}
.mode-step h3 {
  font-size: clamp(1.18rem, 2.1vw, 1.4rem);
}
.mode-step p {
  max-width: 34rem;
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.98rem;
}
.mode-pipeline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.95rem;
}
.pipe-arrow {
  color: color-mix(in srgb, var(--accent) 70%, var(--muted));
  font-size: 0.92rem;
}
.mode-step .sync-lane { margin-top: 0.95rem; }
/* the pivot: a live settings field, mid-paste */
.mode-field {
  display: grid;
  gap: 0.4rem;
  max-width: 27rem;
}
.mode-field-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}
.mode-field-input {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.85rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--surface-border));
  border-radius: 11px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 9%, transparent);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.86rem;
}
.mode-field-text {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
}
.mode-caret {
  flex: none;
  width: 1.5px;
  height: 1.05rem;
  margin-left: 2px;
  background: var(--accent);
}
.mode-pivot-note {
  max-width: 30rem;
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}
/* the URL types itself in once the section scrolls into view; default
   (no JS / reduced motion) is the fully typed field */
@media (prefers-reduced-motion: no-preference) {
  .js .mode-flow .mode-field-text { width: 0; }
  .js .mode-flow.is-visible .mode-field-text { animation: type-url 1.5s steps(26, end) 0.55s forwards; }
  .mode-caret { animation: caret-blink 1.1s steps(1) infinite; }
}
@keyframes type-url { from { width: 0; } to { width: 26ch; } }
@keyframes caret-blink { 50% { opacity: 0; } }
.flow-node {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.92rem;
  border: 1px solid color-mix(in srgb, var(--surface-border) 84%, transparent);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--bg-solid) 52%, var(--surface) 48%);
}
.flow-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}
.flow-copy strong,
.source-pill,
.device-pill,
.backend-options span {
  overflow-wrap: anywhere;
}
.flow-copy strong {
  color: var(--text-strong);
  font-size: 0.98rem;
}
.flow-copy small {
  color: var(--muted);
  font-size: 0.78rem;
}
.source-pill,
.device-pill {
  display: flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid color-mix(in srgb, var(--surface-border) 76%, transparent);
  background: color-mix(in srgb, var(--surface) 68%, transparent);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.25;
}
.source-pill {
  gap: 0.48rem;
  padding: 0.58rem 0.7rem;
  border-radius: 11px;
}
.source-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 15%, transparent);
  flex: none;
}
.sync-lane {
  display: grid;
  grid-template-columns: minmax(118px, 0.92fr) minmax(30px, 0.22fr) minmax(142px, 1fr);
  align-items: center;
  gap: 0.8rem;
}
.device-stack {
  display: grid;
  gap: 0.48rem;
}
.device-pill {
  justify-content: space-between;
  padding: 0.55rem 0.68rem;
  border-radius: 10px;
}
.device-pill::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: 0.55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 78%, #fff 10%);
  flex: none;
}
.flow-arrow {
  position: relative;
  display: block;
  height: 1px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 20%, transparent), color-mix(in srgb, var(--accent) 68%, transparent));
}
/* a summary-update pulse travelling the lane; the dot is 5px, absolutely
   positioned inside a 1px strip, so animating `left` reflows nothing */
@media (prefers-reduced-motion: no-preference) {
  .flow-arrow::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 80%, transparent);
    transform: translateY(-50%);
    animation: flow-pulse 2.4s ease-in-out infinite;
  }
}
@keyframes flow-pulse {
  0% { left: 0; opacity: 0; }
  18% { opacity: 1; }
  82% { opacity: 1; }
  100% { left: calc(100% - 5px); opacity: 0; }
}
.flow-arrow::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-top: 1px solid color-mix(in srgb, var(--accent) 75%, transparent);
  border-right: 1px solid color-mix(in srgb, var(--accent) 75%, transparent);
  transform: translateY(-50%) rotate(45deg);
}
.hub-node {
  min-height: 108px;
  align-items: center;
  background:
    radial-gradient(circle at 24px 24px, color-mix(in srgb, var(--accent-from) 18%, transparent), transparent 48px),
    color-mix(in srgb, var(--surface-2) 82%, transparent);
}
.hub-ring {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 64%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.hub-ring::before,
.hub-ring::after {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 46%, transparent);
  border-radius: inherit;
}
.hub-ring::after {
  inset: 17px;
  background: var(--accent);
  border: 0;
}
.backend-rail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  margin-top: clamp(1rem, 2.6vw, 1.45rem);
  padding-top: 1rem;
  border-top: 1px solid color-mix(in srgb, var(--surface-border) 70%, transparent);
}
.backend-rail .lede {
  max-width: 680px;
  margin: 0;
  font-size: 0.98rem;
}
.backend-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}
.backend-options span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 0.58rem;
  border: 1px solid color-mix(in srgb, var(--surface-border) 76%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 66%, transparent);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
}
@media (max-width: 920px) {
  .how-grid {
    grid-template-columns: 1fr;
    gap: 1.6rem;
  }
}
@media (max-width: 820px) {
  .backend-rail {
    grid-template-columns: 1fr;
  }
  .backend-options {
    justify-content: flex-start;
  }
}
@media (max-width: 620px) {
  .sync-lane {
    grid-template-columns: 1fr;
  }
  .flow-arrow::before { display: none; }
  .flow-arrow {
    width: 1px;
    height: 24px;
    justify-self: center;
    background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 20%, transparent), color-mix(in srgb, var(--accent) 68%, transparent));
  }
  .flow-arrow::after {
    right: auto;
    left: 50%;
    top: auto;
    bottom: -1px;
    transform: translateX(-50%) rotate(135deg);
  }
  .source-pill,
  .device-pill {
    min-height: 38px;
  }
  .flow-node {
    padding: 0.82rem;
  }
}

/* privacy — copy on the left, the actual wire payload on the right */
.privacy {
  border-top: 1px solid color-mix(in srgb, var(--surface-border) 72%, transparent);
}
.privacy-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(1.6rem, 4.5vw, 3.4rem);
  align-items: center;
}
.privacy-intro p { max-width: 46ch; color: var(--muted); }
.privacy-intro h3 { margin: 1.7rem 0 0.4rem; font-size: 0.95rem; }
.privacy-intro .never {
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
}
.privacy-intro .never li { position: relative; padding-left: 1.5rem; }
.privacy-intro .never li + li { margin-top: 0.5rem; }
.privacy-intro .never li::before {
  content: "\00d7";
  position: absolute;
  left: 0;
  top: -1px;
  color: var(--danger);
  font-weight: 800;
}
.privacy-payload { min-width: 0; }
.payload-window { box-shadow: var(--shadow); }
.payload-body { font-size: 0.78rem; line-height: 1.7; }
.payload-body .pk { color: #9ecbff; }
.payload-body .ps { color: #a5d6a7; }
.payload-body .pn { color: #f2cc60; }
.payload-body .pc { color: #8b949e; font-style: italic; }
.payload-cap { margin: 0.8rem 0 0; color: var(--muted); font-size: 0.88rem; }
@media (max-width: 900px) { .privacy-grid { grid-template-columns: 1fr; } }

/* final cta */
.final-cta {
  position: relative;
  isolation: isolate;
  text-align: center;
}
.final-cta::before { /* ambient glow bookending the hero stage */
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 12%;
  bottom: 0;
  width: 100vw;
  transform: translateX(-50%);
  background: radial-gradient(ellipse 56% 72% at 50% 100%, color-mix(in srgb, var(--accent-from) 13%, transparent), transparent 72%);
  pointer-events: none;
}
.final-mark {
  width: 86px;
  height: 86px;
  margin: 0 auto 1rem;
  object-fit: contain;
  filter: drop-shadow(0 10px 26px color-mix(in srgb, var(--accent-from) 35%, transparent));
}
.final-cta h2 { max-width: 24ch; margin-inline: auto; }
.final-cta .hero-actions { justify-content: center; }
.download-grid {
  width: min(720px, 100%);
  margin: 1.6rem auto 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  text-align: left;
}
.download-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-height: 88px;
  padding: 1rem;
  border: 1px solid var(--surface-border);
  border-radius: var(--r-md);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 68%, transparent);
  color: var(--text);
  text-decoration: none;
  box-shadow: none;
  transition: border-color .18s ease, color .18s ease, transform .18s ease, background .18s ease;
}
.download-card:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--text-strong);
  transform: translateY(-2px);
}
.download-card:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 3px;
}
.download-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--surface-border) 72%, #000 10%);
  flex: none;
}
.download-icon img { display: block; width: 22px; height: 22px; object-fit: contain; }
.download-card strong { display: block; color: var(--text-strong); font-size: 1rem; }
.download-card small { display: block; margin-top: 0.25rem; color: var(--muted); font-size: 0.82rem; line-height: 1.4; }
.download-arrow {
  margin-left: auto;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 800;
  transition: transform .18s ease, color .18s ease;
}
.download-card:hover .download-arrow { color: var(--text-strong); transform: translateY(2px); }
.source-note { margin: 1rem auto 0; color: var(--muted); font-size: 0.9rem; }
@media (max-width: 640px) { .download-grid { grid-template-columns: 1fr; } }

/* footer */
.footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 2rem 0 3rem; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; }
.footer a { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--muted); font-weight: 700; text-decoration: none; }
.footer a:hover { color: var(--text); }
@media (max-width: 680px) { .footer { flex-direction: column; align-items: flex-start; } }
