/* ============================================================
   SELF-HOSTED FACES — served from /fonts so first paint never
   waits on a third-party handshake. Each family keeps Google's
   unicode-range split, so latin-ext only downloads if a page
   actually uses a character from it.
   ============================================================ */
/* Fraunces 300 900 — latin-ext */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("./fonts/fraunces-300-900-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Fraunces 300 900 — latin */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("./fonts/fraunces-300-900-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Geist 300 700 — latin-ext */
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("./fonts/geist-300-700-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Geist 300 700 — latin */
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("./fonts/geist-300-700-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* JetBrains Mono 400 — latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/jetbrains-mono-400-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* JetBrains Mono 400 — latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/jetbrains-mono-400-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* JetBrains Mono 700 — latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./fonts/jetbrains-mono-700-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* JetBrains Mono 700 — latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./fonts/jetbrains-mono-700-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;

  /* ============================================================
     THEME TOKENS — raw values for both skins, defined once.
     The "active theme" block below just points --x at --x-light
     or --x-dark; nothing else in this file references *-light/
     *-dark directly.
     ============================================================ */
  --bg-light: #faf9f7;
  --ink-light: #16171b;
  --muted-light: #62666d;
  --tertiary-light: #969aa2;
  --hairline-light: rgba(20, 20, 24, 0.1);
  --dot-bg-light: rgba(20, 20, 24, 0.18);
  --accent-light: #4f46e5;
  --accent-press-light: #4338ca;
  --accent-soft-light: rgba(79, 70, 229, 0.12);
  --accent-glow-light: rgba(79, 70, 229, 0.07);
  --ghost-light: #b3b6bd;
  --panel-light: rgba(255, 255, 255, 0.7);
  --panel-solid-light: #ffffff;
  --panel-border-light: rgba(20, 20, 24, 0.08);
  --panel-tint-light: rgba(255, 255, 255, 0.3);
  --editor-bg-light: rgba(255, 255, 255, 0.88);
  --header-bg-light: rgba(250, 249, 247, 0.82);
  --switch-hover-bg-light: rgba(20, 20, 24, 0.045);
  --switch-active-bg-light: #ffffff;
  --key-top-light: #ffffff;
  --key-bottom-light: #eeeef0;
  --key-shadow-light: 0 1.5px 0 rgba(20, 20, 24, 0.14);
  --button-bg-light: linear-gradient(180deg, #2b2c31, #0c0c0e);
  --button-ink-light: #ffffff;
  --button-highlight-light: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  --button-ring-light: rgba(190, 192, 255, 1); /* cursor glow-ring on the black cap */
  --shadow-highlight-light: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  --shadow-contact-light: 0 1px 2px rgba(15, 15, 20, 0.06), 0 3px 8px rgba(15, 15, 20, 0.05);
  --shadow-ambient-light: 0 30px 70px rgba(15, 15, 20, 0.1), 0 10px 26px rgba(15, 15, 20, 0.06);
  --shadow-float-light: 0 16px 36px rgba(15, 15, 20, 0.1);

  --bg-dark: #08090a;
  --ink-dark: #f2f3f5;
  --muted-dark: #9a9ea7;
  --tertiary-dark: #676b74;
  --hairline-dark: rgba(255, 255, 255, 0.09);
  --dot-bg-dark: rgba(255, 255, 255, 0.14);
  --accent-dark: #6d70f5;
  --accent-press-dark: #8285ff;
  --accent-soft-dark: rgba(109, 112, 245, 0.18);
  --accent-glow-dark: rgba(109, 112, 245, 0.15);
  --ghost-dark: #54565e;
  --panel-dark: rgba(255, 255, 255, 0.045);
  --panel-solid-dark: #131418;
  --panel-border-dark: rgba(255, 255, 255, 0.09);
  --panel-tint-dark: rgba(255, 255, 255, 0.035);
  --editor-bg-dark: rgba(19, 20, 24, 0.92);
  --header-bg-dark: rgba(8, 9, 10, 0.72);
  --switch-hover-bg-dark: rgba(255, 255, 255, 0.06);
  --switch-active-bg-dark: #1b1c21;
  --key-top-dark: #2b2c32;
  --key-bottom-dark: #1a1b1f;
  --key-shadow-dark: 0 1.5px 0 rgba(0, 0, 0, 0.6);
  --button-bg-dark: linear-gradient(180deg, #8386ff, #5457e0);
  --button-ink-dark: #ffffff;
  --button-highlight-dark: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  --button-ring-dark: rgba(230, 231, 255, 1); /* cursor glow-ring on the indigo cap */
  --shadow-highlight-dark: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --shadow-contact-dark: 0 1px 2px rgba(0, 0, 0, 0.6), 0 3px 10px rgba(0, 0, 0, 0.5);
  --shadow-ambient-dark: 0 40px 90px rgba(0, 0, 0, 0.65), 0 14px 34px rgba(0, 0, 0, 0.45);
  --shadow-float-dark: 0 18px 40px rgba(0, 0, 0, 0.5);

  /* ---- active theme: Paper (light) is the default ---- */
  --bg: var(--bg-light);
  --ink: var(--ink-light);
  --muted: var(--muted-light);
  --tertiary: var(--tertiary-light);
  --hairline: var(--hairline-light);
  --dot-bg: var(--dot-bg-light);
  --accent: var(--accent-light);
  --accent-press: var(--accent-press-light);
  --accent-soft: var(--accent-soft-light);
  --accent-glow: var(--accent-glow-light);
  --ghost: var(--ghost-light);
  --panel: var(--panel-light);
  --panel-solid: var(--panel-solid-light);
  --panel-border: var(--panel-border-light);
  --panel-tint: var(--panel-tint-light);
  --editor-bg: var(--editor-bg-light);
  --header-bg: var(--header-bg-light);
  --switch-hover-bg: var(--switch-hover-bg-light);
  --switch-active-bg: var(--switch-active-bg-light);
  --key-top: var(--key-top-light);
  --key-bottom: var(--key-bottom-light);
  --key-shadow: var(--key-shadow-light);
  --button-bg: var(--button-bg-light);
  --button-ink: var(--button-ink-light);
  --button-highlight: var(--button-highlight-light);
  --button-ring: var(--button-ring-light);
  --shadow-highlight: var(--shadow-highlight-light);
  --shadow-contact: var(--shadow-contact-light);
  --shadow-ambient: var(--shadow-ambient-light);
  --shadow-float: var(--shadow-float-light);

  --font-ui: "Geist", system-ui, -apple-system, sans-serif;
  --font-display: "Geist", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  /* The demo editor mimics real Mac apps, so it uses the OS text font. */
  --font-system: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --container: 1120px;
  --demo-window-height: 302px; /* fixed TOTAL window height (header + body) */
  --radius: 14px;
  --radius-lg: 22px;
  --ease-soft: cubic-bezier(0.22, 0.7, 0.2, 1);
}

/* OS preference, only when the visitor hasn't picked a theme explicitly. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--bg-dark);
    --ink: var(--ink-dark);
    --muted: var(--muted-dark);
    --tertiary: var(--tertiary-dark);
    --hairline: var(--hairline-dark);
    --dot-bg: var(--dot-bg-dark);
    --accent: var(--accent-dark);
    --accent-press: var(--accent-press-dark);
    --accent-soft: var(--accent-soft-dark);
    --accent-glow: var(--accent-glow-dark);
    --ghost: var(--ghost-dark);
    --panel: var(--panel-dark);
    --panel-solid: var(--panel-solid-dark);
    --panel-border: var(--panel-border-dark);
    --panel-tint: var(--panel-tint-dark);
    --editor-bg: var(--editor-bg-dark);
    --header-bg: var(--header-bg-dark);
    --switch-hover-bg: var(--switch-hover-bg-dark);
    --switch-active-bg: var(--switch-active-bg-dark);
    --key-top: var(--key-top-dark);
    --key-bottom: var(--key-bottom-dark);
    --key-shadow: var(--key-shadow-dark);
    --button-bg: var(--button-bg-dark);
    --button-ink: var(--button-ink-dark);
    --button-highlight: var(--button-highlight-dark);
    --button-ring: var(--button-ring-dark);
    --shadow-highlight: var(--shadow-highlight-dark);
    --shadow-contact: var(--shadow-contact-dark);
    --shadow-ambient: var(--shadow-ambient-dark);
    --shadow-float: var(--shadow-float-dark);
    color-scheme: dark;
  }
}

/* Explicit visitor choice (the header toggle), wins regardless of OS. */
:root[data-theme="dark"] {
  --bg: var(--bg-dark);
  --ink: var(--ink-dark);
  --muted: var(--muted-dark);
  --tertiary: var(--tertiary-dark);
  --hairline: var(--hairline-dark);
  --dot-bg: var(--dot-bg-dark);
  --accent: var(--accent-dark);
  --accent-press: var(--accent-press-dark);
  --accent-soft: var(--accent-soft-dark);
  --accent-glow: var(--accent-glow-dark);
  --ghost: var(--ghost-dark);
  --panel: var(--panel-dark);
  --panel-solid: var(--panel-solid-dark);
  --panel-border: var(--panel-border-dark);
  --panel-tint: var(--panel-tint-dark);
  --editor-bg: var(--editor-bg-dark);
  --header-bg: var(--header-bg-dark);
  --switch-hover-bg: var(--switch-hover-bg-dark);
  --switch-active-bg: var(--switch-active-bg-dark);
  --key-top: var(--key-top-dark);
  --key-bottom: var(--key-bottom-dark);
  --key-shadow: var(--key-shadow-dark);
  --button-bg: var(--button-bg-dark);
  --button-ink: var(--button-ink-dark);
  --button-highlight: var(--button-highlight-dark);
  --button-ring: var(--button-ring-dark);
  --shadow-highlight: var(--shadow-highlight-dark);
  --shadow-contact: var(--shadow-contact-dark);
  --shadow-ambient: var(--shadow-ambient-dark);
  --shadow-float: var(--shadow-float-dark);
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
::selection { background: var(--accent-soft); }

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 60;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--panel-solid);
  color: var(--ink);
  box-shadow: var(--shadow-ambient);
  transform: translateY(-140%);
  transition: transform 0.16s ease;
}
.skip-link:focus { transform: none; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--hairline);
  background: var(--header-bg);
  backdrop-filter: blur(22px) saturate(1.22);
  -webkit-backdrop-filter: blur(22px) saturate(1.22);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(calc(100% - 48px), var(--container));
  min-height: 64px;
  margin: 0 auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: "Fraunces", var(--font-display);
  font-optical-sizing: auto;
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.brand-mark {
  position: relative;
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--panel-solid);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow-highlight), var(--shadow-contact);
}
.brand-glyph {
  display: block;
  width: 21px;
  height: 21px;
}
main { position: relative; z-index: 1; }

/* ---------- THEME TOGGLE ---------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
}
.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--tertiary);
  transition: background 0.16s var(--ease-soft), color 0.16s var(--ease-soft), box-shadow 0.16s var(--ease-soft);
}
.theme-btn svg { display: block; width: 15px; height: 15px; }
.theme-btn:hover { color: var(--ink); }
.theme-btn.active {
  background: var(--switch-active-bg);
  color: var(--ink);
  box-shadow: var(--shadow-highlight), var(--shadow-contact);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  width: min(calc(100% - 48px), var(--container));
  margin: 0 auto;
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 36px;
  padding: 64px 0 90px;
  min-height: 86vh;
  align-content: center;
}
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -8% -12% auto -12%;
  height: 130%;
  background: radial-gradient(56% 52% at 50% 32%, var(--accent-glow), transparent 72%);
  pointer-events: none;
}
/* Fine film-grain over the flat ground: a tiled SVG feTurbulence noise tile
   (no image asset) blended with soft-light so it modulates the existing
   theme colors instead of adding a gray wash. Covers the full viewport
   (not just .hero's own contained width) so the texture reads as part of
   the page ground, not a box around the hero copy. */
.hero::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
  opacity: 0.05;
  mix-blend-mode: soft-light;
  pointer-events: none;
}
.hero-copy { max-width: 760px; }
h1 {
  margin: 0 0 20px;
  font-family: "Fraunces", var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(44px, 7.2vw, 84px);
  line-height: 0.94;
  color: var(--ink);
}
h1 .em { font-style: normal; color: var(--accent-press); }
/* Continuous weight animation on the accent line. Fraunces glyphs get wider
   as they get heavier, so animating a phrase in normal flow makes every
   character crawl sideways. Fix: JS wraps each character in a fixed-width
   slot (.em-ch) sized by an invisible in-flow copy pinned at the HEAVIEST
   animated weight (::before, which also gives the slot its baseline), while
   the VISIBLE glyph (.em-g) is absolutely positioned over it at a FIXED
   origin. Two hard-won rules here:
   - the glyph must be out-of-flow, so 60fps weight updates never reflow
     the line;
   - its origin must never be a function of its own animated width — both
     text-align centering and left:50% + translateX(-50%) re-derive the
     position every frame, and WebKit pixel-snaps those sub-pixel shifts,
     which reads as ugly per-letter jitter in Safari (Blink/Gecko render
     them fractionally and hide the problem). Anchored at left:0, nothing
     ever moves: the outline just thickens in place, and the slot's slack
     sits uniformly on the right of every char — reads as a constant touch
     of letter-spacing, not off-centering.
   Words are wrapped (.em-word) so lines break only at spaces. */
.em-word { display: inline-block; }
.em-ch {
  position: relative;
  display: inline-block;
}
.em-ch::before {
  content: attr(data-ch);
  visibility: hidden; /* occupies space at the widest state the engine can reach */
  font-variation-settings: "wght" 700;
}
.em-g {
  position: absolute;
  top: 0;
  left: 0;
}
.hero-subhead { margin: 0 auto; max-width: 30em; color: var(--muted); font-size: clamp(17px, 1.6vw, 21px); }
/* The metric pops from the muted subhead in both themes: --ink is near-black
   on the light ground and near-white on the dark one. */
.subhead-metric { color: var(--ink); font-weight: 600; }
.hero-actions { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 28px; flex-wrap: wrap; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 16px;
  transition: transform 0.16s var(--ease-soft), box-shadow 0.2s var(--ease-soft);
}
.button-glyph {
  width: 19px;
  height: 19px;
  margin-top: -3px; /* optically centre the Apple mark against the cap text */
  flex: none;
}
.button-primary {
  position: relative;
  border: none;
  background: var(--button-bg);
  color: var(--button-ink);
  box-shadow: var(--button-highlight), var(--shadow-contact), var(--shadow-ambient);
}
.button-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--button-highlight), var(--shadow-contact), 0 20px 40px var(--accent-glow),
    var(--shadow-ambient);
}
.button-primary:active {
  transform: translateY(0);
  box-shadow: var(--button-highlight), var(--shadow-contact);
}
/* Cursor-tracked glow ring: a soft light rides the pill's edge nearest the
   pointer, masked to just the border band. --mx/--my are set from JS; the ring
   also lights (centred) on keyboard focus. */
.button-ring {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s var(--ease-soft);
  background: radial-gradient(130px circle at var(--mx, 50%) var(--my, 50%), var(--button-ring),
      transparent 58%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
.button-primary.glow-on .button-ring,
.button-primary:focus-visible .button-ring {
  opacity: 1;
}
.link-quiet { color: var(--muted); font-size: 15px; font-weight: 500; border-bottom: 1px solid var(--hairline); padding-bottom: 2px; }
.link-quiet:hover { color: var(--ink); }

/* ---------- EDITOR / DEMO (single realistic editor, morphing ghost) ---------- */
.hero-demo-wrap { width: 100%; max-width: min(100%, 720px); margin: 0 auto; }
.editor-window {
  position: relative;
  margin: 0 auto;
  overflow: hidden;
  /* Fixed total height so the window doesn't jump when the per-app header changes
     size; the header keeps its natural height and the editor body flexes to fill
     whatever's left. */
  height: var(--demo-window-height);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  /* More opaque than the site's glass panels: real app windows are solid, and
     it keeps the demo text readable regardless of what's behind it. */
  background: var(--editor-bg);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow-highlight), var(--shadow-contact), var(--shadow-ambient);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
}
.window-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 16px;
  height: 46px;
  border-bottom: 1px solid var(--hairline);
  background: linear-gradient(180deg, var(--panel-tint), transparent);
}
.win-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(46%, 260px);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  pointer-events: none;
}
.traffic-lights { display: flex; gap: 7px; }
.traffic-lights span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--dot-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 -1px 1px rgba(0, 0, 0, 0.1);
}
.window-app {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.window-app .demo-app-icon { width: 16px; height: 16px; }
.window-app-name { letter-spacing: 0.01em; }
/* Brand glyphs (Gmail/Slack/Claude/ChatGPT/Notion) are flat single-color marks
   with no background of their own — on a dark ground a near-black mark
   (Notion, ChatGPT) would vanish. Give every one of them the same neutral
   tile so they read regardless of page theme, matching how these apps' real
   icons look anyway. */
.demo-app-icon,
.app-switch img {
  box-sizing: border-box;
  background: #fdfdfd;
  object-fit: contain;
}
.demo-app-icon { border-radius: 5px; padding: 2.5px; }

/* ---- Gmail "New Message" compose chrome ---- */
.mail-fields {
  display: flex;
  flex-direction: column;
  font-family: var(--font-system);
  background: var(--panel-tint);
}
.mail-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 34px;
  border-bottom: 1px solid var(--hairline);
  font-size: 13.5px;
  line-height: 1.2;
}
.mail-label {
  flex: 0 0 auto;
  width: 48px;
  color: var(--tertiary);
}
.mail-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(66, 133, 244, 0.16);
  color: #6d9fff;
  font-size: 13px;
}
.mail-subject { color: var(--ink); font-weight: 500; }

/* ---- Slack channel chrome ---- */
.slack-context {
  display: flex;
  gap: 10px;
  padding: 12px 34px 14px;
  font-family: var(--font-system);
  background: var(--panel-tint);
  border-bottom: 1px solid var(--hairline);
}
.slack-avatar {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  /* Pull the avatar up so its center lands on the name line, not the
     midpoint of the whole two-line block below it. */
  margin-top: -6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #611f69, #4a154b); /* Slack aubergine */
}
.slack-msg { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.slack-meta { display: flex; align-items: baseline; gap: 8px; }
.slack-name { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.slack-time { font-size: 11.5px; color: var(--tertiary); }
.slack-text { font-size: 13.5px; line-height: 1.4; color: var(--muted); }

/* ---- Notion page chrome ---- */
.notion-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 34px 6px;
  font-family: var(--font-system);
}
.notion-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0; /* let the row shrink below its content width so the title can ellipsize */
  font-size: 21px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.notion-emoji { flex: 0 0 auto; font-size: 22px; line-height: 1; }
/* The window's height is fixed per app, sized off each header's natural height —
   a title that's free to wrap to a second line grows the header and can squeeze
   the typed-text area down to almost nothing. Force one line, always. */
.notion-title-text {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
}

/* ---- AI chat chrome (Claude, ChatGPT) ---- */
.chat-context {
  display: flex;
  gap: 10px;
  padding: 12px 34px 14px;
  font-family: var(--font-system);
  background: var(--panel-tint);
  border-bottom: 1px solid var(--hairline);
}
.chat-avatar {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  /* Pull the avatar up so its center lands on the name line, not the
     midpoint of the whole two-line block below it. */
  margin-top: -6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
}
/* ChatGPT's mark is flat near-black with no color of its own (unlike
   Claude's coral), so on this dark accent-soft bubble it nearly vanishes —
   give it the same neutral tile other flat glyphs already use. */
.chat-avatar img {
  box-sizing: border-box;
  width: 20px;
  height: 20px;
  padding: 3px;
  border-radius: 50%;
  background: #fdfdfd;
  object-fit: contain;
  display: block;
}
.chat-msg { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.chat-name { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.chat-text { font-size: 13.5px; line-height: 1.4; color: var(--muted); }

/* `.hero` sets text-align:center for the centered hero copy; every real app
   window rendered inside it needs left-aligned text like a normal app does. */
.app-header { flex: 0 0 auto; text-align: left; } /* natural height; never squashed */
.editor-body {
  flex: 1 1 auto; /* absorbs the header-height difference between apps */
  min-height: 0;
  padding: 26px 34px 30px;
  overflow: hidden;
  text-align: left;
}
.editor-doc {
  width: 100%;
  font-family: var(--font-system);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
  letter-spacing: -0.003em;
  color: var(--ink);
  overflow-wrap: anywhere;
  text-align: left;
}
.tw-line { margin: 0; }
.tw-line + .tw-line { margin-top: 0.7em; }
.tw-written, .tw-commit { color: var(--ink); }
.tw-commit.flash { animation: acceptFlash 440ms var(--ease-soft); }
.tw-ghost { color: var(--ghost); }
.tw-caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin: 0 1px;
  vertical-align: -0.18em;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-soft);
  animation: blink 1.05s steps(2, start) infinite;
}
.tw-tab {
  display: none;
  align-items: center;
  margin-left: 8px;
  vertical-align: 0.04em;
}
/* Fade the keycap in when a suggestion appears, instead of hard-popping it on
   every chunk — the pop-in/pop-out churn read as a "weird" repeated animation. */
.tw-tab.show { display: inline-flex; animation: tabFadeIn 0.2s var(--ease-soft); }
/* On accept: pulse the key once, then remove the whole hint so it doesn't linger.
   `forwards` on both animations keeps them at their faded-out end state instead of
   snapping the ripple's glow back to full opacity when the animation completes. */
.tw-tab.press { animation: tabPressOut 480ms var(--ease-soft) forwards; }
.tw-tab.press kbd { animation: tabKeyPress 240ms ease-out; }
.tw-tab.press kbd::after {
  content: "";
  position: absolute;
  inset: -7px -8px;
  border: 1px solid var(--accent);
  border-radius: 9px;
  box-shadow: 0 0 18px var(--accent-soft);
  animation: tabKeyRipple 240ms ease-out forwards;
  pointer-events: none;
}
kbd {
  position: relative;
  display: inline-flex;
  min-width: 29px;
  height: 20px;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: linear-gradient(180deg, var(--key-top), var(--key-bottom));
  border: 1px solid var(--panel-border);
  box-shadow: var(--key-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
}
@keyframes blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }
@keyframes acceptFlash {
  0% { color: var(--accent-press); text-shadow: 0 0 18px var(--accent-soft); }
  100% { color: var(--ink); text-shadow: none; }
}
@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes tabPressOut {
  0% { opacity: 1; }
  50% { opacity: 1; }   /* hold through the key-press pulse */
  100% { opacity: 0; }  /* then remove the hint entirely */
}
@keyframes tabKeyPress {
  0% { transform: translateY(0) scale(1); }
  42% { transform: translateY(1px) scale(0.94); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes tabKeyRipple {
  0% { opacity: 0.7; transform: scale(0.86); }
  100% { opacity: 0; transform: scale(1.4); }
}

/* ---------- APP SWITCHER (icons drive which app the demo types in) ---------- */
.app-switcher {
  display: flex;
  gap: 6px;
  width: max-content;
  max-width: 100%;
  margin: 24px auto 0;
  padding: 7px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow-float);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
}
.app-switch {
  position: relative;
  display: inline-flex;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  transform-origin: center bottom;
  will-change: transform;
  transition: transform 0.18s var(--ease-soft), background 0.18s var(--ease-soft),
    box-shadow 0.18s var(--ease-soft), border-color 0.18s var(--ease-soft);
}
/* While the dock is being magnified, JS drives transforms per-frame — drop the
   transition so icons track the cursor 1:1 instead of lagging behind it. */
.app-switcher.magnifying .app-switch { transition: background 0.18s var(--ease-soft), box-shadow 0.18s var(--ease-soft), border-color 0.18s var(--ease-soft); }
.app-switch img {
  width: 29px;
  height: 29px;
  border-radius: 7px;
  padding: 4px;
  opacity: 0.66;
  transition: opacity 0.18s var(--ease-soft);
}
.app-switch:hover { background: var(--switch-hover-bg); transform: translateY(-2px); }
.app-switch:hover img { opacity: 0.92; }
.app-switch:active { transform: translateY(0) scale(0.94); }
.app-switch.active {
  background: var(--switch-active-bg);
  border-color: var(--panel-border);
  box-shadow: var(--shadow-highlight), var(--shadow-contact);
}
.app-switch.active img { opacity: 1; }
.app-switch.active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-50%);
  box-shadow: 0 0 8px var(--accent-soft);
}
/* Non-interactive "and everywhere else" cue: a stack of app icons. */
.app-everywhere {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
}
.stack {
  display: inline-flex;
  align-items: center;
}
.stack img {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  border: 2px solid var(--bg);
  box-shadow: var(--shadow-contact);
}
.stack img + img { margin-left: -13px; }

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

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { border-top: 1px solid var(--hairline); margin-top: 40px; }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
  width: min(calc(100% - 48px), var(--container));
  margin: 0 auto;
  padding: 28px 0;
}
.footer-brand {
  font-family: "Fraunces", var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
}
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a { font-size: 14px; font-weight: 500; color: var(--muted); }
.footer-links a:hover { color: var(--ink); }
.footer-copy { margin: 0; font-size: 13px; color: var(--tertiary); }

/* ============================================================
   INNER-PAGE HERO (compatibility, and any future subpage)
   ============================================================ */
.page-hero {
  width: min(calc(100% - 48px), var(--container));
  margin: 0 auto;
  padding: 56px 0 8px;
  text-align: left;
}
.page-hero h1 { font-size: clamp(32px, 5.4vw, 52px); line-height: 1.05; margin: 0 0 16px; }
.page-subhead { margin: 0; max-width: 56ch; color: var(--muted); font-size: clamp(16px, 1.4vw, 18px); }

/* ---- status legend ---- */
.compat-legend {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 28px;
  width: min(calc(100% - 48px), var(--container));
  margin: 36px auto 0;
  padding: 22px 24px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
}
.compat-legend li { display: flex; align-items: baseline; gap: 10px; font-size: 14px; color: var(--muted); }
.compat-legend .status-badge { flex: 0 0 auto; }

/* ---- table of contents ---- */
.compat-toc {
  width: min(calc(100% - 48px), var(--container));
  margin: 28px auto 0;
  padding: 24px 26px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
}
.compat-toc-label {
  margin: 0 0 12px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tertiary);
}
.compat-toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.compat-toc > ol > li > a {
  display: inline-block;
  padding: 3px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  transition: color 0.16s var(--ease-soft);
}
.compat-toc ol ol { margin: 3px 0 12px; padding-left: 18px; border-left: 1px solid var(--hairline); }
.compat-toc ol ol a {
  display: inline-block;
  padding: 2px 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.16s var(--ease-soft);
}
.compat-toc a:hover { color: var(--accent-press); }

/* ---- category sections + tables ---- */
.compat-section {
  width: min(calc(100% - 48px), var(--container));
  margin: 0 auto;
  padding: 52px 0 0;
  scroll-margin-top: 84px; /* clears the sticky header when a contents link lands here */
}
.compat-section h2 {
  margin: 0 0 6px;
  font-family: "Fraunces", var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: 24px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.compat-section-intro { margin: 0 0 8px; color: var(--muted); font-size: 15px; max-width: 60ch; }

/* Each category (Browsers, Email, ...) is a subsection nested inside the single
   "Compatibility by app" section above — its own scroll target + smaller heading
   than the parent section, so the contents nesting reads visually too. */
.compat-subsection { margin-top: 36px; scroll-margin-top: 84px; }
.compat-subsection h3 {
  margin: 0 0 14px;
  font-family: "Fraunces", var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.compat-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel-tint);
}
/* table-layout: fixed + an explicit width on the Status column (rather than the
   usual "width: 1%" shrink-to-content trick) so every category table's Status
   column lines up at the same X position, regardless of that table's longest
   badge — "1%" would size each table independently off its own widest content
   (e.g. "Not yet supported" vs. just "TBD"), which is what caused the misalign. */
.compat-table { width: 100%; border-collapse: collapse; font-size: 14.5px; table-layout: fixed; }
.compat-table th {
  text-align: left;
  padding: 12px 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tertiary);
  border-bottom: 1px solid var(--hairline);
}
.compat-table td { padding: 13px 20px; border-bottom: 1px solid var(--hairline); color: var(--ink); vertical-align: middle; }
.compat-table tr:last-child td { border-bottom: none; }
.compat-table td:last-child, .compat-table th:last-child { width: 200px; white-space: nowrap; }

.compat-app { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; }
.compat-icon { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; flex: 0 0 auto; }
img.compat-icon { background: #fdfdfd; border: 1px solid var(--panel-border); box-sizing: border-box; object-fit: cover; }

/* ---- status badges ---- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
  white-space: nowrap;
}
.status-badge svg { width: 13px; height: 13px; flex: 0 0 auto; }
.status-badge.is-works { border-color: transparent; background: var(--accent-soft); color: var(--accent-press); }
.status-badge.is-setup { color: var(--ink); }
.status-badge.is-partial { color: var(--muted); }
.status-badge.is-none { color: var(--tertiary); }
.status-badge.is-tbd { border-style: dashed; color: var(--tertiary); }

/* A status cell can optionally carry a quiet link under the badge, pointing at
   a matching per-app write-up in the "Setup notes" prose sections below —
   only present on rows that actually have one. */
.compat-detail-link {
  display: block;
  width: max-content;
  margin-top: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 1px;
}
.compat-detail-link:hover { color: var(--ink); border-color: var(--ink); }

/* ---- prose sections (why / report) ---- */
.compat-prose { width: min(calc(100% - 48px), var(--container)); margin: 0 auto; padding: 60px 0 0; scroll-margin-top: 84px; }
.compat-prose h2 {
  font-family: "Fraunces", var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: 24px;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
  color: var(--ink);
}
.compat-prose p { max-width: 62ch; color: var(--muted); font-size: 15.5px; }
.compat-prose p + p { margin-top: 14px; }
.compat-prose h3 {
  margin: 26px 0 10px;
  font-family: "Fraunces", var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.005em;
  color: var(--ink);
  scroll-margin-top: 84px;
}
.compat-prose ol { max-width: 62ch; margin: 10px 0 14px; padding-left: 22px; color: var(--muted); font-size: 15.5px; }
.compat-prose ol li + li { margin-top: 6px; }
.compat-prose strong { color: var(--ink); font-weight: 600; }
.compat-prose code {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--panel-tint);
  border: 1px solid var(--panel-border);
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--ink);
}
.compat-code {
  display: block;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  margin: 4px 0 14px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--panel-tint);
  border: 1px solid var(--panel-border);
  font-family: var(--font-mono);
  font-size: 13px;
  white-space: pre;
  color: var(--ink);
}

.compat-callout {
  width: min(calc(100% - 48px), var(--container));
  margin: 60px auto 90px;
  padding: 28px 30px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
  scroll-margin-top: 84px;
}
.compat-callout p { margin: 0; color: var(--muted); font-size: 15px; max-width: 62ch; }
.compat-callout a { color: var(--ink); border-bottom: 1px solid var(--hairline); padding-bottom: 1px; }
.compat-callout a:hover { border-color: var(--ink); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 760px) {
  :root { --demo-window-height: 336px; } /* total; body still ~220 after header */
  .hero { padding-top: 48px; min-height: auto; }
  .editor-body { padding: 22px 22px 26px; }
  .compat-legend { grid-template-columns: 1fr; }
  .compat-table th, .compat-table td { padding: 11px 14px; }
  .footer-inner { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .tw-caret { opacity: 1; }
}
