/* ═══════════════════════════════════════════════════════════════════════════
   ProjectForge — Design System
   Dark-first with complete light theme parity
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Tokens (Dark — default) ──────────────────────────────────────────────── */
:root {
  --bg:            #080b14;
  --bg-card:       #0f1623;
  --bg-elevated:   #161e2e;
  --bg-hover:      #1a2540;
  --border:        #1e2d45;
  --border-subtle: #172035;
  --border-active: #3b82f6;
  --text:          #e2e8f0;
  --text-muted:    #5a7196;
  --text-dim:      #8fa4c2;
  --primary:       #6366f1;
  --primary-dark:  #4f46e5;
  --primary-glow:  rgba(99,102,241,.18);
  --success:       #10b981;
  --danger:        #ef4444;
  --warning:       #f59e0b;
  --accent:        #22d3ee;
  --accent-glow:   rgba(34,211,238,.15);
  --font-mono:     'Space Mono', monospace;
  --font-sans:     'Inter', system-ui, -apple-system, sans-serif;
  --radius:        10px;
  --radius-lg:     16px;
  --shadow:        0 4px 24px rgba(0,0,0,.5);
  --shadow-lg:     0 16px 48px rgba(0,0,0,.7);
  --transition:    .2s cubic-bezier(.4,0,.2,1);
}

/* ── Tokens (Light) ────────────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg:            #f1f5fb;
  --bg-card:       #ffffff;
  --bg-elevated:   #e8eef7;
  --bg-hover:      #dde6f4;
  --border:        #cbd5e8;
  --border-subtle: #dce4f0;
  --border-active: #2563eb;
  --text:          #0f172a;
  --text-muted:    #64748b;
  --text-dim:      #3d5275;
  --primary:       #4f46e5;
  --primary-dark:  #4338ca;
  --primary-glow:  rgba(79,70,229,.10);
  --success:       #059669;
  --danger:        #dc2626;
  --warning:       #d97706;
  --accent:        #0891b2;
  --accent-glow:   rgba(8,145,178,.10);
  --shadow:        0 4px 24px rgba(0,0,0,.08);
  --shadow-lg:     0 16px 48px rgba(0,0,0,.12);
}

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

html { scroll-behavior: smooth; }

/* Smooth theme switch across every themed surface — background, border,
   color, fill and box-shadow all cross-fade together instead of the page
   "popping" between themes. */
*, *::before, *::after {
  transition: background-color .35s ease, border-color .35s ease,
              color .35s ease, box-shadow .35s ease, fill .35s ease;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; display: block; }

/* Elements with their own keyframe animations should not also carry the
   universal color-transition (it can visually fight with translate/opacity
   keyframes and cause jank). */
.hero-grid, .hero-bg::before, .hero-bg::after, .page-bg::before, .page-bg::after, .hero-particle,
.term-cursor, .hero-orb, .gradient-text, .stat-number,
.progress-indicator::after, .gear, .empty-icon {
  transition: none;
}

/* ── Reduced motion ────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   NAVBAR
   ═══════════════════════════════════════════════════════════════════════════ */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 64px;
  background: rgba(8,11,20,.94);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background var(--transition), border-color var(--transition);
}

[data-theme="light"] .navbar {
  background: rgba(241,245,251,.96);
  border-bottom-color: var(--border);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  transition: opacity var(--transition);
}
.navbar-brand:hover { opacity: .8; color: var(--text); }

.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  object-fit: cover;
  border: 1px solid var(--border-active);
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.navbar-links a {
  color: var(--text-dim);
  font-size: .875rem;
  font-weight: 500;
  transition: color var(--transition);
  padding: .25rem .1rem;
}
.navbar-links a:hover { color: var(--text); }
.navbar-links a.api-link { color: var(--accent); }
.navbar-links a.api-link:hover { color: var(--primary); }

/* Mobile: hamburger */
.navbar-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: .4rem;
}
.navbar-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text-dim);
  border-radius: 2px;
  transition: var(--transition);
  display: block;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .85rem;
  color: var(--text-dim);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border-active);
  object-fit: cover;
}
.avatar-fallback {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border-active);
  background: linear-gradient(135deg, var(--accent), var(--primary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Theme toggle ──────────────────────────────────────────────────────────── */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-dim);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
  font-size: .9rem;
  line-height: 1;
}
.theme-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--bg-card);
  transform: rotate(20deg);
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem 1.35rem;
  border-radius: 10px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform .2s cubic-bezier(.4,0,.2,1),
              box-shadow .25s ease,
              background-color .25s ease,
              border-color .25s ease,
              color .25s ease;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
  position: relative;
  overflow: hidden;
  letter-spacing: -.01em;
}
.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Sheen sweep on hover — a soft diagonal highlight that travels across
   the button instead of a flat opacity overlay */
.btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(115deg, transparent, rgba(255,255,255,.22), transparent);
  transform: skewX(-15deg);
  transition: left .55s ease;
  pointer-events: none;
}
.btn:hover::after { left: 130%; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 4px 14px var(--primary-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0,0,0,.15), 0 10px 28px var(--primary-glow);
  color: #fff;
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 4px 14px var(--primary-glow);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #059669);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.1), 0 4px 14px rgba(16,185,129,.22);
}
.btn-success:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0,0,0,.12), 0 10px 26px rgba(16,185,129,.28);
  color: #fff;
}

.btn-ghost {
  background: var(--bg-card);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-glow);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
}
[data-theme="light"] .btn-ghost:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary-glow);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px var(--primary-glow);
}

.btn-danger {
  background: rgba(239,68,68,.12);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,.3);
}
.btn-danger:hover {
  background: var(--danger);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(239,68,68,.3);
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning), #d97706);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.1), 0 4px 14px rgba(245,158,11,.22);
}
.btn-warning:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.btn-sm  { padding: .32rem .85rem; font-size: .8rem; border-radius: 8px; }
.btn-lg  { padding: .85rem 2.1rem; font-size: 1rem; border-radius: 11px; }
.btn-xl  {
  padding: 1.05rem 2.6rem;
  font-size: 1.05rem;
  border-radius: 12px;
}
.btn-xl.btn-primary {
  box-shadow: 0 2px 4px rgba(0,0,0,.15), 0 8px 24px var(--primary-glow);
}
.btn-xl.btn-primary:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,.18), 0 14px 36px var(--primary-glow);
}
.btn-icon { padding: .5rem; aspect-ratio: 1; }

/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  position: relative;
  z-index: 1;
}

.main-content-full {
  position: relative;
  z-index: 1;
}

.footer {
  text-align: center;
  padding: 2.5rem 2rem;
  color: var(--text-muted);
  font-size: .8rem;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}
.footer a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 3px; }
.footer a:hover { color: var(--primary); }

/* ═══════════════════════════════════════════════════════════════════════════
   ANIMATIONS & KEYFRAMES
   ═══════════════════════════════════════════════════════════════════════════ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .5; }
}
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(59,130,246,.2); }
  50%       { box-shadow: 0 0 40px rgba(59,130,246,.4); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}
@keyframes orbitSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes typewriter {
  from { width: 0; }
  to   { width: 100%; }
}
@keyframes blink {
  50% { opacity: 0; }
}
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── Scroll-triggered reveal ──────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: .1s; }
.reveal-delay-2 { transition-delay: .2s; }
.reveal-delay-3 { transition-delay: .3s; }
.reveal-delay-4 { transition-delay: .4s; }

/* ═══════════════════════════════════════════════════════════════════════════
/* ═══════════════════════════════════════════════════════════════════════════
   LANDING PAGE — REDESIGNED (ProjectForge v2)
   Signature: Live code terminal in hero + immersive depth effects
   ═══════════════════════════════════════════════════════════════════════════ */

/* Animated background — now spans the ENTIRE page, not just the hero.
   Fixed positioning means it stays put as the page scrolls, so every
   section (features, stacks, CTA...) sits on the same living backdrop. */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(99,102,241,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,.06) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: gridMove 30s linear infinite;
  mask-image: linear-gradient(to bottom, black 0%, black 70%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 70%, transparent 100%);
}

[data-theme="light"] .hero-grid {
  background-image:
    linear-gradient(rgba(79,70,229,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79,70,229,.04) 1px, transparent 1px);
}

@keyframes gridMove {
  from { transform: translateY(0); }
  to   { transform: translateY(48px); }
}

/* Spotlight glow */
.page-bg::before {
  content: '';
  position: absolute;
  width: 900px;
  height: 900px;
  top: -300px;
  left: -200px;
  background: radial-gradient(circle, rgba(99,102,241,.12) 0%, transparent 65%);
  animation: heroGlow 8s ease-in-out infinite alternate;
}
.page-bg::after {
  content: '';
  position: absolute;
  width: 700px;
  height: 700px;
  bottom: -200px;
  right: -100px;
  background: radial-gradient(circle, rgba(34,211,238,.08) 0%, transparent 65%);
  animation: heroGlow 8s ease-in-out infinite alternate-reverse;
}
[data-theme="light"] .page-bg::before {
  background: radial-gradient(circle, rgba(79,70,229,.07) 0%, transparent 65%);
}
[data-theme="light"] .page-bg::after {
  background: radial-gradient(circle, rgba(6,182,212,.05) 0%, transparent 65%);
}

@keyframes heroGlow {
  from { transform: scale(1) translate(0,0); }
  to   { transform: scale(1.15) translate(40px, 30px); }
}

/* Floating code particles — now drift across the full page height */
.hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.hero-particle {
  position: absolute;
  font-family: var(--font-mono);
  font-size: .72rem;
  color: rgba(99,102,241,.18);
  animation: particleFloat linear infinite;
  white-space: nowrap;
  user-select: none;
}
[data-theme="light"] .hero-particle { color: rgba(79,70,229,.12); }

@keyframes particleFloat {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  5%   { opacity: 1; }
  95%  { opacity: 1; }
  100% { transform: translateY(-100vh) rotate(10deg); opacity: 0; }
}

/* Hero section itself no longer paints its own background —
   it now sits transparently on top of .page-bg */
.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 3rem;
  padding: 5rem 5% 4rem;
  overflow: hidden;
  z-index: 1;
}

/* ── Hero content (left) ──────────────────────────────────────────────────── */
.hero-content {
  position: relative;
  z-index: 1;
  animation: fadeInUp .7s ease both;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem .9rem;
  border-radius: 999px;
  background: rgba(99,102,241,.1);
  border: 1px solid rgba(99,102,241,.25);
  color: #a5b4fc;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}
[data-theme="light"] .hero-eyebrow {
  background: rgba(79,70,229,.08);
  border-color: rgba(79,70,229,.2);
  color: #4338ca;
}
.hero-eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6366f1;
  animation: pulse 1.8s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(99,102,241,.4);
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,.4); }
  50%       { box-shadow: 0 0 0 6px rgba(99,102,241,0); }
}

/* Hero badge (legacy alias) */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem 1rem;
  border-radius: 999px;
  background: rgba(99,102,241,.1);
  border: 1px solid rgba(99,102,241,.25);
  color: #a5b4fc;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .06em;
  margin-bottom: 1.5rem;
}
[data-theme="light"] .hero-badge {
  background: rgba(79,70,229,.08);
  border-color: rgba(79,70,229,.2);
  color: #4338ca;
}
.hero-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6366f1;
  animation: pulse 2s ease-in-out infinite;
}

.hero-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 32px rgba(99,102,241,.35), 0 0 0 1px rgba(99,102,241,.2);
  animation: glowPulse 3s ease-in-out infinite;
  transition: transform var(--transition);
  display: block;
}
@media (max-width: 960px) { .hero-logo { margin: 0 auto 1.5rem; } }
.hero-logo:hover { transform: scale(1.05) rotate(-3deg); }

.hero-title {
  font-size: clamp(2.4rem, 4.5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.03em;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.gradient-text {
  background: linear-gradient(130deg, #6366f1 0%, #22d3ee 55%, #a78bfa 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 5s ease infinite;
}
[data-theme="light"] .gradient-text {
  background: linear-gradient(130deg, #4f46e5 0%, #0891b2 55%, #7c3aed 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 5s ease infinite;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-dim);
  max-width: 520px;
  line-height: 1.75;
  margin-bottom: 2.5rem;
}
@media (max-width: 960px) { .hero-subtitle { margin: 0 auto 2.5rem; } }

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}
@media (max-width: 960px) { .hero-actions { align-items: center; } }

.hero-actions-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.hero-note {
  font-size: .78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: .4rem;
}
.hero-note::before {
  content: '✓';
  color: #22d3ee;
  font-weight: 700;
}
[data-theme="light"] .hero-note::before { color: #0891b2; }

.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  color: var(--text-muted);
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  animation: fadeIn 1s 1.2s ease both;
}
.hero-scroll-line {
  width: 1px;
  height: 28px;
  background: linear-gradient(to bottom, #6366f1, transparent);
  animation: scrollBounce 2s ease-in-out infinite;
}
@keyframes scrollBounce {
  0%, 100% { transform: scaleY(1); opacity: 1; }
  50%       { transform: scaleY(.7); opacity: .5; }
}

/* ── Hero Terminal (right column) ─────────────────────────────────────────── */
.hero-terminal-col {
  position: relative;
  z-index: 1;
  animation: fadeInUp .7s .2s ease both;
}

.hero-terminal-wrapper {
  position: relative;
}

/* Glow behind terminal */
.hero-terminal-wrapper::before {
  content: '';
  position: absolute;
  inset: -30px;
  background: radial-gradient(ellipse 80% 70% at 50% 50%, rgba(99,102,241,.15), transparent 70%);
  z-index: -1;
  animation: heroGlow 6s ease-in-out infinite alternate;
}
[data-theme="light"] .hero-terminal-wrapper::before {
  background: radial-gradient(ellipse 80% 70% at 50% 50%, rgba(79,70,229,.08), transparent 70%);
}

.hero-terminal {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(99,102,241,.25);
  box-shadow: 0 24px 80px rgba(0,0,0,.5), 0 0 0 1px rgba(99,102,241,.1);
  transition: box-shadow var(--transition);
}
[data-theme="light"] .hero-terminal {
  box-shadow: 0 24px 80px rgba(0,0,0,.12), 0 0 0 1px rgba(79,70,229,.15);
}
.hero-terminal:hover {
  box-shadow: 0 28px 90px rgba(99,102,241,.2), 0 0 0 1px rgba(99,102,241,.3);
}

.hero-term-header {
  background: #141824;
  padding: .7rem 1rem;
  display: flex;
  align-items: center;
  gap: .8rem;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.term-dots { display: flex; gap: .4rem; }
.term-dot  { width: 11px; height: 11px; border-radius: 50%; }
.term-dot.red    { background: #ff5f57; }
.term-dot.yellow { background: #febc2e; }
.term-dot.green  { background: #28c840; }
.term-tab {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: #94a3b8;
  padding: .2rem .7rem;
  border-radius: 5px;
  background: rgba(99,102,241,.15);
  border: 1px solid rgba(99,102,241,.2);
  color: #a5b4fc;
}

.hero-term-body {
  background: #080b14;
  padding: 1.1rem 1.25rem;
  height: 340px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: .76rem;
  line-height: 1.75;
  position: relative;
}
.term-line {
  display: flex;
  gap: .5rem;
  align-items: flex-start;
  opacity: 0;
  animation: termLineIn .2s ease forwards;
}
.term-prompt { color: #6366f1; flex-shrink: 0; }
.term-cmd    { color: #e2e8f0; }
.term-out-success { color: #34d399; padding-left: 1.2rem; }
.term-out-info    { color: #94a3b8; padding-left: 1.2rem; }
.term-out-accent  { color: #22d3ee; padding-left: 1.2rem; }
.term-out-file    { color: #a78bfa; padding-left: 1.2rem; }
.term-cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: #6366f1;
  vertical-align: middle;
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes termLineIn {
  from { opacity: 0; transform: translateX(-4px); }
  to   { opacity: 1; transform: none; }
}

/* Terminal badge row */
.hero-term-footer {
  background: #0c1018;
  padding: .55rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  border-top: 1px solid rgba(255,255,255,.04);
}
.term-stat {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-family: var(--font-mono);
  font-size: .68rem;
  color: #475569;
}
.term-stat-dot { width: 6px; height: 6px; border-radius: 50%; }
.ts-green  { background: #28c840; }
.ts-blue   { background: #6366f1; }
.ts-cyan   { background: #22d3ee; }

/* ── Stats row ─────────────────────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-card) 70%, transparent);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  position: relative;
  z-index: 1;
}
@media (max-width: 640px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}

.stat-item {
  text-align: center;
  padding: 2rem 1rem;
  border-right: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  cursor: default;
  transition: background var(--transition);
}
.stat-item:last-child { border-right: none; }
.stat-item::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #6366f1, #22d3ee);
  transform: scaleX(0);
  transition: transform .35s ease;
}
.stat-item:hover::before { transform: scaleX(1); }
.stat-item:hover { background: var(--bg-elevated); }

.stat-number {
  font-size: 2.2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  background: linear-gradient(135deg, #6366f1, #22d3ee);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: .3rem;
}
.stat-label {
  font-size: .78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Section shared ────────────────────────────────────────────────────────── */
.section-eyebrow {
  text-align: center;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #6366f1;
  margin-bottom: .9rem;
}
[data-theme="light"] .section-eyebrow { color: #4f46e5; }

.section-title {
  text-align: center;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -.025em;
  margin-bottom: .6rem;
  color: var(--text);
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 3.5rem;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.75;
}

/* ── Features section ──────────────────────────────────────────────────────── */
.features-section {
  padding: 6rem 5%;
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.75rem 1.5rem;
  transition: all .25s ease;
  position: relative;
  overflow: hidden;
  cursor: default;
  group: true;
}
.feature-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99,102,241,.04), rgba(34,211,238,.03));
  opacity: 0;
  transition: opacity .25s ease;
}
.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #6366f1, #22d3ee, #a78bfa);
  opacity: 0;
  transition: opacity .25s ease;
}
.feature-card:hover {
  border-color: rgba(99,102,241,.35);
  transform: translateY(-5px);
  box-shadow: 0 16px 48px rgba(99,102,241,.1);
}
.feature-card:hover::before,
.feature-card:hover::after { opacity: 1; }

.feature-icon {
  width: 50px;
  height: 50px;
  border-radius: 13px;
  background: rgba(99,102,241,.1);
  border: 1px solid rgba(99,102,241,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.1rem;
  transition: transform .25s ease, box-shadow .25s ease;
  position: relative;
  z-index: 1;
}
[data-theme="light"] .feature-icon {
  background: rgba(79,70,229,.08);
  border-color: rgba(79,70,229,.18);
}
.feature-card:hover .feature-icon {
  transform: scale(1.1) rotate(-6deg);
  box-shadow: 0 6px 20px rgba(99,102,241,.25);
}

.feature-card h3 {
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: .5rem;
  color: var(--text);
  position: relative;
  z-index: 1;
}
.feature-card p {
  font-size: .85rem;
  color: var(--text-muted);
  line-height: 1.7;
  position: relative;
  z-index: 1;
}

/* ── Stacks section ────────────────────────────────────────────────────────── */
.stacks-section {
  padding: 5rem 5%;
  background: color-mix(in srgb, var(--bg-card) 70%, transparent);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.stacks-row {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  justify-content: center;
  max-width: 900px;
  margin: 0 auto;
}

.stack-badge {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem 1.1rem;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: .83rem;
  color: var(--text-dim);
  transition: all .2s ease;
  cursor: default;
  font-weight: 500;
}
.stack-badge:hover {
  border-color: #6366f1;
  color: #a5b4fc;
  background: rgba(99,102,241,.08);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(99,102,241,.12);
}
[data-theme="light"] .stack-badge:hover {
  border-color: #4f46e5;
  color: #4f46e5;
  background: rgba(79,70,229,.07);
}
.stack-badge img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* ── How it works ──────────────────────────────────────────────────────────── */
.how-section {
  padding: 6rem 5%;
  max-width: 980px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.steps-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}
@media (max-width: 640px) { .steps-list { grid-template-columns: 1fr; } }

.step-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  transition: all .25s ease;
  position: relative;
  overflow: hidden;
}
.step-item::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #6366f1, #22d3ee);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s ease;
}
.step-item:hover::before { transform: scaleX(1); }
.step-item:hover {
  border-color: rgba(99,102,241,.3);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(99,102,241,.1);
}

.step-num {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(99,102,241,.1);
  border: 1px solid rgba(99,102,241,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: .88rem;
  font-weight: 700;
  color: #6366f1;
  flex-shrink: 0;
  transition: all .25s ease;
}
[data-theme="light"] .step-num {
  background: rgba(79,70,229,.08);
  border-color: rgba(79,70,229,.2);
  color: #4f46e5;
}
.step-item:hover .step-num {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
  box-shadow: 0 4px 16px rgba(99,102,241,.35);
}
[data-theme="light"] .step-item:hover .step-num {
  background: #4f46e5;
  border-color: #4f46e5;
}

.step-body h3 {
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: .3rem;
  color: var(--text);
}
.step-body p {
  font-size: .83rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ── Download section ──────────────────────────────────────────────────────── */
.download-section {
  padding: 5rem 5%;
  background: color-mix(in srgb, var(--bg-card) 70%, transparent);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-top: 1px solid var(--border);
  text-align: center;
  position: relative;
  z-index: 1;
}

.download-badges {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1.75rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: .9rem;
  font-weight: 500;
  transition: all .2s ease;
  text-decoration: none;
  cursor: pointer;
}
.download-btn:hover {
  border-color: #6366f1;
  background: rgba(99,102,241,.08);
  color: #a5b4fc;
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(99,102,241,.15);
}
[data-theme="light"] .download-btn:hover {
  border-color: #4f46e5;
  background: rgba(79,70,229,.06);
  color: #4f46e5;
}
.download-btn svg { width: 24px; height: 24px; flex-shrink: 0; }
.download-btn-label { text-align: left; line-height: 1.3; }
.download-btn-sub  { font-size: .7rem; color: var(--text-muted); display: block; }
.download-btn-main { font-size: .9rem; font-weight: 600; }

/* ── CTA section ───────────────────────────────────────────────────────────── */
.cta-section {
  padding: 7rem 5%;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 80% at 50% 50%, rgba(99,102,241,.07), transparent 70%);
  pointer-events: none;
}
[data-theme="light"] .cta-section::before {
  background: radial-gradient(ellipse 70% 80% at 50% 50%, rgba(79,70,229,.05), transparent 70%);
}

.cta-card {
  max-width: 660px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid rgba(99,102,241,.2);
  border-radius: 24px;
  padding: 3.5rem 2.5rem;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.cta-card:hover {
  border-color: rgba(99,102,241,.4);
  box-shadow: 0 20px 60px rgba(99,102,241,.1);
}
.cta-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #22d3ee, #a78bfa, #6366f1);
  background-size: 200% 100%;
  animation: gradientShift 3s ease infinite;
}

.cta-card h2 {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -.025em;
  margin-bottom: .8rem;
}
.cta-card p {
  color: var(--text-muted);
  margin-bottom: 2.25rem;
  line-height: 1.75;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

/* CTA trust row */
.cta-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.cta-trust-item {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .78rem;
  color: var(--text-muted);
}
.cta-trust-item::before {
  content: '✓';
  color: #22d3ee;
  font-weight: 700;
  font-size: .85rem;
}
[data-theme="light"] .cta-trust-item::before { color: #0891b2; }

/* ═══════════════════════════════════════════════════════════════════════════
   AUTH PAGE
   ═══════════════════════════════════════════════════════════════════════════ */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 130px);
  padding: 2rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 2.75rem 2.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  text-align: center;
  animation: fadeInScale .4s ease both;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  margin-bottom: 1rem;
  font-family: var(--font-mono);
  font-size: 1.4rem;
}
.auth-logo img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
}

.auth-subtitle {
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.65;
  font-size: .9rem;
}

.btn-github {
  width: 100%;
  justify-content: center;
  padding: .9rem;
  font-size: .95rem;
  border-radius: 12px;
}

.session-error {
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.3);
  color: #f87171;
  border-radius: var(--radius);
  padding: .75rem 1rem;
  margin-bottom: 1.25rem;
  font-size: .875rem;
  line-height: 1.5;
}

.auth-permissions {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  text-align: left;
}
.perm-title {
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: .5rem;
  font-weight: 500;
}
.auth-permissions ul {
  list-style: none;
  font-size: .82rem;
  color: var(--text-dim);
  line-height: 2;
}
.auth-permissions li::before {
  content: '✓ ';
  color: var(--success);
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════════════════
   WIZARD
   ═══════════════════════════════════════════════════════════════════════════ */
.wizard-container {
  max-width: 880px;
  margin: 0 auto;
}

.wizard-progress { margin-bottom: 3rem; }
.progress-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: .75rem;
  position: relative;
}
.progress-steps::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 10%;
  right: 10%;
  height: 1px;
  background: var(--border);
  z-index: 0;
}
.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  flex: 1;
  position: relative;
  z-index: 1;
}
.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: .82rem;
  font-weight: 700;
  transition: all .3s ease;
}
.progress-step.active .step-circle {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-glow);
  box-shadow: 0 0 0 4px rgba(59,130,246,.1);
}
.progress-step.done .step-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.step-label {
  font-size: .7rem;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}
.progress-step.active .step-label { color: var(--primary); font-weight: 500; }

.progress-bar-track {
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
  transition: width .45s cubic-bezier(.4,0,.2,1);
}

.wizard-step { display: none; animation: fadeInUp .3s ease; }
.wizard-step.active { display: block; }
.wizard-step h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: .4rem;
  letter-spacing: -.02em;
}
.step-description { color: var(--text-muted); margin-bottom: 2rem; font-size: .9rem; }

/* Arch cards */
.arch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}
.arch-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  padding: 1.5rem 1rem;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all .2s;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.arch-card input { display: none; }
.arch-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--primary-glow);
  opacity: 0;
  transition: opacity var(--transition);
}
.arch-card:hover { border-color: rgba(59,130,246,.5); transform: translateY(-2px); }
.arch-card:hover::after { opacity: 1; }
.arch-card.selected { border-color: var(--primary); background: rgba(59,130,246,.08); }
.arch-card.selected::before {
  content: '✓';
  position: absolute;
  top: .5rem;
  right: .75rem;
  font-size: .75rem;
  font-weight: 700;
  color: var(--primary);
}
.arch-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  transition: transform .2s;
  position: relative;
  z-index: 1;
}
.arch-card:hover .arch-logo { transform: scale(1.1); }
.arch-name { font-weight: 600; font-size: .9rem; position: relative; z-index: 1; }
.arch-desc { font-size: .74rem; color: var(--text-muted); position: relative; z-index: 1; }

/* Framework cards */
.fw-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  padding: 1rem .75rem;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all .2s;
  text-align: center;
}
.fw-card input { display: none; }
.fw-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.fw-card.selected { border-color: var(--primary); background: rgba(59,130,246,.08); }
.fw-logo { width: 40px; height: 40px; object-fit: contain; }
.fw-name { font-size: .82rem; font-weight: 600; }

/* DB cards */
.db-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.db-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all .2s;
  text-align: center;
}
.db-card input { display: none; }
.db-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.db-card.selected { border-color: var(--success); background: rgba(16,185,129,.07); }
.db-logo { width: 36px; height: 36px; object-fit: contain; margin-bottom: .2rem; }
.db-name { font-weight: 600; font-size: .85rem; }
.db-badge {
  font-size: .68rem;
  padding: .12rem .45rem;
  background: var(--bg-elevated);
  border-radius: 999px;
  color: var(--text-dim);
}

/* Infra cards */
.infra-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.infra-card {
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all .2s;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.infra-card input { display: none; }
.infra-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.infra-card.selected { border-color: var(--primary); background: rgba(59,130,246,.07); }
.infra-icon { font-size: 1.8rem; }
.infra-logo { width: 44px; height: 44px; object-fit: contain; margin-bottom: .25rem; }

/* Checklist */
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.checklist { display: flex; flex-direction: column; gap: .5rem; margin-top: .75rem; }
.checklist label {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem 1rem;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all .2s;
  font-size: .875rem;
}
.checklist label:hover { border-color: var(--primary); }
.checklist label.suggested { border-color: var(--accent); background: rgba(139,92,246,.07); }
.checklist label.selected { border-color: var(--primary); background: rgba(59,130,246,.07); }
.checklist label input { accent-color: var(--primary); }

/* Summary card */
.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.summary-item label {
  font-size: .72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  display: block;
  margin-bottom: .25rem;
}
.summary-item .value { font-weight: 600; font-size: 1rem; }

/* Form elements */
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: .65rem 1rem;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: .9rem;
  font-family: var(--font-sans);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-input::placeholder { color: var(--text-muted); }
.form-group { margin-bottom: 1.25rem; }
.form-group > label {
  display: block;
  margin-bottom: .4rem;
  font-size: .875rem;
  color: var(--text-dim);
  font-weight: 500;
}
.form-group small { color: var(--text-muted); font-size: .78rem; }
.checkbox-label { display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.option-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }

.form-section { margin-bottom: 2rem; }
.form-section > label {
  display: block;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: .75rem;
}

/* Wizard nav */
.wizard-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* AI banner */
.ai-suggestion-banner {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(139,92,246,.1), rgba(59,130,246,.07));
  border: 1px solid rgba(139,92,246,.25);
  margin-bottom: 2rem;
}
.ai-icon { font-size: 1.5rem; flex-shrink: 0; }

/* VPS section */
.vps-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.vps-row {
  display: grid;
  grid-template-columns: 1fr 2fr auto auto auto auto;
  gap: .5rem;
  align-items: end;
  margin-bottom: .75rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   GENERATION / TERMINAL
   ═══════════════════════════════════════════════════════════════════════════ */
.generation-page { max-width: 820px; margin: 0 auto; }
.generation-header { text-align: center; margin-bottom: 2rem; }

.forge-animation {
  display: flex;
  justify-content: center;
  gap: .5rem;
  font-size: 2.2rem;
  margin-bottom: 1rem;
}
.gear { animation: spin 3s linear infinite; display: inline-block; }
.gear-2 { animation-direction: reverse; animation-duration: 2s; }

.subtitle { color: var(--text-muted); min-height: 1.5em; }

.generation-progress { margin-bottom: 1.5rem; }
.progress-track {
  height: 8px;
  background: var(--bg-card);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.progress-indicator {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px;
  transition: width .5s ease;
  position: relative;
  overflow: hidden;
}
.progress-indicator::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 60%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.3), transparent);
  animation: shimmer 1.5s ease infinite;
}

/* Terminal */
.terminal-container {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
}
.terminal-header {
  background: #141824;
  padding: .6rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
[data-theme="light"] .terminal-header {
  background: #1e293b;
}
.terminal-dots { display: flex; gap: .4rem; }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red    { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green  { background: #28c840; }

.terminal-title {
  font-size: .78rem;
  color: #475569;
  font-family: var(--font-mono);
}
.terminal-body {
  background: #0a0d16;
  padding: 1rem;
  height: 400px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: .78rem;
  line-height: 1.7;
}
.terminal-line { margin: .1rem 0; }
.terminal-line.info    { color: #475569; }
.terminal-line.success { color: #34d399; }
.terminal-line.error   { color: #f87171; }
.terminal-line.warn    { color: #fbbf24; }
.terminal-line .ts     { color: #334155; margin-right: .5rem; }
.terminal-line .log-step { color: #60a5fa; margin-right: .4rem; }
code.log-cmd {
  display: block;
  margin-top: .2rem;
  padding: .2rem .5rem;
  background: rgba(59,130,246,.1);
  border-left: 2px solid var(--primary);
  border-radius: 3px;
  color: #93c5fd;
  font-size: .75rem;
}

/* Completion panel */
.completion-panel {
  text-align: center;
  margin-top: 2rem;
  padding: 2rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  animation: fadeInScale .4s ease;
}
.completion-icon      { font-size: 3rem; margin-bottom: 1rem; }
.completion-icon.success { color: var(--success); }
.completion-icon.error   { color: var(--danger); }
.completion-links { display: flex; justify-content: center; gap: 1rem; margin-top: 1rem; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════════════════════════════
   DASHBOARD
   ═══════════════════════════════════════════════════════════════════════════ */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.dashboard-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -.02em;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all .2s;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.project-card:hover {
  border-color: rgba(59,130,246,.4);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(59,130,246,.08);
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
}
.project-name { font-weight: 600; font-size: 1rem; margin-bottom: .3rem; }

.project-arch-badge {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-status {
  display: inline-block;
  padding: .18rem .6rem;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .03em;
}
.status-published  { background: rgba(16,185,129,.12); color: var(--success); }
.status-generating { background: rgba(59,130,246,.12); color: var(--primary); }
.status-failed     { background: rgba(239,68,68,.12);  color: var(--danger); }
.status-draft      { background: var(--bg-elevated);   color: var(--text-muted); border: 1px solid var(--border); }

.project-desc {
  font-size: .85rem;
  color: var(--text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  font-size: .75rem;
  color: var(--text-muted);
}
.project-meta span {
  padding: .2rem .6rem;
  background: var(--bg-elevated);
  border-radius: 999px;
  border: 1px solid var(--border);
}

.project-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--text-muted);
}
.empty-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  animation: float 4s ease-in-out infinite;
}
.empty-state h2 { font-size: 1.4rem; color: var(--text-dim); margin-bottom: .5rem; }
.empty-state p { margin-bottom: 1.5rem; font-size: .9rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   PROJECT DETAIL
   ═══════════════════════════════════════════════════════════════════════════ */
.project-detail { max-width: 1040px; margin: 0 auto; }
.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.breadcrumb {
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: .4rem;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.detail-actions { display: flex; gap: .75rem; flex-wrap: wrap; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.5rem;
}
.detail-main { min-width: 0; }

/* Tabs */
.tabs {
  display: flex;
  gap: .25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.tab {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: .6rem 1rem;
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: .875rem;
  transition: all var(--transition);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--text-dim); }
.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: rgba(59,130,246,.05);
}
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeInUp .3s ease; }

.readme-container {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.75rem;
  border: 1px solid var(--border);
}

.logs-container {
  border-radius: var(--radius);
  overflow: hidden;
}

.empty-tab {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  font-size: .9rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   API DOCS
   ═══════════════════════════════════════════════════════════════════════════ */
.api-page { max-width: 960px; margin: 0 auto; }
.api-page-header { margin-bottom: 2rem; }
.api-page-header h1 { font-size: 1.8rem; font-weight: 700; margin-bottom: .4rem; }
.api-page-header p { color: var(--text-muted); font-size: .9rem; }

.api-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
  transition: border-color var(--transition);
}
.api-section:hover { border-color: rgba(59,130,246,.25); }
.api-section h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.api-section h3 {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-dim);
  margin: 1.25rem 0 .6rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.code-block {
  background: #070a12;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: #7dd3a8;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-x: auto;
  position: relative;
}
[data-theme="light"] .code-block {
  background: #1e293b;
  color: #86efac;
  border-color: rgba(255,255,255,.08);
}

.endpoint-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1rem;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  flex-wrap: wrap;
  transition: all var(--transition);
  margin-bottom: .4rem;
}
.endpoint-row:hover {
  border-color: rgba(59,130,246,.3);
  background: var(--bg-hover);
}

.method {
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 700;
  padding: .22rem .6rem;
  border-radius: 5px;
  min-width: 58px;
  text-align: center;
  letter-spacing: .03em;
}
.method-get    { background: rgba(16,185,129,.15); color: #34d399; border: 1px solid rgba(16,185,129,.25); }
.method-post   { background: rgba(59,130,246,.15); color: #60a5fa; border: 1px solid rgba(59,130,246,.25); }
.method-delete { background: rgba(239,68,68,.15);  color: #f87171; border: 1px solid rgba(239,68,68,.25); }
.method-put    { background: rgba(245,158,11,.15); color: #fbbf24; border: 1px solid rgba(245,158,11,.25); }
.method-patch  { background: rgba(139,92,246,.15); color: #a78bfa; border: 1px solid rgba(139,92,246,.25); }

.endpoint-path {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: .8rem;
  flex: 1;
}
.endpoint-desc { color: var(--text-dim); font-size: .82rem; }
.endpoint-auth {
  font-size: .72rem;
  color: var(--text-muted);
  white-space: nowrap;
  padding: .18rem .5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

/* Try-it-out panel */
.try-it-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-top: .75rem;
  display: none;
}
.try-it-panel.open { display: block; animation: slideDown .25s ease; }
.try-it-title {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: .75rem;
}
.try-response {
  margin-top: .75rem;
  padding: .75rem;
  border-radius: 8px;
  background: #070a12;
  font-family: var(--font-mono);
  font-size: .75rem;
  color: #7dd3a8;
  min-height: 60px;
  white-space: pre-wrap;
  overflow-x: auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════════════════════ */
/* WIP / Prereq backdrop */
.wip-modal-backdrop,
.prereq-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn .2s ease;
}

.wip-modal,
.prereq-modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: fadeInScale .25s ease;
}

.prereq-modal-box { max-width: 560px; text-align: left; }

.wip-modal-icon,
.prereq-modal-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.wip-modal h2,
.prereq-modal-title { font-size: 1.3rem; font-weight: 700; margin-bottom: .5rem; }
.wip-modal p,
.prereq-modal-subtitle { color: var(--text-muted); font-size: .875rem; line-height: 1.6; margin-bottom: 1.25rem; }

.prereq-modal-subtitle { margin-bottom: 1rem; }

.prereq-tools-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1.25rem; }
.prereq-tool-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}
.prereq-tool-status { font-size: 1rem; width: 20px; text-align: center; }
.prereq-tool-info { display: flex; flex-direction: column; gap: .1rem; }
.prereq-tool-name { font-weight: 600; font-size: .875rem; }
.prereq-tool-desc { font-size: .75rem; color: var(--text-muted); }
.prereq-tool-link {
  font-size: .78rem;
  color: var(--primary);
  padding: .2rem .6rem;
  border: 1px solid var(--primary);
  border-radius: 6px;
  white-space: nowrap;
  transition: all var(--transition);
}
.prereq-tool-link:hover { background: var(--primary); color: #fff; }
.prereq-modal-note {
  font-size: .8rem;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .75rem 1rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}
.prereq-modal-note code {
  font-family: var(--font-mono);
  background: rgba(255,255,255,.08);
  padding: .1em .3em;
  border-radius: 4px;
  font-size: .85em;
}
.prereq-modal-actions { display: flex; gap: .75rem; justify-content: flex-end; }

/* ═══════════════════════════════════════════════════════════════════════════
   ALERTS & NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════════════════ */
.alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: .875rem;
  animation: slideDown .3s ease;
}
.alert-error   { background: rgba(239,68,68,.1);  border: 1px solid rgba(239,68,68,.3);  color: #fca5a5; }
.alert-success { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.3); color: #6ee7b7; }
.alert-warning { background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.3); color: #fde68a; }
.alert button  { background: none; border: none; color: inherit; cursor: pointer; font-size: 1rem; padding: 0 .25rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════════════════════ */
.mt-4  { margin-top: 1rem; }
.mt-6  { margin-top: 1.5rem; }
.mt-8  { margin-top: 2rem; }
.mb-4  { margin-bottom: 1rem; }
.text-muted   { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-center  { text-align: center; }
.font-mono    { font-family: var(--font-mono); }

/* Divider */
.divider {
  height: 1px;
  background: var(--border);
  margin: 2rem 0;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .18rem .6rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
}
.badge-blue   { background: rgba(59,130,246,.12); color: var(--primary); }
.badge-green  { background: rgba(16,185,129,.12); color: var(--success); }
.badge-purple { background: rgba(139,92,246,.12); color: var(--accent); }

/* ── API Explorer link in navbar ──────────────────────────────────────────── */
.navbar-links a.api-link { color: var(--accent); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════════════════
   LEGAL PAGES (Privacy & Terms)
   ═══════════════════════════════════════════════════════════════════════════ */
.legal-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
.legal-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.legal-header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: .6rem;
}
.legal-header p {
  color: var(--text-muted);
  font-size: .875rem;
}
.legal-section {
  margin-bottom: 2.5rem;
}
.legal-section h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: .9rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.legal-section h3 {
  font-size: .95rem;
  font-weight: 600;
  margin: 1.2rem 0 .5rem;
  color: var(--text-dim);
}
.legal-section p {
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: .8rem;
  font-size: .9rem;
}
.legal-section ul {
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: .9rem;
  line-height: 1.8;
}
.legal-section ul li { margin-bottom: .25rem; }
.legal-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 3rem;
}
.legal-nav a {
  font-size: .85rem;
  color: var(--text-dim);
  padding: .3rem .75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.legal-nav a:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-glow);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
  .vps-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .main-content { padding: 1.5rem 1rem; }
  .navbar { padding: 0 1rem; }
  .navbar-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1rem;
    gap: .75rem;
    z-index: 99;
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
  }
  .navbar-links.open { display: flex; animation: slideDown .2s ease; }
  .navbar-toggle { display: flex; }

  .hero-title { font-size: clamp(2rem, 8vw, 3rem); }
  .hero-subtitle { font-size: 1rem; }

  .arch-grid { grid-template-columns: repeat(2, 1fr); }
  .db-grid   { grid-template-columns: repeat(2, 1fr); }
  .infra-grid { grid-template-columns: 1fr; }
  .two-columns { grid-template-columns: 1fr; }
  .summary-card { grid-template-columns: 1fr; }

  .stats-row { gap: 2rem; }
  .stat-number { font-size: 1.6rem; }

  .download-badges { flex-direction: column; align-items: center; }
  .download-btn { width: 100%; max-width: 300px; justify-content: flex-start; }

  .wizard-progress .step-label { display: none; }

  .cta-card { padding: 2rem 1.5rem; }
  .cta-card h2 { font-size: 1.6rem; }

  .legal-page { padding: 2rem 1rem; }
  .legal-header h1 { font-size: 1.5rem; }
}

@media (max-width: 480px) {
  .arch-grid { grid-template-columns: 1fr 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .hero-actions-row { flex-direction: column; width: 100%; }
  .hero-actions-row .btn { width: 100%; justify-content: center; }
  .navbar-brand span { display: none; }
  .stats-row { gap: 1.5rem; }
  .infra-grid { grid-template-columns: 1fr; }
}

/* ── Logo images ───────────────────────────────────────────────────────────── */
.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  object-fit: cover;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LIGHT THEME — additional targeted fixes
   ═══════════════════════════════════════════════════════════════════════════ */

/* Code blocks in light mode must keep dark background for readability */
[data-theme="light"] .code-block,
[data-theme="light"] .terminal-body {
  background: #1e293b;
  border-color: rgba(0,0,0,.1);
  color: #86efac;
}

/* Terminal header in light mode */
[data-theme="light"] .terminal-header {
  background: #0f172a;
  border-bottom-color: rgba(255,255,255,.05);
}

/* Form inputs in light mode */
[data-theme="light"] .form-input,
[data-theme="light"] .form-select,
[data-theme="light"] .form-textarea {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text);
}
[data-theme="light"] .form-input::placeholder {
  color: var(--text-muted);
}

/* Cards in light mode */
[data-theme="light"] .feature-card,
[data-theme="light"] .project-card,
[data-theme="light"] .api-section,
[data-theme="light"] .wip-modal,
[data-theme="light"] .prereq-modal-box {
  background: var(--bg-card);
  border-color: var(--border);
}

/* Auth card */
[data-theme="light"] .auth-card {
  box-shadow: 0 8px 40px rgba(0,0,0,.08);
}

/* Session error light */
[data-theme="light"] .session-error {
  background: rgba(220,38,38,.08);
  border-color: rgba(220,38,38,.25);
  color: #b91c1c;
}

/* Status badges in light mode */
[data-theme="light"] .status-published  { background: rgba(5,150,105,.1);  color: #059669; }
[data-theme="light"] .status-generating { background: rgba(37,99,235,.1);  color: #2563eb; }
[data-theme="light"] .status-failed     { background: rgba(220,38,38,.1);  color: #dc2626; }
[data-theme="light"] .status-draft      { background: rgba(100,116,139,.08); color: #64748b; }

/* Wizard cards in light mode */
[data-theme="light"] .arch-card,
[data-theme="light"] .fw-card,
[data-theme="light"] .db-card,
[data-theme="light"] .infra-card {
  background: var(--bg-card);
  border-color: var(--border);
}
[data-theme="light"] .arch-card.selected,
[data-theme="light"] .fw-card.selected,
[data-theme="light"] .infra-card.selected {
  background: rgba(37,99,235,.06);
  border-color: var(--primary);
}
[data-theme="light"] .db-card.selected {
  background: rgba(5,150,105,.06);
  border-color: var(--success);
}
[data-theme="light"] .checklist label {
  background: var(--bg-card);
  border-color: var(--border);
}
[data-theme="light"] .checklist label.selected {
  background: rgba(37,99,235,.06);
  border-color: var(--primary);
}
[data-theme="light"] .checklist label.suggested {
  background: rgba(109,40,217,.06);
  border-color: var(--accent);
}

/* Dashboard grid light */
[data-theme="light"] .project-card { background: var(--bg-card); }
[data-theme="light"] .project-meta span {
  background: var(--bg-elevated);
  border-color: var(--border);
}

/* AI banner light */
[data-theme="light"] .ai-suggestion-banner {
  background: linear-gradient(135deg, rgba(109,40,217,.08), rgba(37,99,235,.06));
  border-color: rgba(109,40,217,.2);
}

/* Summary card light */
[data-theme="light"] .summary-card {
  background: var(--bg-card);
  border-color: var(--border);
}

/* Footer light */
[data-theme="light"] .footer {
  border-top-color: var(--border);
}

/* Alert light */
[data-theme="light"] .alert-error   { background: rgba(220,38,38,.08); border-color: rgba(220,38,38,.25); color: #b91c1c; }
[data-theme="light"] .alert-success { background: rgba(5,150,105,.08);  border-color: rgba(5,150,105,.25); color: #065f46; }
[data-theme="light"] .alert-warning { background: rgba(217,119,6,.08);  border-color: rgba(217,119,6,.25); color: #92400e; }

/* Log entry light */
[data-theme="light"] .terminal-line { color: #86efac; }
[data-theme="light"] .terminal-line.error { color: #f87171; }
[data-theme="light"] .terminal-line.info  { color: #64748b; }
[data-theme="light"] code.log-cmd { background: rgba(37,99,235,.1); color: #1d4ed8; border-left-color: var(--primary); }

/* Progress bar track light */
[data-theme="light"] .progress-track { background: var(--bg-elevated); }
[data-theme="light"] .progress-bar-track { background: var(--bg-elevated); }

/* Tabs light */
[data-theme="light"] .tab:not(.active) { color: var(--text-muted); }
[data-theme="light"] .tabs { border-bottom-color: var(--border); }

/* Endpoint row light */
[data-theme="light"] .endpoint-row { background: var(--bg-elevated); border-color: var(--border); }
[data-theme="light"] .endpoint-row:hover { background: var(--bg-hover); border-color: rgba(37,99,235,.3); }
[data-theme="light"] .endpoint-auth { background: var(--bg-card); border-color: var(--border); }

/* WIP modal backdrop */
[data-theme="light"] .wip-modal-backdrop,
[data-theme="light"] .prereq-modal-backdrop {
  background: rgba(0,0,0,.4);
}

/* ── Session / Auth error (uses variables, works in both themes) ──────────── */
.session-error {
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.3);
  color: #f87171;
}
[data-theme="light"] .session-error {
  background: rgba(220,38,38,.08);
  border-color: rgba(220,38,38,.25);
  color: #b91c1c;
}

/* ── Ensure apidoc page overflows main-content max-width ─────────────────── */
.main-content:has(.apidoc-wrap) {
  max-width: 100%;
  padding: 0;
}
/* Fallback for browsers without :has() */
.apidoc-page-override {
  max-width: 100% !important;
  padding: 0 !important;
}

/* ── Full-width layout (API docs) ─────────────────────────────────────────── */
.main-content-full {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
}
