/* ═══════════════════════════════════════════════════════════════════════════
   JiveDB — Landing v2
   Light, minimal, jivecode-inspired. Dark "product" windows for contrast.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Tokens ──────────────────────────────────────────────────────────────── */
:root {
  /* Accent raw colors (default indigo) — overridden by [data-accent] */
  --c-soft: #a5b4fc; --c1: #6366f1; --c2: #4f46e5; --c-deep: #4338ca;

  /* Dark surfaces (default) */
  --bg: #070912;
  --surface: #0f1320;
  --ink: #e8eaf4;
  --ink-soft: #c7ccdb;
  --muted: #8990a6;
  --line: #232838;
  --line-soft: #1a1f2c;
  --nav-bg: rgba(7, 9, 18, 0.72);
  --menu-bg: rgba(9, 12, 22, 0.94);
  --accent: #34d399;
  --amber: #fbbf24;

  /* Semantic accent tokens (dark) */
  --primary: var(--c1);
  --primary-2: var(--c-soft);
  --primary-ink: var(--c-soft);
  --grad: linear-gradient(135deg, var(--c-soft), var(--c1));
  --grad-ink: linear-gradient(135deg, var(--c1), var(--c2));

  /* App-window palette — stays dark in both modes so windows pop */
  --d-bg: #0c1124;
  --d-bg2: #131a30;
  --d-line: #283050;
  --d-ink: #e7e9f3;
  --d-muted: #8b93b2;

  --r: 16px;
  --r-sm: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 50px -16px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 40px 90px -30px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(129, 140, 248, 0.1);
  --wrap: 1160px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── 7 accent tones ──────────────────────────────────────────────────────── */
[data-accent="indigo"]  { --c-soft:#a5b4fc; --c1:#6366f1; --c2:#4f46e5; --c-deep:#4338ca; }
[data-accent="violet"]  { --c-soft:#c4b5fd; --c1:#8b5cf6; --c2:#7c3aed; --c-deep:#6d28d9; }
[data-accent="emerald"] { --c-soft:#6ee7b7; --c1:#10b981; --c2:#059669; --c-deep:#047857; }
[data-accent="rose"]    { --c-soft:#fda4af; --c1:#f43f5e; --c2:#e11d48; --c-deep:#be123c; }
[data-accent="amber"]   { --c-soft:#fcd34d; --c1:#f59e0b; --c2:#d97706; --c-deep:#b45309; }
[data-accent="sky"]     { --c-soft:#7dd3fc; --c1:#0ea5e9; --c2:#0284c7; --c-deep:#0369a1; }
[data-accent="fuchsia"] { --c-soft:#f0abfc; --c1:#d946ef; --c2:#c026d3; --c-deep:#a21caf; }

/* ── Light mode overrides ────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --ink: #0d1117;
  --ink-soft: #3a4250;
  --muted: #5b6472;
  --line: #e6e9f0;
  --line-soft: #eef1f6;
  --nav-bg: rgba(246, 248, 252, 0.82);
  --menu-bg: rgba(248, 250, 253, 0.95);
  --primary: var(--c2);
  --primary-2: var(--c1);
  --primary-ink: var(--c-deep);
  --grad: linear-gradient(135deg, var(--c1), var(--c-deep));
  --grad-ink: linear-gradient(135deg, var(--c1), var(--c2));
  --shadow: 0 1px 2px rgba(16, 22, 40, 0.05), 0 16px 44px -14px rgba(16, 22, 40, 0.18);
  --shadow-lg: 0 30px 80px -24px rgba(60, 50, 130, 0.3);
}

html { transition: background 0.3s var(--ease); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
em { font-style: italic; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* ── Background decor ─────────────────────────────────────────────────────── */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.bg__grid {
  position: absolute; inset: -2px;
  background-image:
    linear-gradient(to right, rgba(129, 140, 248, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(129, 140, 248, 0.08) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}
.bg__blob {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.28;
  animation: drift 22s var(--ease) infinite alternate;
}
.bg__blob--1 { width: 520px; height: 520px; top: -160px; left: -120px; background: radial-gradient(circle, #a5b4fc, transparent 70%); }
.bg__blob--2 { width: 460px; height: 460px; top: 260px; right: -140px; background: radial-gradient(circle, #c4b5fd, transparent 70%); animation-delay: -7s; }
.bg__blob--3 { width: 420px; height: 420px; top: 1200px; left: 30%; background: radial-gradient(circle, #99f6e4, transparent 70%); animation-delay: -13s; }
@keyframes drift { to { transform: translate3d(40px, 50px, 0) scale(1.12); } }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 14px; line-height: 1;
  padding: 10px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid transparent; transition: transform 0.18s var(--ease), box-shadow 0.18s, background 0.18s, color 0.18s;
  white-space: nowrap;
}
.btn--lg { padding: 14px 24px; font-size: 15px; }
.btn--primary { background: var(--grad-ink); color: #fff; box-shadow: 0 8px 22px -8px rgba(99, 102, 241, 0.7); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -10px rgba(99, 102, 241, 0.8); }
.btn--ghost { border-color: var(--line); color: var(--ink-soft); background: var(--surface); }
.btn--ghost:hover { border-color: var(--primary); color: var(--primary-ink); transform: translateY(-1px); }
.btn--soft { background: rgba(99, 102, 241, 0.1); color: var(--primary-ink); }
.btn--soft:hover { background: rgba(99, 102, 241, 0.16); transform: translateY(-2px); }

/* ── Nav ─────────────────────────────────────────────────────────────────── */
.nav { position: sticky; top: 0; z-index: 50; transition: background 0.25s, box-shadow 0.25s, border-color 0.25s; border-bottom: 1px solid transparent; }
.nav.is-stuck { background: var(--nav-bg); backdrop-filter: saturate(180%) blur(14px); border-color: var(--line); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 0; font-weight: 800; font-size: 21px; letter-spacing: -0.02em; color: var(--ink); }
.brand__mark { width: 56px; height: 56px; transform-origin: 50% 50%; transition: transform 0.4s var(--ease); animation: brandGlow 3.2s ease-in-out infinite; }
.brand:hover .brand__mark { transform: rotate(-8deg) scale(1.524); }
@keyframes brandGlow {
  0%, 100% { filter: drop-shadow(0 0 0 transparent); }
  50% { filter: drop-shadow(0 0 7px rgba(129, 140, 248, 0.65)); }
}
.brand__db { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav__links { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.nav__links > a:not(.btn) { font-size: 14px; font-weight: 500; color: var(--ink-soft); position: relative; }
.nav__links > a:not(.btn)::after { content: ""; position: absolute; left: 0; bottom: -5px; height: 2px; width: 0; background: var(--grad); transition: width 0.25s var(--ease); }
.nav__links > a:not(.btn):hover { color: var(--ink); }
.nav__links > a:not(.btn):hover::after { width: 100%; }
.nav__toggle { display: none; position: relative; width: 40px; height: 40px; background: none; border: 0; color: var(--ink); cursor: pointer; padding: 0; }
.nav__toggle .bar { position: absolute; left: 9px; right: 9px; height: 2px; border-radius: 2px; background: currentColor; transition: transform 0.3s var(--ease), opacity 0.2s var(--ease); }
.nav__toggle .bar:nth-child(1) { top: 13px; }
.nav__toggle .bar:nth-child(2) { top: 19px; }
.nav__toggle .bar:nth-child(3) { top: 25px; }
.nav__toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero { display: grid; grid-template-columns: 0.9fr 1.15fr; gap: 48px; align-items: center; padding: 70px 24px 90px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600;
  color: var(--primary-ink); background: rgba(99, 102, 241, 0.09); border: 1px solid rgba(99, 102, 241, 0.18);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 22px;
}
.pill__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55); animation: ping 1.8s infinite; }
@keyframes ping { 70%, 100% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); } }

.hero__title { font-size: clamp(40px, 5.4vw, 68px); line-height: 1.04; letter-spacing: -0.035em; font-weight: 900; margin: 0 0 18px; }
.hero__title .ink { display: inline; }
.hero__title em { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-style: italic; display: inline-block; padding: 0 0.14em 0.1em 0; margin: 0 -0.14em -0.1em 0; }
.hero__sub { font-size: clamp(16px, 1.6vw, 19px); color: var(--muted); max-width: 540px; margin: 0 0 28px; }
.hero__sub b { color: var(--ink-soft); font-weight: 700; }
.cta { display: flex; gap: 14px; flex-wrap: wrap; }
.cta--center { justify-content: center; }

.stats { list-style: none; display: flex; margin: 40px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.stats li { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 18px 10px; text-align: center; border-left: 1px solid var(--line); transition: background 0.2s var(--ease); }
.stats li:first-child { border-left: 0; }
.stats li:hover { background: rgba(129, 140, 248, 0.08); }
.stats b { display: block; font-size: 32px; font-weight: 800; line-height: 1; letter-spacing: -0.02em; background: var(--grad-ink); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stats span { font-size: 12.5px; font-weight: 500; color: var(--muted); }

/* ── Hero app (floating) ─────────────────────────────────────────────────── */
.hero__copy, .hero__app { min-width: 0; }
.hero__app { position: relative; }
.hero__app .win { max-width: 100%; }
/* 3D tilt — straightens on hover */
.hero__app.reveal { transform: perspective(1600px) rotateY(-13deg) rotateX(6deg) translateY(26px); }
.hero__app.reveal.in { transform: perspective(1600px) rotateY(-13deg) rotateX(6deg); }
.hero__app.reveal.in:hover { transform: perspective(1600px) rotateY(0deg) rotateX(0deg); }
.win--float { box-shadow: var(--shadow-lg); animation: floaty 7s ease-in-out infinite; }
@keyframes floaty { 50% { transform: translateY(-12px); } }
.win__body { display: grid; grid-template-columns: 150px 1fr; min-height: 290px; }
.tree { background: var(--d-bg2); border-right: 1px solid var(--d-line); padding: 10px 8px; font-size: 12px; color: var(--d-muted); }
.tree__row { display: flex; align-items: center; gap: 7px; padding: 4px 6px; border-radius: 6px; white-space: nowrap; opacity: 0; transform: translateX(-8px); }
.is-in .tree__row { animation: treeIn 0.5s var(--ease) forwards; }
.is-in .tree__row:nth-child(1) { animation-delay: 0.05s; }
.is-in .tree__row:nth-child(2) { animation-delay: 0.12s; }
.is-in .tree__row:nth-child(3) { animation-delay: 0.19s; }
.is-in .tree__row:nth-child(4) { animation-delay: 0.26s; }
.is-in .tree__row:nth-child(5) { animation-delay: 0.33s; }
.is-in .tree__row:nth-child(6) { animation-delay: 0.4s; }
@keyframes treeIn { to { opacity: 1; transform: none; } }
.tree__row--in { padding-left: 16px; }
.tree__row--in2 { padding-left: 26px; }
.tree__row.is-active { background: rgba(99, 102, 241, 0.18); color: #fff; }
.ic { width: 13px; height: 13px; border-radius: 3px; flex: none; }
.ic--pg { background: #6366f1; border-radius: 50%; }
.ic--folder { background: #f59e0b; }
.ic--table { background: linear-gradient(135deg, #34d399, #10b981); }
.pane { display: flex; flex-direction: column; background: var(--d-bg); }
.mini-tabs { display: flex; gap: 2px; padding: 8px 8px 0; }
.mini-tab { font-size: 11px; color: var(--d-muted); padding: 5px 10px; border-radius: 6px 6px 0 0; background: var(--d-bg2); }
.mini-tab.is-active { color: var(--d-ink); background: #182039; }
.mini-code { margin: 0; padding: 12px 14px; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; color: var(--d-ink); overflow: hidden; }
.mini-code .k { color: #c4b5fd; }
.mini-code .s { color: #6ee7b7; }
.mini-grid { flex: 1; padding: 0; overflow: hidden; font-family: "JetBrains Mono", monospace; font-size: 11px; }

.badge-float { position: absolute; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 12px; padding: 8px 12px; font-size: 13px; font-weight: 700; }
.badge-float--a { top: 24px; left: -22px; color: var(--accent); animation: floaty 5s ease-in-out infinite; }
.badge-float--b { bottom: 30px; right: -16px; color: var(--primary-ink); animation: floaty 6s ease-in-out infinite reverse; }

/* ── Generic window chrome ───────────────────────────────────────────────── */
.win { background: var(--d-bg); border: 1px solid var(--d-line); border-radius: var(--r); overflow: hidden; }
.win__bar { display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 14px; background: var(--d-bg2); border-bottom: 1px solid var(--d-line); }
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: #3a4266; }
.dots i:nth-child(1) { background: #ff5f57; }
.dots i:nth-child(2) { background: #febc2e; }
.dots i:nth-child(3) { background: #28c840; }
.win__title { font-size: 12.5px; color: var(--d-muted); font-weight: 500; }

/* ── Sections ────────────────────────────────────────────────────────────── */
.section { padding: 64px 24px; }
.num { display: inline-block; font-family: "JetBrains Mono", monospace; font-size: 13px; font-weight: 700; color: var(--primary); letter-spacing: 0.1em; margin-bottom: 12px; }
.num--center { display: block; text-align: center; }
.section__head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.section__head h2 { font-size: clamp(28px, 3.4vw, 42px); letter-spacing: -0.03em; margin: 0 0 12px; font-weight: 800; }
.section__head p { color: var(--muted); margin: 0; font-size: 17px; }
h2 em { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-style: italic; display: inline-block; padding: 0 0.14em 0.1em 0; margin: 0 -0.14em -0.1em 0; }

.feat { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: 56px; align-items: center; }
.feat__copy, .feat__demo { min-width: 0; }
.feat--rev .feat__copy { order: 2; }
.feat__copy h2 { font-size: clamp(26px, 3.2vw, 40px); letter-spacing: -0.03em; margin: 0 0 16px; font-weight: 800; line-height: 1.1; }
.feat__copy p { color: var(--muted); font-size: 17px; margin: 0 0 22px; }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 30px; color: var(--ink-soft); font-weight: 500; }
.ticks li::before {
  content: "✓"; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 6px;
  display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; background: var(--grad-ink);
}
.feat__demo .win { box-shadow: var(--shadow); }

/* ── 01 · Editor demo ────────────────────────────────────────────────────── */
.editor { display: grid; grid-template-columns: 40px 1fr; min-height: 150px; background: var(--d-bg); }
.editor__gutter { padding: 14px 0; text-align: right; padding-right: 10px; color: #4a5378; font-family: "JetBrains Mono", monospace; font-size: 13px; line-height: 1.7; user-select: none; border-right: 1px solid var(--d-line); }
.editor__code { margin: 0; padding: 14px; font-family: "JetBrains Mono", monospace; font-size: 13.5px; line-height: 1.7; color: var(--d-ink); white-space: pre-wrap; min-height: 120px; }
.editor__code .k { color: #c4b5fd; font-weight: 600; }
.editor__code .s { color: #6ee7b7; }
.editor__code .n { color: #fbbf24; }
.editor__code .fn { color: #93c5fd; }
.caret { display: inline-block; width: 7px; height: 16px; background: var(--primary-2); vertical-align: -3px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.toolbar { display: flex; align-items: center; gap: 14px; padding: 8px 14px; background: var(--d-bg2); border-top: 1px solid var(--d-line); border-bottom: 1px solid var(--d-line); }
.run { display: inline-flex; align-items: center; gap: 7px; background: var(--grad-ink); color: #fff; border: 0; border-radius: 8px; padding: 7px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: transform 0.15s, filter 0.15s; }
.run:hover { transform: translateY(-1px); filter: brightness(1.08); }
.run.is-running { opacity: 0.7; pointer-events: none; }
.run kbd { background: rgba(255, 255, 255, 0.2); border-radius: 4px; padding: 1px 5px; font-size: 10px; font-family: inherit; }
.toolbar__status { font-size: 12px; color: var(--accent); font-family: "JetBrains Mono", monospace; }

/* ── Result / grid tables ────────────────────────────────────────────────── */
.result, .bigrid { background: var(--d-bg); color: var(--d-ink); overflow: hidden; }
.dtable { width: 100%; border-collapse: separate; border-spacing: 0; font-family: "JetBrains Mono", monospace; font-size: 12px; }
.dtable th { text-align: left; padding: 8px 12px; color: var(--d-muted); font-weight: 600; border-bottom: 1px solid var(--d-line); background: var(--d-bg2); position: sticky; top: 0; z-index: 2; }
.dtable td { padding: 7px 12px; border-bottom: 1px solid rgba(35, 42, 68, 0.6); }
.dtable tbody tr { opacity: 0; transform: translateY(6px); }
.dtable tbody tr.show { animation: rowIn 0.4s var(--ease) forwards; }
@keyframes rowIn { to { opacity: 1; transform: none; } }
.dtable .num-cell { color: var(--amber); }
.dtable .null-cell { color: #5b6486; font-style: italic; }
.pill-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 10.5px; background: rgba(99, 102, 241, 0.2); color: #c4b5fd; }
.pill-tag--pro { background: rgba(16, 185, 129, 0.18); color: #6ee7b7; }
.result__empty { padding: 26px; text-align: center; color: var(--d-muted); font-size: 13px; }
.bigrid { max-height: 320px; overflow: auto; }
.cell-edit { background: rgba(251, 191, 36, 0.18); outline: 1px solid var(--amber); border-radius: 3px; }

/* ── 03 · ERD (single responsive SVG) ────────────────────────────────────── */
.erd { position: relative; height: 340px; overflow: hidden; background:
  radial-gradient(circle at 1px 1px, rgba(255,255,255,0.05) 1px, transparent 0) 0 0 / 22px 22px,
  var(--d-bg); }
.erd svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.erd__edge { fill: none; stroke: #a78bfa; stroke-width: 1.6; stroke-dasharray: 260; stroke-dashoffset: 260; opacity: 0.75; }
.is-in .erd__edge { animation: draw 1.1s var(--ease) forwards; }
.is-in .erd__edge.e2 { animation-delay: 0.3s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.erd__node { opacity: 0; }
.is-in .erd__node { animation: nodeIn 0.55s var(--ease) forwards; }
.is-in .erd__node.n2 { animation-delay: 0.15s; }
.is-in .erd__node.n3 { animation-delay: 0.3s; }
@keyframes nodeIn { to { opacity: 1; } }
.erd-card { fill: var(--d-bg2); stroke: var(--d-line); stroke-width: 1; }
.erd-title { fill: var(--d-ink); font: 700 12px "Inter", system-ui, sans-serif; }
.erd-div { stroke: var(--d-line); stroke-width: 1; }
.erd-col { fill: var(--d-muted); font: 11px "JetBrains Mono", ui-monospace, monospace; }
.erd-key { fill: var(--amber); font: 11px "JetBrains Mono", ui-monospace, monospace; }
.erd-fk { fill: #93c5fd; font: 11px "JetBrains Mono", ui-monospace, monospace; }

/* ── 04 · Chat ───────────────────────────────────────────────────────────── */
.chat { padding: 16px; display: flex; flex-direction: column; gap: 12px; min-height: 300px; background: var(--d-bg); }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.55; opacity: 0; transform: translateY(8px); }
.msg.show { animation: rowIn 0.4s var(--ease) forwards; }
.msg--user { align-self: flex-end; background: var(--grad-ink); color: #fff; border-bottom-right-radius: 4px; }
.msg--ai { align-self: flex-start; background: var(--d-bg2); border: 1px solid var(--d-line); color: var(--d-ink); border-bottom-left-radius: 4px; }
.msg--ai .lbl { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--primary-2); font-weight: 700; margin-bottom: 6px; }
.msg pre { margin: 8px 0 0; background: #060912; border: 1px solid var(--d-line); border-radius: 8px; padding: 10px 12px; font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--d-ink); overflow-x: auto; }
.msg pre .k { color: #c4b5fd; }
.msg pre .s { color: #6ee7b7; }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--d-muted); animation: bounce 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-5px); opacity: 1; } }

/* ── 05 · Engines ────────────────────────────────────────────────────────── */
.engines { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.engine { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; transition: transform 0.25s var(--ease), box-shadow 0.25s, border-color 0.25s; position: relative; overflow: hidden; }
.engine::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--ec, var(--grad)); transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease); }
.engine:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: transparent; }
.engine:hover::before { transform: scaleX(1); }
.engine__icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; margin-bottom: 16px; font-size: 18px; }
.engine h3 { margin: 0 0 6px; font-size: 17px; }
.engine p { margin: 0; color: var(--muted); font-size: 14px; }

/* ── Features strip ──────────────────────────────────────────────────────── */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.fcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; transition: transform 0.25s var(--ease), box-shadow 0.25s; }
.fcard:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.fcard__ic { width: 40px; height: 40px; border-radius: 11px; background: rgba(99, 102, 241, 0.1); color: var(--primary-ink); display: grid; place-items: center; margin-bottom: 14px; }
.fcard h3 { margin: 0 0 6px; font-size: 16px; }
.fcard p { margin: 0; color: var(--muted); font-size: 14px; }

/* ── CTA box ─────────────────────────────────────────────────────────────── */
.cta-box { text-align: center; margin: 40px auto 80px; max-width: 880px; background: var(--grad-ink); color: #fff; border-radius: 28px; padding: 64px 28px; box-shadow: var(--shadow-lg); position: relative; overflow: hidden; }
.cta-box::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 80% -10%, rgba(255,255,255,0.25), transparent 50%); pointer-events: none; }
.cta-box > * { position: relative; }
.cta-box h2 { font-size: clamp(28px, 4vw, 44px); margin: 0 0 12px; letter-spacing: -0.03em; }
.cta-box p { margin: 0 0 28px; opacity: 0.9; font-size: 18px; }
.cta-box .btn--primary { background: #fff; color: var(--c-deep); box-shadow: none; }
.cta-box .btn--soft { background: rgba(255, 255, 255, 0.16); color: #fff; }
.cta-box__os { display: flex; gap: 22px; justify-content: center; margin-top: 24px; font-size: 13px; opacity: 0.85; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 30px 24px 50px; border-top: 1px solid var(--line); flex-wrap: wrap; color: var(--muted); }
.footer__brand { display: flex; align-items: center; gap: 9px; font-weight: 800; color: var(--ink); }
.footer__note { font-size: 13px; margin: 0; }
.footer__copy { font-size: 13px; margin: 0; }

/* ── Nav live controls (language · accent · mode) ────────────────────────── */
.ctrl { display: inline-flex; align-items: center; gap: 10px; padding-left: 4px; }
.ctrl__btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); font-size: 12px; font-weight: 700; cursor: pointer; transition: border-color 0.18s, color 0.18s, transform 0.18s; }
.ctrl__btn:hover { border-color: var(--primary); color: var(--primary-ink); transform: translateY(-1px); }
.ctrl__mode .ic-moon { display: none; }
[data-theme="light"] .ctrl__mode .ic-sun { display: none; }
[data-theme="light"] .ctrl__mode .ic-moon { display: inline; }

.swatches { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 18px; height: 18px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; transition: transform 0.15s, border-color 0.15s; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.15); }
.swatch:hover { transform: scale(1.18); }
.swatch.is-active { border-color: var(--ink); }
.swatches--lg .swatch { width: 26px; height: 26px; }

/* ── 06 · Appearance panel ───────────────────────────────────────────────── */
.appearance { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; box-shadow: var(--shadow); }
.appearance__hint { margin: 0 0 18px; font-size: 14px; color: var(--muted); }
.ap-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.ap-row:first-of-type { border-top: 0; }
.ap-label { font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--bg); }
.seg button { border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 600; padding: 7px 16px; cursor: pointer; transition: color 0.18s; }
.seg button.is-active { background: var(--grad-ink); color: #fff; }

/* ── 07 · Export demo ────────────────────────────────────────────────────── */
.export { padding: 22px; min-height: 240px; background: var(--d-bg); }
.export__btns { display: flex; gap: 10px; flex-wrap: wrap; }
.xbtn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--d-line); background: var(--d-bg2); color: var(--d-ink); font-size: 13px; font-weight: 700; cursor: pointer; transition: transform 0.15s, border-color 0.15s; }
.xbtn::before { content: "↓"; color: var(--primary-2); font-weight: 800; }
.xbtn:hover { transform: translateY(-2px); border-color: var(--primary-2); }
.export__files { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.xfile { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--d-bg2); border: 1px solid var(--d-line); opacity: 0; transform: translateY(8px); }
.xfile.show { animation: rowIn 0.4s var(--ease) forwards; }
.xfile__ic { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; flex: none; }
.xfile__ic--svg { background: linear-gradient(135deg, #f59e0b, #d97706); }
.xfile__ic--csv { background: linear-gradient(135deg, #10b981, #059669); }
.xfile__ic--json { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.xfile__name { font-family: "JetBrains Mono", monospace; font-size: 12.5px; color: var(--d-ink); }
.xfile__meta { font-size: 11px; color: var(--d-muted); }
.xfile__ok { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--accent); }

/* ── 08 · Feedback demo ──────────────────────────────────────────────────── */
.fb { padding: 18px; background: var(--d-bg); min-height: 240px; }
.fb__types { display: inline-flex; border: 1px solid var(--d-line); border-radius: 10px; overflow: hidden; }
.fb__types button { display: inline-flex; align-items: center; gap: 6px; border: 0; border-right: 1px solid var(--d-line); background: var(--d-bg2); color: var(--d-muted); font-size: 12px; font-weight: 600; padding: 8px 12px; cursor: pointer; transition: background 0.2s, color 0.2s; }
.fb__types button:last-child { border-right: 0; }
.fb__types button.is-active { background: var(--grad-ink); color: #fff; }
.fb__ic { display: inline-flex; align-items: center; }
.fb__ic svg { width: 15px; height: 15px; }
.fb__field { margin-top: 14px; min-height: 92px; border: 1px solid var(--d-line); border-radius: 10px; background: var(--d-bg2); padding: 12px 14px; color: var(--d-muted); font-size: 13.5px; }
.fb__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.fb__attach { font-size: 12.5px; color: var(--d-muted); }
.fb__send { border: 0; border-radius: 8px; background: var(--grad-ink); color: #fff; font-size: 13px; font-weight: 700; padding: 8px 18px; cursor: pointer; transition: transform 0.15s, filter 0.15s; }
.fb__send:hover { transform: translateY(-1px); filter: brightness(1.08); }

/* ── 08 · Engines flow (animated SVG, no panel) ──────────────────────────── */
.flow { margin: 0 auto; max-width: 880px; height: 520px; }
.flow-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.flow-edge { fill: none; stroke: var(--c1); stroke-width: 1.8; opacity: 0.22; stroke-dasharray: 340; stroke-dashoffset: 340; transition: opacity 0.5s var(--ease), stroke 0.5s var(--ease), stroke-width 0.5s var(--ease), filter 0.5s var(--ease); }
.is-in .flow-edge { animation: draw 1.2s var(--ease) forwards; }
.is-in .flow-edge.e2 { animation-delay: 0.12s; }
.is-in .flow-edge.e3 { animation-delay: 0.24s; }
.is-in .flow-edge.e4 { animation-delay: 0.36s; }
.is-in .flow-edge.e5 { animation-delay: 0.55s; }
.flow-edge.lit { opacity: 1; stroke: var(--c-soft); stroke-width: 1.98; filter: drop-shadow(0 0 5px var(--c-soft)); }
.flow-node { opacity: 0; }
.is-in .flow-node { animation: nodeIn 0.55s var(--ease) forwards; }
.is-in .fn0 { animation-delay: 0.05s; }
.is-in .fn1 { animation-delay: 0.13s; }
.is-in .fn2 { animation-delay: 0.21s; }
.is-in .fn3 { animation-delay: 0.29s; }
.is-in .hub { animation-delay: 0.45s; }
.is-in .user { animation-delay: 0.6s; }
.flow-ico { fill: none; stroke: var(--c1); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: stroke 0.25s; }
.flow-node.is-on .flow-ico { stroke: var(--c-soft); }
.flow-badge { fill: var(--surface); stroke: var(--line); stroke-width: 1; transition: stroke 0.25s, fill 0.25s; }
.flow-node.is-on .flow-badge { stroke: var(--c-soft); }
.flow-name { fill: var(--ink); font: 600 13px "Inter", sans-serif; }
.flow-user { fill: var(--ink); font: 700 13px "Inter", sans-serif; }
.flow-hub-glow { fill: var(--c1); opacity: 0.1; transition: opacity 0.25s; }
.flow-node.is-on .flow-hub-glow { opacity: 0.24; }
.flow-hub-name { fill: var(--ink); font: 800 19px "Inter", sans-serif; }
.flow-hub-sub { fill: var(--muted); font: 500 11px "Inter", sans-serif; }
@media (max-width: 640px) {
  .flow { max-width: none; height: auto; }
  .flow-svg { height: auto; }
  .cta-box .cta { flex-direction: column; align-items: stretch; }
  .cta-box .cta .btn { width: 100%; justify-content: center; }
  /* Feedback ticks: 2 columns on mobile */
  #feedback .ticks { grid-template-columns: 1fr 1fr; gap: 10px 16px; }
  .footer__note { display: none; }
  /* Hide type icons so labels fit without truncation */
  .fb__types { display: flex; width: 100%; }
  .fb__types button { flex: 1; justify-content: center; padding: 9px 6px; font-size: 12px; }
  .fb__ic { display: none; }
}

/* ── Modals (download · contact) ─────────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 2000; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal:not([hidden]) { display: flex; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(2, 4, 10, 0.6); backdrop-filter: blur(4px); opacity: 0; transition: opacity 0.25s var(--ease); }
.modal.show .modal__backdrop { opacity: 1; }
.modal__panel { position: relative; width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px; box-shadow: var(--shadow-lg); transform: translateY(14px) scale(0.98); opacity: 0; transition: transform 0.28s var(--ease), opacity 0.28s var(--ease); }
.modal.show .modal__panel { transform: none; opacity: 1; }
.modal__x { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; transition: background 0.18s, color 0.18s; }
.modal__x:hover { background: var(--line-soft); color: var(--ink); }
.modal__title { margin: 0 0 6px; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.modal__sub { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.os-list { display: flex; flex-direction: column; gap: 10px; }
.os { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); transition: border-color 0.18s, transform 0.18s; }
.os:hover { border-color: var(--primary); transform: translateY(-2px); }
.os__ic { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--grad-ink); color: #fff; }
.os__txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.os__txt b { font-size: 15px; }
.os__meta { font-size: 12px; color: var(--muted); }
.os__arrow { margin-left: auto; color: var(--primary-ink); flex: none; }
.dl-meta { display: inline-flex; align-items: center; gap: 7px; margin: -8px 0 18px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--ink); background: var(--bg); }
.dl-meta b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dl-changelog { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.dl-changelog__h { margin: 0 0 10px; font-size: 14px; font-weight: 700; color: var(--ink); }
.dl-notes { max-height: 220px; overflow-y: auto; font-size: 13px; line-height: 1.6; color: var(--muted); }
.dl-notes h1, .dl-notes h2, .dl-notes h3, .dl-notes h4 { margin: 14px 0 6px; font-size: 13px; font-weight: 700; color: var(--ink); }
.dl-notes h1:first-child, .dl-notes h2:first-child, .dl-notes h3:first-child { margin-top: 0; }
.dl-notes ul { margin: 4px 0 10px; padding-left: 18px; }
.dl-notes li { margin: 2px 0; }
.dl-notes p { margin: 0 0 8px; }
.dl-notes strong { color: var(--ink); }
.ct-form { display: flex; flex-direction: column; gap: 12px; }
.ct-input { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); font: inherit; font-size: 14px; transition: border-color 0.18s; }
.ct-input:focus { outline: none; border-color: var(--primary); }
textarea.ct-input { resize: vertical; max-width: 100%; min-height: 90px; max-height: 220px; }
.ct-input::placeholder { color: var(--muted); }
.ct-send { width: 100%; justify-content: center; margin-top: 4px; }

/* ── Reveal ──────────────────────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 940px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 40px; }
  .hero__app.reveal { transform: translateY(26px); }
  .hero__app.reveal.in, .hero__app.reveal.in:hover { transform: none; }
  .feat, .feat--rev .feat__copy { grid-template-columns: 1fr; order: 0; }
  .feat { gap: 32px; }
  .engines { grid-template-columns: repeat(2, 1fr); }
  .features { grid-template-columns: 1fr; }
  /* Feature cards: icon | text (2 columns) when full-width */
  .fcard { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "ic title" "ic desc"; column-gap: 16px; row-gap: 3px; align-items: start; }
  .fcard__ic { grid-area: ic; margin-bottom: 0; align-self: center; }
  .fcard h3 { grid-area: title; }
  .fcard p { grid-area: desc; }
  .nav__links { position: fixed; inset: 66px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--menu-bg); backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--line); padding: 8px 20px 18px; transform: translateY(-130%); transition: transform 0.3s var(--ease); box-shadow: var(--shadow); max-height: calc(100vh - 66px); overflow-y: auto; }
  .nav__links.open { transform: none; }
  /* When the menu is open, match the header bar to the menu */
  .nav:has(.nav__links.open) { background: var(--menu-bg); backdrop-filter: saturate(180%) blur(14px); border-color: var(--line); }
  /* Cohesive list: shared rows + dividers, not separate chips */
  .nav__links > a:not(.btn) { padding: 14px 4px; font-size: 16px; font-weight: 600; color: var(--ink); border-bottom: 1px solid var(--line-soft); transition: color 0.18s, padding-left 0.18s; }
  .nav__links > a:not(.btn)::after { display: none; }
  .nav__links > a:not(.btn):hover, .nav__links > a:not(.btn):active { color: var(--primary-ink); padding-left: 10px; }
  .nav__links .btn { width: 100%; justify-content: center; padding: 14px; font-size: 15px; margin-top: 12px; }
  .nav__toggle { display: block; }
  .badge-float { display: none; }
  .hero .cta { flex-direction: column; align-items: stretch; }
  .hero .cta .btn { width: 100%; justify-content: center; }
  .ctrl { flex-wrap: wrap; gap: 12px; justify-content: space-between; padding: 10px 2px; border-top: 1px solid var(--line-soft); }
  .ap-row { flex-direction: column; align-items: flex-start; gap: 10px; }
}
@media (max-width: 540px) {
  .engines { grid-template-columns: 1fr; }
  .stats li { padding: 14px 6px; }
  .stats b { font-size: 24px; }
  .stats span { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
