/* ===========================
   STEPBACK.DEV - Global Styles
   =========================== */

/* ===========================
   1. RESET & BASE
   =========================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===========================
   2. CSS CUSTOM PROPERTIES
   =========================== */
:root {
  /* Primary - Warm Terracotta */
  --primary: #d97757;
  --primary-glow: rgba(217, 119, 87, 0.4);
  --primary-dim: #a84f2f;
  --primary-bright: #f8d1c7;

  /* Background layers */
  --bg-deep: #0a0908;
  --bg-primary: #0f0e0c;
  --bg-elevated: #1a1816;
  --bg-surface: #242220;

  /* Text */
  --text-primary: #f5f3f0;
  --text-secondary: #a8a5a0;
  --text-muted: #6b6965;

  /* Accents */
  --accent-green: #7cb97e;
  --accent-blue: #6b9bd1;
  --accent-purple: #a98bd4;

  /* Effects */
  --glass-bg: rgba(26, 24, 22, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);
  --grain-opacity: 0.03;

  /* Typography */
  --font-display: 'JetBrains Mono', monospace;
  --font-body: 'Outfit', sans-serif;

  /* Spacing */
  --section-padding: clamp(80px, 12vh, 140px);
  --container-max: 1200px;
  --container-padding: clamp(20px, 5vw, 48px);
}

/* ===========================
   3. BASE STYLES
   =========================== */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

::selection {
  background: var(--primary);
  color: var(--bg-deep);
}

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

/* ===========================
   4. TYPOGRAPHY
   =========================== */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2.5rem, 8vw, 5rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
}

.mono {
  font-family: var(--font-display);
}

/* ===========================
   5. LAYOUT
   =========================== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

section {
  position: relative;
  padding: var(--section-padding) 0;
}

/* ===========================
   6. COMPONENTS
   =========================== */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--bg-deep);
  box-shadow: 0 0 0 0 var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-bright);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--primary-glow);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  background: var(--bg-surface);
  border-color: var(--text-muted);
}

.btn-small {
  padding: 10px 20px;
  font-size: 0.85rem;
}

/* Glass cards */
.glass-card {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  padding: 32px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.glass-card:hover {
  border-color: var(--primary-dim);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

/* Links */
.text-link {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.text-link:hover {
  color: var(--primary-bright);
}

/* ===========================
   7. NAVIGATION
   =========================== */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 20px 0;
  transition: all 0.3s ease;
}

nav.scrolled {
  background: rgba(10, 9, 8, 0.9);
  backdrop-filter: blur(20px);
  padding: 12px 0;
  border-bottom: 1px solid var(--glass-border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--bg-deep);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.nav-links svg {
  width: 18px;
  height: 18px;
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Mobile menu */
.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.mobile-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: all 0.3s ease;
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .mobile-toggle {
    display: flex;
  }
}

/* ===========================
   8. HERO SECTION
   =========================== */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: 100px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-gradient {
  position: absolute;
  width: 800px;
  height: 800px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
}

.hero-gradient-1 {
  top: -200px;
  right: -200px;
  background: var(--primary);
}

.hero-gradient-2 {
  bottom: -300px;
  left: -200px;
  background: var(--accent-purple);
  opacity: 0.1;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-text {
  max-width: 560px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  animation: fadeInUp 0.6s ease-out;
}

.hero-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.hero-title {
  margin-bottom: 24px;
  animation: fadeInUp 0.6s ease-out 0.1s both;
}

.hero-title .highlight {
  color: var(--primary);
  position: relative;
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--text-secondary);
  margin-bottom: 40px;
  line-height: 1.7;
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

/* Tree Visualization */
.hero-visual {
  position: relative;
  height: 500px;
  animation: fadeIn 1s ease-out 0.4s both;
}

.tree-container {
  position: absolute;
  inset: 0;
}

.tree-svg {
  width: 100%;
  height: 100%;
}

.tree-node {
  cursor: pointer;
  transition: all 0.3s ease;
}

.tree-node:hover .node-circle {
  filter: drop-shadow(0 0 12px var(--primary-glow));
}

.node-circle {
  transition: all 0.3s ease;
}

.tree-path {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  animation: drawPath 1.5s ease-out forwards;
}

@keyframes drawPath {
  to { stroke-dashoffset: 0; }
}

.node-label {
  font-family: var(--font-display);
  font-size: 10px;
  fill: var(--text-muted);
}

@media (max-width: 900px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-text {
    max-width: 100%;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-visual {
    height: 350px;
    order: -1;
  }
}

/* ===========================
   9. PROBLEM SECTION
   =========================== */
#problem {
  background: var(--bg-primary);
  position: relative;
}

#problem::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
}

.problem-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.problem-content h2 {
  margin-bottom: 32px;
}

.problem-content h2 .strike {
  text-decoration: line-through;
  opacity: 0.4;
}

.problem-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.problem-list li {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: var(--bg-elevated);
  border-radius: 12px;
  border-left: 3px solid var(--text-muted);
  transition: all 0.3s ease;
}

.problem-list li:hover {
  border-left-color: var(--primary);
  transform: translateX(4px);
}

.problem-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--text-muted);
}

.problem-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.problem-text strong {
  color: var(--text-primary);
  font-weight: 500;
}

/* Comparison visual */
.comparison-visual {
  position: relative;
}

.comparison-box {
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 32px;
  position: relative;
}

.comparison-label {
  position: absolute;
  top: -12px;
  left: 24px;
  padding: 4px 12px;
  background: var(--bg-primary);
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--text-muted);
  border-radius: 4px;
}

.linear-chat {
  margin-bottom: 40px;
}

.linear-chat .comparison-label {
  color: var(--text-muted);
}

.branching-chat .comparison-label {
  color: var(--primary);
  border: 1px solid var(--primary-dim);
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-msg {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  max-width: 80%;
}

.chat-msg.user {
  background: var(--primary-dim);
  color: var(--text-primary);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-msg.ai {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border-bottom-left-radius: 4px;
}

.chat-msg.derailed {
  opacity: 0.5;
  border: 1px dashed var(--text-muted);
}

.branch-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--primary);
  background: linear-gradient(135deg, var(--primary-dim), var(--primary));
  color: var(--bg-deep);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  width: fit-content;
}

@media (max-width: 900px) {
  .problem-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
}

/* ===========================
   10. FEATURES SECTION
   =========================== */
#features {
  background: var(--bg-deep);
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 64px;
}

.section-label {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-top: 16px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.feature-card {
  padding: 40px;
}

.feature-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--bg-surface), var(--bg-elevated));
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  transition: all 0.3s ease;
}

.feature-card:hover .feature-icon {
  background: linear-gradient(135deg, var(--primary-dim), var(--primary));
  border-color: var(--primary);
}

.feature-icon svg {
  width: 28px;
  height: 28px;
  stroke: var(--primary);
  transition: stroke 0.3s ease;
}

.feature-card:hover .feature-icon svg {
  stroke: var(--bg-deep);
}

.feature-card h3 {
  margin-bottom: 12px;
  color: var(--text-primary);
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

@media (max-width: 768px) {
  .features-grid {
    grid-template-columns: 1fr;
  }
}

/* ===========================
   11. HOW IT WORKS / STEPS
   =========================== */
#how-it-works,
#roadmap-content {
  background: var(--bg-primary);
  position: relative;
}

.steps-container {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.steps-container::before {
  content: '';
  position: absolute;
  left: 28px;
  top: 60px;
  bottom: 60px;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary), var(--accent-purple), var(--accent-blue));
  opacity: 0.3;
}

.step {
  display: grid;
  grid-template-columns: 60px 1fr 1fr;
  gap: 40px;
  align-items: center;
  padding: 40px 0;
}

.step-number {
  width: 56px;
  height: 56px;
  background: var(--bg-elevated);
  border: 2px solid var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
  position: relative;
  z-index: 2;
}

.step-content h3 {
  margin-bottom: 12px;
}

.step-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.step-visual {
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 24px;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-visual svg {
  width: 100%;
  height: auto;
  max-height: 120px;
}

@media (max-width: 900px) {
  .step {
    grid-template-columns: 1fr;
    gap: 20px;
    text-align: center;
  }

  .steps-container::before {
    display: none;
  }

  .step-number {
    margin: 0 auto;
  }

  .step-visual {
    order: -1;
  }
}

/* ===========================
   12. TECH SECTION
   =========================== */
#tech {
  background: var(--bg-deep);
}

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

.tech-content h2 {
  margin-bottom: 24px;
}

.tech-content > p {
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 1.05rem;
}

.tech-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tech-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  transition: all 0.3s ease;
}

.tech-item:hover {
  border-color: var(--primary-dim);
  transform: translateX(4px);
}

.tech-item-icon {
  width: 40px;
  height: 40px;
  background: var(--bg-surface);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.tech-item-text {
  flex: 1;
}

.tech-item-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tech-item-value {
  font-weight: 500;
  color: var(--text-primary);
  margin-top: 2px;
}

/* Code block */
.code-block {
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--glass-border);
}

.code-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.code-dot.red { background: #ff5f56; }
.code-dot.yellow { background: #ffbd2e; }
.code-dot.green { background: #27c93f; }

.code-content {
  padding: 20px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  line-height: 1.8;
  overflow-x: auto;
}

.code-content .comment {
  color: var(--text-muted);
}

.code-content .keyword {
  color: var(--accent-purple);
}

.code-content .string {
  color: var(--accent-green);
}

.code-content .property {
  color: var(--accent-blue);
}

.code-content .value {
  color: var(--primary);
}

@media (max-width: 900px) {
  .tech-grid {
    grid-template-columns: 1fr;
  }
}

/* ===========================
   13. CTA SECTION
   =========================== */
#cta {
  background: var(--bg-primary);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  background: var(--primary);
  filter: blur(150px);
  opacity: 0.1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.cta-content {
  position: relative;
  z-index: 2;
  max-width: 640px;
  margin: 0 auto;
}

.cta-content h2 {
  margin-bottom: 20px;
}

.cta-content p {
  color: var(--text-secondary);
  font-size: 1.15rem;
  margin-bottom: 40px;
}

.cta-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ===========================
   14. FOOTER
   =========================== */
footer {
  background: var(--bg-deep);
  padding: 64px 0 32px;
  border-top: 1px solid var(--glass-border);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 16px;
  max-width: 280px;
}

.footer-column h4 {
  font-family: var(--font-display);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.footer-column ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-column a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-column a:hover {
  color: var(--primary);
}

.footer-column svg {
  width: 16px;
  height: 16px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 32px;
  border-top: 1px solid var(--glass-border);
}

.footer-copyright {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-tagline {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: span 2;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

/* ===========================
   15. ANIMATIONS
   =========================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animations */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }

/* ===========================
   16. PAGE HEADERS
   =========================== */
.page-header {
  padding: 160px 0 80px;
  background: var(--bg-primary);
  text-align: center;
  position: relative;
}

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center top, var(--primary-glow) 0%, transparent 60%);
  opacity: 0.3;
}

.page-header .container {
  position: relative;
  z-index: 2;
}

.page-header h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 16px;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 1.15rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ===========================
   17. BLOG STYLES
   =========================== */
.blog-list {
  display: grid;
  gap: 32px;
}

.blog-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  padding: 32px;
  align-items: start;
}

.blog-card-image {
  width: 100%;
  aspect-ratio: 16/10;
  background: var(--bg-surface);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.blog-card-image svg {
  width: 48px;
  height: 48px;
  stroke: var(--primary);
  opacity: 0.5;
}

.blog-card-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.blog-card-meta {
  display: flex;
  gap: 16px;
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.blog-card h3 {
  font-size: 1.35rem;
}

.blog-card h3 a {
  transition: color 0.2s ease;
}

.blog-card h3 a:hover {
  color: var(--primary);
}

.blog-card-excerpt {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

.blog-card-link {
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  transition: gap 0.2s ease;
}

.blog-card-link:hover {
  gap: 10px;
}

@media (max-width: 768px) {
  .blog-card {
    grid-template-columns: 1fr;
  }

  .blog-card-image {
    aspect-ratio: 16/9;
  }
}

/* Blog post */
.blog-post {
  max-width: 760px;
  margin: 0 auto;
  padding: var(--section-padding) var(--container-padding);
}

.blog-post-header {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--glass-border);
}

.blog-post-meta {
  display: flex;
  gap: 16px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.blog-post-title {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.2;
  margin-bottom: 20px;
}

.blog-post-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.blog-post-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.blog-post-content h2 {
  font-size: 1.75rem;
  color: var(--text-primary);
  margin: 48px 0 24px;
}

.blog-post-content h3 {
  font-size: 1.35rem;
  color: var(--text-primary);
  margin: 36px 0 16px;
}

.blog-post-content p {
  margin-bottom: 24px;
}

.blog-post-content a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.blog-post-content a:hover {
  color: var(--primary-bright);
}

.blog-post-content ul,
.blog-post-content ol {
  margin: 24px 0;
  padding-left: 24px;
}

.blog-post-content li {
  margin-bottom: 12px;
}

.blog-post-content blockquote {
  border-left: 3px solid var(--primary);
  padding-left: 24px;
  margin: 32px 0;
  font-style: italic;
  color: var(--text-primary);
}

.blog-post-content code {
  font-family: var(--font-display);
  font-size: 0.9em;
  background: var(--bg-surface);
  padding: 2px 8px;
  border-radius: 4px;
}

.blog-post-content pre {
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 24px;
  overflow-x: auto;
  margin: 32px 0;
}

.blog-post-content pre code {
  background: none;
  padding: 0;
}

/* ===========================
   18. ACCESS REQUEST PAGE
   =========================== */
.access-content {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.access-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary-dim), var(--primary));
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 32px;
}

.access-icon svg {
  width: 40px;
  height: 40px;
  stroke: var(--bg-deep);
}

.access-content h2 {
  margin-bottom: 16px;
}

.access-content > p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 40px;
}

.access-options {
  display: flex;
  flex-direction: column;
  gap: 24px;
  text-align: left;
}

.access-option {
  padding: 28px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.access-option-icon {
  width: 48px;
  height: 48px;
  background: var(--bg-surface);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.access-option-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--primary);
}

.access-option h3 {
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.access-option p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

/* ===========================
   19. ROADMAP STYLES
   =========================== */
.roadmap-item {
  padding: 40px 0;
  border-bottom: 1px solid var(--glass-border);
}

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

.roadmap-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.roadmap-status {
  padding: 4px 12px;
  font-family: var(--font-display);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 100px;
}

.roadmap-status.planned {
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--glass-border);
}

.roadmap-status.in-progress {
  background: var(--accent-blue);
  color: var(--bg-deep);
}

.roadmap-status.completed {
  background: var(--accent-green);
  color: var(--bg-deep);
}

.roadmap-item h3 {
  margin-bottom: 12px;
}

.roadmap-item p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 700px;
}

/* ===========================
   20. UTILITIES
   =========================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.85rem;
  margin-bottom: 32px;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--primary);
}

.back-link svg {
  width: 16px;
  height: 16px;
}

/* ===========================
   21. SIGNUP FORM
   =========================== */
.signup-form-card {
  text-align: left;
}

.signup-form-card h3 {
  font-size: 1.35rem;
}

.signup-form {
  width: 100%;
}

.form-row {
  display: flex;
  gap: 12px;
  width: 100%;
}

.form-row input[type="email"] {
  flex: 1;
  padding: 14px 20px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  outline: none;
  transition: all 0.3s ease;
}

.form-row input[type="email"]::placeholder {
  color: var(--text-muted);
}

.form-row input[type="email"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-row .btn {
  flex-shrink: 0;
}

.form-row .btn .btn-loading {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.form-message {
  margin-top: 16px;
  font-size: 0.9rem;
  min-height: 24px;
}

.form-message.success {
  color: var(--accent-green);
}

.form-message.error {
  color: #e57373;
}

@media (max-width: 600px) {
  .form-row {
    flex-direction: column;
  }

  .form-row .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ===========================
   22. BRANCH TREE VISUALIZATION
   =========================== */
.branch-tree {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 500px;
}

/* Simplified ambient glow - single gradient, no animation */
.tree-ambient {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 50% 40% at 50% 40%, rgba(217, 119, 87, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

/* Main SVG */
.tree-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Branch Paths - simplified animations */
.branch-path {
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: drawBranch 1s ease-out forwards;
  transition: opacity 0.2s ease;
}

/* Main branch is more prominent */
.main-branch {
  animation-delay: 0s;
}

/* Secondary branches draw after main */
.secondary-branch {
  animation-delay: 0.3s;
}

.branch-path[data-branch="green"] {
  animation-delay: 0.5s;
}

/* Merge path draws last with flowing dash animation */
.merge-path {
  animation: drawBranch 0.8s ease-out 0.6s forwards, dashFlow 1.5s linear 1.5s infinite;
}

@keyframes drawBranch {
  to { stroke-dashoffset: 0; }
}

@keyframes dashFlow {
  to { stroke-dashoffset: -20; }
}

/* Flowing Particles - simplified */
.flow-particles .particle {
  opacity: 0;
  animation: particleFade 0.3s ease-out 1s forwards;
}

.particle-purple { animation-delay: 1.2s; }
.particle-blue { animation-delay: 1.4s; }

@keyframes particleFade {
  to { opacity: 0.85; }
}

/* SVG Nodes - simplified appearance animation */
.tree-node {
  cursor: pointer;
  opacity: 0;
  animation: svgNodeAppear 0.3s ease-out forwards;
  animation-delay: calc(var(--delay, 0s) + 0.1s);
}

@keyframes svgNodeAppear {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Node hover effects - simplified */
.tree-node .node-outer {
  transition: transform 0.2s ease;
  transform-origin: center;
  transform-box: fill-box;
}

.tree-node:hover .node-outer {
  transform: scale(1.15);
}

/* Node Labels */
.tree-node .node-label {
  font-family: var(--font-display);
  font-size: 10px;
  fill: var(--text-muted);
  opacity: 0.7;
  pointer-events: none;
}

.tree-node:hover .node-label {
  opacity: 1;
}

.tree-node .node-label-badge {
  font-size: 9px;
  font-weight: 600;
  fill: var(--primary);
  opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .branch-tree {
    min-height: 380px;
  }
}

@media (max-width: 600px) {
  .branch-tree {
    min-height: 320px;
  }

  .tree-svg {
    transform: scale(0.85);
    transform-origin: top center;
  }
}

/* ===========================
   23. PAGE TRANSITIONS (View Transitions API)
   =========================== */
@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: fadeSlideOut 0.3s ease-out forwards;
}

::view-transition-new(root) {
  animation: fadeSlideIn 0.3s ease-out forwards;
}

@keyframes fadeSlideOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fallback page transition for non-supporting browsers */
.page-transitioning {
  animation: pageExit 0.3s ease-out forwards;
}

@keyframes pageExit {
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

/* ===========================
   24. SCROLL-LINKED ANIMATIONS
   =========================== */

/* Hero parallax layers */
.hero-gradient-1 {
  animation: parallaxFloat 20s ease-in-out infinite;
}

.hero-gradient-2 {
  animation: parallaxFloat 25s ease-in-out infinite reverse;
}

@keyframes parallaxFloat {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(20px, -30px); }
  50% { transform: translate(-10px, 20px); }
  75% { transform: translate(30px, 10px); }
}

/* Scroll-driven section reveals */
@supports (animation-timeline: scroll()) {
  .animate-on-scroll {
    opacity: 0;
    transform: translateY(60px);
    animation: scrollReveal linear forwards;
    animation-timeline: view();
    animation-range: entry 0% entry 40%;
  }

  @keyframes scrollReveal {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Staggered delays for scroll animation */
  .stagger-1 { animation-range: entry 5% entry 45%; }
  .stagger-2 { animation-range: entry 10% entry 50%; }
  .stagger-3 { animation-range: entry 15% entry 55%; }
  .stagger-4 { animation-range: entry 20% entry 60%; }

  /* Hero title scroll effect */
  .hero-title {
    animation: heroTitleScroll linear forwards;
    animation-timeline: scroll();
    animation-range: 0vh 50vh;
  }

  @keyframes heroTitleScroll {
    to {
      opacity: 0.3;
      transform: translateY(-30px) scale(0.95);
    }
  }

  /* Feature cards scale on scroll */
  .feature-card {
    animation: cardScroll linear forwards;
    animation-timeline: view();
    animation-range: entry 0% cover 50%;
  }

  @keyframes cardScroll {
    from {
      opacity: 0.5;
      transform: scale(0.9) translateY(40px);
    }
    to {
      opacity: 1;
      transform: scale(1) translateY(0);
    }
  }

  /* CTA glow intensifies on scroll */
  .cta-glow {
    animation: ctaGlowScroll linear forwards;
    animation-timeline: view();
    animation-range: entry 0% cover 60%;
  }

  @keyframes ctaGlowScroll {
    from {
      opacity: 0.05;
      transform: translate(-50%, -50%) scale(0.8);
    }
    to {
      opacity: 0.15;
      transform: translate(-50%, -50%) scale(1.2);
    }
  }

  /* Problem section slide-in */
  .comparison-box {
    animation: slideInFromSide linear forwards;
    animation-timeline: view();
    animation-range: entry 0% entry 50%;
  }

  .linear-chat {
    --slide-direction: -30px;
  }

  .branching-chat {
    --slide-direction: 30px;
  }

  @keyframes slideInFromSide {
    from {
      opacity: 0;
      transform: translateX(var(--slide-direction, 0));
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  /* Steps timeline progress */
  .steps-container::before {
    animation: timelineGrow linear forwards;
    animation-timeline: view();
    animation-range: entry 20% cover 80%;
    transform-origin: top center;
  }

  @keyframes timelineGrow {
    from {
      transform: scaleY(0);
      opacity: 0;
    }
    to {
      transform: scaleY(1);
      opacity: 0.3;
    }
  }
}

/* Fallback for browsers without scroll-timeline support */
@supports not (animation-timeline: scroll()) {
  .animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .animate-on-scroll.animate-in {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===========================
   25. ENHANCED HOVER STATES
   =========================== */

/* Magnetic button effect base */
.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 30%, rgba(255,255,255,0.2) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.btn-primary:hover::before {
  transform: translateX(100%);
}

/* Card hover glow effect */
.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(217, 119, 87, 0.1) 0%,
    transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.glass-card:hover::before {
  opacity: 1;
}

/* Link underline animation */
.nav-links a {
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

/* ===========================
   26. MICRO-INTERACTIONS
   =========================== */

/* Button press effect */
.btn:active {
  transform: scale(0.97);
}

/* Input focus glow */
input:focus,
textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-glow), 0 0 20px rgba(217, 119, 87, 0.1);
}

/* Card lift on focus-within */
.glass-card:focus-within {
  transform: translateY(-4px);
  border-color: var(--primary);
}

/* Smooth icon transitions */
.feature-icon svg,
.access-option-icon svg {
  transition: transform 0.3s ease, stroke 0.3s ease;
}

.feature-card:hover .feature-icon svg,
.access-option:hover .access-option-icon svg {
  transform: scale(1.1) rotate(-5deg);
}

/* Loading skeleton pulse */
@keyframes skeletonPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-elevated) 50%, var(--bg-surface) 75%);
  background-size: 200% 100%;
  animation: skeletonPulse 1.5s ease-in-out infinite;
}
