/* ───────────────────── PALETTE: Desert Infrastructure ───────────────────── */
:root {
  --bg: #F5F0E8;
  --bg-alt: #EDE7DB;
  --surface: #FAF7F2;
  --text: #2D2A26;
  --text-secondary: #5A5347;
  --muted: #8A7E72;
  --border: #D9D0C4;
  --border-light: #E8E0D4;

  --terracotta: #C4663A;
  --terracotta-light: #F4E0D4;
  --sage: #5A7F60;
  --sage-light: #DCE8DD;
  --dusty-blue: #5E7A8A;
  --dusty-blue-light: #D6E2E8;
  --charcoal: #3A3632;
  --warm-black: #1E1C19;

  --font-heading: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Source Serif 4', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

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

/* subtle paper grain */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.2; }
a { color: var(--terracotta); text-decoration: none; }
code { font-family: var(--font-mono); font-size: 0.85em; background: var(--bg-alt); padding: 2px 6px; border-radius: 4px; }
ul { list-style: none; }

/* ───────────────────── NAV ───────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 40px;
  background: rgba(245, 240, 232, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
}

.nav-brand {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--terracotta);
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--terracotta); }

.nav-github {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--charcoal);
  color: var(--bg) !important;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.78rem !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  transition: background 0.2s, transform 0.2s;
}

.nav-github:hover {
  background: var(--terracotta) !important;
  color: #fff !important;
  transform: translateY(-1px);
}

.nav-github i { font-size: 1rem; }

/* ───────────────────── HERO ───────────────────── */
.hero {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 60px;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: 140px 40px 100px;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--sage);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--warm-black);
  margin-bottom: 24px;
}

.hero-accent {
  color: var(--terracotta);
  font-style: italic;
  font-family: 'Source Serif 4', serif;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin-bottom: 40px;
}

.hero-stats {
  display: flex;
  gap: 32px;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-stat-num {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--terracotta);
  line-height: 1;
}

.hero-stat-label {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* File tree */
.hero-tree {
  position: relative;
  padding: 28px 24px;
  background: var(--warm-black);
  border-radius: 16px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #C8BFA8;
  overflow: hidden;
}

.tree-line {
  position: absolute;
  left: 40px;
  top: 28px;
  bottom: 28px;
  width: 1px;
  background: rgba(200, 191, 168, 0.15);
}

.tree-item {
  padding: 5px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateX(12px);
  transition: all 0.4s var(--ease-out);
  transition-delay: calc(var(--delay) * 0.07s);
}

.hero-tree.in-view .tree-item {
  opacity: 1;
  transform: translateX(0);
}

.tree-item.indent { padding-left: 24px; }

.tree-icon {
  width: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.7rem;
}

.tree-item .fa-folder { color: var(--terracotta); }
.tree-item .fa-cube { color: var(--sage); opacity: 0.8; }

.tree-tag {
  margin-left: auto;
  font-size: 0.65rem;
  color: var(--muted);
  background: rgba(200, 191, 168, 0.1);
  padding: 1px 8px;
  border-radius: 8px;
}

/* ───────────────────── SECTIONS ───────────────────── */
.section {
  padding: 100px 40px;
  max-width: 1100px;
  margin: 0 auto;
}

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

.section-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--sage);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-header h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--warm-black);
  margin-bottom: 12px;
}

.section-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 640px;
}

/* ───────────────────── MODULE CARDS ───────────────────── */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.module-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 28px 24px;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), border-color 0.3s;
}

.module-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(45, 42, 38, 0.08);
  border-color: var(--accent-card, var(--border));
}

.module-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  margin-bottom: 16px;
  color: var(--accent-card, var(--terracotta));
  background: color-mix(in srgb, var(--accent-card, var(--terracotta)) 10%, transparent);
}

.module-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.module-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 14px;
}

.module-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.module-tags span {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg-alt);
  color: var(--muted);
}

/* ───────────────────── PATTERN BLOCKS ───────────────────── */
.pattern-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
  margin-bottom: 80px;
  padding-bottom: 80px;
  border-bottom: 1px solid var(--border-light);
}

.pattern-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.pattern-reverse {
  direction: rtl;
}

.pattern-reverse > * {
  direction: ltr;
}

.pattern-text h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--warm-black);
}

.pattern-text p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.merge-list {
  margin: 12px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.merge-list li {
  padding: 4px 0 4px 20px;
  position: relative;
}

.merge-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 13px;
  width: 8px;
  height: 2px;
  background: var(--terracotta);
}

.merge-list strong {
  color: var(--text);
  font-weight: 600;
}

/* Code tabs */
.code-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 0;
}

.code-tab {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 8px 18px;
  border: none;
  background: var(--bg-alt);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 8px 8px 0 0;
}

.code-tab.active {
  background: var(--warm-black);
  color: #C8BFA8;
}

.code-panel {
  display: none;
  background: var(--warm-black);
  border-radius: 0 12px 12px 12px;
  padding: 20px 24px;
  overflow-x: auto;
}

.code-panel.active { display: block; }

.code-panel pre {
  margin: 0;
  line-height: 1.7;
}

.code-panel code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: none;
  padding: 0;
  color: #C8BFA8;
}

.code-panel .kw { color: #C4663A; }
.code-panel .str { color: #8DB580; }
.code-panel .attr { color: #88A8B8; }
.code-panel .num { color: #D4A85C; }

/* Registry diagram */
.registry-diagram {
  display: flex;
  align-items: center;
  gap: 12px;
}

.registry-source, .registry-consumer {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px;
  flex: 1;
  min-width: 0;
}

.registry-label {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 10px;
}

.registry-map {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.registry-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 5px 8px;
  background: var(--bg);
  border-radius: 6px;
}

.reg-key {
  color: var(--terracotta);
  font-weight: 500;
  white-space: nowrap;
}

.reg-arrow { color: var(--muted); }

.reg-val {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.65rem;
}

.registry-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  width: 80px;
}

.flow-svg { width: 80px; height: 40px; }
.flow-line { stroke: var(--terracotta); stroke-width: 2; stroke-dasharray: 6 4; animation: pipe-flow 1.5s linear infinite; }
.flow-head { fill: var(--terracotta); }
.flow-label { font-family: var(--font-mono); font-size: 0.6rem; color: var(--muted); white-space: nowrap; }

/* Merge diagram */
.merge-diagram {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.merge-box {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 14px 16px;
  min-width: 140px;
}

.merge-title {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 8px;
}

.merge-field {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 3px 6px;
  border-radius: 4px;
  margin-bottom: 2px;
}

.merge-field.highlight { background: var(--terracotta-light); }

.mf-key { color: var(--dusty-blue); font-weight: 500; }
.mf-val { color: var(--text-secondary); }

.merge-result .merge-field.highlight { background: var(--sage-light); }

.merge-operator {
  color: var(--muted);
  flex-shrink: 0;
}

.merge-operator svg { width: 32px; height: 32px; }

/* ───────────────────── ARCHITECTURE DIAGRAM ───────────────────── */
.arch-section {
  background: var(--bg-alt);
  max-width: none;
  padding-left: 40px;
  padding-right: 40px;
}

.arch-section .section-header,
.arch-section .arch-diagram {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.arch-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.arch-layer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px 32px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  flex-wrap: wrap;
}

.arch-layer::before {
  content: attr(data-label);
  position: absolute;
  top: -10px;
  left: 24px;
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 2px 10px;
  border-radius: 4px;
  background: var(--charcoal);
  color: var(--bg);
}

.arch-layer-wide { min-width: 80%; }

.arch-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 20px;
  border-radius: 10px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.78rem;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s;
}

.arch-box:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}

.arch-box i { font-size: 1rem; }

.box-sand { background: var(--terracotta-light); color: var(--terracotta); }
.box-terra { background: var(--terracotta-light); color: var(--terracotta); }
.box-sage { background: var(--sage-light); color: var(--sage); }
.box-blue { background: var(--dusty-blue-light); color: var(--dusty-blue); }
.box-faint {
  background: var(--bg);
  color: var(--text-secondary);
  border: 1px dashed var(--border);
}

.arch-pipe {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 48px;
  position: relative;
}

.pipe-line {
  stroke: var(--terracotta);
  stroke-width: 2;
  stroke-dasharray: 6 4;
  animation: pipe-flow 1.5s linear infinite;
}

@keyframes pipe-flow {
  to { stroke-dashoffset: -20; }
}

.pipe-label {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: calc(100% + 14px);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ───────────────────── DEPLOYED CARDS ───────────────────── */
.deployed-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.deployed-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 28px 24px;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s;
}

.deployed-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(45, 42, 38, 0.07);
}

.deployed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.deployed-domain {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--terracotta);
}

.deployed-workspace {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  background: var(--bg-alt);
  padding: 2px 10px;
  border-radius: 6px;
}

.deployed-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.deployed-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.deployed-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.deployed-stack span {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.deployed-stack i {
  color: var(--sage);
  font-size: 0.7rem;
}

/* ───────────────────── AGENTS ───────────────────── */
.agents-section {
  background: var(--warm-black);
  color: #E8E0D4;
  max-width: none;
  padding-left: 40px;
  padding-right: 40px;
}

.agents-section .section-header,
.agents-section .agents-row,
.agents-section .agent-flow {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.agents-section .section-label { color: #D4A85C; }
.agents-section .section-header h2 { color: #F5F0E8; }
.agents-section .section-desc { color: #B0A898; }

.agents-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 48px;
}

.agent-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 24px 18px;
  text-align: center;
  transition: transform 0.3s var(--ease-out), background 0.3s;
}

.agent-card:hover {
  transform: translateY(-4px);
  background: rgba(255,255,255,0.07);
}

.agent-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  font-size: 1.1rem;
  color: #D4A85C;
  background: rgba(212, 168, 92, 0.12);
}

.agent-card h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #F5F0E8;
}

.agent-card p {
  font-size: 0.78rem;
  color: #B0A898;
  line-height: 1.5;
}

/* Agent flow diagram */
.agent-flow {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 32px;
}

.agent-flow-title {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #D4A85C;
  margin-bottom: 24px;
  text-align: center;
}

.flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 24px;
  min-width: 110px;
}

.flow-step-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #D4A85C;
  background: rgba(212, 168, 92, 0.1);
  border: 1px solid rgba(212, 168, 92, 0.2);
}

.flow-step-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  color: #F5F0E8;
}

.flow-step-detail {
  font-size: 0.72rem;
  color: #8A7E72;
}

.flow-arrow {
  flex-shrink: 0;
  width: 60px;
}

.flow-arrow svg { width: 60px; height: 24px; }

.arrow-line {
  stroke: #D4A85C;
  stroke-width: 2;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  transition: stroke-dashoffset 0.8s var(--ease-out);
}

.arrow-head { fill: #D4A85C; }

.agent-flow.in-view .arrow-line {
  stroke-dashoffset: 0;
}

.agent-flow.in-view .flow-arrow:nth-child(2) .arrow-line { transition-delay: 0.3s; }
.agent-flow.in-view .flow-arrow:nth-child(4) .arrow-line { transition-delay: 0.6s; }

/* ───────────────────── TECH STACK ───────────────────── */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.stack-item {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 12px;
}

.stack-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.stack-ver {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--sage);
  margin-left: 6px;
}

.stack-item p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ───────────────────── SPECS TIMELINE ───────────────────── */
.specs-section {
  background: var(--bg-alt);
  max-width: none;
  padding-left: 40px;
  padding-right: 40px;
}

.specs-section .section-header,
.specs-section .specs-timeline {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.specs-timeline {
  position: relative;
  max-width: 600px;
}

.specs-timeline::before {
  content: '';
  position: absolute;
  left: 22px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

.specs-step {
  position: relative;
  display: flex;
  gap: 24px;
  padding-bottom: 32px;
  align-items: flex-start;
}

.specs-step:last-child { padding-bottom: 0; }

.specs-step-num {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--terracotta);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--terracotta);
  flex-shrink: 0;
  z-index: 1;
}

.specs-step-content h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
  margin-top: 4px;
}

.specs-step-content h4 {
  font-family: var(--font-mono);
  color: var(--warm-black);
}

.specs-step-content p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ───────────────────── FOOTER ───────────────────── */
.footer {
  text-align: center;
  padding: 40px;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--border-light);
}

/* ───────────────────── ANIMATIONS ───────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal-right.in-view {
  opacity: 1;
  transform: translateX(0);
}

/* Stagger module cards */
.modules-grid .module-card:nth-child(1) { transition-delay: 0s; }
.modules-grid .module-card:nth-child(2) { transition-delay: 0.06s; }
.modules-grid .module-card:nth-child(3) { transition-delay: 0.12s; }
.modules-grid .module-card:nth-child(4) { transition-delay: 0.18s; }
.modules-grid .module-card:nth-child(5) { transition-delay: 0.24s; }
.modules-grid .module-card:nth-child(6) { transition-delay: 0.30s; }
.modules-grid .module-card:nth-child(7) { transition-delay: 0.36s; }
.modules-grid .module-card:nth-child(8) { transition-delay: 0.42s; }

/* Stagger deployed cards */
.deployed-grid .deployed-card:nth-child(1) { transition-delay: 0s; }
.deployed-grid .deployed-card:nth-child(2) { transition-delay: 0.08s; }
.deployed-grid .deployed-card:nth-child(3) { transition-delay: 0.16s; }
.deployed-grid .deployed-card:nth-child(4) { transition-delay: 0.24s; }

/* Stagger agent cards */
.agents-row .agent-card:nth-child(1) { transition-delay: 0s; }
.agents-row .agent-card:nth-child(2) { transition-delay: 0.07s; }
.agents-row .agent-card:nth-child(3) { transition-delay: 0.14s; }
.agents-row .agent-card:nth-child(4) { transition-delay: 0.21s; }
.agents-row .agent-card:nth-child(5) { transition-delay: 0.28s; }

/* ───────────────────── REDUCED MOTION ───────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal, .reveal-right { opacity: 1; transform: none; }
  .tree-item { opacity: 1; transform: none; }
}

/* ───────────────────── RESPONSIVE ───────────────────── */
@media (max-width: 768px) {
  .nav { padding: 14px 20px; }
  .nav-links { gap: 16px; }
  .nav-links a { font-size: 0.7rem; }

  .hero {
    grid-template-columns: 1fr;
    padding: 120px 20px 60px;
    gap: 40px;
  }

  .hero-stats { flex-wrap: wrap; gap: 20px; }

  .section { padding: 60px 20px; }

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

  .pattern-block {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .pattern-reverse { direction: ltr; }

  .registry-diagram { flex-direction: column; }
  .registry-flow { transform: rotate(90deg); width: auto; }

  .merge-diagram { flex-direction: column; }
  .merge-operator { transform: rotate(90deg); }

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

  .agents-row { grid-template-columns: repeat(2, 1fr); }
  .agents-row .agent-card:last-child { grid-column: span 2; }

  .flow { flex-direction: column; }
  .flow-arrow { transform: rotate(90deg); }

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

  .arch-layer { gap: 8px; padding: 20px 16px; }
  .arch-box { padding: 10px 14px; font-size: 0.7rem; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 1.8rem; }
  .nav-links { display: none; }
  .agents-row { grid-template-columns: 1fr; }
  .agents-row .agent-card:last-child { grid-column: span 1; }
}
