/* MindSift Website
   Light palette on :root, dark palette via system setting or the toggle (data-theme). */

:root {
  --bg: #f6f7f9;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --surface-3: #e8ebf0;
  --line: #e2e5eb;
  --line-strong: #cfd4dd;
  --text: #0e131b;
  --text-2: #3d4554;
  --muted: #6a7384;
  --accent: #2563eb;
  --accent-2: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.09);
  --accent-line: rgba(37, 99, 235, 0.28);
  --tag-bg: rgba(37, 99, 235, 0.08);
  --ok: #16a34a;
  --warn: #d97706;
  --anna: #db2777;
  --anna-soft: rgba(219, 39, 119, 0.1);
  --code-bg: #0f141c;
  --code-text: #d8dee9;
  --shadow: 0 1px 2px rgba(15, 20, 28, 0.04), 0 8px 24px rgba(15, 20, 28, 0.06);
  --shadow-lg: 0 2px 4px rgba(15, 20, 28, 0.04), 0 30px 80px -20px rgba(15, 20, 28, 0.25);
  --radius: 14px;
  --radius-sm: 8px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Inter Tight", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --wrap: 1180px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0c10;
    --bg-elev: #0f1217;
    --surface: #12161c;
    --surface-2: #181d25;
    --surface-3: #202631;
    --line: #232935;
    --line-strong: #313847;
    --text: #e8ebf1;
    --text-2: #b6bdca;
    --muted: #838c9d;
    --accent: #4f8bff;
    --accent-2: #6b9dff;
    --accent-soft: rgba(79, 139, 255, 0.12);
    --accent-line: rgba(79, 139, 255, 0.35);
    --tag-bg: rgba(79, 139, 255, 0.14);
    --anna: #f472b6;
    --anna-soft: rgba(244, 114, 182, 0.14);
    --code-bg: #0b0e13;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 40px 100px -20px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0a0c10;
  --bg-elev: #0f1217;
  --surface: #12161c;
  --surface-2: #181d25;
  --surface-3: #202631;
  --line: #232935;
  --line-strong: #313847;
  --text: #e8ebf1;
  --text-2: #b6bdca;
  --muted: #838c9d;
  --accent: #4f8bff;
  --accent-2: #6b9dff;
  --accent-soft: rgba(79, 139, 255, 0.12);
  --accent-line: rgba(79, 139, 255, 0.35);
  --tag-bg: rgba(79, 139, 255, 0.14);
  --anna: #f472b6;
  --anna-soft: rgba(244, 114, 182, 0.14);
  --code-bg: #0b0e13;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 40px 100px -20px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

/* ---------- Base ---------- */

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
code, kbd { font-family: var(--font-mono); font-size: 0.86em; }
kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  line-height: 1.4;
}
:not(pre) > code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--text);
}
[hidden] { display: none !important; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: 24px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: 600 15px/1.2 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost { border-color: var(--line-strong); color: var(--text); background: var(--surface); }
.btn-ghost:hover { border-color: var(--text-2); }
.btn-sm { padding: 7px 13px; font-size: 14px; border-radius: 8px; }
.btn svg { flex: none; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 700 18px/1 var(--font-display);
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.nav { display: flex; gap: 4px; margin-right: auto; }
.nav a {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  text-decoration: none;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding-block: 72px 40px;
  text-align: center;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -64px 0 auto;
  height: 720px;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, var(--accent-soft), transparent 70%);
  pointer-events: none;
  z-index: -1;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
}
.eyebrow-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent);
}
.hero h1 {
  margin: 22px auto 0;
  max-width: 14ch;
  font: 750 clamp(42px, 7.4vw, 84px)/1.0 var(--font-display);
  letter-spacing: -0.035em;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
}
.hero-lead {
  max-width: 640px;
  margin: 22px auto 0;
  color: var(--text-2);
  font-size: clamp(17px, 2vw, 19px);
  line-height: 1.55;
}
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
}

/* ---------- Outliner stage (hero demo) ---------- */

.stage {
  position: relative;
  margin: 56px auto 0;
  max-width: 1040px;
  text-align: left;
}
.stage-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.caption-text {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15.5px;
  color: var(--text);
  transition: opacity 0.25s;
}
.caption-text.fading { opacity: 0; }
.caption-step {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding-inline: 6px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font: 600 12.5px/1 var(--font-mono);
}
.caption-step.done { background: var(--ok); }
.stage-controls { display: flex; gap: 8px; }
.tour-progress {
  height: 2px;
  margin-top: -1px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.tour-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.4s ease;
}

.app-window {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.app-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-elev);
}
.win-dots { display: flex; gap: 6px; }
.win-dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--line-strong); }
.crumbs {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
  font-size: 13.5px;
  color: var(--muted);
}
.crumb {
  flex: none;
  max-width: 220px;
  padding: 3px 7px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  font: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.crumb:hover { background: var(--surface-2); color: var(--text); }
.crumb.current { color: var(--text); font-weight: 600; cursor: default; }
.crumb.current:hover { background: none; }
.crumb.pulse { animation: bulletPulse 0.7s ease; }
.crumb-sep { flex: none; color: var(--line-strong); }
.app-bar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; flex: none; }
.presence { display: flex; }
.avatar {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--bg-elev);
  font: 700 11px/1 var(--font);
  color: #fff;
  background: var(--accent);
}
.avatar + .avatar { margin-left: -7px; }
.avatar.anna { background: var(--anna); animation: pop 0.35s cubic-bezier(.3,1.6,.6,1); }
@keyframes pop { from { transform: scale(0.3); opacity: 0; } }
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ok);
}
.live-pill::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
  animation: pulse 2s infinite;
}
@keyframes pulse { 50% { opacity: 0.35; } }

.app-body { display: grid; grid-template-columns: 220px 1fr; min-height: 560px; }
.app-side {
  border-right: 1px solid var(--line);
  padding: 14px 10px;
  background: var(--bg-elev);
  font-size: 14px;
}
.side-label {
  margin: 14px 8px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.side-label:first-child { margin-top: 2px; }
.side-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 7px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.side-item.active { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.side-item.new { animation: flash 1.6s ease; }
@keyframes flash { 0%, 40% { background: var(--accent-soft); color: var(--accent); } }
.side-tags { display: flex; flex-wrap: wrap; gap: 4px; padding-inline: 6px; }
.side-tags span {
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--surface-2);
  font-size: 12px;
  color: var(--text-2);
}

.app-main { position: relative; min-width: 0; padding: 30px 40px 40px; }
.doc-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  font: 700 clamp(22px, 3vw, 30px)/1.2 var(--font-display);
  letter-spacing: -0.02em;
}
.doc-title .doc-icon { font-size: 0.95em; }
.zoom-in { animation: zoomIn 0.35s cubic-bezier(.2,.8,.2,1); }
.zoom-out { animation: zoomOut 0.35s cubic-bezier(.2,.8,.2,1); }
@keyframes zoomIn { from { opacity: 0; transform: translateX(18px) scale(0.985); } }
@keyframes zoomOut { from { opacity: 0; transform: translateX(-18px) scale(0.985); } }

/* Outliner rows */
.ol { position: relative; --indent: 26px; }
.ol-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  min-height: 32px;
  padding-left: calc(var(--depth, 0) * var(--indent));
}
.ol-row.entering { animation: rowIn 0.22s ease; }
@keyframes rowIn { from { opacity: 0; transform: translateY(-4px); } }
.ol-guide {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line);
}
.ol-gutter {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  width: 40px;
  height: 32px;
  margin-left: -14px;
}
.ol-toggle {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s, transform 0.18s;
  display: grid;
  place-items: center;
}
.ol-row:hover > .ol-gutter .ol-toggle,
.ol-toggle.show { opacity: 1; }
.ol-toggle.collapsed { transform: rotate(-90deg); }
.ol-bullet {
  position: relative;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-left: 2px;
  border: 0;
  padding: 0;
  border-radius: 50%;
  background: none;
  cursor: zoom-in;
}
.ol-bullet::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-2);
  transition: transform 0.15s;
}
.ol-bullet:hover { background: var(--surface-3); }
.ol-bullet:hover::after { transform: scale(1.25); }
.ol-bullet.has-hidden { background: var(--surface-3); }
.ol-bullet.pulse { animation: bulletPulse 0.7s ease; }
@keyframes bulletPulse {
  0% { box-shadow: 0 0 0 0 var(--accent-line); background: var(--accent-soft); }
  100% { box-shadow: 0 0 0 12px transparent; }
}

.ol-content {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding-block: 3px;
}
.ol-check {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 4px;
  border: 1.5px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  color: #fff;
  transition: background 0.15s, border-color 0.15s;
}
.ol-check svg { opacity: 0; transform: scale(0.5); transition: 0.15s; }
.ol-check.on { background: var(--ok); border-color: var(--ok); }
.ol-check.on svg { opacity: 1; transform: none; }
.ol-check.pop { animation: pop 0.4s cubic-bezier(.3,1.6,.6,1); }
.ol-text {
  flex: 1;
  min-width: 0;
  min-height: 26px;
  outline: none;
  color: var(--text);
  font-size: 16px;
  line-height: 26px;
  word-break: break-word;
  white-space: pre-wrap;
}
.ol-text:focus:empty::before {
  content: attr(data-ph);
  color: var(--muted);
  opacity: 0.6;
}
.ol-row.is-todo.is-done .ol-text { color: var(--muted); text-decoration: line-through; }
.ol-row.is-h2 .ol-text { font: 700 20px/30px var(--font-display); letter-spacing: -0.01em; }
.ol-row.is-h2 { padding-top: 10px; }
.ol-row.is-callout .ol-content {
  padding: 8px 14px;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: var(--accent-soft);
}
.ol-row.is-callout .ol-text { font-style: italic; color: var(--text-2); }
.ol-row.is-code .ol-content {
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--code-bg);
}
.ol-row.is-code .ol-text { font: 13.5px/22px var(--font-mono); color: var(--code-text); }
.ol-row.is-link .ol-text { color: var(--accent); }

.tok-tag {
  padding: 0 4px;
  border-radius: 4px;
  background: var(--tag-bg);
  color: var(--accent);
}
.tok-link { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
.tok-br { color: var(--muted); opacity: 0.55; }

/* Ghost caret during the tour */
.caret {
  display: inline-block;
  width: 2px;
  height: 1.15em;
  margin-left: 1px;
  vertical-align: -0.2em;
  background: var(--accent);
  animation: blink 1s steps(1) infinite;
}
.caret.anna { background: var(--anna); }
@keyframes blink { 50% { opacity: 0; } }

/* Locks */
.ol-row.locked .ol-text { color: var(--text-2); }
.lock-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--anna) 40%, transparent);
  background: var(--anna-soft);
  color: var(--anna);
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
}
.ol-row.shake .ol-content { animation: shake 0.35s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* Slash menu */
.slash-menu {
  position: absolute;
  z-index: 10;
  width: 280px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: menuIn 0.14s ease;
}
@keyframes menuIn { from { opacity: 0; transform: translateY(-4px); } }
.slash-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font: 14px/1.3 var(--font);
  text-align: left;
  cursor: pointer;
}
.slash-item.active { background: var(--accent-soft); }
.slash-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg-elev);
  font: 600 13px/1 var(--font-mono);
  color: var(--text-2);
}
.slash-item small { display: block; color: var(--muted); font-size: 12px; }
.slash-item code { margin-left: auto; padding: 0; background: none; color: var(--muted); font-size: 12px; }

.app-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: var(--bg-elev);
  font-size: 13px;
  color: var(--muted);
}
.app-foot kbd { font-size: 11.5px; }
.app-foot .sep { width: 1px; height: 14px; background: var(--line); }
.touch-tools { display: none; gap: 6px; margin-left: auto; }
.touch-tools button {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text-2);
  font: 600 13px/1 var(--font);
  cursor: pointer;
}
@media (hover: none) {
  .touch-tools { display: flex; }
  .keys-hint { display: none; }
  .ol-toggle { opacity: 1; }
}

.keycast {
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 15;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 3px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: 600 13px/1 var(--font-mono);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
}
.keycast.show { animation: keycast 1s ease forwards; }
@keyframes keycast {
  0% { opacity: 0; transform: translateY(4px) scale(0.9); }
  15% { opacity: 1; transform: none; }
  25% { transform: translateY(2px); border-bottom-width: 1px; }
  40% { transform: none; border-bottom-width: 3px; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 20;
  padding: 8px 14px;
  border-radius: 9px;
  background: var(--text);
  color: var(--bg);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transform: translate(-50%, 8px);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Sections ---------- */

.section { padding-block: 110px; }
.section-head { max-width: 720px; margin-bottom: 56px; }
.section-head.center { margin-inline: auto; text-align: center; }
.kicker,
.section-head p.kicker,
.demo-card > p.kicker {
  margin: 0 0 14px;
  color: var(--accent);
  font: 600 13px/1 var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.section h2 {
  margin: 0;
  font: 720 clamp(32px, 4.6vw, 52px)/1.05 var(--font-display);
  letter-spacing: -0.03em;
}
.section-head p {
  margin: 18px 0 0;
  color: var(--text-2);
  font-size: 18px;
}

/* Feature grid with mini illustrations */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.feature {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}
.feature:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.feature-vis {
  position: relative;
  height: 180px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 1px 1px, var(--line) 1px, transparent 0) 0 0 / 16px 16px,
    var(--bg-elev);
  overflow: hidden;
  font-size: 13.5px;
}
.feature-body { padding: 20px 22px 24px; }
.feature h3 {
  margin: 0 0 8px;
  font: 650 18px/1.3 var(--font-display);
  letter-spacing: -0.01em;
}
.feature p { margin: 0; color: var(--text-2); font-size: 15px; }

.mini { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.mini-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; white-space: nowrap; }
.mini-row::before { content: ""; flex: none; width: 5px; height: 5px; border-radius: 50%; background: var(--text-2); }
.mini-row.d1 { padding-left: 18px; }
.mini-row.d2 { padding-left: 36px; }
.mini-row.dim { opacity: 0.35; }
.mini-crumbs { display: flex; gap: 6px; align-items: center; margin-bottom: 10px; color: var(--muted); font-size: 12px; }
.mini-crumbs b { color: var(--text); font-weight: 600; }

.vis-zoom .mini { padding: 12px 14px; }
.vis-zoom .layer-a { position: absolute; inset: 22px 22px auto; transition: 0.6s; }
.vis-zoom .layer-b { position: absolute; inset: 22px 22px auto; opacity: 0; transform: scale(1.06); transition: 0.6s; }
.feature:hover .vis-zoom .layer-a, .vis-zoom.auto .layer-a { opacity: 0; transform: scale(0.94); }
.feature:hover .vis-zoom .layer-b, .vis-zoom.auto .layer-b { opacity: 1; transform: none; }
.vis-zoom .target::before { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.vis-slash .mini { padding: 6px; width: 230px; }
.vis-slash .q { margin-bottom: 8px; font-family: var(--font-mono); color: var(--text); }
.vis-slash .q span { color: var(--accent); }
.vis-slash .opt { display: flex; align-items: center; gap: 8px; padding: 5px 7px; border-radius: 6px; }
.vis-slash .opt.on { background: var(--accent-soft); }
.vis-slash .opt i { font-style: normal; display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--line); border-radius: 5px; font: 600 11px/1 var(--font-mono); color: var(--text-2); }

.vis-links .mini { padding: 10px 12px; }
.vis-links .back { position: absolute; right: 22px; bottom: 22px; width: 62%; padding: 10px 12px; }
.vis-links .back small { display: block; color: var(--muted); font-size: 11.5px; margin-bottom: 4px; }

.vis-tags { display: flex; flex-wrap: wrap; align-content: center; gap: 8px; }
.vis-tags span {
  padding: 4px 10px;
  border-radius: 7px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 13px;
}
.vis-tags span b { color: var(--accent); font-weight: 600; }
.vis-tags span sup { color: var(--muted); margin-left: 3px; }

.vis-todos .mini { padding: 10px 12px; }
.todo-mini { display: flex; align-items: center; gap: 8px; padding: 3px 0; white-space: nowrap; }
.todo-mini i { flex: none; width: 13px; height: 13px; border: 1.5px solid var(--line-strong); border-radius: 4px; }
.todo-mini.done i { background: var(--ok); border-color: var(--ok); }
.todo-mini.done span { color: var(--muted); text-decoration: line-through; }
.todo-mini small { margin-left: auto; padding-left: 10px; color: var(--muted); font-size: 11.5px; }

.vis-extract { display: flex; align-items: center; gap: 14px; }
.vis-extract .mini { flex: 1; padding: 10px 12px; min-width: 0; }
.vis-extract .arrow { flex: none; color: var(--accent); font-size: 20px; }
.vis-extract .hl { background: var(--accent-soft); border-radius: 6px; margin-inline: -6px; padding-inline: 6px; }

.more-features {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}
.more-features span {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 14.5px;
}

/* ---------- Collaboration ---------- */

.collab {
  background: var(--bg-elev);
  border-block: 1px solid var(--line);
}
.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 22px;
}
.duo-win {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.duo-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--muted);
}
.duo-bar strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 600; }
.duo-bar > .avatar, .duo-bar .live-pill { flex: none; }
.duo-bar .peer { flex: none; }
.duo-bar .live-pill { margin-left: auto; }
.duo-doc { padding: 16px 22px 24px; }
.duo-doc h4 { margin: 0 0 12px; font: 700 18px/1.3 var(--font-display); }
.duo-crumbs { margin-bottom: 8px; color: var(--muted); font-size: 12.5px; }
.duo-crumbs b { color: var(--text-2); font-weight: 600; }
.zoom-badge {
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font: 600 11px/18px var(--font-mono);
}
.duo .avatar { width: 22px; height: 22px; font-size: 9.5px; border-width: 0; }
.peer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  padding: 2px 9px 2px 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-2);
  font-size: 12px;
  white-space: nowrap;
  transition: border-color 0.3s, background 0.3s;
}
.peer .avatar { width: 18px; height: 18px; font-size: 8px; }
.peer.near { border-color: var(--anna); background: var(--anna-soft); color: var(--text); }
.duo-zone {
  position: relative;
  margin: 12px -10px 6px;
  padding: 8px 10px 8px;
  border: 1.5px dashed var(--accent-line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}
.duo-zone .ol-row.is-h2 { padding-top: 2px; }
.zone-label {
  position: absolute;
  top: -11px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px 0 3px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 20px;
}
.zone-label .avatar { width: 18px; height: 18px; font-size: 8px; }
.duo-map {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
}
.map-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-2);
  transition: 0.3s;
}
.map-pill.here { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.map-pill .avatar { width: 16px; height: 16px; font-size: 7px; animation: pop 0.35s cubic-bezier(.3,1.6,.6,1); }
.duo .ol-row.is-h2 .ol-text { font-size: 16px; line-height: 26px; }
.duo .ol-row.is-h2 { padding-top: 6px; }
.duo .ol-row { min-height: 30px; }
.duo .ol-text { font-size: 15px; }
.duo .lock-pill.me { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.duo-caption {
  min-height: 3.2em;
  margin: 22px 0 0;
  text-align: center;
  color: var(--text-2);
  font-weight: 500;
}

.collab-points {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  margin-top: 56px;
}
.collab-points h3 {
  margin: 0 0 6px;
  font: 650 16.5px/1.35 var(--font-display);
}
.collab-points p { margin: 0; color: var(--text-2); font-size: 14.5px; }
.collab-points .num {
  display: block;
  margin-bottom: 12px;
  color: var(--accent);
  font: 600 13px/1 var(--font-mono);
}
.fallback {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
  font: 500 12px/1 var(--font-mono);
  color: var(--muted);
}
.fallback span { padding: 4px 7px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }

/* ---------- Local speech recognition ---------- */

.voice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.voice-lead { margin: 18px 0 0; color: var(--text-2); font-size: 18px; }
.voice-ways { margin: 28px 0 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.voice-ways li { display: flex; gap: 14px; align-items: baseline; color: var(--text-2); font-size: 15.5px; }
.voice-ways li > code, .voice-ways li > b {
  flex: none;
  min-width: 96px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 13.5px;
  text-align: center;
}
.voice-ways li > b { font-family: var(--font); }

.dict-card {
  padding: 24px 26px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.dict-card h4 { margin: 0 0 12px; font: 700 19px/1.3 var(--font-display); }
.dict-card .ol-text { font-size: 15.5px; }
.dict-block {
  margin: 6px 0 0 26px;
  padding: 14px 16px 12px;
  border: 1px solid var(--accent-line);
  border-radius: 12px;
  background: var(--accent-soft);
  transition: opacity 0.25s, transform 0.25s;
}
.dict-block.leaving { opacity: 0; transform: scale(0.98); }
.dict-live { min-height: 3.2em; margin: 0 0 10px; font-size: 15.5px; line-height: 1.6; color: var(--text); }
.dict-interim { color: var(--muted); }
.dict-wave { display: flex; align-items: center; gap: 3px; height: 34px; }
.dict-wave i {
  flex: 1;
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.75;
  transform: scaleY(0.12);
  transition: transform 0.12s ease;
}
.dict-meta { display: flex; align-items: center; gap: 8px; margin-top: 10px; font: 500 13px/1 var(--font-mono); color: var(--text-2); }
.dict-rec { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; animation: pulse 1.2s infinite; }
.dict-stop {
  margin-left: auto;
  padding: 5px 12px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--text) 10%, transparent);
  font-family: var(--font);
  font-weight: 600;
  transition: 0.15s;
}
.dict-stop.press { background: var(--accent); color: #fff; transform: scale(0.95); }

.voice-path {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}
.vp-node {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
}
.vp-arrow { color: var(--accent); font-weight: 700; }
.vp-server {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 12px 10px;
  border: 1.5px dashed var(--accent-line);
  border-radius: 12px;
}
.vp-server small {
  position: absolute;
  top: -9px;
  left: 12px;
  padding: 0 6px;
  background: var(--bg);
  color: var(--accent);
  font: 600 11.5px/18px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.vp-cloud { margin: 12px 0 0; text-align: center; color: var(--muted); font-size: 13.5px; }
.vp-cloud s { text-decoration-color: #ef4444; text-decoration-thickness: 2px; }

/* ---------- App tour (screenshots) ---------- */

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 26px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow-x: auto;
  scrollbar-width: none;
  width: fit-content;
  max-width: 100%;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none;
  padding: 8px 15px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text-2);
  font: 500 14.5px/1.2 var(--font);
  cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: var(--accent); color: #fff; }

.shot-panel {
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: 40px;
  align-items: center;
}
.shot-panel.mobile { grid-template-columns: 1fr 1fr; }
.shot-frame {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.shot-frame img { width: 100%; height: auto; }
.phones { display: flex; justify-content: center; gap: 22px; }
.phone {
  width: min(46%, 270px);
  border: 7px solid var(--surface-3);
  border-radius: 32px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--surface);
}
.phone img { width: 100%; height: auto; }
.phone:nth-child(2) { transform: translateY(34px); }
.shot-text h3 {
  margin: 0 0 10px;
  font: 700 26px/1.2 var(--font-display);
  letter-spacing: -0.02em;
}
.shot-text p { margin: 0 0 14px; color: var(--text-2); }
.shot-text ul { margin: 0; padding: 0; list-style: none; }
.shot-text li {
  position: relative;
  padding: 5px 0 5px 22px;
  color: var(--text-2);
  font-size: 15px;
}
.shot-text li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 14px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Themes ---------- */

.theme-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.theme-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}
.theme-card img { width: 100%; height: auto; aspect-ratio: 1280 / 748; object-fit: cover; }
.theme-card figcaption {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
}
.theme-card figcaption i { width: 10px; height: 10px; border-radius: 50%; }
.theme-card figcaption small { margin-left: auto; color: var(--muted); font-weight: 500; }

/* ---------- Self-hosting ---------- */

.host {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 56px;
  align-items: start;
}
.host-facts { display: grid; gap: 22px; margin-top: 34px; }
.fact { display: flex; gap: 14px; }
.fact-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--accent);
}
.fact h3 { margin: 0 0 3px; font: 650 16px/1.4 var(--font-display); }
.fact p { margin: 0; color: var(--text-2); font-size: 14.5px; }

.code-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--code-bg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.code-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.code-tab {
  white-space: nowrap;
  padding: 8px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: #8b93a4;
  font: 500 13.5px/1 var(--font);
  cursor: pointer;
}
.code-tab[aria-selected="true"] { color: #fff; border-bottom-color: #4f8bff; }
.copy-btn {
  margin-left: auto;
  margin-bottom: 6px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  background: transparent;
  color: #c9d1dc;
  font: 500 12.5px/1 var(--font);
  cursor: pointer;
}
.copy-btn:hover { border-color: rgba(255, 255, 255, 0.35); color: #fff; }
.code-card pre {
  margin: 0;
  padding: 20px 22px;
  overflow-x: auto;
  color: var(--code-text);
  font: 13.5px/1.7 var(--font-mono);
}
.code-card .c { color: #6b7385; }
.code-card .k { color: #7aa2f7; }
.code-card .s { color: #9ece6a; }
.code-note {
  padding: 0 22px 18px;
  color: #8b93a4;
  font-size: 13.5px;
}
.code-note code { background: rgba(255, 255, 255, 0.08); color: #d8dee9; }

/* ---------- Demo CTA ---------- */

.demo-card {
  position: relative;
  padding: clamp(32px, 6vw, 72px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(ellipse 70% 80% at 100% 0%, var(--accent-soft), transparent 60%),
    var(--surface);
  overflow: hidden;
}
.demo-card h2 { max-width: 16ch; }
.demo-card > p { max-width: 560px; margin: 18px 0 0; color: var(--text-2); font-size: 18px; }
.demo-card > p.demo-tip {
  max-width: 640px;
  margin-top: 28px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-elev);
  color: var(--text-2);
  font-size: 15px;
}
.demo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-top: 32px; }
.demo-actions small { color: var(--muted); font-size: 14px; }

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 40px calc(40px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
}
.footer-inner .brand { font-size: 16px; color: var(--text); }
.footer-inner .brand img { width: 24px; height: 24px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-left: auto; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); }

/* ---------- Reveal on scroll ---------- */

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }

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

/* ---------- Responsive ---------- */

@media (max-width: 1020px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .collab-points { grid-template-columns: repeat(2, 1fr); }
  .theme-grid { grid-template-columns: repeat(2, 1fr); }
  .shot-panel, .shot-panel.mobile { grid-template-columns: 1fr; gap: 28px; }
  .host, .voice { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 860px) {
  .nav { display: none; }
  .header-inner { justify-content: space-between; }
  .app-body { grid-template-columns: 1fr; min-height: 480px; }
  .app-side { display: none; }
  .app-main { padding: 22px 18px 30px; }
  .duo { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .wrap { padding-inline: 16px; }
  .section { padding-block: 76px; }
  .hero { padding-top: 48px; }
  .feature-grid, .collab-points, .theme-grid { grid-template-columns: 1fr; }
  .header-actions .btn-ghost { display: none; }
  .ol { --indent: 18px; }
  .ol-text { font-size: 15px; }
  .crumb { max-width: 110px; }
  .duo-caption { min-height: 4.8em; }
  .stage-caption { align-items: flex-start; }
  .phone { border-width: 5px; border-radius: 24px; }
}
