/* ── Theme tokens (matches the dashboard's navy/purple system) ────── */
:root, :root[data-theme="dark"] {
  --crust:        #040E1F;
  --base:         #081425;
  --mantle:       #111C2D;
  --surface0:     #152031;
  --surface1:     #1F2A3C;
  --surface2:     #2A3548;
  --text:         #D8E3FB;
  --subtext:      #CCC3D8;
  --subtext0:     #6B7280;

  --primary:        #7C3AED;
  --primary-soft:   #D2BBFF;
  --primary-bright: #EDE0FF;
  --primary-deep:   #3F008E;
  --indigo:         #5254DF;
  --indigo-soft:    #C0C1FF;

  --mauve:  #7C3AED;
  --green:  #3FD3A1;
  --yellow: #F5C95B;
  --sky:    #4FC8E6;
  --peach:  #FB923C;
  --red:    #F77272;

  --border:        rgba(255, 255, 255, 0.10);
  --border-soft:   rgba(255, 255, 255, 0.05);
  --border-strong: rgba(255, 255, 255, 0.12);

  --glass-nav:  rgba(8, 20, 37, 0.65);
  --glass-card: rgba(21, 32, 49, 0.6);

  --shadow:         0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-card:    0 4px 4px rgba(0, 0, 0, 0.25);
  --shadow-soft:    0 10px 15px -3px rgba(210, 187, 255, 0.20),
                    0 4px 6px -4px rgba(210, 187, 255, 0.20);
  --shadow-primary: 0 12px 28px -8px rgba(124, 58, 237, 0.45);

  --font-display: 'Hanken Grotesk', 'Inter', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;
  --font-ui:      'Geist', 'Inter', system-ui, sans-serif;
  --font-mono:    'Geist Mono', ui-monospace, 'SF Mono', Consolas, monospace;
}

:root[data-theme="light"] {
  --crust:        #ECECF4;
  --base:         #F5F5FA;
  --mantle:       #FFFFFF;
  --surface0:     #FFFFFF;
  --surface1:     #F1EEF7;
  --surface2:     #E5DEF2;
  --text:         #14132B;
  --subtext:      #4B4760;
  --subtext0:     #8A86A0;

  --primary:        #7C3AED;
  --primary-soft:   #6428D2;
  --primary-bright: #FFFFFF;
  --primary-deep:   #FFFFFF;
  --indigo:         #4244B5;
  --indigo-soft:    #4244B5;

  --mauve:  #6428D2;
  --green:  #2EB17F;
  --yellow: #C99419;
  --sky:    #178FB6;
  --peach:  #DC6A1B;
  --red:    #D14444;

  --border:        rgba(15, 23, 42, 0.10);
  --border-soft:   rgba(15, 23, 42, 0.06);
  --border-strong: rgba(15, 23, 42, 0.14);

  --glass-nav:  rgba(255, 255, 255, 0.78);
  --glass-card: rgba(255, 255, 255, 0.85);
}

/* ── Base ─────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: dark; }
:root[data-theme="light"] html { color-scheme: light; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px; line-height: 1.6;
  color: var(--text);
  background: var(--base);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  position: relative;
}

/* Painterly aurora behind the page — same atmospheric glow as the app. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(60vw 50vh at 12% -8%, rgba(124, 58, 237, 0.18), transparent 60%),
    radial-gradient(50vw 40vh at 88% -4%, rgba(82, 84, 223, 0.14), transparent 65%),
    radial-gradient(40vw 30vh at 100% 100%, rgba(124, 58, 237, 0.10), transparent 70%);
}
:root[data-theme="light"] body::before {
  background:
    radial-gradient(60vw 50vh at 12% -8%, rgba(124, 58, 237, 0.10), transparent 60%),
    radial-gradient(50vw 40vh at 88% -4%, rgba(82, 84, 223, 0.06), transparent 65%);
}

body > * { position: relative; z-index: 1; }

a { color: var(--primary-soft); text-decoration: none; }
a:hover { color: var(--primary-bright); text-decoration: underline; }
[data-theme="light"] a:hover { color: var(--primary); }

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--surface1);
  color: var(--text);
  padding: 2px 6px;
  border-radius: 4px;
}

h1, h2, h3 {
  color: var(--text);
  margin: 0 0 16px 0;
  line-height: 1.2;
  letter-spacing: -0.012em;
  font-family: var(--font-display);
}
h1 { font-size: clamp(2.6rem, 5.4vw, 4.2rem); font-weight: 600; text-align: center; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 600; text-align: center; }
h3 { font-size: 1.18rem; font-weight: 600; }
p { margin: 0 0 12px 0; color: var(--subtext); }
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }

/* ── Nav ──────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--glass-nav);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid var(--border-soft);
}
.nav-inner {
  display: flex; align-items: center; gap: 24px;
  padding: 14px 24px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-weight: 600; font-size: 20px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand-accent {
  background: linear-gradient(135deg, #C0A6FF 0%, #7C3AED 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-logo { display: block; flex-shrink: 0; filter: drop-shadow(0 4px 8px rgba(124, 58, 237, 0.45)); }
.nav-links {
  display: flex; gap: 24px;
  margin-left: auto;
  font-size: 14px;
}
.nav-links a { color: var(--subtext); }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.theme-toggle {
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--subtext);
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease;
}
.theme-toggle:hover { color: var(--text); background: var(--surface1); border-color: var(--border-soft); }
@media (max-width: 720px) {
  .nav-inner {
    flex-wrap: wrap;
    gap: 10px 16px;
  }
  .brand {
    flex: 1 1 auto;
  }
  .nav-links {
    order: 3;
    width: 100%;
    gap: 18px;
    margin-left: 0;
    overflow-x: auto;
    padding-bottom: 2px;
    white-space: nowrap;
  }
  .theme-toggle {
    margin-left: auto;
  }
}

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero { padding: 80px 0 40px; }
.hero-inner {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: center;
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}
.hero-copy { width: 100%; }
.hero-copy .install-tabs { margin-left: auto; margin-right: auto; }
@media (max-width: 960px) {
  .hero { padding: 40px 0 24px; }
}
.kicker {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--primary-soft);
  background: rgba(124, 58, 237, 0.14);
  border: 1px solid rgba(210, 187, 255, 0.20);
  padding: 5px 12px; border-radius: 999px;
  margin-bottom: 20px;
}
.accent {
  background: linear-gradient(135deg, #D2BBFF 0%, #7C3AED 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.lede {
  font-size: 22px;
  line-height: 1.5;
  max-width: 640px;
  margin: 0 auto 32px;
  color: var(--subtext);
  text-align: center;
}

/* Install command boxes */
.install-tabs {
  width: min(720px, 100%);
  margin: 0 auto 14px;
  text-align: left;
}
.install-tabs-compact {
  width: min(620px, 100%);
  margin-top: 22px;
  margin-bottom: 24px;
}
.install-tablist {
  display: flex;
  align-items: flex-end;
  gap: 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
}
.install-tab {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--subtext);
  cursor: pointer;
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  padding: 0 0 12px;
  transition: color 150ms ease, border-color 150ms ease;
}
.install-tab:hover,
.install-tab.active {
  color: var(--peach);
  border-bottom-color: var(--peach);
}
.install-panel { display: none; }
.install-panel.active { display: block; }
.install-cmd {
  position: relative;
  background: var(--mantle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 80px 16px 18px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text);
  overflow-x: auto;
  white-space: nowrap;
}
.install-cmd code { background: transparent; padding: 0; color: var(--text); }
.install-cmd-large { font-size: 16px; padding: 22px 90px 22px 22px; max-width: 600px; margin: 24px auto 32px; }
/* Tight variant for the final CTA — same width as the buttons row, less
   vertical air so the box doesn't dwarf the single line of code inside. */
.install-cmd-tight {
  font-size: 14px;
  padding: 10px 70px 10px 16px;
  margin: 0;
}
.install-cmd-tight .copy-btn { padding: 4px 10px; font-size: 11px; }
.copy-btn {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: var(--surface2); color: var(--subtext);
  border: 1px solid var(--border-soft); border-radius: 6px;
  padding: 6px 12px; font-family: var(--font-ui); font-size: 11px; font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.copy-btn:hover { background: var(--primary); color: var(--primary-bright); border-color: var(--primary); }
.copy-btn.copied { color: var(--green); border-color: var(--green); background: rgba(63, 211, 161, 0.08); }
.install-note { font-size: 13px; color: var(--subtext0); margin: 0 0 28px 0; }
.install-note code { font-size: 12px; }
.hero-define {
  max-width: 440px;
  margin: 6px auto 34px;
  padding: 14px 18px 18px;
  text-align: left;
  background: var(--surface0);
  border: 1px solid var(--border);
  border-left: 3px solid var(--mauve);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}
.hero-define .define-headword { margin: 0 0 5px; font-size: 15px; font-weight: 700; color: var(--text); }
.hero-define .define-pron,
.hero-define .define-pos { font-weight: 400; font-style: italic; color: var(--subtext0); }
.hero-define .define-meaning { margin: 0 0 6px; font-size: 14px; color: var(--text); }
.hero-define .define-example { margin: 0; font-size: 13px; font-style: italic; color: var(--subtext); }
@media (max-width: 620px) {
  .install-tablist { gap: 18px; margin-bottom: 18px; }
  .install-tab { font-size: 12px; }
  .install-cmd {
    padding: 14px 62px 14px 14px;
    font-size: 12px;
  }
  .copy-btn { padding: 5px 8px; }
}

/* CTAs */
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.btn-with-icon svg { flex-shrink: 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 12px 22px; border-radius: 10px;
  font-family: var(--font-ui);
  font-size: 14px; font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  cursor: pointer; text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: var(--primary);
  color: var(--primary-bright);
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover {
  background: #6E2BE0;
  box-shadow: 0 16px 36px -8px rgba(124, 58, 237, 0.55);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--primary-soft); background: var(--surface1); color: var(--primary-soft); }
.btn-github {
  background: var(--sky);
  color: #04101F;
  border-color: rgba(79, 200, 230, 0.55);
  box-shadow: 0 12px 28px -10px rgba(79, 200, 230, 0.55);
}
.btn-github:hover {
  background: #38BDF8;
  border-color: #38BDF8;
  box-shadow: 0 16px 34px -12px rgba(56, 189, 248, 0.65);
}

/* ── Hero shot band (full-width screenshot above the pitch) ───────── */
.hero-shot-band {
  padding: 0 0 60px;
  position: relative;
}
.hero-shot-band .container { position: relative; }
.hero-screenshot {
  display: block;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--mantle);
  box-shadow:
    0 40px 80px -24px rgba(0, 0, 0, 0.6),
    0 16px 36px -12px rgba(124, 58, 237, 0.35);
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.hero-screenshot:hover {
  transform: translateY(-3px);
  box-shadow:
    0 50px 90px -24px rgba(0, 0, 0, 0.65),
    0 20px 44px -12px rgba(124, 58, 237, 0.45);
  text-decoration: none;
}
.hero-screenshot img {
  display: block;
  width: 100%;
  height: auto;
}
/* Soft purple aura behind the screenshot frame */
.hero-screenshot::before {
  content: '';
  position: absolute;
  inset: -60px;
  border-radius: 28px;
  background: radial-gradient(closest-side, rgba(124, 58, 237, 0.30), transparent 70%);
  filter: blur(60px);
  z-index: -1;
  pointer-events: none;
}
@media (max-width: 720px) {
  .hero-shot-band { padding: 0 0 36px; }
}

/* ── Pitch ────────────────────────────────────────────────────────── */
.pitch {
  padding: 60px 0;
  background: var(--mantle);
  border-block: 1px solid var(--border-soft);
}
.pitch h2 { margin: 0 auto 24px; max-width: 700px; }
.pitch-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.pitch-list li {
  position: relative;
  padding-left: 28px;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--subtext);
}
.pitch-list li::before {
  content: "→";
  position: absolute; left: 0; top: 0;
  color: var(--primary-soft);
  font-weight: 700;
}
.pitch-list strong { color: var(--text); }

/* ── Demo ─────────────────────────────────────────────────────────── */
.demo { padding: 80px 0; }
.demo h2 { text-align: center; margin-bottom: 12px; }
.demo-intro { text-align: center; max-width: 720px; margin: 0 auto 32px; font-size: 16px; }
.demo-frame {
  max-width: 920px; margin: 0 auto;
  background: var(--mantle);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.demo-frame video {
  display: block; width: 100%; height: auto;
  background: var(--crust);
}
.demo-fallback {
  text-align: center; font-size: 13px; color: var(--subtext0);
  padding: 14px 16px 18px; margin: 0;
  border-top: 1px solid var(--border);
}

/* ── Features ─────────────────────────────────────────────────────── */
.features {
  padding: 80px 0;
  background: var(--mantle);
  border-block: 1px solid var(--border-soft);
}
.features h2 { margin-bottom: 40px; }
.feature-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.feature {
  background: var(--glass-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 24px 26px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 150ms ease, transform 150ms ease;
}
.feature:hover { border-color: rgba(210, 187, 255, 0.40); transform: translateY(-2px); }
.feature-icon {
  display: inline-flex;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  background: rgba(124, 58, 237, 0.16);
  color: var(--primary-soft);
  border-radius: 10px;
  margin-bottom: 14px;
}
.feature h3 { margin-bottom: 8px; }
.feature p { font-size: 14px; line-height: 1.55; margin: 0; }

/* ── How it works ─────────────────────────────────────────────────── */
.how-it-works { padding: 80px 0; }
.how-it-works h2 { margin-bottom: 32px; }
.hiw-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 24px; }
.hiw-list > li { display: flex; gap: 20px; }
.hiw-step {
  flex-shrink: 0;
  font-family: var(--font-ui);
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--primary-soft);
  background: rgba(124, 58, 237, 0.14);
  padding: 8px 12px; border-radius: 8px;
  height: fit-content;
}
.hiw-list h3 { margin-bottom: 6px; }
.hiw-list p { font-size: 14.5px; line-height: 1.6; margin: 0; }

/* ── Comparison ───────────────────────────────────────────────────── */
.comparison {
  padding: 80px 0;
  background: var(--mantle);
  border-block: 1px solid var(--border-soft);
}
.comparison h2 { margin-bottom: 12px; }
.vs-intro { font-size: 16px; max-width: 760px; margin: 0 auto 32px; text-align: center; }
.vs-grid { display: grid; gap: 24px; grid-template-columns: 1fr 1fr; }
@media (max-width: 700px) { .vs-grid { grid-template-columns: 1fr; } }
.vs-col {
  background: var(--glass-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.vs-col h3 {
  font-family: var(--font-ui);
  color: var(--subtext);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}
.vs-col-us {
  border-color: rgba(210, 187, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(210, 187, 255, 0.25) inset, var(--shadow-primary);
}
.vs-col-us h3 { color: var(--primary-soft); }
.vs-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.vs-list li {
  position: relative;
  padding-left: 26px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--subtext);
}
.vs-list-against li::before {
  content: "✕";
  position: absolute; left: 0;
  color: var(--red); font-weight: 700;
}
.vs-list-for li::before {
  content: "✓";
  position: absolute; left: 0;
  color: var(--green); font-weight: 700;
}
.vs-note {
  font-size: 14px; color: var(--subtext); text-align: center;
  margin: 32px 0 0 0; font-style: italic;
}

/* ── Privacy ──────────────────────────────────────────────────────── */
.privacy { padding: 80px 0; }
.privacy-inner {
  display: grid; gap: 40px;
  grid-template-columns: 1fr 1fr;
  align-items: start;
}
@media (max-width: 800px) { .privacy-inner { grid-template-columns: 1fr; } }
.privacy h2 { margin-bottom: 14px; text-align: left; }
.privacy p { font-size: 14.5px; }
.codeblock {
  background: var(--mantle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 24px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  overflow-x: auto;
}
.codeblock code { background: transparent; padding: 0; font-size: inherit; color: inherit; }

/* ── Final CTA ────────────────────────────────────────────────────── */
.final-cta {
  padding: 100px 0;
  background: var(--mantle);
  border-block: 1px solid var(--border-soft);
  text-align: center;
}
.final-cta h2 { margin-bottom: 8px; }
.cta-links { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
  padding: 32px 0;
  background: var(--crust);
  font-size: 13px;
  color: var(--subtext0);
  border-top: 1px solid var(--border-soft);
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 16px;
}
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--subtext); }
.footer-links a:hover { color: var(--text); }

/* ── Planned integrations ─────────────────────────────────────────── */
.integrations { padding: 80px 0; }
.integrations h2 { margin-bottom: 12px; }
.integrations-intro { font-size: 16px; max-width: 760px; margin: 0 auto 32px; text-align: center; }
.integration-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.integration {
  background: var(--glass-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 24px 26px;
  display: flex; flex-direction: column; gap: 10px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.integration h3 {
  margin: 0;
  font-size: 1.1rem;
}
.integration p { font-size: 14px; line-height: 1.55; margin: 0; }
.integration-status {
  align-self: flex-start;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(124, 58, 237, 0.16);
  color: var(--primary-soft);
  padding: 4px 11px;
  border-radius: 999px;
}
.integration-suggest {
  border-style: dashed;
}
.integration-suggest .integration-status {
  background: var(--surface1);
  color: var(--subtext);
}

/* Architecture page */
.architecture-page .nav-links a[aria-current="page"] {
  color: var(--text);
}
.architecture-hero {
  padding: 82px 0 48px;
  text-align: center;
}
.architecture-hero-inner {
  max-width: 820px;
}
.architecture-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.architecture-flow {
  padding: 72px 0 84px;
  background: var(--mantle);
  border-block: 1px solid var(--border-soft);
}
.architecture-flow .container {
  max-width: 1360px;
}
.section-heading {
  max-width: 780px;
  margin: 0 auto 28px;
  text-align: center;
}
.section-heading .kicker {
  margin-bottom: 14px;
}
.map-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 26px;
}
.path-chip {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface0);
  color: var(--subtext);
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 13px;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 120ms ease;
}
.path-chip:hover,
.path-chip.active {
  background: rgba(124, 58, 237, 0.18);
  border-color: rgba(210, 187, 255, 0.42);
  color: var(--text);
  transform: translateY(-1px);
}
.flow-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
  align-items: start;
}
.flow-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(145px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding: 2px 2px 18px;
}
.flow-lane {
  position: relative;
  min-width: 145px;
  display: grid;
  align-content: start;
  gap: 12px;
}
.flow-lane:not(:last-child)::after {
  content: ">";
  position: absolute;
  top: 62px;
  right: -13px;
  z-index: 2;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface1);
  border: 1px solid var(--border);
  color: var(--primary-soft);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 800;
}
.lane-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
}
.lane-heading h3 {
  margin: 0;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--subtext);
}
.lane-number {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(79, 200, 230, 0.12);
  border: 1px solid rgba(79, 200, 230, 0.22);
  color: var(--sky);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
}
.flow-node {
  position: relative;
  width: 100%;
  min-height: 130px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--glass-card);
  color: var(--text);
  cursor: pointer;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-card);
  transition: border-color 150ms ease, box-shadow 150ms ease, opacity 150ms ease, transform 150ms ease;
}
.flow-node::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 14px 0 0 14px;
  background: var(--primary);
  opacity: 0.75;
}
.flow-lane:nth-child(2) .flow-node::before { background: var(--green); }
.flow-lane:nth-child(3) .flow-node::before { background: var(--yellow); }
.flow-lane:nth-child(4) .flow-node::before { background: var(--sky); }
.flow-lane:nth-child(5) .flow-node::before { background: var(--peach); }
.flow-lane:nth-child(6) .flow-node::before { background: var(--red); }
.flow-node:hover,
.flow-node:focus-visible,
.flow-node.active {
  border-color: rgba(210, 187, 255, 0.58);
  box-shadow: 0 16px 34px -22px rgba(124, 58, 237, 0.85), var(--shadow-card);
  transform: translateY(-2px);
  outline: none;
}
.flow-node.is-muted {
  opacity: 0.35;
}
.flow-node.is-highlighted {
  border-color: rgba(63, 211, 161, 0.55);
  box-shadow: 0 0 0 1px rgba(63, 211, 161, 0.16) inset, var(--shadow-card);
}
.flow-node .node-kicker {
  color: var(--subtext0);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.flow-node strong {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.18;
}
.flow-node small {
  color: var(--subtext);
  font-size: 13px;
  line-height: 1.4;
}
.flow-node[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(100% + 10px);
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  background: var(--crust);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.45;
  padding: 10px 12px;
  transition: opacity 140ms ease, transform 140ms ease;
}
.flow-node[data-tip]:hover::after,
.flow-node[data-tip]:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}
.flow-lane .flow-node:first-of-type[data-tip]::after {
  top: calc(100% + 10px);
  bottom: auto;
}
.flow-inspector {
  position: sticky;
  top: 86px;
  background: var(--surface0);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.inspector-label {
  display: inline-block;
  color: var(--primary-soft);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.flow-inspector h3 {
  margin-bottom: 10px;
}
.flow-inspector p {
  font-size: 14px;
  line-height: 1.55;
}
.inspector-meta {
  display: grid;
  gap: 16px;
  margin: 18px 0 0;
}
.inspector-meta div {
  border-top: 1px solid var(--border-soft);
  padding-top: 14px;
}
.inspector-meta dt {
  color: var(--subtext0);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.inspector-meta dd {
  margin: 0;
  color: var(--subtext);
  font-size: 13px;
  line-height: 1.55;
}
.architecture-summary {
  padding: 76px 0;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.summary-grid article {
  background: var(--glass-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}
.summary-stat {
  display: inline-block;
  color: var(--green);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.summary-grid h3 {
  margin-bottom: 8px;
}
.summary-grid p {
  margin: 0;
  font-size: 14px;
}
.agent-json-section {
  padding: 82px 0;
  background: var(--mantle);
  border-block: 1px solid var(--border-soft);
}
.json-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}
.json-header h2 {
  text-align: left;
  margin-bottom: 8px;
}
.json-header .kicker {
  margin-bottom: 14px;
}
.json-header p {
  margin: 0;
}
.agent-json {
  max-height: 620px;
  overflow: auto;
  background: var(--crust);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.58;
  margin: 0;
  padding: 24px;
}
.agent-json code {
  display: block;
  background: transparent;
  color: inherit;
  padding: 0;
  white-space: pre;
}
@media (max-width: 1240px) {
  .flow-shell {
    grid-template-columns: 1fr;
  }
  .flow-inspector {
    position: static;
  }
}
@media (max-width: 760px) {
  .architecture-hero {
    padding: 56px 0 34px;
  }
  .architecture-flow,
  .agent-json-section {
    padding: 56px 0;
  }
  .summary-grid {
    grid-template-columns: 1fr;
  }
  .json-header {
    align-items: stretch;
    flex-direction: column;
  }
  .json-header .btn {
    align-self: flex-start;
  }
  .flow-grid {
    grid-template-columns: repeat(6, 180px);
  }
}
