/* ============================================================
   AutoArchitect design system — single source of truth for
   colors, typography, spacing, and responsive rules.
   Used by: index.html (React landing) + all static sub-pages.
   ============================================================ */

:root {
  /* Base scaffolding */
  --bg-0: #07070a;
  --bg-1: #0c0c12;
  --bg-2: #121219;
  --bg-3: #181824;
  --bg-4: #20202e;
  --line-1: #1d1d2a;
  --line-2: #282838;
  --line-3: #353549;
  --fg-1: #f4f2fa;
  --fg-2: #a9a6be;
  --fg-3: #6f6c85;
  --fg-4: #444258;

  /* Default accent (violet) — overridden by [data-accent] selectors below */
  --accent: #8b5cf6;
  --accent-2: #a78bfa;
  --accent-3: #c4b5fd;
  --accent-soft: rgba(139, 92, 246, 0.14);
  --accent-glow: rgba(139, 92, 246, 0.45);

  --warn: #f5b849;
  --danger: #ef4444;
  --ok: #34d399;
  --info: #60a5fa;
  --pink: #f472b6;

  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  --font-display: var(--font-sans);

  --container: 1200px;

  /* Primary-button label ink — reads against var(--accent) */
  --primary-ink: #0a0b0d;
}

/* LIGHT theme */
html[data-theme="light"] {
  --bg-0: #fbfbfc;
  --bg-1: #ffffff;
  --bg-2: #ffffff;
  --bg-3: #f4f4f6;
  --bg-4: #e8e8ec;
  --line-1: #ececef;
  --line-2: #d8d8dd;
  --line-3: #b8b8c0;
  --fg-1: #111113;
  --fg-2: #2e2e34;
  --fg-3: #5a5a63;
  --fg-4: #8e8e99;
  --warn: #a16207;
  --danger: #b91c1c;
  --ok: #047857;
  --info: #1d4ed8;
  --pink: #be185d;
  --primary-ink: #ffffff;
}

html[data-theme="light"] body {
  background-image:
    linear-gradient(rgba(17, 17, 19, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 17, 19, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
}

html[data-theme="light"] nav.site-nav,
html[data-theme="light"] .site-nav {
  background: rgba(251, 251, 252, 0.82) !important;
}

/* Force-dark panels (terminal blocks that should stay dark in light theme) */
html[data-theme="light"] .force-dark-panel {
  --bg-0: #07070a !important;
  --bg-1: #0c0c12 !important;
  --bg-2: #121219 !important;
  --bg-3: #181824 !important;
  --bg-4: #20202e !important;
  --line-1: #1d1d2a !important;
  --line-2: #282838 !important;
  --line-3: #353549 !important;
  --fg-1: #f4f2fa !important;
  --fg-2: #a9a6be !important;
  --fg-3: #6f6c85 !important;
  --fg-4: #444258 !important;
  --warn: #f5b849 !important;
  --ok: #34d399 !important;
  --info: #60a5fa !important;
  background: #0c0c12 !important;
  color: #f4f2fa !important;
}

/* Accent variants — dark theme */
html[data-accent="violet"] {
  --accent: #8b5cf6; --accent-2: #a78bfa; --accent-3: #c4b5fd;
  --accent-soft: rgba(139,92,246,0.14); --accent-glow: rgba(139,92,246,0.45);
}
html[data-accent="mint"] {
  --accent: #5eead4; --accent-2: #22d3ee; --accent-3: #a7f3d0;
  --accent-soft: rgba(94,234,212,0.14); --accent-glow: rgba(94,234,212,0.45);
}
html[data-accent="amber"] {
  --accent: #f59e0b; --accent-2: #fbbf24; --accent-3: #fcd34d;
  --accent-soft: rgba(245,158,11,0.14); --accent-glow: rgba(245,158,11,0.45);
}
html[data-accent="lime"] {
  --accent: #a3e635; --accent-2: #bef264; --accent-3: #d9f99d;
  --accent-soft: rgba(163,230,53,0.14); --accent-glow: rgba(163,230,53,0.45);
}

/* Accent variants — light theme (darkened for contrast on white) */
html[data-theme="light"][data-accent="violet"] {
  --accent: #6d28d9; --accent-2: #5b21b6; --accent-3: #4c1d95;
  --accent-soft: rgba(109,40,217,0.14); --accent-glow: rgba(109,40,217,0.30);
}
html[data-theme="light"][data-accent="mint"] {
  --accent: #0d9488; --accent-2: #0f766e; --accent-3: #115e59;
  --accent-soft: rgba(13,148,136,0.14); --accent-glow: rgba(13,148,136,0.30);
}
html[data-theme="light"][data-accent="amber"] {
  --accent: #b45309; --accent-2: #92400e; --accent-3: #78350f;
  --accent-soft: rgba(180,83,9,0.14); --accent-glow: rgba(180,83,9,0.30);
}
html[data-theme="light"][data-accent="lime"] {
  --accent: #4d7c0f; --accent-2: #3f6212; --accent-3: #365314;
  --accent-soft: rgba(77,124,15,0.14); --accent-glow: rgba(77,124,15,0.30);
}

/* Italic accent — the serif run-in used on display copy */
em, i, .italic-accent {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--accent-2);
}

h1, h2, h3, .display-title, .hero-title, .footer-title {
  font-family: var(--font-display);
  letter-spacing: -0.025em;
}

/* ============================================================
   Resets + base
   ============================================================ */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg-0);
  color: var(--fg-1);
  font-family: var(--font-sans);
  font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "ss02", "cv11";
}
button { font-family: inherit; font-size: inherit; color: inherit; background: none; border: none; cursor: pointer; padding: 0; }
input, textarea { font-family: inherit; font-size: inherit; color: inherit; background: none; border: none; outline: none; padding: 0; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent-soft); color: var(--accent-2); }

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 5px; border: 2px solid var(--bg-0); }
*::-webkit-scrollbar-thumb:hover { background: var(--bg-4); }

/* ============================================================
   Animations
   ============================================================ */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: 0.15; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes flicker { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

/* ============================================================
   Layout utilities — for hand-written sub-pages
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container);
  margin-left: auto; margin-right: auto;
  padding-left: 24px; padding-right: 24px;
}

.section { padding: 96px 0; position: relative; }
.section-sm { padding: 56px 0; }

.section-label {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-3);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.section-label::before {
  content: ""; display: inline-block;
  width: 22px; height: 1px;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

.display-title {
  margin: 0;
  font-size: 58px;
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 600;
  color: var(--fg-1);
  text-wrap: balance;
}

.lede {
  margin-top: 18px;
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--fg-2);
  max-width: 600px;
  text-wrap: pretty;
}

/* Buttons (static HTML equivalents of React PrimaryBtn / GhostBtn) */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: 10px;
  transition: transform 140ms, box-shadow 180ms, border-color 140ms, background 140ms;
  cursor: pointer;
}
.btn-primary {
  color: var(--primary-ink);
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-2), 0 6px 20px -6px var(--accent-glow),
              inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px var(--accent-2), 0 10px 30px -6px var(--accent-glow),
              inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-ghost {
  color: var(--fg-2);
  background: var(--bg-2);
  border: 1px solid var(--line-2);
}
.btn-ghost:hover {
  color: var(--fg-1);
  border-color: var(--line-3);
  background: var(--bg-3);
}
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 14px 22px; font-size: 15px; border-radius: 12px; }

/* Card — the bordered panel used everywhere */
.card {
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  padding: 22px;
  transition: transform 200ms, border-color 200ms, box-shadow 200ms;
}
.card:hover { border-color: var(--line-3); }
.card-hoverlift:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px -20px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

/* Hero — static sub-page hero block */
.hero {
  position: relative;
  padding-top: 96px; padding-bottom: 48px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line-1) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-1) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.5;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, black 30%, transparent 80%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, black 30%, transparent 80%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  top: -100px; right: -200px;
  width: 800px; height: 800px;
  background: radial-gradient(circle, var(--accent-soft), transparent 60%);
  pointer-events: none;
  filter: blur(40px);
}
.hero > * { position: relative; z-index: 1; }

.hero-title {
  margin: 0;
  font-size: 72px;
  line-height: 0.96;
  letter-spacing: -0.04em;
  font-weight: 600;
  color: var(--fg-1);
  text-wrap: balance;
}

/* Mono pill (badge) */
.mono-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 10.5px;
  font-family: var(--font-mono);
  color: var(--accent-2);
  background: var(--accent-soft);
  border: 1px solid var(--line-3);
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* Mono label row (HUD style) */
.hud-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
  letter-spacing: 0.08em;
}

/* Terminal block */
.terminal {
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.terminal-bar {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-2);
  background: var(--bg-2);
  display: flex; align-items: center; gap: 8px;
  font-size: 11px;
  color: var(--fg-3);
  letter-spacing: 0.08em;
}
.terminal-body { padding: 16px 18px; line-height: 1.75; }
.terminal-dot { width: 9px; height: 9px; border-radius: 50%; }
.terminal-dot.red { background: #ef4444; }
.terminal-dot.yellow { background: #f5b849; }
.terminal-dot.green { background: #34d399; }

/* Grid helpers */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ============================================================
   Responsive
   ============================================================ */
h1, h2 { word-break: break-word; }

@media (max-width: 1100px) {
  :root { --container: 100%; }
  .hero-grid { grid-template-columns: 1fr !important; gap: 48px !important; }
}

@media (max-width: 900px) {
  .oss-grid { grid-template-columns: 1fr !important; gap: 40px !important; }
  .ecosystem-grid { grid-template-columns: 1fr !important; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr !important; row-gap: 32px !important; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .kanban-columns { display: flex !important; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
  .kanban-columns > div { min-width: 260px; scroll-snap-align: start; }
  .sprint-bar-hide-narrow { display: none !important; }
}

@media (max-width: 680px) {
  html, body { font-size: 14.5px; }
  h1.hero-title { font-size: clamp(40px, 11vw, 62px) !important; line-height: 1 !important; }
  .display-title { font-size: clamp(32px, 8vw, 46px) !important; line-height: 1.05 !important; }
  .footer-title { font-size: clamp(38px, 10vw, 60px) !important; }
  .feature-grid { grid-template-columns: 1fr !important; }
  .gallery-grid { grid-template-columns: 1fr !important; }
  .studio-modules { grid-template-columns: 1fr !important; }
  .footer-grid { grid-template-columns: 1fr 1fr !important; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .nav-desktop-links { display: none !important; }
  .nav-mobile-toggle { display: inline-flex !important; }
  section { padding-top: 72px !important; padding-bottom: 32px !important; }
  .hero { padding-top: 60px !important; padding-bottom: 32px !important; }
  .container { padding-left: 20px !important; padding-right: 20px !important; }
  .hero-trust { flex-wrap: wrap !important; row-gap: 10px !important; }
  .hero-trust > div { border-left: none !important; padding-left: 0 !important; }
  .hero-ctas { flex-direction: column; align-items: stretch !important; }
  .hero-ctas > * { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
  .contributor-grid { grid-template-columns: repeat(6, 1fr) !important; }
  .oss-stats { grid-template-columns: 1fr !important; }
  .oss-stats > div { border-left: none !important; border-top: 1px solid var(--line-2); }
  .oss-stats > div:first-child { border-top: none; }
  .footer-grid { grid-template-columns: 1fr !important; }
  .footer-grid > * { grid-column: auto !important; }
  .kanban-columns > div { min-width: 240px; }
  .activity-delta, .activity-num { display: none !important; }
}
