/* ============================================
   Garrison website styles
   Dark-first, with a light theme. Colors come from the logo:
   periwinkle towers and a magenta flag.
   ============================================ */

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

:root,
[data-theme="dark"] {
  --bg: #060913;
  --bg-band: #080d1a;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.055);
  --surface-solid: #0c1222;
  --surface-raised: #101830;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef2fc;
  --text-secondary: #a3afc8;
  --text-muted: #7a87a3;
  --accent: #8fb0f5;
  --accent-strong: #6f93ea;
  --accent-soft: rgba(143, 176, 245, 0.13);
  --flag: #ec8fbd;
  --flag-soft: rgba(236, 143, 189, 0.14);
  --ok: #5fd39a;
  --warn: #f2c46b;
  --no: #8a93a8;
  --btn-primary-bg: #eef2fc;
  --btn-primary-text: #0a1020;
  --code-bg: #070b16;
  --code-bar: #0d1324;
  --code-text: #d8e0f2;
  --nav-bg: rgba(6, 9, 19, 0.72);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.75);
  --shadow-xl: 0 40px 90px -30px rgba(0, 0, 0, 0.9);
  --grid-line: rgba(255, 255, 255, 0.04);
  --glow-1: rgba(111, 147, 234, 0.26);
  --glow-2: rgba(236, 143, 189, 0.12);
  --glow-3: rgba(80, 110, 220, 0.14);
  --stop-a: #8fb0f5;
  --stop-b: #b49cf3;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --nav-height: 66px;
  --maxw: 1200px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #ffffff;
  --bg-band: #f5f7fc;
  --surface: #ffffff;
  --surface-hover: #f5f7fc;
  --surface-solid: #ffffff;
  --surface-raised: #ffffff;
  --border: #e1e6f1;
  --border-strong: #c9d2e4;
  --text: #0b1222;
  --text-secondary: #46526b;
  --text-muted: #5f6b84;
  --accent: #3355b0;
  --accent-strong: #26449a;
  --accent-soft: rgba(51, 85, 176, 0.09);
  --flag: #a8336f;
  --flag-soft: rgba(168, 51, 111, 0.09);
  --ok: #17824f;
  --warn: #9a6a00;
  --no: #6b7489;
  --btn-primary-bg: #0b1222;
  --btn-primary-text: #ffffff;
  --code-bg: #0a1020;
  --code-bar: #121a2f;
  --code-text: #d8e0f2;
  --nav-bg: rgba(255, 255, 255, 0.78);
  --shadow-lg: 0 20px 40px -18px rgba(14, 30, 70, 0.18);
  --shadow-xl: 0 30px 70px -28px rgba(14, 30, 70, 0.28);
  --grid-line: rgba(14, 30, 70, 0.055);
  --glow-1: rgba(51, 85, 176, 0.14);
  --glow-2: rgba(168, 51, 111, 0.07);
  --glow-3: rgba(80, 110, 220, 0.08);
  --stop-a: #3355b0;
  --stop-b: #7a4fc9;
  color-scheme: light;
}

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-height) + 16px); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
code, pre { font-family: var(--font-mono); }
p code, li code, dd code, td code {
  font-size: 0.86em; background: var(--accent-soft); color: var(--text);
  border-radius: 5px; padding: 0.1em 0.38em; overflow-wrap: anywhere;
}
::selection { background: var(--accent-soft); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

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

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm);
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .container { padding: 0 28px; } }

/* --- Background --- */
.bg-layers { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bg-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(to right, var(--grid-line) 1px, transparent 1px), linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 75% 55% at 50% 18%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 75% 55% at 50% 18%, #000 0%, transparent 75%);
}
.bg-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 55% 40% at 30% -6%, var(--glow-1) 0%, transparent 62%),
    radial-gradient(ellipse 38% 34% at 88% 8%, var(--glow-2) 0%, transparent 60%),
    radial-gradient(ellipse 45% 40% at 6% 30%, var(--glow-3) 0%, transparent 60%);
}

/* --- Navigation --- */
.nav {
  position: sticky; top: 0; z-index: 100; height: var(--nav-height);
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color 0.25s ease, background 0.25s ease;
}
.nav.scrolled { border-bottom-color: var(--border); }
.nav-inner { max-width: var(--maxw); height: 100%; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 20px; }
@media (min-width: 640px) { .nav-inner { padding: 0 28px; } }
.nav-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.nav-logo-img { width: 32px; height: 32px; }
.wordmark { font-weight: 700; font-size: 1.12rem; letter-spacing: -0.02em; }
.nav-links { display: flex; gap: 2px; margin-left: auto; }
.nav-links a {
  color: var(--text-secondary); text-decoration: none; font-size: 0.9rem; font-weight: 500;
  padding: 8px 12px; border-radius: 8px; transition: color 0.15s ease, background 0.15s ease;
}
.nav-links a:hover { color: var(--text); background: var(--surface-hover); }
.nav-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary);
  cursor: pointer; text-decoration: none; transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-hover); }
.theme-icon-moon { display: none; }
[data-theme="dark"] .theme-icon-sun { display: none; }
[data-theme="dark"] .theme-icon-moon { display: block; }
.nav-toggle { display: none; }

@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }
  .nav-actions { margin-left: auto; }
  .nav-links {
    display: none; position: absolute; top: var(--nav-height); left: 0; right: 0;
    flex-direction: column; gap: 0; margin: 0; padding: 8px 16px 18px;
    background: var(--surface-solid); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 13px 8px; font-size: 1rem; border-bottom: 1px solid var(--border); border-radius: 0; }
}

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 0.96rem; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn-primary { background: var(--btn-primary-bg); color: var(--btn-primary-text); box-shadow: 0 8px 28px -10px var(--glow-1); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 34px -12px var(--accent); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-hover); transform: translateY(-1px); }

/* --- Hero --- */
.hero { padding: 84px 0 64px; position: relative; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface);
  font: 500 0.74rem var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-secondary);
  margin-bottom: 26px;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(95, 211, 154, 0.18); }
.hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.5rem); line-height: 1.04; letter-spacing: -0.035em; font-weight: 800; margin-bottom: 24px; }
.gradient-text {
  background: linear-gradient(100deg, var(--stop-a) 0%, var(--stop-b) 55%, var(--flag) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { font-size: 1.12rem; color: var(--text-secondary); max-width: 37em; margin-bottom: 32px; }
.hero-sub a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.hero-sub a:hover { text-decoration-color: var(--accent); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-actions.center { justify-content: center; }
.hero-meta { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 30px; font-size: 0.82rem; color: var(--text-muted); }
.hero-meta li { position: relative; padding-left: 14px; }
.hero-meta li::before { content: ''; position: absolute; left: 0; top: 0.62em; width: 6px; height: 6px; border-radius: 2px; background: var(--accent); opacity: 0.7; }

.hero-visual { position: relative; }
.window {
  background: var(--code-bg); border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl); overflow: hidden; position: relative; z-index: 1;
}
[data-theme="light"] .window { border-color: #1b2540; }
.window-bar { display: flex; align-items: center; gap: 7px; padding: 13px 16px; background: var(--code-bar); border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.wdot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.wdot.red { background: #ff5f57; } .wdot.yellow { background: #febc2e; } .wdot.green { background: #28c840; }
.window-title { margin-left: 10px; font: 500 0.76rem var(--font-mono); color: #8692ad; }
.window-body { padding: 20px 22px 34px; color: var(--code-text); font-size: 12.6px; line-height: 1.75; overflow-x: auto; }
.window-body code { font-size: inherit; }
.t-prompt { color: #8fb0f5; } .t-dim { color: #6c7894; } .t-key { color: #e9eefb; font-weight: 500; }
.t-ok { color: #5fd39a; } .t-str { color: #f2c46b; }

.float-card {
  position: absolute; z-index: 2; background: var(--surface-raised); border: 1px solid var(--border-strong);
  border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 2px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
[data-theme="dark"] .float-card { background: rgba(16, 24, 48, 0.92); }
.fc-label { font: 500 0.66rem var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }
.fc-value { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; }
.fc-value small { font-size: 0.78rem; color: var(--text-secondary); font-weight: 500; }
.fc-env { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; }
.fc-env b { font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text-secondary); }
.fc-env b.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.fc-env i { width: 14px; height: 1px; background: var(--border-strong); }
.float-a { top: -26px; right: -14px; }
.float-b { bottom: -38px; left: -26px; }

@media (max-width: 1080px) { .float-a { right: 8px; } .float-b { left: 8px; } }
@media (max-width: 900px) {
  .hero { padding: 48px 0 56px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 52px; }
}
@media (max-width: 520px) {
  .float-card { display: none; }
  .window-body { font-size: 11px; padding: 16px; }
}

/* --- Stats --- */
.stats { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-band); padding: 40px 0 30px; position: relative; }
.stat-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; }
.stat { display: flex; flex-direction: column-reverse; align-items: center; text-align: center; gap: 8px; padding: 6px 14px; border-left: 1px solid var(--border); }
.stat:first-child { border-left: 0; }
.stat dd { font-size: clamp(2rem, 3.6vw, 2.7rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1; }
.stat dt { font: 500 0.72rem/1.5 var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); max-width: 18em; }
.stat:nth-child(odd) dd { color: var(--text); }
.stat:nth-child(even) dd { background: linear-gradient(100deg, var(--stop-a), var(--stop-b)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stats-note { margin: 26px auto 0; max-width: 54em; text-align: center; font-size: 0.82rem; color: var(--text-muted); }
.stats-note a { color: var(--text-secondary); text-underline-offset: 3px; }
@media (max-width: 900px) {
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 0; }
  .stat { border-left: 0; }
  .stat:last-child { grid-column: 1 / -1; }
}

/* --- Sections --- */
.section { padding: 112px 0; position: relative; }
.section-band { background: var(--bg-band); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
@media (max-width: 700px) { .section { padding: 76px 0; } }

.kicker {
  display: inline-flex; align-items: center; gap: 12px; margin-bottom: 16px;
  font: 500 0.74rem var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent);
}
.kicker::before { content: ''; width: 28px; height: 1px; background: currentColor; opacity: 0.7; }
.section h2 { font-size: clamp(1.9rem, 3.8vw, 2.9rem); line-height: 1.1; letter-spacing: -0.03em; font-weight: 750; margin-bottom: 18px; }
.lead { font-size: 1.08rem; color: var(--text-secondary); max-width: 42em; }
.section-head { text-align: center; margin: 0 auto 56px; max-width: 760px; }
.section-head .lead { margin: 0 auto; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 64px; align-items: start; }
.split-rev { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.split-rev .split-copy { order: 2; }
.split-rev .split-visual { order: 1; }
.split-copy { position: sticky; top: calc(var(--nav-height) + 32px); }
.split-copy .lead { margin-bottom: 30px; }
@media (max-width: 960px) {
  .split, .split-rev { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .split-rev .split-copy, .split-rev .split-visual { order: initial; }
  .split-copy { position: static; }
}

.ticks { list-style: none; display: grid; gap: 16px; }
.ticks li { position: relative; padding-left: 34px; color: var(--text-secondary); font-size: 0.98rem; }
.ticks li strong { color: var(--text); font-weight: 600; }
.ticks li::before {
  content: ''; position: absolute; left: 0; top: 2px; width: 22px; height: 22px; border-radius: 7px;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238fb0f5' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 13px no-repeat;
  border: 1px solid var(--border);
}
[data-theme="light"] .ticks li::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233355b0' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E");
}

/* --- Panels (shared frame for visuals) --- */
.panel {
  background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 22px; position: relative; overflow: hidden;
}
.panel::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: 0.55;
}
.panel figcaption { margin-top: 14px; font-size: 0.84rem; color: var(--text-muted); text-align: center; }
.panel svg { display: block; width: 100%; height: auto; }
.stop-a { stop-color: var(--stop-a); }
.stop-b { stop-color: var(--stop-b); }

/* Scale visual */
.s-cap { font: 500 10.5px var(--font-mono); letter-spacing: 0.14em; fill: var(--text-muted); }
.s-cp rect { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.3; }
.s-label { font: 600 12.5px var(--font-mono); fill: var(--text); }
.s-leader { fill: var(--ok); }
.s-wire { fill: none; stroke: var(--border-strong); stroke-width: 1.5; }
.s-db { fill: var(--surface-raised); stroke: var(--border-strong); stroke-width: 1.3; }
.s-pull path { fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-dasharray: 4 5; animation: dash 1.4s linear infinite; }
.s-grid .w { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1.1; }
.s-grid .w-add { fill: none; stroke-dasharray: 5 5; }
.s-grid .sl { fill: var(--surface-hover); stroke: var(--border); }
.s-grid .sl.on { fill: var(--accent); stroke: none; opacity: 0.9; }
.s-mini { font: 500 10px var(--font-mono); fill: var(--text-muted); }
.s-add { font: 500 11px var(--font-mono); fill: var(--text-muted); }
.s-grid .p1 { animation: pulse 2.6s ease-in-out infinite; }
.s-grid .p2 { animation: pulse 3.1s ease-in-out 0.4s infinite; }
.s-grid .p3 { animation: pulse 2.8s ease-in-out 0.9s infinite; }
.s-grid .p4 { animation: pulse 3.4s ease-in-out 0.2s infinite; }
.s-grid .p5 { animation: pulse 2.9s ease-in-out 1.3s infinite; }
.s-grid .p6 { animation: pulse 3.3s ease-in-out 0.7s infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.95; } 50% { opacity: 0.3; } }
@keyframes dash { to { stroke-dashoffset: -18; } }

.measure {
  margin-top: 22px; background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 24px; box-shadow: var(--shadow-lg);
}
.measure-title { font-weight: 700; font-size: 1rem; }
.measure-sub { font-size: 0.86rem; color: var(--text-secondary); margin: 4px 0 18px; }
.bar-row { display: grid; grid-template-columns: 9.5em minmax(0, 1fr) 7.5em; align-items: center; gap: 14px; font-size: 0.86rem; margin-bottom: 12px; }
.bar-row span { color: var(--text-secondary); }
.bar-row b { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 999px; background: var(--surface-hover); overflow: hidden; border: 1px solid var(--border); }
.bar i { display: block; height: 100%; width: var(--w); border-radius: inherit; background: linear-gradient(90deg, var(--stop-a), var(--stop-b)); transform-origin: left; transition: transform 1.1s cubic-bezier(.2, .7, .2, 1); }
.js .measure:not(.visible) .bar i { transform: scaleX(0); }
.measure-foot { font-size: 0.8rem; color: var(--text-muted); margin-top: 14px; }
.measure-foot a { color: var(--text-secondary); text-underline-offset: 3px; }
@media (max-width: 520px) { .bar-row { grid-template-columns: 1fr auto; } .bar-row .bar { grid-column: 1 / -1; grid-row: 2; } }

/* Studio visual */
.studio-panel { padding: 0; }
.studio-top { display: flex; align-items: center; gap: 4px; padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
.studio-tab { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); padding: 5px 11px; border-radius: 8px; }
.studio-tab.on { color: var(--text); background: var(--accent-soft); }
.studio-badge { margin-left: auto; font: 500 0.7rem var(--font-mono); color: var(--flag); background: var(--flag-soft); padding: 4px 10px; border-radius: 999px; }
.studio-body { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.studio-canvas { border-right: 1px solid var(--border); }
.c-dot { fill: var(--border-strong); }
.c-edge { fill: none; stroke: var(--accent); stroke-width: 1.6; }
.c-head { fill: var(--accent); }
.c-edge-label { font: 600 11px var(--font-mono); fill: var(--flag); }
.c-node { fill: var(--surface-raised); stroke: var(--border-strong); stroke-width: 1.2; }
.c-entry { stroke: var(--accent); stroke-width: 1.8; }
.c-node-title { font: 600 13px var(--font-sans); fill: var(--text); }
.c-node-sub { font: 500 10.5px var(--font-mono); fill: var(--text-muted); }
.c-files { fill: var(--surface); stroke: var(--border-strong); stroke-dasharray: 4 4; }
.studio-chat { padding: 16px 14px; display: flex; flex-direction: column; gap: 10px; font-size: 0.78rem; justify-content: center; }
.bubble { padding: 10px 12px; border-radius: 12px; line-height: 1.45; }
.bubble.you { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; max-width: 92%; }
[data-theme="dark"] .bubble.you { color: #0a1020; }
.bubble.bot { background: var(--surface-hover); border: 1px solid var(--border); color: var(--text-secondary); border-bottom-left-radius: 4px; }
.bubble.bot b { display: block; color: var(--text); font-size: 0.72rem; margin-bottom: 2px; }
.approve { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--border-strong); border-radius: 10px; padding: 7px 8px 7px 12px; }
.approve span { font: 500 0.7rem var(--font-mono); color: var(--text-muted); }
.approve b { background: var(--ok); color: #04160d; font-size: 0.72rem; padding: 4px 10px; border-radius: 7px; }
.env-strip { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.env { display: flex; flex-direction: column; align-items: center; padding: 8px 16px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); min-width: 92px; }
.env-name { font-weight: 700; font-size: 0.86rem; }
.env-rev { font: 500 0.7rem var(--font-mono); color: var(--text-muted); }
.env-on { border-color: var(--ok); box-shadow: 0 0 0 3px rgba(95, 211, 154, 0.12); }
.env-arrow { width: 28px; height: 1px; background: var(--border-strong); position: relative; }
.env-arrow::after { content: ''; position: absolute; right: -1px; top: -3px; border: 3.5px solid transparent; border-left: 5px solid var(--border-strong); }
.studio-panel figcaption { margin: 0; padding: 0 16px 16px; }
@media (max-width: 620px) {
  .studio-body { grid-template-columns: minmax(0, 1fr); }
  .studio-canvas { border-right: 0; border-bottom: 1px solid var(--border); }
  .env { min-width: 76px; padding: 6px 10px; }
  .env-arrow { width: 14px; }
}

/* Lifecycle loop */
.loop { list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-top: 72px; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-solid); }
.loop li { padding: 22px 18px; border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.loop li:first-child { border-left: 0; }
.loop-n { font: 500 0.72rem var(--font-mono); color: var(--accent); }
.loop b { font-size: 1.05rem; letter-spacing: -0.01em; }
.loop li span:last-child { font-size: 0.8rem; color: var(--text-muted); line-height: 1.45; }
@media (max-width: 960px) { .loop { grid-template-columns: repeat(3, minmax(0, 1fr)); } .loop li:nth-child(4) { border-left: 0; } .loop li:nth-child(n+4) { border-top: 1px solid var(--border); } }
@media (max-width: 560px) { .loop { grid-template-columns: repeat(2, minmax(0, 1fr)); } .loop li { border-left: 0; border-top: 1px solid var(--border); } .loop li:nth-child(even) { border-left: 1px solid var(--border); } .loop li:nth-child(-n+2) { border-top: 0; } }

/* Harness band */
.harness-band { padding: 56px 0; border-bottom: 1px solid var(--border); }
.band-title { text-align: center; font: 500 0.74rem var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 26px; }
.harness-list { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.harness-list li {
  display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); transition: border-color 0.2s ease, transform 0.2s ease;
}
.harness-list li:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.harness-list b { font-size: 1.02rem; letter-spacing: -0.01em; }
.harness-list b a { text-decoration: none; }
.harness-list b a:hover { color: var(--accent); }
.harness-list span { font: 500 0.72rem var(--font-mono); color: var(--text-muted); }
@media (max-width: 760px) { .harness-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Features */
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.feature { background: var(--bg); padding: 30px 28px 32px; transition: background 0.2s ease; }
.feature:hover { background: var(--surface-solid); }
.ficon {
  width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
  background: var(--accent-soft); border: 1px solid var(--border);
}
.ficon svg { width: 21px; height: 21px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { font-size: 1.04rem; letter-spacing: -0.01em; margin-bottom: 8px; }
.feature p { font-size: 0.92rem; color: var(--text-secondary); }
@media (max-width: 960px) { .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .feature-grid { grid-template-columns: minmax(0, 1fr); } .feature { padding: 24px 20px; } }

/* Architecture */
.arch { padding: 28px; }
.a-cap { font: 500 11px var(--font-mono); letter-spacing: 0.14em; fill: var(--text-muted); }
.a-client rect { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1.2; }
.a-t { font: 600 14px var(--font-sans); fill: var(--text); }
.a-s { font: 400 12px var(--font-sans); fill: var(--text-muted); }
.a-s2 { font: 400 12.5px var(--font-sans); fill: var(--text-secondary); }
.a-line path, .a-line-s { fill: none; stroke: var(--accent); stroke-width: 1.6; }
.a-dash { stroke-dasharray: 5 5; }
.a-head { fill: var(--accent); }
.a-l { font: 500 11px var(--font-mono); fill: var(--text-secondary); }
.a-cp { fill: var(--surface-raised); stroke: url(#a-cp); stroke-width: 2; }
.a-title { font: 700 18px var(--font-sans); fill: var(--text); letter-spacing: -0.01em; }
.a-chip rect { fill: var(--accent-soft); stroke: var(--border); }
.a-c { font: 500 13px var(--font-sans); fill: var(--text); }
.a-worker { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1.2; }
.a-harness { fill: var(--flag-soft); stroke: var(--flag); stroke-width: 1.2; stroke-opacity: 0.5; }
.a-pill rect { fill: var(--surface-raised); stroke: var(--border-strong); }
.a-m { font: 500 12px var(--font-mono); fill: var(--text); }
.arch-db {
  display: flex; align-items: center; gap: 12px; margin: 18px auto 0; max-width: 620px;
  padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  font-size: 0.88rem; color: var(--text-secondary);
}
.arch-db b { color: var(--text); }
.db-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.7; display: block; }
@media (max-width: 600px) { .arch { padding: 14px; } }

.steps { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-top: 28px; }
.steps li { counter-increment: step; position: relative; padding: 22px 20px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-solid); }
.steps li::before { content: '0' counter(step); display: block; font: 500 0.74rem var(--font-mono); color: var(--accent); margin-bottom: 10px; }
.steps h3 { font-size: 1.02rem; margin-bottom: 6px; }
.steps p { font-size: 0.86rem; color: var(--text-secondary); }
@media (max-width: 1080px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .steps { grid-template-columns: minmax(0, 1fr); } }

/* Screens */
.screens { position: relative; max-width: 1040px; margin: 0 auto; padding-bottom: 12%; }
.shot { border-radius: 14px; overflow: hidden; border: 1px solid var(--border-strong); background: var(--surface-solid); box-shadow: var(--shadow-xl); }
.shot-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--border); }
.shot-bar .wdot { width: 9px; height: 9px; }
.shot-url { margin-left: 10px; font: 500 0.7rem var(--font-mono); color: var(--text-muted); background: var(--surface-hover); padding: 3px 12px; border-radius: 6px; }
.shot-back { width: 76%; transform: rotate(-1deg); }
.shot-front { position: absolute; width: 66%; right: 0; bottom: 0; transform: rotate(1deg); }
[data-theme="light"] .shot-back { z-index: 0; }
[data-theme="dark"] .shot-back { position: absolute; right: 0; bottom: 0; left: auto; width: 66%; z-index: 2; transform: rotate(1deg); }
[data-theme="dark"] .shot-front { position: relative; width: 76%; z-index: 1; transform: rotate(-1deg); }
.screens-note { text-align: center; color: var(--text-muted); font-size: 0.82rem; margin-top: 26px; }
@media (max-width: 700px) {
  .screens { padding-bottom: 0; display: grid; gap: 18px; }
  .shot-back, .shot-front, [data-theme="dark"] .shot-back, [data-theme="dark"] .shot-front { position: static; width: 100%; transform: none; }
}

/* Compare */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-solid); box-shadow: var(--shadow-lg); }
.compare { width: 100%; min-width: 980px; border-collapse: separate; border-spacing: 0; font-size: 0.82rem; }
.compare caption { caption-side: bottom; text-align: left; padding: 14px 18px; color: var(--text-muted); font-size: 0.78rem; border-top: 1px solid var(--border); }
.compare th, .compare td { padding: 14px 14px; vertical-align: top; text-align: left; border-bottom: 1px solid var(--border); color: var(--text-secondary); line-height: 1.45; }
.compare tbody tr:last-child th, .compare tbody tr:last-child td { border-bottom: 0; }
.compare thead th { color: var(--text); font-size: 0.86rem; font-weight: 700; background: var(--surface); position: sticky; top: 0; }
.compare thead th small { display: block; font: 500 0.68rem var(--font-mono); color: var(--text-muted); margin-top: 2px; }
.compare tbody th { color: var(--text); font-weight: 600; width: 15%; position: sticky; left: 0; background: var(--surface-solid); z-index: 1; }
.compare .col-g { background: var(--accent-soft); color: var(--text); }
.compare thead .col-g { color: var(--accent); }
.mk { display: block; width: max-content; font: 600 0.66rem var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; margin-bottom: 6px; border: 1px solid; }
.mk.yes { color: var(--ok); border-color: currentColor; background: rgba(95, 211, 154, 0.1); }
.mk.part { color: var(--warn); border-color: currentColor; background: rgba(242, 196, 107, 0.08); }
.mk.no { color: var(--no); border-color: var(--border-strong); }
.mk.txt { color: var(--accent); border-color: var(--border-strong); }
.compare-note { text-align: center; color: var(--text-muted); font-size: 0.8rem; margin-top: 16px; }
.compare-note a { color: var(--text-secondary); text-underline-offset: 3px; }

.choose-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 52px; }
.choose { padding: 24px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-solid); }
.choose h3 { font-size: 1rem; margin-bottom: 8px; }
.choose p { font-size: 0.9rem; color: var(--text-secondary); }
.choose-g { border-color: var(--accent); background: linear-gradient(160deg, var(--accent-soft), transparent 70%), var(--surface-solid); }
@media (max-width: 960px) { .choose-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .choose-grid { grid-template-columns: minmax(0, 1fr); } }

/* Use cases */
.usecase-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.usecase { position: relative; padding: 28px 26px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); overflow: hidden; transition: border-color 0.2s ease, transform 0.2s ease; }
.usecase:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.uc-n { position: absolute; right: 18px; top: 10px; font-size: 3.2rem; font-weight: 800; letter-spacing: -0.05em; color: var(--accent); opacity: 0.12; }
.usecase h3 { font-size: 1.05rem; margin-bottom: 8px; padding-right: 56px; }
.usecase p { font-size: 0.92rem; color: var(--text-secondary); }
@media (max-width: 960px) { .usecase-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .usecase-grid { grid-template-columns: minmax(0, 1fr); } }

/* Tabs */
.tabs { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-solid); box-shadow: var(--shadow-lg); overflow: hidden; }
.tab-list { display: flex; gap: 6px; padding: 8px; border-bottom: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
.tab {
  display: inline-flex; align-items: center; gap: 9px; flex: 1 1 auto; justify-content: center;
  padding: 11px 16px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--text-secondary);
  font: 600 0.92rem var(--font-sans); cursor: pointer; transition: color 0.15s ease, background 0.15s ease;
}
.tab svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab:hover { color: var(--text); background: var(--surface-hover); }
.tab[aria-selected="true"] { color: var(--text); background: var(--surface-solid); border-color: var(--border-strong); box-shadow: 0 4px 14px -8px rgba(0, 0, 0, 0.4); }
.tab[aria-selected="true"] svg { stroke: var(--accent); }
.tab-panel { padding: 30px; }
.tab-panel[hidden] { display: none; }
.panel-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.panel-grid > div > p { color: var(--text-secondary); font-size: 0.94rem; margin-bottom: 12px; }
.step-label { font: 500 0.74rem var(--font-mono) !important; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted) !important; margin: 20px 0 8px !important; }
.panel-grid > div > .step-label:first-child { margin-top: 0 !important; }
.side-card { padding: 22px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.side-card h3 { font-size: 0.95rem; margin-bottom: 8px; }
.side-card p { font-size: 0.88rem; color: var(--text-secondary); margin-bottom: 10px; }
.ports { display: grid; gap: 0; margin-top: 8px; border-top: 1px solid var(--border); }
.ports div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.82rem; }
.ports dt { color: var(--text-secondary); }
.ports dd { font-family: var(--font-mono); color: var(--text); font-size: 0.78rem; }
.plain-steps { color: var(--text-secondary); padding-left: 20px; font-size: 0.92rem; margin-bottom: 8px; }
.plain-steps li { margin-bottom: 6px; }
.more { margin-top: 6px; }
.more a { color: var(--accent) !important; font-weight: 600; text-decoration: none; }
.more a:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 860px) { .panel-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) { .tab-panel { padding: 18px 16px; } .tab { flex-basis: 100%; justify-content: flex-start; } }

.code { position: relative; margin: 0 0 14px; }
.code pre {
  background: var(--code-bg); color: var(--code-text); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 18px; padding-right: 78px; overflow-x: auto; font-size: 12.8px; line-height: 1.75;
}
[data-theme="light"] .code pre { border-color: #1b2540; }
.code code { font-size: inherit; }
.c-prompt { color: #8fb0f5; user-select: none; }
.c-comment { color: #75819c; }
.copy-btn {
  position: absolute; top: 9px; right: 9px; padding: 5px 11px; font: 600 0.74rem var(--font-sans);
  color: #d8e0f2; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px; cursor: pointer; transition: background 0.15s ease;
}
.copy-btn:hover { background: rgba(255, 255, 255, 0.15); }
.copy-btn:focus-visible { outline-color: #8fb0f5; }

.next-card {
  display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-top: 22px;
  padding: 24px 28px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface-solid);
}
.next-card h3 { font-size: 1.05rem; margin-bottom: 4px; }
.next-card p { font-size: 0.92rem; color: var(--text-secondary); max-width: 52em; }
.next-card .btn { flex-shrink: 0; }
@media (max-width: 760px) { .next-card { flex-direction: column; align-items: flex-start; } }

/* CTA */
.cta { padding: 110px 0; }
.cta-card {
  text-align: center; padding: 64px 24px; border-radius: 28px; border: 1px solid var(--border-strong);
  background:
    radial-gradient(ellipse 60% 80% at 50% 0%, var(--glow-1), transparent 70%),
    radial-gradient(ellipse 40% 60% at 90% 100%, var(--glow-2), transparent 70%),
    var(--surface-solid);
  box-shadow: var(--shadow-xl);
}
.cta-card img { margin: 0 auto 20px; width: 72px; height: 72px; }
.cta-card h2 { font-size: clamp(1.9rem, 3.8vw, 2.7rem); letter-spacing: -0.03em; margin-bottom: 10px; }
.cta-card p { color: var(--text-secondary); margin-bottom: 28px; font-size: 1.05rem; }
@media (max-width: 600px) { .cta { padding: 72px 0; } .cta-card { padding: 44px 18px; } }

/* Footer */
.footer { border-top: 1px solid var(--border); background: var(--bg-band); padding: 60px 0 34px; }
.footer-inner { display: flex; justify-content: space-between; gap: 48px; flex-wrap: wrap; }
.footer-brand { max-width: 320px; }
.footer-brand p { color: var(--text-muted); font-size: 0.9rem; margin-top: 14px; }
.footer-links { display: flex; gap: 64px; flex-wrap: wrap; }
.footer-col { display: flex; flex-direction: column; gap: 10px; min-width: 120px; }
.footer-heading { font: 500 0.72rem var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
.footer-col a { color: var(--text-secondary); text-decoration: none; font-size: 0.9rem; }
.footer-col a:hover { color: var(--text); }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.82rem; }
@media (max-width: 600px) { .footer-links { gap: 32px; } }

/* --- Reveal on scroll (only when JS runs and motion is allowed) --- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .s-pull path, .s-grid .sl { animation: none !important; }
  .bar i { transition: none; }
  .js .measure:not(.visible) .bar i { transform: none; }
  .btn, .harness-list li, .usecase { transition: none; }
}

/* Late adjustments */
[data-theme="light"] .approve b { color: #ffffff; }
.studio-panel .studio-canvas { height: 100%; min-height: 260px; background-image: radial-gradient(var(--border-strong) 1.1px, transparent 1.2px); background-size: 16px 16px; }
.arch-scroll { overflow-x: auto; }
@media (max-width: 760px) { .arch-scroll svg { min-width: 720px; } }
