/* =====================================================================
   TermZ marketing site — design system
   Tokens lifted directly from the TermZ app (src/lib/theme/tokens.css)
   so the site and the product share one visual identity.
   ===================================================================== */

:root {
  /* ---- color roles (from the app's dark theme — src/lib/theme/tokens.css) ---- */
  --bg: #0e0b16;
  --surface: #16131f;
  --surface-raised: #1d1830;
  --surface-overlay: #251f38;
  --border: #2a2440;
  --border-strong: #3a3358;
  --text: #e7e3f4;
  --text-muted: #a39ec0;
  --text-faint: #6f6a8d;
  --accent: #7c5cff;
  --accent-hover: #8f74ff;
  --accent-fg: #ffffff;
  --accent-muted: rgba(124, 92, 255, 0.16);
  --green: #3ecf8e;
  --green-soft: rgba(62, 207, 142, 0.16);
  --status-warn: #e0a44a;
  --status-error: #e5484d;
  --status-info: #5b9dff;

  /* ---- glass + glow ---- */
  --glass-bg: rgba(22, 19, 31, 0.62);
  --glass-blur: 18px;
  --glass-border: rgba(255, 255, 255, 0.09);
  --glow-accent: 0 0 0 1px var(--accent), 0 0 22px -6px rgba(124, 92, 255, 0.55);
  --glow-accent-soft: 0 0 40px -10px rgba(124, 92, 255, 0.55);
  --shadow-accent-strong: 0 14px 40px -12px rgba(124, 92, 255, 0.8);

  /* ---- gradients ---- */
  --accent-gradient: linear-gradient(125deg, #c9bbff 0%, var(--accent) 45%, #3a2a86 100%);
  --wordmark-gradient: linear-gradient(95deg, #3ecf8e 0%, var(--accent) 55%, #d9ccff 100%);
  --header-rule: linear-gradient(90deg, #c9bbff 0%, #6a4bd6 42%, #2a2058 100%);
  --app-backdrop: radial-gradient(140% 104% at 50% 116%, #4a3a96 0%, #2a2058 30%, #15102e 56%, var(--bg) 80%);
  --dot-color: rgba(124, 92, 255, 0.08);

  /* ---- app-preview surfaces (mirror app token roles) ---- */
  --term-bg: #14111e;
  --term-fg: #d7d3ec;
  --term-card-bg: rgba(20, 17, 30, 0.86);
  --panel-bg: rgba(22, 19, 31, 0.74);
  --rail-bg: rgba(18, 15, 26, 0.82);

  /* ---- terminal text palette (Tokyo-Night-ish for dark) ---- */
  --t-prompt: #3ecf8e;
  --t-green: #3ecf8e;
  --t-violet: #bb9af7;
  --t-blue: #82aaff;
  --t-cyan: #6ad7ff;
  --t-amber: #ffcf6a;
  --t-pink: #ff85c0;
  --t-faint: #6f6a8d;

  /* ---- scales ---- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --font-ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --elevation-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --elevation-2: 0 6px 24px rgba(0, 0, 0, 0.45);
  --elevation-3: 0 24px 80px -20px rgba(0, 0, 0, 0.7);

  --maxw: 1180px;
  --header-h: 64px;
}

/* =====================================================================
   LIGHT THEME — palette lifted verbatim from the app's built-in light
   theme (zacterm/src/lib/theme/themes.ts → lightTheme). Mirrors how the
   app applies light mode: violet accent on a near-white base, opaque
   panels, a flat (glow-free) backdrop.
   ===================================================================== */
:root[data-theme="light"] {
  --bg: #f3f1fb;
  --surface: #ffffff;
  --surface-raised: #f1eef9;
  --surface-overlay: #ffffff;
  --border: #e3ddf1;
  --border-strong: #cdc4e4;
  --text: #1b1730;
  --text-muted: #574f74;
  --text-faint: #8a83a4;
  --accent: #6b46e8;
  --accent-hover: #593bd4;
  --accent-fg: #ffffff;
  --accent-muted: rgba(107, 70, 232, 0.12);
  --green: #1f9d57;
  --green-soft: rgba(31, 157, 87, 0.13);
  --status-warn: #b9770f;
  --status-error: #d12b35;
  --status-info: #2f6fd8;

  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glow-accent: 0 0 0 1px var(--accent), 0 0 22px -6px rgba(107, 70, 232, 0.45);
  --glow-accent-soft: 0 0 24px -10px rgba(107, 70, 232, 0.4);
  --shadow-accent-strong: 0 14px 40px -14px rgba(107, 70, 232, 0.5);

  /* Light mode: a DARKER, glow-free wordmark + a flat backdrop + flat rule,
     exactly as the app does for its near-white top bar. */
  --accent-gradient: linear-gradient(125deg, #b9a7ff 0%, var(--accent) 50%, #4a2db0 100%);
  --wordmark-gradient: linear-gradient(95deg, #1f9d6a 0%, var(--accent) 55%, #6a4bd6 100%);
  --header-rule: linear-gradient(90deg, var(--border), var(--border));
  --app-backdrop: var(--bg);
  --dot-color: rgba(107, 70, 232, 0.06);

  --term-bg: #fbfaff;
  --term-fg: #2a2640;
  --term-card-bg: #fbfaff;
  --panel-bg: #ffffff;
  --rail-bg: #f1eef9;

  --t-prompt: #1f9d57;
  --t-green: #1f9d57;
  --t-violet: #a14fe6;
  --t-blue: #2f6fd8;
  --t-cyan: #1390a8;
  --t-amber: #b9770f;
  --t-pink: #d6358f;
  --t-faint: #8a83a4;

  --elevation-2: 0 6px 24px rgba(40, 30, 80, 0.12);
  --elevation-3: 0 24px 80px -20px rgba(40, 30, 80, 0.22);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 17px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.4s ease, color 0.4s ease;
}

/* The from-below violet glow that defines the app's backdrop, fixed behind
   everything so it reads as ambient light through the whole page. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: var(--app-backdrop);
  background-attachment: fixed;
}
/* A faint dotted grid layered over the glow for terminal/technical texture. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(var(--dot-color) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent);
  pointer-events: none;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 0.4em;
  font-weight: 700;
}

p { margin: 0 0 1em; }

::selection { background: rgba(124, 92, 255, 0.4); color: #fff; }

/* ========================== layout ========================== */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

section { position: relative; padding: 110px 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 18px;
  padding: 6px 12px;
  border: 1px solid var(--green-soft);
  border-radius: 999px;
  background: var(--green-soft);
}
.eyebrow.violet { color: #b9a7ff; border-color: var(--accent-muted); background: var(--accent-muted); }

.section-head { max-width: 720px; margin: 0 auto 64px; text-align: center; }
.section-head h2 { font-size: clamp(2rem, 4vw, 3rem); }
.section-head p { color: var(--text-muted); font-size: 1.1rem; }

.grad-text {
  background: var(--wordmark-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ====================== buttons ====================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-family: var(--font-ui);
  font-size: 0.97rem;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.25s ease, background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
  box-shadow: var(--glow-accent-soft);
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px var(--accent), 0 14px 40px -12px rgba(124, 92, 255, 0.8);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-strong);
  color: var(--text);
  backdrop-filter: blur(6px);
}
.btn-ghost:hover { border-color: var(--accent); color: #fff; transform: translateY(-2px); }

.btn-lg { padding: 15px 30px; font-size: 1.05rem; }
.btn .ico { width: 18px; height: 18px; }

/* ====================== glass card + laser border ====================== */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--elevation-2);
}

/* Masked gradient ring, ported from the app's .laser-border utility. */
.laser {
  position: relative;
  isolation: isolate;
}
.laser::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: var(--accent-gradient);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.7;
  z-index: 1;
}

/* ========================= header / nav ========================= */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  z-index: 100;
  display: flex;
  align-items: center;
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border-bottom-color: var(--border);
}
/* The continuous "laser" rule beneath the header, like the app's chrome. */
.site-header.scrolled::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: var(--header-rule);
  opacity: 0.7;
}
.nav {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-links { display: flex; align-items: center; gap: 26px; margin-left: auto; }
.nav-links a {
  font-size: 0.95rem;
  transition: color 0.18s ease;
  position: relative;
}
/* Plain nav links use the muted color. The CTA is a filled button — EXCLUDE it
   so the nav color never overrides .btn-primary's on-accent (white) label
   (it was rendering dark-on-purple). */
.nav-links a:not(.cta) { color: var(--text-muted); }
.nav-links a:not(.cta):hover { color: var(--text); }

.brand { display: flex; align-items: center; gap: 11px; }
.brand img { width: 26px; height: 26px; filter: drop-shadow(0 0 8px rgba(62, 207, 142, 0.45)); }
.brand .wordmark {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  background: var(--wordmark-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-toggle {
  display: none;
  background: none;
  border: 0;
  color: var(--text);
  cursor: pointer;
  padding: 8px;
}

/* ============================== hero ============================== */
.hero {
  padding: calc(var(--header-h) + 90px) 0 90px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  max-width: 16ch;
  margin: 18px auto 22px;
}
.hero .lede {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: var(--text-muted);
  max-width: 60ch;
  margin: 0 auto 34px;
}
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-sub {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}

/* floating glow logo */
.hero-logo {
  width: 110px;
  height: 110px;
  margin: 0 auto;
  filter: drop-shadow(0 0 26px rgba(62, 207, 142, 0.45)) drop-shadow(0 0 60px rgba(124, 92, 255, 0.4));
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ===================== terminal mockup ===================== */
.terminal-wrap {
  max-width: 920px;
  margin: 70px auto 0;
  perspective: 1600px;
}
.terminal {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--term-card-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--elevation-3), var(--glow-accent-soft);
  transform: rotateX(8deg);
  transform-origin: center top;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.terminal.flat { transform: rotateX(0deg); }
.term-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 15px;
  background: var(--glass-bg);
  border-bottom: 1px solid var(--border);
}
.term-dot { width: 12px; height: 12px; border-radius: 50%; }
.term-dot.r { background: #ff5f57; }
.term-dot.y { background: #febc2e; }
.term-dot.g { background: #28c840; }
.term-title {
  margin-left: 12px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}
.term-body {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  padding: 22px 24px;
  min-height: 320px;
  line-height: 1.75;
  text-align: left;
  color: var(--term-fg);
}
.term-body .line { white-space: pre-wrap; }
.t-green { color: var(--t-green); }
.t-violet { color: var(--t-violet); }
.t-blue { color: var(--t-blue); }
.t-cyan { color: var(--t-cyan); }
.t-amber { color: var(--t-amber); }
.t-pink { color: var(--t-pink); }
.t-muted { color: var(--t-faint); }
.t-prompt { color: var(--t-prompt); }
.cursor {
  display: inline-block;
  width: 9px;
  height: 1.05em;
  background: var(--accent);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: blink 1.1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ============== full app-window preview (the real TermZ chrome) ============== */
.app-wrap { max-width: 1080px; margin: 64px auto 0; perspective: 1800px; }
.app-window {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--elevation-3), var(--glow-accent-soft);
  text-align: left;
  transform: rotateX(7deg);
  transform-origin: center top;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.app-window.flat { transform: none; }

.aw-chrome {
  display: grid;
  grid-template-columns: 54px 232px 1fr;
  grid-template-rows: 46px 1fr 30px;
  height: 540px;
}
.aw-chrome > * { min-width: 0; min-height: 0; }

/* --- title/header row --- */
.aw-titlecell { border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.aw-tl { grid-column: 1; grid-row: 1; gap: 7px; padding-left: 15px; }
.aw-dot { width: 12px; height: 12px; border-radius: 50%; }
.aw-dot.r { background: #ff5f57; } .aw-dot.y { background: #febc2e; } .aw-dot.g { background: #28c840; }
.aw-wshead { grid-column: 2; grid-row: 1; justify-content: space-between; padding: 0 12px; gap: 8px; }
.aw-wshead .ws { font-weight: 700; font-size: 0.82rem; }
.aw-seg { display: flex; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; font-size: 0.68rem; }
.aw-seg span { padding: 3px 7px; color: var(--text-muted); }
.aw-seg span.on { background: var(--accent-muted); color: var(--text); }
.aw-mainhead { grid-column: 3; grid-row: 1; gap: 14px; padding: 0 16px; }
.aw-mainhead .wordmark { font-size: 1.05rem; }
.aw-search {
  flex: 1;
  display: flex; align-items: center; gap: 9px;
  height: 30px; padding: 0 12px;
  background: rgba(127, 127, 160, 0.08);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-faint);
  font-size: 0.78rem;
}
.aw-search .kbd { font-family: var(--font-mono); font-size: 0.7rem; padding: 1px 5px; border: 1px solid var(--border); border-radius: 4px; color: var(--text-muted); }
.aw-sync { display: flex; align-items: center; gap: 7px; font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }
.aw-sync .live { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }

/* --- activity rail --- */
.aw-rail {
  grid-column: 1; grid-row: 2;
  background: var(--rail-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 12px 0;
}
.aw-rail .ri { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: var(--text-faint); }
.aw-rail .ri svg { width: 18px; height: 18px; }
.aw-rail .ri.active { color: var(--accent); background: var(--accent-muted); box-shadow: inset 0 0 0 1px var(--border-strong); }
.aw-rail .grow { flex: 1; }

/* --- sidebar --- */
.aw-side {
  grid-column: 2; grid-row: 2;
  background: var(--panel-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 11px;
  padding: 13px 12px; overflow: hidden;
}
.aw-side-filter {
  height: 32px; display: flex; align-items: center; padding: 0 11px;
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-faint); font-size: 0.74rem;
  background: rgba(127, 127, 160, 0.06);
}
.aw-tree { display: flex; flex-direction: column; gap: 3px; font-size: 0.82rem; }
.aw-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 7px; color: var(--text-muted); }
.aw-row.head { color: var(--text); font-weight: 600; }
.aw-row.sel { background: var(--accent-muted); color: var(--text); }
.aw-row .tri { color: var(--text-faint); font-size: 0.7rem; width: 10px; }
.aw-row .nm { color: var(--text); }
.aw-row .sub { margin-left: auto; font-family: var(--font-mono); font-size: 0.66rem; color: var(--text-faint); }
.aw-row .d { width: 7px; height: 7px; border-radius: 50%; }
.aw-row .d.ok { background: var(--green); } .aw-row .d.warn { background: var(--status-warn); } .aw-row .d.off { background: var(--text-faint); }
.aw-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; font-size: 0.72rem; color: var(--text-faint); }
.aw-side-foot .views { font-family: var(--font-mono); letter-spacing: 0.1em; }

/* --- main column --- */
.aw-main { grid-column: 3; grid-row: 2; display: flex; flex-direction: column; padding: 11px 13px; gap: 10px; }
.aw-tabs { display: flex; gap: 7px; }
.aw-tab { display: flex; align-items: center; gap: 9px; padding: 6px 13px; font-size: 0.78rem; border: 1px solid var(--border-strong); border-radius: 8px; color: var(--text); box-shadow: var(--glow-accent-soft); }
.aw-tab .x { color: var(--text-faint); }
.aw-term { flex: 1; display: flex; flex-direction: column; border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; background: var(--term-card-bg); }
.aw-term-head { display: flex; align-items: center; gap: 9px; padding: 9px 13px; border-bottom: 1px solid var(--border); }
.aw-term-head .live { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 7px var(--green); }
.aw-term-head .nm { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text); }
.aw-term-head .ctl { margin-left: auto; display: flex; gap: 12px; color: var(--text-faint); }
.aw-term-head .ctl svg { width: 14px; height: 14px; }
.aw-term-body {
  flex: 1; overflow: hidden;
  font-family: var(--font-mono); font-size: 0.82rem; line-height: 1.7;
  padding: 14px 16px; color: var(--term-fg);
  background: var(--term-bg);
}
.aw-term-body .line { white-space: pre-wrap; }

/* --- status bar --- */
.aw-status {
  grid-column: 1 / -1; grid-row: 3;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  padding: 0 15px; font-size: 0.72rem; color: var(--text-faint);
}
.aw-status .right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.aw-status .sftp { display: flex; align-items: center; gap: 6px; color: var(--green); }
.aw-status .sftp .live { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.aw-status .tt { cursor: pointer; display: inline-flex; }
.aw-status .tt:hover { color: var(--text); }

@media (max-width: 880px) {
  .aw-chrome { grid-template-columns: 1fr; grid-template-rows: 46px 1fr 30px; }
  .aw-tl, .aw-wshead, .aw-rail, .aw-side { display: none; }
  .aw-mainhead { grid-column: 1; }
  .aw-main { grid-column: 1; }
}
@media (max-width: 520px) {
  .aw-chrome { height: 460px; }
  .aw-mainhead { gap: 8px; padding: 0 10px; }
  .aw-term-body { font-size: 0.72rem; padding: 12px; }
}

/* ===================== theme toggle ===================== */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(127, 127, 160, 0.06);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.theme-toggle:hover { color: var(--text); border-color: var(--accent); transform: translateY(-1px); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .sun { display: none; }
:root[data-theme="light"] .theme-toggle .sun { display: block; }
:root[data-theme="light"] .theme-toggle .moon { display: none; }

/* ====================== feature grid ====================== */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature {
  padding: 30px 28px;
  border-radius: var(--radius-lg);
}
.feature .f-ico {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--accent-muted);
  color: #b9a7ff;
  margin-bottom: 18px;
}
.feature h3 { font-size: 1.18rem; }
.feature p { color: var(--text-muted); font-size: 0.97rem; margin: 0; }
.feature svg { width: 24px; height: 24px; }

/* ===== alternating showcase rows ===== */
.showcase-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  margin-bottom: 120px;
}
.showcase-row:last-child { margin-bottom: 0; }
.showcase-row.reverse .showcase-media { order: -1; }
.showcase-text h3 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.showcase-text p { color: var(--text-muted); font-size: 1.05rem; }
.showcase-list { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; }
.showcase-list li { display: flex; gap: 12px; align-items: flex-start; color: var(--text-muted); font-size: 0.98rem; }
.showcase-list svg { width: 20px; height: 20px; color: var(--green); flex-shrink: 0; margin-top: 3px; }
.showcase-media { border-radius: var(--radius-lg); overflow: hidden; padding: 22px; }

/* small inline code window used inside showcase media */
.mini-term { font-family: var(--font-mono); font-size: 0.85rem; line-height: 1.7; }
.mini-term .row { display: flex; gap: 10px; padding: 5px 0; }
.kv { color: var(--text-faint); }

/* ===== stats strip ===== */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.stat { text-align: center; padding: 28px 16px; border-radius: var(--radius-lg); }
.stat .num {
  font-family: var(--font-mono);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  background: var(--wordmark-gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat .lbl { color: var(--text-muted); font-size: 0.9rem; }

/* ===== pricing ===== */
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: stretch; }
.price-card { padding: 34px 30px; border-radius: var(--radius-lg); display: flex; flex-direction: column; }
.price-card.featured { background: linear-gradient(180deg, rgba(124,92,255,0.12), rgba(22,19,31,0.62)); }
.price-tag { font-size: 0.85rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.12em; font-family: var(--font-mono); }
.price { font-size: 2.6rem; font-weight: 700; margin: 12px 0 4px; }
.price .per { font-size: 0.95rem; color: var(--text-faint); font-weight: 400; }
.price-desc { color: var(--text-muted); font-size: 0.95rem; min-height: 48px; }
.price-feats { list-style: none; padding: 0; margin: 24px 0; display: grid; gap: 13px; flex: 1; }
.price-feats li { display: flex; gap: 11px; font-size: 0.95rem; color: var(--text-muted); }
.price-feats svg { width: 19px; height: 19px; color: var(--green); flex-shrink: 0; margin-top: 2px; }
.badge-pop {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
}

/* ===== CTA band ===== */
.cta-band { text-align: center; padding: 64px 40px; border-radius: var(--radius-xl); }
.cta-band h2 { font-size: clamp(2rem, 4vw, 2.8rem); }
.cta-band p { color: var(--text-muted); max-width: 50ch; margin: 0 auto 28px; }

/* ===== download cards ===== */
.dl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.dl-card { padding: 34px 28px; border-radius: var(--radius-lg); text-align: center; }
.dl-card .os-ico { width: 54px; height: 54px; margin: 0 auto 18px; color: var(--text); }
.dl-card h3 { font-size: 1.3rem; }
.dl-card .meta { color: var(--text-faint); font-size: 0.85rem; font-family: var(--font-mono); margin-bottom: 20px; }
.dl-card { position: relative; }
.dl-card.detected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 14px 40px -18px var(--accent); }
.dl-detected { position: absolute; top: 12px; right: 12px; font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); padding: 3px 8px; border-radius: 999px; }
.dl-alt { display: inline-block; margin-top: 12px; font-size: 0.82rem; color: var(--text-muted); text-decoration: underline; text-underline-offset: 3px; }
.dl-alt:hover { color: var(--accent); }
.dl-alts { display: flex; gap: 16px; justify-content: center; }
/* While the manifest loads (or if a format is absent) the link isn't actionable. */
.dl-pending { opacity: 0.85; cursor: progress; }
.dl-missing { opacity: 0.4; pointer-events: none; }

/* ===== footer ===== */
.site-footer { border-top: 1px solid var(--border); padding: 60px 0 40px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
.footer-col h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-faint); font-family: var(--font-mono); }
.footer-col a { display: block; color: var(--text-muted); font-size: 0.95rem; padding: 5px 0; transition: color 0.15s; }
.footer-col a:hover { color: var(--text); }
.footer-about p { color: var(--text-muted); font-size: 0.95rem; max-width: 34ch; }
.footer-bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-faint);
  font-size: 0.85rem;
}

/* ===== docs simple layout ===== */
.doc-hero { padding: calc(var(--header-h) + 80px) 0 40px; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.doc-card { padding: 28px; border-radius: var(--radius-lg); transition: transform 0.2s ease, border-color 0.2s; }
.doc-card:hover { transform: translateY(-4px); }
.doc-card h3 { font-size: 1.2rem; }
.doc-card p { color: var(--text-muted); font-size: 0.95rem; margin: 0; }
.doc-card .f-ico { width: 42px; height: 42px; display: grid; place-items: center; border-radius: var(--radius-md); background: var(--green-soft); color: var(--green); margin-bottom: 16px; }
.doc-card svg { width: 22px; height: 22px; }

.note {
  display: flex; gap: 14px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: var(--accent-muted);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.95rem;
}
.note svg { width: 20px; height: 20px; color: #b9a7ff; flex-shrink: 0; margin-top: 2px; }

/* ========================= scroll reveal ========================= */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }
/* No-JS fallback: never hide content if we can't run the reveal animation. */
html:not(.js) .reveal { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .terminal { transform: none; }
}

/* ============================ responsive ============================ */
@media (max-width: 940px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .pricing { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .dl-grid { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .showcase-row { grid-template-columns: 1fr; gap: 32px; margin-bottom: 80px; }
  .showcase-row.reverse .showcase-media { order: 0; }
}

@media (max-width: 720px) {
  section { padding: 80px 0; }
  .nav-links {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 24px 24px;
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--border);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }
  .nav-links.open { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links a { padding: 14px 0; border-bottom: 1px solid var(--border); }
  .nav-links a.cta { margin-top: 12px; }
  .nav-toggle { display: inline-flex; }
  .nav-actions { margin-left: auto; }
}

@media (max-width: 560px) {
  .features { grid-template-columns: 1fr; }
  .term-body { font-size: 0.8rem; padding: 16px; }
}

/* ===================== docs / wiki ===================== */
.docs-shell {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px 96px;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}
.docs-nav {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  font-size: 0.9rem;
  padding-right: 6px;
}
.docs-nav h4 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-faint);
  margin: 22px 0 6px;
}
.docs-nav h4:first-child { margin-top: 0; }
.docs-nav a {
  display: block;
  padding: 5px 11px;
  border-radius: 7px;
  color: var(--text-muted);
  border-left: 2px solid transparent;
  line-height: 1.35;
}
.docs-nav a:hover { color: var(--text); background: var(--accent-muted); }
.docs-nav a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-muted);
  font-weight: 600;
}
.docs-content { min-width: 0; max-width: 760px; }
.docs-intro {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-muted);
  padding-bottom: 28px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
/* Reset the global marketing-section padding (110px) — docs sections only need
   a modest gap; scroll-margin keeps anchor jumps clear of the sticky header. */
.docs-content section { padding: 0; margin-bottom: 36px; scroll-margin-top: 92px; }
.docs-content h2 {
  font-size: 1.6rem;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.docs-content h3 { font-size: 1.1rem; margin: 26px 0 6px; }
.docs-content p { color: var(--text-muted); line-height: 1.75; margin: 10px 0; }
.docs-content ul, .docs-content ol { padding-left: 22px; margin: 12px 0; }
.docs-content li { color: var(--text-muted); line-height: 1.7; margin: 6px 0; }
.docs-content a { color: #b9a7ff; }
.docs-content a:hover { text-decoration: underline; }
.docs-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--accent-muted);
  color: var(--text);
  padding: 1px 6px;
  border-radius: 5px;
}
.docs-content kbd {
  font-family: var(--font-mono);
  font-size: 0.8em;
  background: var(--surface-2, rgba(255,255,255,0.06));
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 1px 6px;
  color: var(--text);
}
.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 0.92rem;
}
.docs-content th, .docs-content td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}
.docs-content th { color: var(--text); font-weight: 600; }
.docs-content .note { margin: 16px 0; }
.docs-badge {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  vertical-align: middle;
  color: var(--accent);
  background: var(--accent-muted);
  padding: 3px 8px;
  border-radius: 999px;
  margin-left: 8px;
}
.docs-toc-toggle {
  display: none;
  margin: 0 auto 18px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-ui);
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 880px) {
  .docs-shell { grid-template-columns: 1fr; gap: 0; }
  .docs-toc-toggle { display: block; }
  .docs-nav {
    position: static;
    max-height: none;
    overflow: visible;
    display: none;
    margin: 0 auto 28px;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    max-width: 520px;
  }
  .docs-nav.open { display: block; }
  .docs-content { margin: 0 auto; }
}
