/* ============================================================
   CollabMD landing — "Your folder, now multiplayer"
   Ink-dark, signal blue, presence amber/violet, JetBrains Mono
   eyebrows in the product's own file-path vernacular.
   ============================================================ */

:root {
  /* Palette mirrors the app's dark theme (src/client/styles/foundation/themes.css) */
  --ink: #0b0f14;          /* app --color-bg */
  --bg-2: #090d12;         /* slightly deeper than app bg for section rhythm */
  --panel: #11161d;        /* app --color-surface */
  --panel-2: #171d26;      /* app --color-surface-2 */
  --line: #242e3a;         /* app --color-divider */
  --line-soft: #1a222d;    /* between bg and divider */

  --text: #e6edf3;         /* app --color-text */
  --muted: #9aa7b4;        /* app --color-text-muted */
  --faint: #788698;        /* accessible secondary metadata */

  --blue: #60a5fa;         /* app --color-primary */
  --blue-deep: #2563eb;    /* app --color-primary-active */
  --cyan: #7dd3fc;         /* supporting accent (presence palette) */
  --amber: #fbbf24;        /* app --color-warning / presence */
  --violet: #a78bfa;       /* presence accent from the app's avatar palette */
  --green: #4ade80;        /* app --color-success */

  --font-display: 'Inter Tight', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  --wrap: 1160px;
  --radius: 14px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { scroll-behavior: smooth; }

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

/* film grain */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2000;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

img, video { display: block; max-width: 100%; height: auto; }
svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  padding: 0.1em 0.4em;
  color: var(--cyan);
  white-space: nowrap;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

::selection { background: rgba(96, 165, 250, 0.28); }

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 3000;
  background: var(--blue);
  color: #06101f;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  transition: top 0.2s var(--ease-out);
}
.skip-link:focus { top: 12px; }

.wrap {
  width: min(var(--wrap), 100% - 48px);
  margin-inline: auto;
}

/* ---------- Typography ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--blue);
  margin-bottom: 20px;
}
.eyebrow::before { content: ''; }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 1.2rem + 3.6vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.04;
}
.section-sub {
  color: var(--muted);
  max-width: 56ch;
  margin-top: 18px;
  font-size: 17px;
}
.section-head { margin-bottom: clamp(48px, 7vw, 88px); }

.grad {
  font-style: normal;
  background: linear-gradient(92deg, var(--blue) 10%, var(--cyan) 55%, var(--violet) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 14.5px;
  padding: 11px 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: transform 0.18s var(--ease-out), background 0.18s var(--ease-out),
              border-color 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn .icon { width: 16px; height: 16px; }

.btn-primary {
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
  color: #f4f9ff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 8px 24px rgba(37, 99, 235, 0.35);
}
.btn-primary:hover {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.22) inset, 0 10px 32px rgba(37, 99, 235, 0.5);
  transform: translateY(-1px);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--line);
  color: var(--text);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); border-color: #2a3850; }

.btn-lg { padding: 15px 26px; font-size: 15.5px; border-radius: 12px; }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: background 0.25s, border-color 0.25s, backdrop-filter 0.25s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(11, 15, 20, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line-soft);
}
.nav-inner {
  width: min(1280px, 100% - 40px);
  margin-inline: auto;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 17px;
  flex: none;
}
.nav-mark { width: 26px; height: 26px; color: var(--blue); }
.nav-links {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.nav-links a {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  padding: 7px 12px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav-cta { padding: 8px 15px; font-size: 13.5px; }

.nav-demo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--blue);
  padding: 7px 12px;
  border-radius: 8px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.nav-demo:hover { background: rgba(96, 165, 250, 0.1); color: var(--cyan); }
.nav-demo-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse-dot 2.2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.82); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-top: clamp(130px, 18vh, 190px);
  padding-bottom: 40px;
  overflow: hidden;
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 62% at 50% 0%, black 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 62% at 50% 0%, black 30%, transparent 78%);
  opacity: 0.55;
}
.hero-glow {
  position: absolute;
  top: -320px;
  left: 50%;
  width: 900px;
  height: 640px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(37, 99, 235, 0.22), rgba(125, 211, 252, 0.06), transparent);
  filter: blur(10px);
  pointer-events: none;
}
.hero-inner { position: relative; text-align: center; }

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 1.4rem + 7vw, 6.2rem);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 0.98;
  margin-bottom: 26px;
}
.hero-title .grad {
  display: inline-block;
  padding-inline-end: 0.07em;
  margin-inline-end: -0.07em;
  padding-block: 0.04em 0.14em;
  margin-block: -0.04em -0.14em;
}
.hero-sub {
  color: var(--muted);
  font-size: clamp(16px, 1.4vw, 18.5px);
  max-width: 58ch;
  margin: 0 auto 34px;
  text-wrap: balance;
}
.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.hero-demo-note {
  margin-bottom: 44px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.01em;
}

/* Terminal */
.term {
  width: min(680px, 100%);
  margin: 0 auto 64px;
  background: #0d141d;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(96, 165, 250, 0.05);
  overflow: hidden;
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.02);
}
.term-dots { display: flex; gap: 7px; flex: none; }
.term-dot { width: 11px; height: 11px; border-radius: 50%; background: #26303f; }
.term-dot:nth-child(1) { background: #ff5f57; opacity: 0.75; }
.term-dot:nth-child(2) { background: #febc2e; opacity: 0.75; }
.term-dot:nth-child(3) { background: #28c840; opacity: 0.75; }
.term-title {
  margin-left: 3px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--faint);
}
.term-copy {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.term-copy:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); border-color: #33445a; }
.term-copy.is-copied { color: var(--green); border-color: rgba(74, 222, 128, 0.35); }
.term-copy .icon { width: 13px; height: 13px; }
.term-body {
  padding: 20px 22px 24px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.75;
}
.term-line {
  white-space: normal;
  overflow-wrap: anywhere;
}
.term-prompt { color: var(--green); margin-right: 10px; user-select: none; }
.term-cmd { color: var(--text); }
.term-caret {
  display: inline-block;
  width: 8px;
  height: 17px;
  margin-left: 3px;
  vertical-align: -3px;
  background: var(--blue);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.term-out {
  max-height: 220px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.6s var(--ease-out), opacity 0.5s var(--ease-out) 0.1s;
}
.terminal-ready .term-out { max-height: 0; opacity: 0; }
.terminal-ready .term-out.is-open { max-height: 220px; opacity: 1; }
.term-key {
  display: inline-block;
  min-width: 66px;
  color: var(--violet);
  user-select: none;
}
.term-dim { color: var(--faint); }
.term-ready { color: var(--green); }
.term-next {
  max-height: 40px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.4s var(--ease-out), opacity 0.4s var(--ease-out);
}
.terminal-ready .term-next { max-height: 0; opacity: 0; }
.terminal-ready .term-next.is-open { max-height: 40px; opacity: 1; }

/* Hero shot */
.hero-shot { margin: 0 0 64px; }
.hero-shot-frame {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.55), 0 0 120px rgba(37, 99, 235, 0.12);
}
.hero-shot-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  border-radius: inherit;
  pointer-events: none;
}
.hero-shot-cap {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
}
.hero-shot-cap a { color: var(--blue); border-bottom: 1px solid rgba(96, 165, 250, 0.35); }
.hero-shot-cap a:hover { color: var(--cyan); }

.hero-facts {
  list-style: none;
  padding: 0;
  margin: 44px 0 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 28px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}
.hero-facts li { display: flex; align-items: center; gap: 8px; }
.fact-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 8px var(--blue); }

/* ---------- Marquee ---------- */
.marquee {
  border-block: 1px solid var(--line-soft);
  padding: 18px 0;
  margin: 60px 0 0;
  overflow: hidden;
  background: var(--bg-2);
  mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent);
}
.marquee-track {
  display: flex;
  gap: 44px;
  width: max-content;
  animation: marquee 36s linear infinite;
}
.marquee-track span {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--faint);
  white-space: nowrap;
  transition: color 0.2s;
}
.marquee-track span:hover { color: var(--blue); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { padding: clamp(90px, 12vw, 150px) 0 0; }

/* Feature blocks */
.feat {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(36px, 6vw, 80px);
  align-items: center;
  margin-bottom: clamp(80px, 10vw, 130px);
}
.feat-flip .feat-copy { order: 2; }
.feat-flip .feat-visual { order: 1; }

.eyebrow-path { color: var(--faint); }
.eyebrow-path::first-letter { color: var(--blue); }

.feat-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 1.1rem + 2vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 18px;
}
.feat-body { color: var(--muted); font-size: 16px; margin-bottom: 22px; }
.feat-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 10px;
  font-size: 14.5px;
  color: var(--muted);
}
.feat-list li { position: relative; padding-left: 24px; }
.feat-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--blue);
  font-family: var(--font-mono);
}

.feat-visual { min-width: 0; }

/* --- Mock: sync loop --- */
.sync-mock {
  display: grid;
  grid-template-columns: 1fr 64px 1.25fr 64px 1fr;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 26px;
  gap: 0;
}
.sync-node {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.sync-node-file {
  border-color: rgba(96, 165, 250, 0.35);
  box-shadow: 0 0 30px rgba(37, 99, 235, 0.12);
  gap: 8px;
}
.sync-node-label { font-size: 13px; font-weight: 600; }
.sync-node-sub { font-family: var(--font-mono); font-size: 10.5px; color: var(--faint); }
.sync-file-row {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sync-hl { color: var(--cyan); }
.sync-lane {
  position: relative;
  height: 2px;
  background: var(--line);
}
.sync-lane::before {
  content: '';
  position: absolute;
  inset: -6px 0;
}
.sync-pulse {
  position: absolute;
  top: -2.5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.sync-pulse-in {
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: lane-in 2.6s linear infinite;
}
.sync-pulse-out {
  background: var(--blue);
  box-shadow: 0 0 10px var(--blue);
  animation: lane-out 2.6s linear infinite;
}
@keyframes lane-in {
  from { left: 0; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  to { left: calc(100% - 7px); opacity: 0; }
}
@keyframes lane-out {
  from { right: 0; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  to { right: calc(100% - 7px); opacity: 0; }
}

/* --- Mock: editor with presence --- */
.editor-mock {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.editor-mock-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.02);
}
.editor-mock-file { color: var(--cyan); font-size: 12px; }
.editor-mock-presence {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-family: var(--font-body);
}
.pdot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.pdot-amber { background: var(--amber); }
.pdot-violet { background: var(--violet); }
.pdot-blue { background: var(--blue); }
.editor-mock-body { padding: 16px 0 52px; }
.eline {
  display: flex;
  align-items: center;
  padding: 3px 16px 3px 0;
  line-height: 1.7;
  position: relative;
}
.eln {
  width: 40px;
  flex: none;
  text-align: right;
  padding-right: 14px;
  color: #3d4a5f;
  user-select: none;
}
.elt { color: #c6d2e0; white-space: pre; }
.elt b { color: #fff; font-weight: 600; }
.elt-dim { color: var(--faint); }
.ecaret {
  width: 2px;
  height: 15px;
  margin-left: 2px;
  animation: blink 1.1s steps(1) infinite;
}
.ecaret-john { background: var(--amber); }
.ecaret-kim { background: var(--violet); }
.eflag {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  color: #0b0f14;
  padding: 1px 7px;
  border-radius: 999px;
  margin-left: 6px;
  transform: translateY(-9px);
}
.eflag-john { background: var(--amber); }
.eflag-kim { background: var(--violet); }
.editor-mock-chat {
  position: absolute;
  right: 14px;
  bottom: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  background: #1a222c;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}
.echat-name { font-weight: 700; }
.echat-kim { color: var(--violet); }
.echat-text { color: var(--muted); }

/* --- Mock: comments --- */
.comment-mock {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 0 26px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  overflow: hidden;
}
.eline-marked {
  background: rgba(96, 165, 250, 0.07);
  box-shadow: inset 2px 0 0 var(--blue);
}
.emark {
  background: rgba(96, 165, 250, 0.16);
  border-bottom: 1px solid rgba(96, 165, 250, 0.5);
  border-radius: 3px;
  padding: 0 2px;
  color: #dbeafe;
}
.emarker {
  flex: none;
  margin-left: 10px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--blue);
  color: #06101f;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  border-radius: 6px;
}
.thread-card {
  margin: 14px 16px 0 40px;
  background: #171d26;
  border: 1px solid rgba(96, 165, 250, 0.25);
  border-radius: 12px;
  padding: 14px 16px;
  font-family: var(--font-body);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.thread-head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.thread-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #0b0f14;
  flex: none;
}
.thread-avatar-john { background: var(--amber); }
.thread-avatar-kim { background: var(--violet); }
.thread-name { font-size: 13px; font-weight: 600; }
.thread-time { margin-left: auto; font-size: 11px; color: var(--faint); font-family: var(--font-mono); }
.thread-text { font-size: 13.5px; color: #c6d2e0; }
.thread-reply {
  display: flex;
  gap: 9px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  align-items: flex-start;
}
.thread-reply .thread-text { padding-top: 2px; }
.thread-resolve {
  margin-top: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  border: 1px solid rgba(74, 222, 128, 0.35);
  padding: 5px 12px;
  border-radius: 8px;
  transition: background 0.15s;
}
.thread-resolve:hover { background: rgba(74, 222, 128, 0.1); }

/* --- Mock: diagram grid --- */
.diagram-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.diagram-tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.25s var(--ease-out), border-color 0.25s, box-shadow 0.25s;
}
.diagram-tile:hover {
  transform: translateY(-4px);
  border-color: rgba(96, 165, 250, 0.4);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
}
.diagram-glyph { width: 100%; height: 74px; margin-bottom: 12px; }
.dg-box { fill: rgba(255, 255, 255, 0.04); stroke: #5a6b82; stroke-width: 1.4; }
.dg-box-blue { fill: rgba(96, 165, 250, 0.12); stroke: var(--blue); }
.dg-line { stroke: #5a6b82; stroke-width: 1.4; fill: none; }
.dg-line-blue { stroke: var(--blue); }
.dg-dash { stroke-dasharray: 4 4; }
.dg-arrow { stroke-linecap: round; stroke-linejoin: round; }
.dg-dot { fill: #5a6b82; }
.dg-sketch { stroke: #8fa1b8; stroke-width: 1.8; fill: none; stroke-linecap: round; }
.dg-sketch-blue { stroke: var(--blue); fill: rgba(96, 165, 250, 0.08); }
.diagram-name { font-weight: 700; font-size: 14.5px; }
.diagram-ext { font-family: var(--font-mono); font-size: 11px; color: var(--faint); }

/* ---------- Secondary capabilities ---------- */
#features .feat:last-of-type {
  margin-bottom: clamp(48px, 6vw, 72px);
}
.capability-rail {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-block: 1px solid var(--line);
}
.capability {
  min-width: 0;
  padding: 24px 28px;
}
.capability:first-child { padding-left: 0; }
.capability:last-child { padding-right: 0; }
.capability + .capability { border-left: 1px solid var(--line-soft); }
.capability-kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--blue);
  margin-bottom: 10px;
}
.capability-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 7px;
  transition: color 0.18s;
}
.capability:hover .capability-title { color: var(--blue); }
.capability-body { font-size: 13.5px; color: var(--muted); }
.capability-rail-operations { margin-top: 24px; }

/* ---------- Demo ---------- */
.section-demo .section-head { text-align: center; }
.section-demo .section-sub { margin-inline: auto; }
.demo-frame {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.5), 0 0 100px rgba(37, 99, 235, 0.08);
  background: var(--panel);
}
.demo-frame video { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.demo-video-toggle {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(230, 237, 243, 0.2);
  border-radius: 9px;
  background: rgba(11, 15, 20, 0.82);
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 12px;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s, transform 0.15s var(--ease-out);
}
.video-ready .demo-video-toggle { display: inline-flex; }
.demo-video-toggle:hover { background: rgba(23, 29, 38, 0.94); border-color: rgba(96, 165, 250, 0.5); transform: translateY(-1px); }
.demo-video-icon {
  width: 10px;
  height: 12px;
  border-inline: 3px solid currentColor;
}
.demo-video-toggle.is-paused .demo-video-icon {
  width: 0;
  height: 0;
  border: 6px solid transparent;
  border-left: 9px solid currentColor;
  border-right: 0;
}

/* Demo link card — the "play around" invitation */
.demo-cta { margin-top: 22px; }
.demo-link-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: linear-gradient(120deg, rgba(37, 99, 235, 0.12), rgba(125, 211, 252, 0.04) 60%, transparent);
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 14px;
  padding: 20px 24px;
  transition: transform 0.22s var(--ease-out), border-color 0.22s, box-shadow 0.22s;
}
.demo-link-card:hover {
  transform: translateY(-2px);
  border-color: rgba(96, 165, 250, 0.6);
  box-shadow: 0 16px 44px rgba(37, 99, 235, 0.22);
}
.demo-link-left { display: flex; align-items: center; gap: 16px; min-width: 0; }
.demo-link-pulse {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px var(--green);
  animation: pulse-dot 2.2s ease-in-out infinite;
}
.demo-link-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.demo-link-title {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.demo-link-sub { font-size: 13.5px; color: var(--muted); }
.demo-link-arrow {
  flex: none;
  font-size: 22px;
  color: var(--blue);
  transition: transform 0.22s var(--ease-out);
}
.demo-link-card:hover .demo-link-arrow { transform: translateX(5px); }

/* ---------- Steps ---------- */
.steps {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  counter-reset: step;
}
.step {
  display: flex;
  gap: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
}
.step::after {
  content: '';
  position: absolute;
  top: 0; left: 24px; right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.4), transparent);
}
.step-num {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(96, 165, 250, 0.55);
  flex: none;
}
.step-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.step-text { font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.step-cmd {
  display: inline-block;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* ---------- Install ---------- */
.install {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.install-tabs {
  display: flex;
  gap: 4px;
  padding: 10px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.02);
}
.install-tab {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  padding: 8px 18px;
  border-radius: 9px;
  border: 1px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.install-tab:hover { color: var(--text); }
.install-tab.is-active {
  color: var(--text);
  background: var(--panel-2);
  border-color: var(--line);
}
.install-panel { padding: 26px 28px 22px; }
.install-code {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.install-code pre {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  overflow-x: auto;
  min-width: 0;
  max-width: 100%;
  padding-top: 4px;
}
.install-code .btn { flex: none; padding: 8px 14px; font-size: 13px; }
.install-note {
  margin-top: 16px;
  font-size: 13.5px;
  color: var(--faint);
}

/* ---------- Final CTA ---------- */
.cta {
  margin-top: clamp(100px, 13vw, 170px);
  padding: clamp(80px, 10vw, 130px) 0;
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line-soft);
  background:
    radial-gradient(ellipse 70% 90% at 50% 120%, rgba(37, 99, 235, 0.2), transparent 70%),
    var(--bg-2);
}
.cta-inner { text-align: center; }
.cta-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 1.2rem + 4.5vw, 4rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.02;
  margin-bottom: 40px;
}
.cta-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.copy-mono { font-family: var(--font-mono); font-weight: 400; font-size: 14px; color: var(--cyan); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line-soft);
  padding: 44px 0;
  background: var(--ink);
}
.footer-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.footer-brand { display: flex; flex-direction: column; gap: 2px; }
.footer-word {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 16px;
}
.footer-tag { font-size: 12.5px; color: var(--faint); }
.footer-links {
  display: flex;
  gap: 22px;
  margin-left: auto;
}
.footer-links a {
  font-size: 13.5px;
  color: var(--muted);
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--text); }
.footer-legal {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--faint);
  margin-top: 8px;
}

/* ---------- Reveal ---------- */
.reveal-ready .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.reveal-ready .reveal.is-visible { opacity: 1; transform: none; }
html:not(.copy-ready) .copy-btn,
html:not(.tabs-ready) .install-tabs { display: none; }
/* Stagger children groups slightly via transition-delay when siblings reveal together */
.capability-rail .reveal:nth-child(2), .steps .reveal:nth-child(2) { transition-delay: 0.08s; }
.capability-rail .reveal:nth-child(3), .steps .reveal:nth-child(3) { transition-delay: 0.16s; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .feat, .feat-flip { grid-template-columns: 1fr; }
  .feat-flip .feat-copy { order: 1; }
  .feat-flip .feat-visual { order: 2; }
  .steps { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-demo { margin-left: auto; }
}
@media (max-width: 640px) {
  .hero-actions { margin-bottom: 12px; }
  .hero-demo-note { margin-bottom: 34px; }
  .hero-shot { margin-bottom: 44px; }
  .term { margin-bottom: 48px; }
  .hero-facts { margin-top: 0; }
  .nav-cta { display: none; }
  .capability-rail { grid-template-columns: 1fr; }
  .capability { padding: 20px 0; }
  .capability + .capability { border-left: 0; border-top: 1px solid var(--line-soft); }
  .diagram-grid { grid-template-columns: 1fr; }
  .sync-mock { grid-template-columns: 1fr; gap: 18px; }
  .sync-lane { height: 34px; width: 2px; margin-inline: auto; }
  .sync-pulse-in { animation: none; opacity: 0; }
  .sync-pulse-out { animation: none; opacity: 0; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .editor-mock .elt, .comment-mock .elt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .editor-mock .eflag { flex: none; }
  .comment-mock .emarker { margin-left: 6px; margin-right: 12px; }
  .thread-card { margin-left: 16px; }
  .install-code { flex-direction: column; min-width: 0; }
  .install-code pre { width: 100%; }
  .cta-actions .btn { width: 100%; justify-content: center; min-width: 0; }
  .copy-mono { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .footer-links { margin-left: 0; flex-wrap: wrap; gap: 12px 18px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal-ready .reveal { opacity: 1; transform: none; transition: none; }
  .marquee-track { animation: none; }
  .term-caret, .ecaret { animation: none; }
  .sync-pulse-in, .sync-pulse-out { animation: none; opacity: 0; }
  .nav-demo-dot, .demo-link-pulse { animation: none; }
  .btn, .capability-title, .diagram-tile, .demo-link-card, .demo-link-arrow, .demo-video-toggle { transition: none; }
}
