/* ============================================
 * SOLERI BASE — Shared Solarpunk Design System
 * Used by all pages. Page-specific styles stay inline.
 * ============================================ */

/* ============================================
 * DESIGN TOKENS — Soleri Solar Punk Theme
 * Derived from design-system/src/tokens.css
 * ============================================ */
:root {
  /* Primitive Scales */
  --color-primary-50: #F9EAD6;
  --color-primary-100: #FADFBD;
  --color-primary-200: #F6D09D;
  --color-primary-300: #EFBC75;
  --color-primary-400: #E8A847;
  --color-primary-500: #C88F37;
  --color-primary-600: #6D4300;
  --color-primary-700: #5E3D03;
  --color-primary-800: #4F3816;
  --color-primary-900: #41321F;

  --color-secondary-50: #D7E2E7;
  --color-secondary-100: #C1DDE9;
  --color-secondary-200: #A3D4E7;
  --color-secondary-300: #78C4E1;
  --color-secondary-400: #50B1D3;
  --color-secondary-500: #239DC3;
  --color-secondary-600: #005774;
  --color-secondary-700: #004A62;
  --color-secondary-800: #023E50;
  --color-secondary-900: #0F323F;

  --color-tertiary-50: #E4F1DD;
  --color-tertiary-100: #D5EDC9;
  --color-tertiary-200: #C1E3AF;
  --color-tertiary-300: #A9D68F;
  --color-tertiary-400: #91C96E;
  --color-tertiary-500: #7AAC5B;
  --color-tertiary-600: #345918;
  --color-tertiary-700: #324E1F;
  --color-tertiary-800: #304423;
  --color-tertiary-900: #2D3A26;

  --color-neutral-50: #D9DCDF;
  --color-neutral-100: #CED4DB;
  --color-neutral-200: #BFC7D3;
  --color-neutral-300: #A9B4C5;
  --color-neutral-400: #919EB2;
  --color-neutral-500: #7A899F;
  --color-neutral-600: #3F4E63;
  --color-neutral-700: #374253;
  --color-neutral-800: #2E3744;
  --color-neutral-900: #252C36;

  --color-white: #FFFFFF;
  --color-black: #000000;

  /* Shadows */
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.06);
  --shadow-md: 0 8px 24px -8px rgb(0 0 0 / 0.12);
  --shadow-lg: 0 16px 48px -12px rgb(0 0 0 / 0.15);
  --shadow-glow-amber: 0 0 60px -12px rgb(232 168 71 / 0.2);
  --shadow-glow-teal: 0 0 60px -12px rgb(35 157 195 / 0.15);
  --shadow-glow-green: 0 0 60px -12px rgb(145 201 110 / 0.15);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;
}

/* ============================================
 * LIGHT THEME (default - warm, sunlit solarpunk)
 * ============================================ */
[data-theme="light"] {
  --bg: var(--color-white);
  --bg-warm: #FBF6ED;
  --surface: color-mix(in srgb, var(--color-white) 92%, var(--color-secondary-300) 8%);
  --surface-glass: rgba(255, 255, 255, 0.78);
  --surface-elevated: var(--color-white);
  --foreground: var(--color-primary-700);
  --foreground-strong: var(--color-primary-800);
  --muted: #5C6B7F;
  --border: var(--color-neutral-200);
  --border-subtle: rgba(191, 199, 211, 0.4);
  --accent-primary: var(--color-primary-400);
  --accent-teal: var(--color-secondary-600);
  --accent-green: var(--color-tertiary-600);
  --ring: var(--color-secondary-500);
  --code-bg: color-mix(in srgb, var(--color-primary-50) 60%, var(--color-white) 40%);
  --code-fg: var(--color-neutral-800);
  --hero-gradient: linear-gradient(
    160deg,
    color-mix(in srgb, var(--color-white) 92%, var(--color-secondary-300) 8%) 0%,
    color-mix(in srgb, var(--color-white) 94%, var(--color-tertiary-300) 6%) 100%
  );
  --card-gradient: linear-gradient(
    180deg,
    color-mix(in srgb, var(--color-white) 95%, var(--color-secondary-300) 5%) 0%,
    color-mix(in srgb, var(--color-white) 92%, var(--color-primary-100) 8%) 100%
  );
  --glow-amber-opacity: 0.4;
  --glow-green-opacity: 0.3;
  --glow-teal-opacity: 0.25;
  --botanical-opacity: 0.05;
  --code-border: var(--border);
  --code-prompt: var(--color-tertiary-600);
  --code-cmd: var(--color-secondary-600);
  --code-arg: var(--color-primary-600);
  --code-comment: var(--color-neutral-500);
  --code-key: var(--color-secondary-600);
  --code-val: var(--color-primary-600);
  --code-ok: var(--color-tertiary-600);
}

/* ============================================
 * DARK THEME (deep, bioluminescent)
 * ============================================ */
[data-theme="dark"] {
  --bg: #1A1F26;
  --bg-warm: #1E2530;
  --surface: rgba(46, 55, 68, 0.7);
  --surface-glass: rgba(46, 55, 68, 0.55);
  --surface-elevated: #2E3744;
  --foreground: var(--color-neutral-100);
  --foreground-strong: var(--color-neutral-50);
  --muted: var(--color-neutral-400);
  --border: rgba(55, 66, 83, 0.8);
  --border-subtle: rgba(55, 66, 83, 0.5);
  --accent-primary: var(--color-primary-400);
  --accent-teal: var(--color-secondary-400);
  --accent-green: var(--color-tertiary-400);
  --ring: var(--color-secondary-400);
  --code-bg: #151A21;
  --code-fg: var(--color-neutral-100);
  --hero-gradient: linear-gradient(
    160deg,
    rgba(232, 168, 71, 0.06) 0%,
    rgba(35, 157, 195, 0.04) 40%,
    rgba(145, 201, 110, 0.04) 100%
  );
  --card-gradient: linear-gradient(
    180deg,
    rgba(46, 55, 68, 0.6) 0%,
    rgba(37, 44, 54, 0.4) 100%
  );
  --glow-amber-opacity: 0.14;
  --glow-green-opacity: 0.1;
  --glow-teal-opacity: 0.08;
  --botanical-opacity: 0.04;
  --code-border: rgba(55, 66, 83, 0.5);
  --code-prompt: var(--color-tertiary-400);
  --code-cmd: var(--color-secondary-300);
  --code-arg: var(--color-primary-300);
  --code-comment: var(--color-neutral-500);
  --code-key: var(--color-secondary-300);
  --code-val: var(--color-primary-300);
  --code-ok: var(--color-tertiary-300);
}

/* ============================================
 * BASE RESET
 * ============================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Sora", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--foreground);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

/* View Transitions API - circular reveal */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

/* ============================================
 * DECORATIVE - Organic background elements
 * ============================================ */
.page {
  min-height: 100vh;
  position: relative;

  /* Aurora color slots — override per page */
  --glow-color-1: var(--color-primary-400);
  --glow-color-2: var(--color-tertiary-400);
  --glow-color-3: var(--color-secondary-400);
}

/* Aurora drift — slow-moving solarpunk light sources */
.glow {
  pointer-events: none;
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  z-index: 0;
  will-change: transform;
}

.glow-amber {
  width: 600px;
  height: 600px;
  top: -120px;
  left: 40%;
  background: radial-gradient(circle, var(--glow-color-1) 0%, transparent 70%);
  opacity: var(--glow-amber-opacity);
  animation: drift-amber 20s ease-in-out infinite;
}

.glow-green {
  width: 500px;
  height: 500px;
  top: 500px;
  right: -120px;
  background: radial-gradient(circle, var(--glow-color-2) 0%, transparent 70%);
  opacity: var(--glow-green-opacity);
  animation: drift-green 26s ease-in-out infinite;
}

.glow-teal {
  width: 450px;
  height: 450px;
  top: 1100px;
  left: -100px;
  background: radial-gradient(circle, var(--glow-color-3) 0%, transparent 70%);
  opacity: var(--glow-teal-opacity);
  animation: drift-teal 18s ease-in-out infinite;
}

@keyframes drift-amber {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%      { transform: translate(300px, 200px) scale(1.3); }
  50%      { transform: translate(-200px, 400px) scale(0.8); }
  75%      { transform: translate(250px, -150px) scale(1.2); }
}

@keyframes drift-green {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%      { transform: translate(-280px, -250px) scale(1.25); }
  50%      { transform: translate(250px, -150px) scale(0.75); }
  75%      { transform: translate(-150px, 300px) scale(1.3); }
}

@keyframes drift-teal {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%      { transform: translate(320px, 180px) scale(1.2); }
  50%      { transform: translate(100px, -300px) scale(0.85); }
  75%      { transform: translate(-250px, 150px) scale(1.25); }
}

/* Grid background overlay */
.grid-bg {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.18;
  background-image:
    linear-gradient(
      to right,
      color-mix(in srgb, var(--border) 50%, transparent) 1px,
      transparent 1px
    ),
    linear-gradient(
      to bottom,
      color-mix(in srgb, var(--border) 50%, transparent) 1px,
      transparent 1px
    );
  background-size: 22px 22px;
  mask-image: radial-gradient(circle at 50% 24%, black 15%, transparent 60%);
}

/* Light chasers flowing through grid tubes */
.grid-rays {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 10;
  overflow: hidden;
}

.ray {
  position: absolute;
}

/* Horizontal chaser - bright dot travels left -> right */
.ray-h {
  height: 1px;
  width: 100px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(232, 168, 71, 0.03) 30%,
    rgba(232, 168, 71, 0.15) 70%,
    rgba(255, 220, 140, 0.4) 90%,
    rgba(255, 240, 180, 0.6) 100%
  );
  animation: var(--anim, chase-h-a) var(--dur, 40s) var(--del, 0s) ease-in infinite;
  opacity: 0;
}

.ray-h::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -1px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.7) 0%, rgba(255, 230, 160, 0.4) 40%, transparent 70%);
  box-shadow:
    0 0 2px 1px rgba(255, 240, 180, 0.5),
    0 0 6px 2px rgba(232, 168, 71, 0.2);
}

/* Teal variant - cooler light */
.ray-teal.ray-h {
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(35, 157, 195, 0.02) 30%,
    rgba(35, 157, 195, 0.1) 70%,
    rgba(120, 200, 230, 0.3) 90%,
    rgba(180, 230, 250, 0.5) 100%
  );
}

.ray-teal.ray-h::after,
.ray-teal.ray-v::after {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, rgba(160, 220, 240, 0.3) 40%, transparent 70%);
  box-shadow:
    0 0 2px 1px rgba(180, 230, 250, 0.5),
    0 0 6px 2px rgba(35, 157, 195, 0.2);
}

/* Rays travel during a small window, then idle — feels sporadic */
@keyframes chase-h-a {
  0%   { transform: translateX(-120px); opacity: 0; }
  1%   { opacity: 0.8; }
  14%  { opacity: 0.8; }
  15%  { transform: translateX(calc(100vw + 60px)); opacity: 0; }
  100% { transform: translateX(calc(100vw + 60px)); opacity: 0; }
}
@keyframes chase-h-b {
  0%, 30% { transform: translateX(-120px); opacity: 0; }
  31%  { opacity: 0.6; }
  49%  { opacity: 0.6; }
  50%  { transform: translateX(calc(100vw + 60px)); opacity: 0; }
  100% { transform: translateX(calc(100vw + 60px)); opacity: 0; }
}
@keyframes chase-h-c {
  0%, 60% { transform: translateX(-120px); opacity: 0; }
  61%  { opacity: 0.7; }
  84%  { opacity: 0.7; }
  85%  { transform: translateX(calc(100vw + 60px)); opacity: 0; }
  100% { transform: translateX(calc(100vw + 60px)); opacity: 0; }
}

/* ============================================
 * LAYOUT
 * ============================================ */
.container {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 24px 100px;
  overflow-x: hidden;
}

/* ============================================
 * NAV
 * ============================================ */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  margin-bottom: 56px;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.brand a {
  text-decoration: none;
  color: inherit;
}

.brand-top {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: min-content;
}

.brand-lines {
  display: flex;
  gap: 10%;
  width: 100%;
}

.brand-lines span {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--foreground-strong);
}

.brand-name {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--foreground-strong);
}

.brand-meta {
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin-top: -48px;
  margin-bottom: 48px;
}

/* Nav links - page navigation */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--foreground-strong);
  background: var(--surface);
}

.nav-links a[aria-current="page"] {
  color: var(--foreground-strong);
  background: var(--surface);
  font-weight: 600;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  cursor: pointer;
  color: var(--muted);
  padding: 0;
  transition: color 0.15s ease, border-color 0.15s ease;
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  box-shadow: var(--shadow-md);
}

.menu-toggle:hover {
  color: var(--foreground-strong);
  border-color: var(--foreground);
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: block;
}

.chip {
  border: none;
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  letter-spacing: 0.02em;
}

.lang-switcher {
  display: flex;
  gap: 0;
}

.lang-switcher a {
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  color: var(--border);
  padding: 4px 6px;
  transition: color 0.15s ease;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.lang-switcher a:hover {
  color: var(--foreground);
}

.lang-switcher a.active {
  color: var(--muted);
}

.theme-toggle {
  border: none;
  background: transparent;
  border-radius: var(--radius-full);
  height: 28px;
  width: 28px;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.theme-toggle:hover {
  color: var(--foreground-strong);
}

.toggle-track {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  position: relative;
}

.toggle-thumb {
  display: none;
}

.toggle-icon {
  width: 14px;
  height: 14px;
  position: absolute;
  z-index: 0;
  transition: opacity 0.2s ease;
}

.toggle-sun {
  color: inherit;
  opacity: 0;
}

.toggle-moon {
  color: inherit;
  opacity: 1;
}

[data-theme="dark"] .toggle-sun {
  opacity: 1;
}

[data-theme="dark"] .toggle-moon {
  opacity: 0;
}

/* ============================================
 * PAGE HERO (inner pages - text only)
 * ============================================ */
.page-hero {
  margin-bottom: 72px;
  padding: 32px 0;
}

.page-hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-green);
  letter-spacing: 0.02em;
}

.page-hero .eyebrow::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-tertiary-400);
  animation: pulse-dot 2s ease infinite;
}

.page-hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.035em;
  font-weight: 800;
  color: var(--foreground-strong);
  margin-bottom: 16px;
  max-width: 20ch;
}

.page-hero .hero-subtitle {
  max-width: 54ch;
  color: var(--muted);
  line-height: 1.7;
  font-size: 16px;
}

/* ============================================
 * HERO (landing page)
 * ============================================ */
.hero {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 72px;
}

.hero-image {
  width: 100%;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
  aspect-ratio: 21 / 10;
  background: linear-gradient(
    135deg,
    rgba(45, 58, 38, 0.8) 0%,
    rgba(15, 50, 63, 0.7) 40%,
    rgba(65, 50, 31, 0.6) 100%
  );
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  display: block;
}

.hero-image::after {
  content: "";
  position: absolute;
  inset: 0;
  /* Eased multi-stop gradient — dark at bottom, subtle tint at top */
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.82) 0%,
    rgba(0, 0, 0, 0.65) 25%,
    rgba(0, 0, 0, 0.4) 50%,
    rgba(0, 0, 0, 0.2) 75%,
    rgba(0, 0, 0, 0.08) 100%
  );
  pointer-events: none;
}

.hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 32px 40px;
}

.hero-overlay .eyebrow {
  color: var(--color-tertiary-300);
}

.hero-overlay .eyebrow::before {
  background: var(--color-tertiary-300);
}

.hero-overlay .hero-title {
  color: var(--color-white);
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.hero-overlay .hero-title .accent-amber {
  background: linear-gradient(135deg, var(--color-primary-400), var(--color-primary-200));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 8px rgba(232, 168, 71, 0.3));
}

.hero-overlay .hero-title .accent-teal {
  background: linear-gradient(135deg, var(--color-secondary-300), var(--color-secondary-100));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 8px rgba(35, 157, 195, 0.3));
}

.hero-overlay .hero-title .accent-green {
  background: linear-gradient(135deg, var(--color-tertiary-300), var(--color-tertiary-100));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 8px rgba(145, 201, 110, 0.3));
}

.hero-overlay .hero-text {
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.2);
  font-size: 15px;
  line-height: 1.6;
  max-width: 50ch;
  margin-bottom: 18px;
}

.hero-overlay .hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-overlay .btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-white);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hero-overlay .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.4);
}

.hero-main {
  background: var(--hero-gradient);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 32px 34px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-main::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, var(--color-tertiary-400) 0%, transparent 70%);
  opacity: 0.08;
  border-radius: 50%;
  pointer-events: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-green);
  letter-spacing: 0.02em;
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-tertiary-400);
  animation: pulse-dot 2s ease infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero-title {
  font-size: clamp(32px, 5.5vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 800;
  color: var(--foreground-strong);
  margin-bottom: 18px;
}

.hero-text {
  max-width: 54ch;
  color: var(--muted);
  line-height: 1.7;
  font-size: 16px;
  margin-bottom: 22px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ============================================
 * BUTTONS
 * ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  padding: 13px 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.15s ease;
  border: none;
  cursor: pointer;
  min-height: 46px;
}

.btn:hover {
  filter: brightness(1.1);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-secondary-500), var(--color-secondary-400));
  color: var(--color-white);
  box-shadow: 0 4px 16px -4px rgba(35, 157, 195, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 8px 24px -4px rgba(35, 157, 195, 0.4);
}

.btn-secondary {
  background: var(--surface);
  color: var(--foreground);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent-teal);
  box-shadow: 0 4px 16px -4px rgba(35, 157, 195, 0.15);
}

.btn-amber {
  background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-400));
  color: var(--color-white);
  box-shadow: 0 4px 16px -4px rgba(200, 143, 55, 0.35);
}

.btn-amber:hover {
  box-shadow: 0 8px 24px -4px rgba(200, 143, 55, 0.4);
}

.btn-green {
  background: linear-gradient(135deg, var(--color-tertiary-600), var(--color-tertiary-500));
  color: var(--color-white);
  box-shadow: 0 4px 16px -4px rgba(122, 172, 91, 0.35);
}

.btn-green:hover {
  box-shadow: 0 8px 24px -4px rgba(122, 172, 91, 0.4);
}

/* ============================================
 * TERMINAL / QUICK START
 * ============================================ */
.terminal {
  background: var(--surface-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 22px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot.red { background: #FF5F57; }
.terminal-dot.yellow { background: var(--color-primary-400); }
.terminal-dot.green { background: var(--color-tertiary-400); }

.terminal-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 6px;
}

.terminal-code {
  flex: 1;
  border-radius: var(--radius-lg);
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 18px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 13px;
  line-height: 2;
  overflow-x: auto;
  border: 1px solid rgba(55, 66, 83, 0.6);
}

.terminal-code .prompt {
  color: var(--code-prompt);
}

.terminal-code .cmd {
  color: var(--code-cmd);
}

.terminal-code .arg {
  color: var(--code-arg);
}

.terminal-code .comment {
  color: var(--code-comment);
}

/* ============================================
 * SECTIONS
 * ============================================ */
.section {
  margin-top: 72px;
}

.section.spacious {
  margin-top: 100px;
}

.section.tight {
  margin-top: 56px;
}

.section-header {
  margin-bottom: 28px;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-teal);
  margin-bottom: 10px;
}

.section-label svg {
  width: 16px;
  height: 16px;
}

.section-title {
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--foreground-strong);
  margin-bottom: 10px;
  padding-left: 16px;
  position: relative;
}
.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  border-radius: 1px;
  background: linear-gradient(to bottom,
    var(--accent-teal) calc(50% - 3px),
    transparent calc(50% - 3px),
    transparent calc(50% + 3px),
    var(--accent-teal) calc(50% + 3px));
}

.section-subtitle {
  max-width: 62ch;
  color: var(--muted);
  line-height: 1.7;
  font-size: 15px;
}

/* ============================================
 * FEATURE CARDS
 * ============================================ */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px;
  transition: transform 0.2s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}


.card-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  font-size: 18px;
}

.card-icon.amber {
  background: rgba(232, 168, 71, 0.12);
  color: var(--color-primary-400);
}

.card-icon.teal {
  background: rgba(35, 157, 195, 0.12);
  color: var(--color-secondary-400);
}

.card-icon.green {
  background: rgba(145, 201, 110, 0.12);
  color: var(--color-tertiary-400);
}

.card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--foreground-strong);
  margin-bottom: 8px;
}

.card p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
}

/* ============================================
 * ARCHITECTURE - Growing layers
 * ============================================ */
.architecture {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--surface);
}

.layer {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  padding: 18px 22px;
  border-top: 1px solid var(--border-subtle);
  align-items: center;
  transition: background 0.2s ease;
}

.layer:first-child {
  border-top: none;
}

.layer:hover {
  background: rgba(35, 157, 195, 0.03);
}

.layer-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.layer:nth-child(1) .layer-label { color: var(--color-primary-400); }
.layer:nth-child(2) .layer-label { color: var(--color-secondary-400); }
.layer:nth-child(3) .layer-label { color: var(--color-tertiary-400); }
.layer:nth-child(4) .layer-label { color: var(--accent-teal); }

.layer-bar {
  width: 3px;
  height: 18px;
  border-radius: 2px;
}

.layer:nth-child(1) .layer-bar { background: var(--color-primary-400); }
.layer:nth-child(2) .layer-bar { background: var(--color-secondary-400); }
.layer:nth-child(3) .layer-bar { background: var(--color-tertiary-400); }
.layer:nth-child(4) .layer-bar { background: var(--accent-teal); }

.layer-value {
  font-size: 14px;
  color: var(--foreground);
  line-height: 1.5;
}

/* ============================================
 * HOW IT WORKS - Asymmetric 2-column layout
 * ============================================ */
.how-section {
  margin-top: 100px;
}

.how-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.how-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--foreground-strong);
  margin-bottom: 18px;
  padding-left: 16px;
  position: relative;
}
.how-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  border-radius: 1px;
  background: linear-gradient(to bottom,
    var(--accent-primary) calc(50% - 3px),
    transparent calc(50% - 3px),
    transparent calc(50% + 3px),
    var(--accent-primary) calc(50% + 3px));
}

.how-text {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
  max-width: 42ch;
  margin-bottom: 24px;
}

.how-text strong {
  color: var(--foreground-strong);
  font-weight: 600;
}

.engine-row {
  display: flex;
  gap: 10px;
}

.engine-tag {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  color: var(--muted);
}

.feature-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--border-subtle);
  min-width: 0;
}

.feature-item:first-child {
  padding-top: 0;
}

.feature-item:last-child {
  border-bottom: none;
}

.feature-item h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--foreground-strong);
  margin-bottom: 6px;
}

.feature-item p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
}

.feature-item code,
.layer-value code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(35, 157, 195, 0.08);
  color: var(--foreground-strong);
}

/* ============================================
 * PERSONA CARDS
 * ============================================ */
.persona-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.persona-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  transition: transform 0.2s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}

.persona-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.persona-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: var(--color-white);
  margin-bottom: 16px;
}

.persona-card.salvador .persona-avatar {
  background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-400));
}

.persona-card.gaudi .persona-avatar {
  background: linear-gradient(135deg, var(--color-secondary-500), var(--color-secondary-400));
}

.persona-card.sentinel .persona-avatar {
  background: linear-gradient(135deg, var(--color-tertiary-600), var(--color-tertiary-500));
}

.persona-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--foreground-strong);
  margin-bottom: 4px;
}

.persona-domain {
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.01em;
  margin-bottom: 10px;
}

.persona-card.salvador .persona-domain { color: var(--color-primary-400); }
.persona-card.gaudi .persona-domain { color: var(--color-secondary-400); }
.persona-card.sentinel .persona-domain { color: var(--color-tertiary-400); }

.persona-card p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
}

.persona-capabilities {
  list-style: none;
  padding: 0;
  margin: 0 0 12px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.persona-capabilities li {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  color: var(--foreground);
  text-align: center;
  white-space: nowrap;
}

.persona-ships {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

/* ============================================
 * BEFORE/AFTER COMPARISON
 * ============================================ */
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.compare-panel {
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  overflow: hidden;
}

.compare-label {
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.compare-label.before {
  background: rgba(200, 80, 80, 0.06);
  color: #C05050;
}

.compare-label.after {
  background: rgba(145, 201, 110, 0.06);
  color: var(--color-tertiary-500);
}

.compare-content {
  padding: 16px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.9;
  background: var(--code-bg);
  color: var(--code-fg);
  white-space: pre-wrap;
}

.compare-content .dim {
  opacity: 0.4;
}

.compare-content .hl {
  color: var(--color-tertiary-300);
}

.compare-content .warn {
  color: var(--color-primary-300);
}

/* ============================================
 * FEATURE CODE PREVIEWS
 * ============================================ */
.feature-code {
  margin-top: 12px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.7;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--code-bg);
  color: var(--code-fg);
  border: 1px solid var(--code-border);
  overflow-x: auto;
  white-space: pre;
  max-width: 100%;
}

.feature-code .key {
  color: var(--code-key);
}

.feature-code .val {
  color: var(--code-val);
}

.feature-code .cmt {
  color: var(--code-comment);
}

.feature-code .ok {
  color: var(--code-ok);
}

/* ============================================
 * CTA
 * ============================================ */
.cta {
  margin-top: 100px;
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 40px 38px;
  position: relative;
  overflow: hidden;
  background: var(--surface);
}

.cta h2 {
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--foreground-strong);
  margin-bottom: 10px;
  position: relative;
  padding-left: 16px;
}
.cta h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  border-radius: 1px;
  background: linear-gradient(to bottom,
    var(--accent-green) calc(50% - 3px),
    transparent calc(50% - 3px),
    transparent calc(50% + 3px),
    var(--accent-green) calc(50% + 3px));
}

.cta p {
  max-width: 58ch;
  color: var(--muted);
  line-height: 1.7;
  font-size: 15px;
  margin-bottom: 22px;
  position: relative;
}

/* ============================================
 * SOLERI MARK — a line with an intentional gap
 * ============================================ */
.soleri-mark {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 200px;
  margin: 56px auto;
}
.soleri-mark::before,
.soleri-mark::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.soleri-mark.mark-hero {
  margin: 0 auto 24px;
}

/* ============================================
 * FOOTER
 * ============================================ */
.footer {
  margin-top: 56px;
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer p {
  font-size: 12px;
  color: var(--muted);
}

.footer .copyright {
  font-size: 11px;
  color: var(--border);
  margin-top: 4px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.footer-links a {
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--accent-teal);
}

/* ============================================
 * OVERFLOW SAFETY — prevent pre/code from pushing pages wider
 * ============================================ */
/* Grid/flex children must shrink below content width */
.section,
.card,
.feature-item,
.container > *,
[class*="grid"] > *,
[class*="content"] {
  min-width: 0;
}

/* Grid children need overflow constraint to prevent pre-formatted code from pushing layout wider */
[class*="grid"] > * {
  overflow: hidden;
}

/* ============================================
 * RESPONSIVE
 * ============================================ */
@media (max-width: 980px) {
  .hero-image {
    aspect-ratio: 16 / 8;
  }

  .cards,
  .persona-cards {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 820px) {
  .how-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .compare {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
    position: fixed;
    bottom: 82px;
    right: 24px;
    flex-direction: column;
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 8px;
    min-width: 180px;
    box-shadow: var(--shadow-md);
    z-index: 200;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 10px 14px;
    font-size: 14px;
  }

  .menu-toggle {
    display: flex;
  }
}

@media (max-width: 700px) {
  .container {
    padding: 16px 16px 72px;
  }

  .hero-image {
    aspect-ratio: 3 / 4;
  }

  .hero-overlay {
    padding: 20px 22px;
  }

  .hero-overlay .hero-title {
    font-size: clamp(22px, 6.5vw, 34px);
  }

  .hero-overlay .hero-text {
    font-size: 13px;
  }

  .hero-overlay .hero-actions {
    gap: 8px;
  }

  .hero-overlay .btn {
    font-size: 13px;
    padding: 10px 16px;
    min-height: 42px;
    width: 100%;
    justify-content: center;
  }

  .cards,
  .persona-cards {
    grid-template-columns: 1fr;
  }

  .hero-main,
  .terminal,
  .cta {
    padding: 22px;
  }

  .layer {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .nav {
    margin-bottom: 36px;
  }

  .section {
    margin-top: 56px;
  }

  .cta {
    margin-top: 56px;
  }

  .how-grid {
    gap: 24px;
  }

  /* Allow code blocks to wrap on mobile instead of overflowing */
  .feature-code {
    white-space: pre-wrap;
    word-break: break-word;
  }

  /* Tables scroll horizontally when they overflow */
  table {
    display: block;
    overflow-x: auto;
  }

  /* Constrain aurora glows on mobile to prevent horizontal overflow */
  .glow {
    animation: none;
  }
  .glow-amber { width: 300px; height: 300px; }
  .glow-green { width: 250px; height: 250px; }
  .glow-teal { width: 200px; height: 200px; }
}

/* ============================================
 * REDUCED MOTION
 * ============================================ */
@media (prefers-reduced-motion: reduce) {
  .glow { animation: none; }
  .ray  { animation: none; }
}

/* ============================================
 * INLINE SVG ICONS
 * ============================================ */
.icon-svg {
  width: 20px;
  height: 20px;
}
