/* ==========================================================================
   Emissions - GitHub Pages Site Styles
   Color palette derived from the rocket mascot logo:
   Purple, Pink, Teal, Yellow/Orange, Lavender
   ========================================================================== */

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

:root {
  --purple-900: #1e1b4b;
  --purple-800: #3b0764;
  --purple-700: #6d28d9;
  --purple-600: #7c3aed;
  --purple-500: #8b5cf6;
  --purple-400: #a78bfa;
  --purple-300: #c4b5fd;
  --purple-200: #ddd6fe;
  --purple-100: #ede9fe;
  --purple-50: #f5f3ff;

  --pink-600: #db2777;
  --pink-500: #ec4899;
  --pink-400: #f472b6;
  --pink-300: #f9a8d4;
  --pink-200: #fbcfe8;
  --pink-100: #fce7f3;

  --teal-500: #14b8a6;
  --teal-400: #2dd4bf;
  --teal-300: #5eead4;
  --teal-200: #99f6e4;

  --yellow-500: #eab308;
  --yellow-400: #facc15;
  --yellow-300: #fde047;

  --orange-500: #f97316;
  --orange-400: #fb923c;
  --orange-300: #fdba74;

  --gray-900: #111827;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50: #f9fafb;

  --white: #ffffff;

  --gradient-primary: linear-gradient(135deg, var(--purple-600), var(--pink-500));
  --gradient-hero: linear-gradient(160deg, var(--purple-50) 0%, var(--pink-100) 50%, var(--purple-100) 100%);
  --gradient-card-hover: linear-gradient(135deg, var(--purple-500), var(--pink-400));

  --font-display: 'Nunito', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'Fira Code', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(124, 58, 237, 0.08);
  --shadow-md: 0 4px 16px rgba(124, 58, 237, 0.1);
  --shadow-lg: 0 8px 32px rgba(124, 58, 237, 0.12);
  --shadow-xl: 0 16px 48px rgba(124, 58, 237, 0.15);
  --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.2);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-body);
  color: var(--gray-700);
  line-height: 1.7;
  background: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--purple-900);
  line-height: 1.3;
}

a {
  color: var(--purple-600);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--pink-500);
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.icon {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin-right: 4px;
}

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

.btn-primary {
  background: var(--gradient-primary);
  color: var(--white);
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.4);
  color: var(--white);
}

.btn-secondary {
  background: var(--white);
  color: var(--purple-600);
  border-color: var(--purple-300);
}

.btn-secondary:hover {
  background: var(--purple-50);
  border-color: var(--purple-400);
  transform: translateY(-2px);
  color: var(--purple-700);
}

.btn-outline {
  background: transparent;
  color: var(--purple-600);
  border-color: var(--purple-300);
}

.btn-outline:hover {
  background: var(--purple-50);
  border-color: var(--purple-400);
  transform: translateY(-2px);
  color: var(--purple-700);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.875rem;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 12px 0;
  transition: all 0.3s;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.nav.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 20px rgba(124, 58, 237, 0.08);
}

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

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--purple-900);
}

.nav-brand:hover {
  color: var(--purple-700);
}

.nav-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

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

.nav-links a {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.925rem;
  color: var(--gray-600);
  transition: color 0.2s;
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--purple-700);
  border-radius: 2px;
  transition: all 0.3s;
}

.nav-toggle.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Hero --- */
.hero {
  position: relative;
  padding: 160px 0 100px;
  background: var(--gradient-hero);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.06) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-inner {
  text-align: center;
  position: relative;
  z-index: 2;
}

.hero-logo {
  width: 200px;
  height: 200px;
  object-fit: contain;
  margin-bottom: 24px;
  animation: float 4s ease-in-out infinite;
  filter: drop-shadow(0 16px 32px rgba(124, 58, 237, 0.2));
}

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

.hero-title {
  font-size: 4rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--gray-600);
  max-width: 640px;
  margin: 0 auto 12px;
  line-height: 1.8;
}

.hero-tagline {
  font-size: 1rem;
  color: var(--gray-500);
  margin: 0 auto 36px;
  letter-spacing: 0.02em;
}

.hero-tagline a {
  color: var(--gray-500);
  text-decoration: underline;
  text-decoration-color: var(--purple-600);
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.hero-tagline a:hover {
  color: var(--purple-600);
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.hero-install {
  display: inline-block;
  background: var(--purple-900);
  padding: 12px 28px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
}

.hero-install code {
  color: var(--purple-300);
  font-size: 1rem;
  font-weight: 500;
}

/* Sparkles - four-point star shapes */
.sparkles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.sparkle {
  position: absolute;
  animation: sparkle-float ease-in-out infinite;
  opacity: 0;
}

/* Four-point star shape via clip-path */
.sparkle::before {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  background: inherit;
  clip-path: polygon(
    50% 0%, 60% 35%, 100% 50%, 60% 65%,
    50% 100%, 40% 65%, 0% 50%, 40% 35%
  );
}

/* Also add a rotated inner glow */
.sparkle::after {
  content: '';
  position: absolute;
  inset: 15%;
  background: inherit;
  clip-path: polygon(
    50% 0%, 60% 35%, 100% 50%, 60% 65%,
    50% 100%, 40% 65%, 0% 50%, 40% 35%
  );
  transform: rotate(45deg);
  filter: brightness(1.4);
  opacity: 0.7;
}

.sparkle-1 {
  background: var(--purple-400);
  width: 32px; height: 32px;
  top: 12%; left: 8%;
  animation-duration: 5s; animation-delay: 0s;
}
.sparkle-2 {
  background: var(--pink-400);
  width: 40px; height: 40px;
  top: 20%; right: 12%;
  animation-duration: 6s; animation-delay: 0.8s;
}
.sparkle-3 {
  background: var(--teal-300);
  width: 24px; height: 24px;
  top: 55%; left: 6%;
  animation-duration: 4.5s; animation-delay: 1.5s;
}
.sparkle-4 {
  background: var(--yellow-400);
  width: 36px; height: 36px;
  top: 35%; right: 7%;
  animation-duration: 5.5s; animation-delay: 0.3s;
}
.sparkle-5 {
  background: var(--orange-400);
  width: 22px; height: 22px;
  top: 65%; left: 18%;
  animation-duration: 4s; animation-delay: 2s;
}
.sparkle-6 {
  background: var(--purple-300);
  width: 28px; height: 28px;
  top: 25%; left: 78%;
  animation-duration: 5s; animation-delay: 1.2s;
}
.sparkle-7 {
  background: var(--pink-300);
  width: 20px; height: 20px;
  top: 45%; left: 42%;
  animation-duration: 6s; animation-delay: 2.5s;
}
.sparkle-8 {
  background: var(--teal-400);
  width: 34px; height: 34px;
  top: 10%; left: 55%;
  animation-duration: 5.5s; animation-delay: 0.6s;
}
.sparkle-9 {
  background: var(--yellow-300);
  width: 18px; height: 18px;
  top: 72%; right: 25%;
  animation-duration: 4s; animation-delay: 3s;
}
.sparkle-10 {
  background: var(--purple-500);
  width: 26px; height: 26px;
  top: 50%; right: 18%;
  animation-duration: 5s; animation-delay: 1.8s;
}

@keyframes sparkle-float {
  0%   { opacity: 0; transform: translateY(0) scale(0) rotate(0deg); }
  15%  { opacity: 1; transform: translateY(-10px) scale(1) rotate(15deg); }
  50%  { opacity: 0.6; transform: translateY(-40px) scale(0.85) rotate(-10deg); }
  75%  { opacity: 0.9; transform: translateY(-60px) scale(1.05) rotate(20deg); }
  100% { opacity: 0; transform: translateY(-90px) scale(0.3) rotate(0deg); }
}

/* --- Section Styles --- */
.section-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 12px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  text-align: center;
  font-size: 1.15rem;
  color: var(--gray-500);
  max-width: 560px;
  margin: 0 auto 48px;
}

/* --- Features --- */
.features {
  padding: 100px 0;
  background: var(--white);
}

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

.feature-card {
  background: var(--white);
  border: 2px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover {
  border-color: var(--purple-200);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.feature-icon svg {
  width: 26px;
  height: 26px;
}

.feature-icon-purple { background: var(--purple-100); color: var(--purple-600); }
.feature-icon-pink { background: var(--pink-100); color: var(--pink-600); }
.feature-icon-teal { background: rgba(20, 184, 166, 0.1); color: var(--teal-500); }
.feature-icon-yellow { background: rgba(234, 179, 8, 0.1); color: var(--yellow-500); }
.feature-icon-orange { background: rgba(249, 115, 22, 0.1); color: var(--orange-500); }
.feature-icon-lavender { background: var(--purple-200); color: var(--purple-700); }

.feature-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.95rem;
  color: var(--gray-500);
  line-height: 1.6;
}

/* --- Quick Start --- */
.quickstart {
  padding: 100px 0;
  background: var(--purple-50);
}

.steps {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.step {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.step-number {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: var(--gradient-primary);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  margin-top: 4px;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}

.step-content {
  flex: 1;
  min-width: 0;
}

.step-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--purple-800);
}

.step-note {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--gray-600);
  line-height: 1.5;
}

.step-content pre {
  border-radius: var(--radius-md);
  overflow-x: auto;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(124, 58, 237, 0.1);
}

.step-content pre code {
  font-size: 0.85rem;
  line-height: 1.7;
}

/* Override Prism theme slightly */
pre[class*="language-"] {
  border-radius: var(--radius-md) !important;
  margin: 0 !important;
}

code[class*="language-"],
pre[class*="language-"] {
  font-family: var(--font-mono) !important;
}

/* --- Architecture --- */
.architecture {
  padding: 100px 0;
  background: var(--white);
}

.arch-diagram {
  max-width: 700px;
  margin: 0 auto 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.arch-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  width: 100%;
}

.arch-consumers {
  gap: 16px;
}

.arch-node {
  padding: 16px 28px;
  border-radius: var(--radius-md);
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  transition: transform 0.3s;
}

.arch-node:hover {
  transform: scale(1.05);
}

.arch-label {
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.arch-node code {
  font-size: 0.8rem;
  opacity: 0.8;
}

.arch-app {
  background: var(--purple-100);
  color: var(--purple-800);
  border: 2px solid var(--purple-200);
}

.arch-buffer {
  background: var(--pink-100);
  color: var(--pink-600);
  border: 2px solid var(--pink-200);
}

.arch-producer {
  background: linear-gradient(135deg, var(--purple-500), var(--pink-500));
  color: var(--white);
  border: none;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.25);
}

.arch-producer code {
  color: rgba(255, 255, 255, 0.85);
}

.arch-adapter {
  background: rgba(20, 184, 166, 0.1);
  color: var(--teal-500);
  border: 2px solid var(--teal-200);
  flex: 1;
  max-width: 200px;
}

.arch-handler {
  background: rgba(249, 115, 22, 0.1);
  color: var(--orange-500);
  border: 2px solid var(--orange-300);
  flex: 1;
  max-width: 200px;
}

.arch-arrow {
  width: 2px;
  height: 32px;
  background: var(--purple-300);
  position: relative;
}

.arch-arrow::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid var(--purple-300);
}

.arch-fanout {
  display: flex;
  justify-content: center;
  gap: 100px;
  padding: 0 20px;
  height: 32px;
  position: relative;
  width: 100%;
  max-width: 600px;
}

.arch-fanout::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 8px;
  background: var(--purple-300);
  transform: translateX(-50%);
}

.arch-fanout::after {
  content: '';
  position: absolute;
  top: 8px;
  left: calc(50% - 200px);
  right: calc(50% - 200px);
  height: 2px;
  background: var(--purple-300);
}

.arch-arrow-branch {
  width: 2px;
  height: 24px;
  background: var(--purple-300);
  position: relative;
  margin-top: 8px;
}

.arch-arrow-branch::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid var(--purple-300);
}

.arch-description {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.arch-description p {
  font-size: 1rem;
  color: var(--gray-500);
  line-height: 1.8;
}

/* --- Buffer Lifecycle --- */
.lifecycle {
  padding: 100px 0;
  background: var(--purple-50);
}

.lifecycle-flow {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.lifecycle-step {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 28px;
  border-radius: var(--radius-lg);
  background: var(--white);
  border: 2px solid var(--gray-200);
  min-width: 300px;
  transition: all 0.3s;
}

.lifecycle-step:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.lifecycle-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.lifecycle-info strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--purple-800);
}

.lifecycle-info span {
  font-size: 0.85rem;
  color: var(--gray-500);
}

.lifecycle-start .lifecycle-dot { background: var(--purple-500); }
.lifecycle-start { border-color: var(--purple-200); }

.lifecycle-emit .lifecycle-dot { background: var(--pink-500); }
.lifecycle-emit { border-color: var(--pink-200); }

.lifecycle-commit .lifecycle-dot { background: var(--teal-500); }
.lifecycle-commit { border-color: var(--teal-200); }

.lifecycle-flush .lifecycle-dot { background: var(--yellow-500); }
.lifecycle-flush { border-color: rgba(234, 179, 8, 0.3); }

.lifecycle-terminate .lifecycle-dot { background: var(--orange-500); }
.lifecycle-terminate { border-color: var(--orange-300); }

.lifecycle-connector {
  width: 2px;
  height: 24px;
  background: var(--purple-300);
  position: relative;
}

.lifecycle-connector::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--purple-300);
}

.lifecycle-branch {
  display: flex;
  gap: 20px;
  margin-top: 4px;
  position: relative;
}

.lifecycle-branch::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 120px);
  height: 2px;
  background: var(--purple-200);
}

.lifecycle-path {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --- Guides --- */
.guides {
  padding: 100px 0;
  background: var(--white);
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.guide-card {
  display: flex;
  flex-direction: column;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--white);
  border: 2px solid var(--gray-100);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.guide-card:hover {
  border-color: var(--purple-300);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.guide-card:hover .guide-icon {
  background: var(--gradient-primary);
  color: var(--white);
}

.guide-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--purple-100);
  color: var(--purple-600);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  transition: all 0.3s;
}

.guide-icon svg {
  width: 24px;
  height: 24px;
}

.guide-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--purple-900);
}

.guide-card p {
  font-size: 0.9rem;
  color: var(--gray-500);
  line-height: 1.5;
}

/* --- Footer --- */
.footer {
  padding: 64px 0 32px;
  background: var(--purple-900);
  color: rgba(255, 255, 255, 0.7);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.footer-brand p {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--purple-300);
}

.footer-links {
  display: flex;
  gap: 64px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.footer-col a {
  color: var(--purple-300);
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--white);
}

.footer-bottom {
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 0.85rem;
}

.footer-bottom a {
  color: var(--purple-300);
}

.footer-bottom a:hover {
  color: var(--white);
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .arch-consumers {
    flex-direction: column;
    align-items: center;
  }

  .arch-node {
    max-width: 100% !important;
    width: 260px;
  }

  .arch-fanout {
    flex-direction: column;
    align-items: center;
    height: auto;
    gap: 0;
  }

  .arch-fanout::after {
    display: none;
  }

  .arch-fanout::before {
    height: 100%;
    width: 2px;
    top: 0;
    left: 50%;
  }

  .arch-arrow-branch {
    margin-top: 0;
  }

  .lifecycle-branch {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .lifecycle-branch::before {
    display: none;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 20px 24px;
    gap: 16px;
    box-shadow: var(--shadow-lg);
    border-bottom: 2px solid var(--purple-100);
  }

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

  .nav-toggle {
    display: flex;
  }

  .hero {
    padding: 120px 0 80px;
  }

  .hero-title {
    font-size: 2.75rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .hero-logo {
    width: 150px;
    height: 150px;
  }

  .section-title {
    font-size: 2rem;
  }

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

  .step {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-links {
    flex-direction: column;
    gap: 32px;
  }

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

@media (max-width: 480px) {
  .hero-title {
    font-size: 2.25rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 280px;
  }
}

/* ==========================================================================
   Guide Pages
   ========================================================================== */

/* --- Guide Layout --- */
.guide-layout {
  display: flex;
  max-width: 1200px;
  margin: 80px auto 0;
  padding: 0 24px;
  min-height: calc(100vh - 80px);
}

/* --- Guide Sidebar --- */
.guide-sidebar {
  width: 240px;
  flex-shrink: 0;
  padding: 40px 0;
  position: sticky;
  top: 80px;
  height: fit-content;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}

.guide-sidebar-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
  margin-bottom: 12px;
  padding-left: 16px;
}

.guide-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.guide-sidebar-link {
  display: block;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--gray-600);
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
  transition: all 0.2s;
}

.guide-sidebar-link:hover {
  color: var(--purple-600);
  background: var(--purple-50);
}

.guide-sidebar-link.active {
  color: var(--purple-700);
  background: var(--purple-50);
  border-left-color: var(--purple-600);
  font-weight: 600;
}

.guide-sidebar-sublink {
  padding-left: 32px;
  font-size: 0.85rem;
}

/* --- Guide Content Area --- */
.guide-content {
  flex: 1;
  min-width: 0;
  padding: 40px 0 80px 48px;
  max-width: 780px;
}

/* --- Breadcrumb --- */
.guide-breadcrumb {
  font-size: 0.85rem;
  color: var(--gray-400);
  margin-bottom: 32px;
}

.guide-breadcrumb a {
  color: var(--gray-500);
}

.guide-breadcrumb a:hover {
  color: var(--purple-600);
}

.guide-breadcrumb-sep {
  margin: 0 8px;
  color: var(--gray-300);
}

/* --- Article Typography --- */
.guide-article h1 {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 16px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.guide-article h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 48px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--purple-100);
}

.guide-article h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 32px;
  margin-bottom: 12px;
}

.guide-article p {
  margin-bottom: 16px;
  line-height: 1.8;
  color: var(--gray-700);
}

.guide-article ul,
.guide-article ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.guide-article li {
  margin-bottom: 6px;
  line-height: 1.7;
  color: var(--gray-700);
}

.guide-article li strong {
  color: var(--purple-800);
}

/* Inline code */
.guide-article code:not([class*="language-"]) {
  background: var(--purple-50);
  color: var(--purple-700);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.875em;
  border: 1px solid var(--purple-100);
}

/* Code blocks */
.guide-article pre {
  margin-bottom: 24px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(124, 58, 237, 0.1);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.guide-article pre code {
  font-size: 0.85rem;
  line-height: 1.7;
}

/* --- Tables --- */
.guide-article table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 0.9rem;
}

.guide-article thead th {
  background: var(--purple-50);
  color: var(--purple-800);
  font-family: var(--font-display);
  font-weight: 700;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 2px solid var(--purple-200);
}

.guide-article tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
}

.guide-article tbody tr:hover {
  background: var(--gray-50);
}

.guide-article tbody td code {
  font-size: 0.8rem;
}

/* --- Mermaid Diagrams --- */
.guide-article .mermaid {
  margin: 24px 0;
  text-align: center;
  background: var(--purple-50);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  border: 1px solid var(--purple-100);
  overflow-x: auto;
}

/* --- Prev/Next Pager --- */
.guide-pager {
  display: flex;
  justify-content: space-between;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 2px solid var(--gray-100);
  gap: 16px;
}

.guide-pager-spacer {
  flex: 1;
}

.guide-pager-prev,
.guide-pager-next {
  display: flex;
  flex-direction: column;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  border: 2px solid var(--gray-100);
  transition: all 0.2s;
  text-decoration: none;
}

.guide-pager-prev:hover,
.guide-pager-next:hover {
  border-color: var(--purple-300);
  background: var(--purple-50);
}

.guide-pager-next {
  text-align: right;
  margin-left: auto;
}

.guide-pager-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
}

.guide-pager-title {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--purple-700);
  font-size: 1rem;
}

/* --- Mobile Sidebar Toggle Button --- */
.guide-sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 50;
  background: var(--gradient-primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-full);
  padding: 12px 20px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
}

/* --- Guide Page Responsive --- */
@media (max-width: 900px) {
  .guide-layout {
    flex-direction: column;
  }

  .guide-sidebar {
    width: 100%;
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    background: var(--white);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    padding: 16px 24px;
    max-height: 50vh;
    transform: translateY(100%);
    transition: transform 0.3s;
    border-top: 2px solid var(--purple-100);
  }

  .guide-sidebar.open {
    transform: translateY(0);
  }

  .guide-sidebar-toggle {
    display: block;
  }

  .guide-content {
    padding: 24px 0 100px 0;
  }
}

@media (max-width: 480px) {
  .guide-article h1 {
    font-size: 1.75rem;
  }

  .guide-article h2 {
    font-size: 1.25rem;
  }

  .guide-pager {
    flex-direction: column;
  }

  .guide-pager-prev,
  .guide-pager-next {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .guide-sidebar {
    transition: none;
  }
}
