/* 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(48,52,56,0.72);
  --widget-bg-strong: rgba(48,52,56,0.78);
  --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, .feature-copy p { 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 + theme switches */
.switch { display: inline-flex; align-items: center; height: 38px; padding: 0 0.22rem; gap: 2px; border: 1px solid var(--surface-border); border-radius: 999px; background: var(--surface); }
.switch button {
  border: 0; border-radius: 999px; background: transparent; color: var(--muted);
  min-width: 34px; height: 30px; padding: 0 0.6rem; font: inherit; font-weight: 800; font-size: 0.8rem; cursor: pointer; line-height: 1;
  transition: color .15s ease, background .15s ease;
}
.switch button:hover { color: var(--text); }
.switch button[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 16%, var(--surface) 58%);
  color: var(--text-strong);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}
.site-header .switch {
  border-color: var(--nav-control-border);
  background: var(--nav-control-bg);
}
.site-header .switch button { color: var(--nav-muted); }
.site-header .switch button:hover { color: var(--nav-text); }
.site-header .switch button[aria-pressed="true"] {
  background: color-mix(in srgb, var(--nav-text) 13%, var(--nav-control-bg) 87%);
  color: var(--nav-text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--nav-text) 13%, transparent);
}
.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, .switch button: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); }

/* real Token Monitor widget preview used in the hero */
.product-stack {
  position: relative;
  min-height: 610px;
  perspective: 1200px;
}

.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%);
  color: var(--widget-text);
  font-family: var(--mono);
}

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

.app-widget-back {
  inset: 18px 86px 176px 2px;
  z-index: 1;
  opacity: 0.62;
  transform: rotateY(-12deg) rotateX(5deg) rotateZ(-5deg);
}

.app-widget-front {
  right: 0;
  bottom: 20px;
  z-index: 4;
  width: 55%;
  min-height: 190px;
  transform: 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);
}

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

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

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

.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;
}

.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; }

.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-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 used in the feature showcase — same surface and
   .tm-* type system as the hero widget, but in normal flow (no 3D stack) so
   each feature 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(28px) saturate(116%);
  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-title-dot { color: #58bfca; }
.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-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; }

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

/* scrollable list regions — scroll inside the widget to reveal more rows (like the app).
   scrollbar is hidden (macOS-style); a partially-clipped row hints there's more below. */
.tm-scroll { overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; }
.tm-scroll::-webkit-scrollbar { width: 0; height: 0; display: none; }
.app-frame .tm-breakdown.tm-scroll { max-height: 182px; }
.app-frame .tm-limits.tm-scroll { max-height: 318px; }

/* AI Tool Limits view — sits directly under the title bar (no repeated totals header) */
.app-frame .tm-limits { margin-top: 0; }
.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 — sits directly under the title bar (no repeated totals header) */
.app-frame .tm-crumb { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 0; }
.tm-crumb-back { color: var(--widget-muted); font-size: 14px; font-weight: 800; }
.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; }
/* the session card has two pages: the per-reply detail (default) and the session
   list. ‹ sessions and the list rows swap between them; min-height keeps the card
   from resizing on swap so the section below never jumps (main.js sets data-view). */
.tm-sessions { margin-top: 6px; min-height: 300px; }
.tm-view { display: none; }
.tm-sessions[data-view="detail"] .tm-view-detail,
.tm-sessions[data-view="list"] .tm-view-list { display: block; }
.tm-back { padding: 0; border: 0; background: none; color: var(--widget-muted); font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; transition: color .15s ease; }
.tm-back:hover { color: var(--widget-text); }
.tm-crumb-title { 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-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; }

/* list page — each row opens its session detail */
.tm-list { margin-top: 4px; }
.tm-litem { display: block; width: 100%; padding: 9px 8px; border: 0; border-radius: 12px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background .15s ease; }
.tm-litem:hover { background: rgba(255,255,255,0.05); }
.tm-litem + .tm-litem { margin-top: 2px; }
.tm-litem-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.tm-litem-title { min-width: 0; overflow: hidden; font-size: 14px; font-weight: 800; white-space: nowrap; text-overflow: ellipsis; }
.tm-litem-val { font-size: 14px; font-weight: 800; white-space: nowrap; }
.tm-litem-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 5px 0 0 30px; color: #8b94a1; font-size: 11px; }
.tm-litem-cost { color: #b8c0ce; }
.tm-litem .tm-bar { margin: 8px 0 0 30px; }

/* compact session feature card: this is intentionally not the full widget
   chrome. It keeps the app's icon/tabs but omits the total token/cost header,
   so the landing-page card stays short and focused on session detail. */
.app-frame-session {
  max-width: 440px;
}

.app-frame-session .tm-inner {
  padding: 16px 16px 17px;
}

.app-frame-session .tm-sessions {
  height: 260px;
  min-height: 0;
  margin-top: 0;
  overflow: hidden;
}

.app-frame-session .tm-view {
  height: 100%;
  overflow: hidden;
}

.app-frame-session .tm-titlebar {
  margin-bottom: 14px;
}

.app-frame-session .tm-title {
  font-size: 20px;
}

.app-frame-session .tm-crumb {
  margin-bottom: 10px;
}

.app-frame-session .tm-back,
.app-frame-session .tm-crumb-title {
  font-size: 15px;
}

.app-frame-session .tm-pill {
  padding: 6px 11px;
  border-radius: 13px;
  font-size: 11px;
}

.app-frame-session .tm-session-feed {
  overflow: hidden;
}

.app-frame-session .tm-sess {
  column-gap: 10px;
}

.app-frame-session .tm-sess + .tm-sess {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px dashed rgba(232,238,244,0.10);
}

.app-frame-session .tm-caret {
  padding-top: 3px;
  font-size: 12px;
}

.app-frame-session .tm-sess-collapsed .tm-caret::before {
  content: "\25B8";
}

.app-frame-session .tm-sess-title,
.app-frame-session .tm-sess-val {
  font-size: 14px;
}

.app-frame-session .tm-sess-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.15;
}

.app-frame-session .tm-sess-body .tm-bar {
  height: 6px;
  margin-top: 5px;
}

.app-frame-session .tm-replies {
  margin-top: 6px;
  margin-left: 0;
  padding-left: 16px;
  overflow: hidden;
  border-left-color: rgba(232,238,244,0.16);
}

.app-frame-session .tm-reply {
  margin-top: 5px;
}

.app-frame-session .tm-reply-name,
.app-frame-session .tm-reply-val {
  font-size: 13px;
}

.app-frame-session .tm-reply-name {
  color: var(--widget-muted);
}

.app-frame-session .tm-reply-val {
  color: var(--widget-text);
}

.app-frame-session .tm-reply-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  color: #8b94a1;
  font-size: 10.5px;
  line-height: 1.15;
  white-space: nowrap;
}

.app-frame-session .tm-reply-meta span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-frame-session .tm-reply-cost {
  margin-left: 8px;
}

.app-frame-session .tm-tool-line {
  color: #8b94a1;
  font-size: 10.5px;
  line-height: 1.15;
  margin-top: 1px;
  white-space: nowrap;
}

.app-frame-session .tm-list {
  overflow: hidden;
}

.app-frame-session .tm-litem {
  padding: 0 0 12px;
  border-radius: 0;
  border-bottom: 1px solid rgba(232,238,244,0.10);
}

/* right metrics column stacks cost over a disclosure chevron, like the real widget */
.app-frame-session .tm-litem-end {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
.app-frame-session .tm-litem-go {
  color: #8b94a1;
  font-size: 14px;
  line-height: 1;
}

.app-frame-session .tm-litem:hover {
  background: none;
}

.app-frame-session .tm-litem + .tm-litem {
  margin-top: 13px;
}

.app-frame-session .tm-litem-head {
  gap: 10px;
}

.app-frame-session .tm-litem-title,
.app-frame-session .tm-litem-val {
  font-size: 14px;
}

.app-frame-session .tm-litem-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  margin: 5px 0 0 30px;
  font-size: 11px;
  line-height: 1.22;
}

.app-frame-session .tm-litem-meta span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.app-frame-session .tm-litem-cost {
  white-space: nowrap;
}

.app-frame-session .tm-litem .tm-bar {
  height: 7px;
  margin-top: 8px;
}

/* 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: 1120px) {
  .mini-session-widget {
    padding: 13px 14px 14px;
  }
  .mini-session-row {
    gap: 10px;
    margin-top: 11px;
  }
  .mini-session-title,
  .mini-session-value {
    font-size: 12px;
  }
  .mini-session-meta,
  .mini-session-value span {
    font-size: 10px;
  }
}

@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; }
  .switch button { min-width: 32px; }
}

/* 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; }
  .tm-inner { padding: 18px; }
  .tm-title { font-size: 20px; }
  .tm-tabs span { padding: 8px 11px; font-size: 11px; }
  .tm-titlebar { margin-bottom: 25px; }
  .tm-label { font-size: 13px; }
  .tm-total { font-size: 46px; }
  .tm-row-name, .tm-row-value { font-size: 15px; }
  .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;
  }
  .tm-inner { padding: 17px 19px 18px; }
  .tm-titlebar { margin-bottom: 24px; }
  .tm-title { font-size: 19px; }
  .tm-tabs span {
    padding: 8px 11px;
    font-size: 11px;
  }
  .tm-label { font-size: 13px; }
  .tm-total {
    margin-top: 10px;
    font-size: 47px;
  }
  .tm-cost { font-size: 13px; }
  .tm-breakdown { margin-top: 24px; }
  .tm-row {
    margin-top: 13px;
    padding-bottom: 12px;
  }
  .tm-row-name,
  .tm-row-value { font-size: 15px; }
  .tm-row-value span { font-size: 11px; }
  .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(-4deg) rotateX(2deg);
  }
  .app-widget-back,
  .app-widget-front { display: none; }
  .tm-inner { padding: 14px; }
  .tm-titlebar {
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
  }
  .tm-title { font-size: 17px; }
  .tm-tabs { padding: 3px; }
  .tm-tabs span {
    padding: 7px 8px;
    font-size: 10px;
  }
  .tm-label { font-size: 11px; }
  .tm-total {
    margin-top: 9px;
    font-size: 34px;
  }
  .tm-cost {
    margin-top: 6px;
    font-size: 12px;
  }
  .tm-breakdown { margin-top: 20px; }
  .tm-row {
    margin-top: 12px;
    padding-bottom: 11px;
  }
  .tm-row-head {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
  }
  .tm-row-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .tm-row-name,
  .tm-row-value { font-size: 13px; }
  .tm-row-value {
    grid-column: auto;
    text-align: right;
    white-space: nowrap;
  }
  .tm-row-value span { font-size: 10px; }
  .tm-icon {
    width: 16px;
    height: 16px;
  }
  .tm-icon img {
    width: 15px;
    height: 15px;
  }
  .tm-bar {
    height: 5px;
    margin-top: 9px;
  }
  .tm-row:nth-child(4),
  .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: 100%;
    width: calc(100vw - 32px);
    max-width: 100%;
    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: 100%;
    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; }
  .tm-inner { padding: 17px; }
  .tm-titlebar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
  }
  .tm-total { font-size: 36px; }
  .tm-row-name, .tm-row-value { font-size: 15px; }
  .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%);
  }
}

/* feature showcase */
.features {
  padding-top: clamp(3rem, 6vw, 5rem);
}
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(2rem,5vw,4rem);
  margin-bottom: clamp(3rem,6vw,5rem);
}
.feature-row:last-child { margin-bottom: 0; }
.feature-row .feature-visual { order: 2; }
.feature-row.reverse .feature-copy { order: 2; }
.feature-row.reverse .feature-visual { order: 1; }
.feature-copy p { color: var(--muted); font-size: 1.05rem; }
@media (max-width: 900px) {
  .feature-row, .feature-row.reverse { grid-template-columns: 1fr; }
  .feature-row .feature-visual, .feature-row.reverse .feature-visual,
  .feature-row.reverse .feature-copy { order: 0; }
}

/* 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;
}
.mode-map {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: clamp(1.4rem, 4vw, 3.5rem);
  align-items: stretch;
}
.mode-panel {
  position: relative;
  overflow: hidden;
  min-height: 392px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: clamp(1.1rem, 2vw, 1.45rem);
  padding: clamp(1.05rem, 2.4vw, 1.55rem);
  border: 1px solid color-mix(in srgb, var(--surface-border) 84%, transparent);
  border-radius: var(--r-md);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 46%),
    color-mix(in srgb, var(--surface) 58%, transparent);
}
.mode-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 38%, transparent), transparent);
  opacity: 0.75;
}
.mode-sync {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 14%, transparent), transparent 52%),
    color-mix(in srgb, var(--surface-2) 60%, transparent);
}
.mode-copy {
  position: relative;
  z-index: 1;
}
.mode-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 0.8rem;
  padding: 0 0.6rem;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--surface-border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--link);
  font-size: 0.74rem;
  font-weight: 800;
}
.mode-panel h3 {
  font-size: clamp(1.18rem, 2.1vw, 1.45rem);
}
.mode-panel p {
  max-width: 34rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}
.mode-visual {
  position: relative;
  z-index: 1;
  align-self: stretch;
  min-height: 190px;
  border-top: 1px solid color-mix(in srgb, var(--surface-border) 70%, transparent);
  padding-top: clamp(1rem, 2vw, 1.25rem);
}
.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-node-primary {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--surface-border));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-from) 16%, transparent), transparent 70%),
    color-mix(in srgb, var(--surface-2) 76%, transparent);
}
.flow-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--text-strong);
  color: var(--on-strong);
  font-size: 2rem;
  font-weight: 850;
  line-height: 1;
}
.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;
}
.local-loop {
  display: grid;
  align-content: center;
  gap: 1rem;
}
.local-sources {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.68rem;
  padding-top: 1.15rem;
}
.local-sources::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 1px;
  height: 0.85rem;
  background: color-mix(in srgb, var(--accent) 50%, var(--surface-border));
}
.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));
}
.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: 820px) {
  .mode-map {
    grid-template-columns: 1fr;
  }
  .mode-panel {
    min-height: auto;
  }
  .backend-rail {
    grid-template-columns: 1fr;
  }
  .backend-options {
    justify-content: flex-start;
  }
}
@media (max-width: 620px) {
  .local-sources,
  .sync-lane {
    grid-template-columns: 1fr;
  }
  .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 */
.privacy-card {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 2rem;
  padding: clamp(1.5rem,4vw,3rem);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 11%, transparent), transparent 44%),
    color-mix(in srgb, var(--surface) 58%, transparent);
  backdrop-filter: blur(14px);
}
.privacy-card p { color: var(--muted); }
.privacy-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.privacy-lists ul { margin: 0.5rem 0 0; padding-left: 1.1rem; color: var(--muted); }
.privacy-lists li + li { margin-top: 0.5rem; }
.privacy-lists .never li::marker { color: var(--danger); }
@media (max-width: 860px) { .privacy-card { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .privacy-lists { grid-template-columns: 1fr; } }

/* final cta */
.final-cta { text-align: center; }
.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; }
.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; } }
