/* ============================================================
   Sen website — design tokens
   One token set, six themes. The theme IS the mode: there is no
   separate dark/light toggle, exactly like the app.
   ============================================================ */

:root {
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;

  /* fixed brand hues (trademark marks — colour is the point) */
  --dialect-pg: #7baad6;
  --dialect-my: #e48e00;
  --dialect-sl: #58b7e0;
  --dialect-ms: #e05c4b;

  --radius: 12px;
  --radius-sm: 8px;
  --nav-h: 64px;
  --wrap: 1160px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---- Sen Sprig (brand default) ---- */
[data-theme="sen"] {
  color-scheme: dark;
  --bg: #0b120e;
  --bg-soft: #0e1510;
  --panel: #111a14;
  --panel-2: #0d1410;
  --border: rgba(233, 226, 208, 0.10);
  --border-strong: rgba(233, 226, 208, 0.22);
  --text: #e9e2d0;
  --muted: #93a094;
  --accent: #7cc7a0;
  --accent-soft: rgba(124, 199, 160, 0.13);
  --on-accent: #0b120e;
  --danger-fg: #e58b84;
  --danger-bg: rgba(224, 101, 92, 0.14);
  --code-bg: #0d1410;
  --code-border: rgba(233, 226, 208, 0.08);
  --syn-kw: #82cfa4;
  --syn-str: #e3c08a;
  --syn-num: #e8a35c;
  --syn-com: #5e6b60;
  --syn-fn: #8fb4e3;
  --glow: rgba(124, 199, 160, 0.16);
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.55);
}

/* ---- Everforest Dark ---- */
[data-theme="everforest"] {
  color-scheme: dark;
  --bg: #262e34;
  --bg-soft: #2a333a;
  --panel: #2e373d;
  --panel-2: #293136;
  --border: rgba(211, 198, 170, 0.10);
  --border-strong: rgba(211, 198, 170, 0.24);
  --text: #d3c6aa;
  --muted: #8b9c8f;
  --accent: #a7c080;
  --accent-soft: rgba(167, 192, 128, 0.13);
  --on-accent: #262e34;
  --danger-fg: #e67e80;
  --danger-bg: rgba(230, 126, 128, 0.13);
  --code-bg: #2a333a;
  --code-border: rgba(211, 198, 170, 0.09);
  --syn-kw: #a7c080;
  --syn-str: #dbbc7f;
  --syn-num: #e69875;
  --syn-com: #6c7a77;
  --syn-fn: #7fbbb3;
  --glow: rgba(167, 192, 128, 0.14);
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.5);
}

/* ---- Tokyo Night ---- */
[data-theme="tokyo"] {
  color-scheme: dark;
  --bg: #1a1b26;
  --bg-soft: #1e2030;
  --panel: #1f2133;
  --panel-2: #1b1d2b;
  --border: rgba(192, 202, 245, 0.11);
  --border-strong: rgba(192, 202, 245, 0.26);
  --text: #c0caf5;
  --muted: #9aa5ce;
  --accent: #7aa2f7;
  --accent-soft: rgba(122, 162, 247, 0.13);
  --on-accent: #10131f;
  --danger-fg: #f7768e;
  --danger-bg: rgba(247, 118, 142, 0.12);
  --code-bg: #16161e;
  --code-border: rgba(192, 202, 245, 0.09);
  --syn-kw: #bb9af7;
  --syn-str: #9ece6a;
  --syn-num: #ff9e64;
  --syn-com: #5c6388;
  --syn-fn: #7aa2f7;
  --glow: rgba(122, 162, 247, 0.16);
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.6);
}

/* ---- Catppuccin Mocha ---- */
[data-theme="catppuccin"] {
  color-scheme: dark;
  --bg: #181825;
  --bg-soft: #1b1b2b;
  --panel: #1e1e2e;
  --panel-2: #191927;
  --border: rgba(205, 214, 244, 0.11);
  --border-strong: rgba(205, 214, 244, 0.26);
  --text: #cdd6f4;
  --muted: #a6adc8;
  --accent: #cba6f7;
  --accent-soft: rgba(203, 166, 247, 0.13);
  --on-accent: #181825;
  --danger-fg: #f38ba8;
  --danger-bg: rgba(243, 139, 168, 0.12);
  --code-bg: #141420;
  --code-border: rgba(205, 214, 244, 0.09);
  --syn-kw: #cba6f7;
  --syn-str: #a6e3a1;
  --syn-num: #fab387;
  --syn-com: #6c7086;
  --syn-fn: #89b4fa;
  --glow: rgba(203, 166, 247, 0.16);
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.55);
}

/* ---- Gruvbox Dark ---- */
[data-theme="gruvbox"] {
  color-scheme: dark;
  --bg: #1d2021;
  --bg-soft: #222425;
  --panel: #262829;
  --panel-2: #212324;
  --border: rgba(235, 219, 178, 0.11);
  --border-strong: rgba(235, 219, 178, 0.26);
  --text: #ebdbb2;
  --muted: #bdae93;
  --accent: #a9b665;
  --accent-soft: rgba(169, 182, 101, 0.13);
  --on-accent: #1d2021;
  --danger-fg: #fb7061;
  --danger-bg: rgba(251, 73, 52, 0.12);
  --code-bg: #1a1c1d;
  --code-border: rgba(235, 219, 178, 0.09);
  --syn-kw: #fb4934;
  --syn-str: #b8bb26;
  --syn-num: #fe8019;
  --syn-com: #928374;
  --syn-fn: #fabd2f;
  --glow: rgba(169, 182, 101, 0.14);
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.55);
}

/* ---- Flexoki Light (the one light theme — still a theme, not a toggle) ---- */
[data-theme="flexoki"] {
  color-scheme: light;
  --bg: #fffcf0;
  --bg-soft: #f7f3e8;
  --panel: #f4f0e4;
  --panel-2: #faf7ee;
  --border: rgba(16, 15, 15, 0.13);
  --border-strong: rgba(16, 15, 15, 0.32);
  --text: #100f0f;
  --muted: #5f5e59;
  --accent: #205d46;
  --accent-soft: rgba(32, 93, 70, 0.10);
  --on-accent: #fffcf0;
  --danger-fg: #af3029;
  --danger-bg: rgba(175, 48, 41, 0.09);
  --code-bg: #f0ebdf;
  --code-border: rgba(16, 15, 15, 0.10);
  --syn-kw: #4f45ad;
  --syn-str: #205d46;
  --syn-num: #bc5215;
  --syn-com: #878580;
  --syn-fn: #0d6678;
  --glow: rgba(32, 93, 70, 0.12);
  --shadow: 0 24px 60px -30px rgba(16, 15, 15, 0.28);
}

/* ============================================================
   Base
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.45s var(--ease), color 0.45s var(--ease);
}

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.12;
  margin: 0;
  letter-spacing: -0.015em;
  font-weight: 600;
}

h1 em, h2 em {
  font-style: normal;
  color: var(--accent);
}

p { margin: 0; }
code { font-family: var(--font-mono); font-size: 0.86em; }
a { color: inherit; }
img { display: block; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

::selection { background: var(--accent-soft); color: var(--text); }

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

kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 6px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--bg-soft);
  color: var(--muted);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 200;
  padding: 8px 14px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 40px);
}
.wrap.narrow { max-width: 860px; }

.section { padding-block: clamp(72px, 9vw, 116px); }

.sec-head { max-width: 640px; margin-bottom: clamp(36px, 5vw, 52px); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

h2 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); margin-bottom: 14px; }

.sec-sub { color: var(--muted); font-size: 16px; max-width: 58ch; }

/* ============================================================
   Buttons & pills
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14.5px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease),
              background-color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 8px 24px -10px var(--glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -10px var(--glow); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover { transform: translateY(-2px); background: var(--accent-soft); }

.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 8px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
}
.pill-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.link-btn {
  color: var(--accent);
  font-weight: 600;
  padding: 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
.link-btn:hover { border-color: var(--accent); }

/* ============================================================
   Nav
   ============================================================ */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 24px;
  padding-inline: clamp(16px, 3vw, 32px);
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  gap: 4px;
  margin-inline: auto;
}
.nav-links a {
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s, background-color 0.15s;
}
.nav-links a:hover { color: var(--text); background: var(--accent-soft); }

.nav-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.nav-links + .nav-actions { margin-left: 0; }

.palette-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  font-size: 13px;
  color: var(--muted);
  background: var(--bg-soft);
  transition: border-color 0.15s, color 0.15s;
}
.palette-trigger:hover { border-color: var(--accent); color: var(--text); }
.palette-trigger svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.palette-trigger kbd { margin-left: 4px; }
.palette-trigger kbd i { font-style: normal; }

/* ============================================================
   Hero
   ============================================================ */

.hero {
  position: relative;
  min-height: max(92svh, 640px);
  display: flex;
  align-items: center;
  overflow: hidden;
}

#heroCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
  cursor: grab;
}
#heroCanvas.dragging { cursor: grabbing; }

.hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg,
      color-mix(in srgb, var(--bg) 94%, transparent) 0%,
      color-mix(in srgb, var(--bg) 55%, transparent) 30%,
      transparent 55%),
    radial-gradient(52% 44% at 76% 38%, var(--glow), transparent 70%),
    radial-gradient(40% 34% at 16% 78%, var(--accent-soft), transparent 72%);
  transition: background 0.45s var(--ease);
}

.hero-inner {
  position: relative;
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding: calc(var(--nav-h) + 40px) clamp(20px, 4vw, 40px) 80px;
}

.hero-copy { max-width: 640px; }

h1 {
  font-size: clamp(2.7rem, 6.4vw, 4.7rem);
  margin: 22px 0 20px;
  letter-spacing: -0.03em;
}

.lede {
  font-size: clamp(16px, 1.9vw, 18.5px);
  color: var(--muted);
  max-width: 54ch;
  margin-bottom: 30px;
}

.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 40px; }

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.stat-row li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 26px;
  border-left: 1px solid var(--border);
}
.stat-row li:first-child { border-left: none; padding-left: 0; }
.stat-row strong {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
}
.stat-row span { font-size: 12px; color: var(--muted); letter-spacing: 0.04em; }

.hero-hint {
  position: absolute;
  right: clamp(20px, 4vw, 44px);
  bottom: 96px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  pointer-events: none;
  animation: hint-nudge 3.2s var(--ease) infinite;
}
.hero-hint svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

@keyframes hint-nudge {
  0%, 100% { transform: translateX(0); opacity: 0.75; }
  50% { transform: translateX(6px); opacity: 1; }
}

.hero-scroll {
  position: absolute;
  left: 50%;
  bottom: 28px;
  width: 24px;
  height: 38px;
  border: 1.5px solid var(--border-strong);
  border-radius: 14px;
  transform: translateX(-50%);
}
.hero-scroll span {
  position: absolute;
  left: 50%;
  top: 7px;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--accent);
  animation: scroll-dot 2s var(--ease) infinite;
}
@keyframes scroll-dot {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(12px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ============================================================
   Dialect strip
   ============================================================ */

.strip { padding-block: clamp(28px, 4vw, 48px); }

.strip-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.strip-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.22s var(--ease), border-color 0.22s var(--ease);
}
.strip-card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.strip-card img { margin-bottom: 8px; }
.strip-card h3 { font-size: 14.5px; }
.strip-card p { font-size: 12.5px; color: var(--muted); line-height: 1.5; }

/* ============================================================
   App window mock
   ============================================================ */

.demo { padding-top: clamp(40px, 6vw, 72px); }

.window-mock {
  max-width: 1040px;
  margin-inline: auto;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  font-size: 13px;
}

.win-titlebar {
  display: flex;
  align-items: center;
  height: 42px;
  padding-inline: 14px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
}
.win-brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 13px; }
.win-center { flex: 1; display: flex; justify-content: center; }
.win-kbd {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 11.5px;
  color: var(--muted);
  background: var(--bg-soft);
}
.win-kbd svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.win-controls { display: flex; gap: 7px; }
.win-controls span { width: 11px; height: 11px; border-radius: 50%; background: var(--border-strong); }
.win-controls span:last-child { background: var(--danger-bg); border: 1px solid var(--danger-fg); }

.win-body {
  display: grid;
  grid-template-columns: 226px 1fr;
  min-height: 480px;
}

/* — sidebar tree — */
.win-side {
  border-right: 1px solid var(--border);
  background: var(--panel-2);
  padding: 12px 10px;
  font-size: 12px;
}
.win-side-head {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 2px 8px 10px;
}
.win-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 4px 10px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--muted);
  font-size: 11.5px;
  background: var(--bg-soft);
}
.win-filter svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; }
.win-tree { list-style: none; margin: 0; padding: 0; color: var(--muted); }
.win-tree li { display: flex; align-items: center; gap: 7px; padding: 4px 8px; border-radius: 6px; }
.win-tree li.ind1 { padding-left: 22px; }
.win-tree li.ind2 { padding-left: 38px; }
.win-tree li.active { background: var(--accent-soft); color: var(--text); }
.t-caret {
  width: 0; height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  opacity: 0.55;
}
.t-caret.open { transform: rotate(90deg); }
.t-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px var(--glow); }
.t-group {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.72;
  margin-top: 6px;
}

/* — main pane — */
.win-main { display: flex; flex-direction: column; min-width: 0; }

.win-tabs {
  display: flex;
  align-items: stretch;
  gap: 2px;
  padding: 6px 10px 0;
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
}
.win-tabs [role="tab"] {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--muted);
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  transition: color 0.15s, background-color 0.15s;
}
.win-tabs [role="tab"]:hover { color: var(--text); }
.win-tabs [role="tab"][aria-selected="true"] {
  color: var(--text);
  background: var(--panel);
  border-color: var(--border);
}
.win-tabs .dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.pg { background: var(--dialect-pg); }
.dot.my { background: var(--dialect-my); }
.dot.sl { background: var(--dialect-sl); }
.dot.ms { background: var(--dialect-ms); }
.win-tab-plus { align-self: center; padding: 0 10px; color: var(--muted); }

.win-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
}
.win-run {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 7px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 12px;
  font-weight: 600;
  transition: transform 0.15s var(--ease), filter 0.15s;
}
.win-run:hover { filter: brightness(1.08); }
.win-run:active { transform: scale(0.97); }
.win-run svg { width: 11px; height: 11px; fill: currentColor; }
.win-run.running { opacity: 0.75; }
.win-tool-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.toggle {
  width: 26px; height: 15px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  position: relative;
  transition: background-color 0.2s, border-color 0.2s;
}
.toggle i {
  position: absolute;
  top: 1.5px; left: 2px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.2s var(--ease), background-color 0.2s;
}
.toggle.on { background: var(--accent-soft); border-color: var(--accent); }
.toggle.on i { transform: translateX(11px); background: var(--accent); }
.win-conn {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
}

/* — editor — */
.win-editor {
  display: flex;
  min-height: 208px;
  background: var(--code-bg);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
}
.win-gutter {
  padding: 12px 10px 12px 16px;
  color: var(--syn-com);
  text-align: right;
  user-select: none;
  border-right: 1px solid var(--code-border);
}
.win-gutter span { display: block; }
.win-code { flex: 1; margin: 0; padding: 12px 16px; overflow: hidden; white-space: pre-wrap; word-break: break-word; }
.type-cursor {
  display: inline-block;
  width: 7px;
  height: 1.05em;
  margin-left: 1px;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: blink 1.05s steps(1) infinite;
}
.type-cursor.busy { animation: none; }
@keyframes blink { 50% { opacity: 0; } }

.tk-kw { color: var(--syn-kw); font-weight: 600; }
.tk-str { color: var(--syn-str); }
.tk-num { color: var(--syn-num); }
.tk-com { color: var(--syn-com); font-style: italic; }
.tk-fn { color: var(--syn-fn); }
.tk-id { color: var(--text); }
.tk-op { color: var(--muted); }

/* — results — */
.win-results { border-top: 1px solid var(--border); background: var(--panel); }
.win-res-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--border);
}
.res-tab {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
.res-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.res-meta {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
}
.res-meta.running { color: var(--accent); }

.win-grid-wrap { min-height: 138px; max-height: 168px; overflow: auto; }
.win-grid-wrap table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 11.5px; }
.win-grid-wrap th {
  position: sticky;
  top: 0;
  background: var(--panel);
  text-align: left;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 7px 14px;
  border-bottom: 1px solid var(--border);
}
.win-grid-wrap td {
  padding: 6px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  white-space: nowrap;
}
.win-grid-wrap td.num { text-align: right; font-variant-numeric: tabular-nums; }
.win-grid-wrap td.null { color: var(--muted); font-style: italic; }
.win-grid-wrap td.pk { color: var(--accent); }
.win-grid-wrap tr { animation: row-in 0.35s var(--ease) both; }
@keyframes row-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.empty-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 138px;
  color: var(--muted);
  font-size: 12px;
}

.demo-note {
  text-align: center;
  margin-top: 22px;
  font-size: 12.5px;
  color: var(--muted);
}

/* ============================================================
   Bento features
   ============================================================ */

.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

.card {
  position: relative;
  grid-column: span 2;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty, 0));
}
.card:hover { border-color: var(--border-strong); --ty: -3px; }
.card.span3 { grid-column: span 3; }

/* cursor spotlight */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), var(--accent-soft), transparent 65%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
}
.card:hover::before { opacity: 1; }

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}
.card-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.card h3 { font-size: 16px; margin-bottom: 8px; }
.card p { font-size: 13.5px; color: var(--muted); }
.card p code {
  background: var(--accent-soft);
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 0.9em;
}

/* ============================================================
   Split sections (editor / security)
   ============================================================ */

.split {
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  gap: clamp(36px, 5vw, 72px);
  align-items: center;
}

.check-list { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 18px; }
.check-list li { display: flex; gap: 14px; font-size: 14.5px; color: var(--muted); }
.check-list strong { color: var(--text); font-weight: 600; }
.check-list kbd { font-size: 9.5px; padding: 1px 5px; }
.check {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
}
.check svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* — completion mini editor — */
.mini-editor {
  position: relative;
  padding: 22px 22px 18px;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
}
.mini-code .ln {
  display: inline-block;
  width: 18px;
  margin-right: 12px;
  color: var(--syn-com);
  text-align: right;
  user-select: none;
}
.completion-caret {
  display: inline-block;
  width: 7px; height: 1.05em;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: blink 1.05s steps(1) infinite;
}

.completion-pop {
  position: relative;
  margin: 14px 0 0 30px;
  max-width: 340px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: pop-in 0.5s var(--ease) both;
  animation-delay: 0.5s;
}
@keyframes pop-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.cp-head {
  padding: 7px 12px;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.completion-pop ul { list-style: none; margin: 0; padding: 4px; }
.cp-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 12px;
  color: var(--text);
}
.cp-item code { font-size: 12px; }
.cp-item.hot { background: var(--accent-soft); }
.cp-kind {
  flex: none;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 5px;
}
.cp-kind.col { background: var(--accent-soft); color: var(--accent); }
.cp-kind.tbl { background: color-mix(in srgb, var(--syn-fn) 14%, transparent); color: var(--syn-fn); }
.cp-kind.fn  { background: color-mix(in srgb, var(--syn-num) 14%, transparent); color: var(--syn-num); }
.cp-detail { margin-left: auto; font-size: 10.5px; color: var(--muted); }

.mini-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--code-border);
}
.sq-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--danger-bg);
  color: var(--danger-fg);
  font-size: 10.5px;
  font-weight: 600;
  font-family: var(--font-mono);
}
.sq-pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sq-hint { font-size: 11px; color: var(--muted); }

/* ============================================================
   Themes
   ============================================================ */

.theme-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}

.theme-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.theme-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.theme-card[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 10px 26px -14px var(--glow);
}

.swatches { display: flex; gap: 6px; margin-bottom: 10px; }
.swatches i {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
}
.theme-name { font-weight: 600; font-size: 13.5px; font-family: var(--font-display); }
.theme-mode { font-size: 11px; color: var(--muted); }

/* ============================================================
   Performance
   ============================================================ */

.perf { position: relative; overflow: hidden; }

#gridCanvas {
  position: absolute;
  inset: auto 0 0 0;
  width: 100%;
  height: 52%;
  pointer-events: none;
}
.perf::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    var(--bg) 12%,
    color-mix(in srgb, var(--bg) 90%, transparent) 50%,
    color-mix(in srgb, var(--bg) 52%, transparent) 80%,
    transparent 98%
  );
  pointer-events: none;
}

.perf-inner { position: relative; z-index: 1; }

.perf-facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 48px;
  max-width: 880px;
}
.perf-facts li {
  padding: 18px 0;
  border-top: 1px solid var(--border);
}
.perf-facts strong {
  display: block;
  font-family: var(--font-display);
  font-size: 16px;
  margin-bottom: 4px;
}
.perf-facts span { font-size: 13px; color: var(--muted); }

.perf-hint {
  margin-top: 42px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.8;
}

/* ============================================================
   Security filemap
   ============================================================ */

.filemap {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 0;
  box-shadow: var(--shadow);
}
.fm-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
}
.fm-row + .fm-row { border-top: 1px solid var(--border); }
.fm-row code { font-size: 12.5px; color: var(--accent); }
.fm-row span { margin-left: auto; font-size: 12px; color: var(--muted); text-align: right; }
.fm-key svg { width: 15px; height: 15px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ============================================================
   Download
   ============================================================ */

.dl-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.dl-card {
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dl-card.primary {
  grid-column: 1 / -1;
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.dl-card.planned { opacity: 0.85; }

.dl-head { display: flex; align-items: center; gap: 14px; }
.dl-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}
.dl-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dl-title h3 { font-size: 16.5px; }
.dl-meta { font-size: 12.5px; color: var(--muted); font-family: var(--font-mono); }
.dl-head .pill { margin-left: auto; }

.dl-btn { justify-content: center; font-size: 15px; }

.dl-hash {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius-sm);
}
.dl-hash > span {
  flex: none;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.dl-hash code {
  flex: 1;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dl-note { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.dl-note code { background: var(--accent-soft); padding: 1px 5px; border-radius: 5px; }

.env-caption {
  padding: 12px 4px 0;
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.env-grid { margin-top: 26px; display: grid; gap: 0; }
.env-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 18px;
  padding: 12px 4px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}
.env-row code { color: var(--accent); font-size: 12.5px; }

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  font-family: var(--font-body);
  font-size: 11.5px;
  color: var(--muted);
  transition: color 0.15s, border-color 0.15s;
}
.copy-btn:hover { color: var(--text); border-color: var(--accent); }
.copy-btn svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.copy-btn.copied { color: var(--accent); border-color: var(--accent); }

@media (max-width: 760px) {
  .dl-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Footer
   ============================================================ */

.footer {
  border-top: 1px solid var(--border);
  padding: 36px 0 44px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
}
.footer-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; }
.footer-tag { font-family: var(--font-body); font-weight: 400; font-size: 12.5px; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-inline: auto; }
.footer-links a, .footer-links .link-btn {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-links a:hover, .footer-links .link-btn:hover { color: var(--text); }
.footer-note { width: 100%; font-size: 12px; color: var(--muted); opacity: 0.8; }

/* ============================================================
   Command palette
   ============================================================ */

.palette-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: color-mix(in srgb, var(--bg) 55%, rgba(0, 0, 0, 0.5));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 14vh 20px 20px;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}
.palette-overlay.open { opacity: 1; }
.palette-overlay[hidden] { display: none; }

.palette {
  width: 100%;
  max-width: 560px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: translateY(-10px) scale(0.985);
  transition: transform 0.22s var(--ease);
}
.palette-overlay.open .palette { transform: none; }

.palette-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.palette-input-row svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.palette-input-row input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
}
.palette-input-row input::placeholder { color: var(--muted); }

.palette-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.palette-list li[role="option"] {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13.5px;
  color: var(--text);
  cursor: pointer;
}
.palette-list li[aria-selected="true"] { background: var(--accent-soft); }
.palette-list mark {
  background: none;
  color: var(--accent);
  font-weight: 700;
}
.p-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
}
.p-icon svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.p-swatch { flex: none; width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--border-strong); }
.p-hint { margin-left: auto; }
.p-section {
  padding: 10px 12px 4px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.palette-empty { padding: 22px; text-align: center; font-size: 13px; color: var(--muted); }

.palette-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--muted);
}
.palette-foot kbd { margin-right: 3px; }
.palette-foot-note { margin-left: auto; opacity: 0.75; font-style: italic; }

/* ============================================================
   Toast
   ============================================================ */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 400;
  transform: translate(-50%, 16px);
  padding: 11px 20px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 16px 40px -12px var(--glow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================
   Reveal on scroll
   ============================================================ */

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease) var(--d, 0s), transform 0.7s var(--ease) var(--d, 0s);
}
[data-reveal].is-visible { opacity: 1; transform: none; }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1020px) {
  .card, .card.span3 { grid-column: span 3; }
  .theme-grid { grid-template-columns: repeat(3, 1fr); }
  .nav-links { display: none; }
}

@media (max-width: 760px) {
  .strip-grid { grid-template-columns: repeat(2, 1fr); }
  .win-body { grid-template-columns: 1fr; }
  .win-side { display: none; }
  .split { grid-template-columns: 1fr; }
  .perf-facts { grid-template-columns: 1fr; }
  .palette-trigger-label, .palette-trigger kbd { display: none; }
  .hero-hint { display: none; }
  .stat-row li { padding-inline: 18px; }
  #heroCanvas { opacity: 0.5; }
}

@media (max-width: 560px) {
  .card, .card.span3 { grid-column: span 6; }
  .theme-grid { grid-template-columns: repeat(2, 1fr); }
  .strip-grid { grid-template-columns: 1fr; }
  .win-tabs [role="tab"] { padding: 8px 10px; font-size: 11px; }
  .win-conn { display: none; }
  .nav-actions .btn { display: none; }
  .footer-note { display: none; }
}

/* ============================================================
   Reduced motion — everything still works, nothing dances
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .hero-scroll span, .hero-hint { animation: none; }
}
