@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Inter+Tight:wght@600;700;800;900&display=swap');

:root {
  /* === Brand Colors === */
  --color-brand-dark: #2C2C2C;
  --color-brand-teal: #4ECDB8;
  --color-teal-light: #5CEAD3;
  --color-teal-dim: #2B7269;
  --color-black: #050505;

  /* === Dark Sections === */
  --color-hero-bg: #0A0A0A;
  --color-hero-mid: #111111;
  --color-dark-strip: #161616;

  /* === Light Sections (EL page) === */
  --color-white: #FFFFFF;
  --color-bg: #FFFFFF;
  --color-bg-soft: #F7F8FA;

  /* === Text === */
  --color-text-dark: #1A1A1A;
  --color-text-light: #F3F4F6;
  --color-text-muted: #9CA3AF;

  /* === Borders === */
  --color-border: #E5E7EB;
  --color-border-dark: rgba(255, 255, 255, 0.1);

  /* === Typography === */
  --font-heading: 'Inter Tight', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  /* === Type Scale === */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;

  /* === Spacing === */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* === Radius === */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* === Shadows === */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-teal: 0 4px 20px rgba(78, 205, 184, 0.25);
  --shadow-glow: 0 0 40px rgba(78, 205, 184, 0.15);

  /* === Glassmorphism === */
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: blur(24px);

  /* === Transitions === */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --duration: 300ms;

  /* === Layout === */
  --container: 1200px;
  --nav-h: 72px;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text-dark);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.theme-dark {
  background-color: var(--color-hero-bg);
  color: var(--color-text-light);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul { list-style: none; }

/* === Typography === */
h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

/* === Layout === */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.section { padding: var(--space-16) 0; }

/* === Utilities === */
.text-center { text-align: center; }
.text-teal { color: var(--color-brand-teal); }
.text-muted { color: var(--color-text-muted); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-sm);
  border-radius: var(--radius-full);
  transition: all var(--duration) var(--ease);
  text-decoration: none;
  min-height: 44px;
}
.btn--primary {
  background: var(--color-brand-teal);
  color: var(--color-black);
}
.btn--primary:hover {
  background: var(--color-teal-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-teal);
}
.btn--outline {
  background: transparent;
  color: var(--color-text-light);
  border: 1px solid var(--glass-border);
}
.btn--outline:hover {
  background: var(--glass-bg);
  border-color: var(--color-brand-teal);
  color: var(--color-brand-teal);
}

/* ========================================
   NAVBAR
   ======================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: rgba(10, 10, 10, 0.6);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  z-index: 100;
  display: flex;
  align-items: center;
}
.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--text-lg);
  letter-spacing: -0.02em;
}
.nav-logo svg, .nav-logo img {
  height: 28px;
  width: auto;
}
.nav-links {
  display: none;
  gap: var(--space-6);
  align-items: center;
}
.nav-link {
  font-weight: 500;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: color var(--duration) var(--ease);
  position: relative;
}
.nav-link:hover, .nav-link.active {
  color: var(--color-text-light);
}

/* Hamburger */
.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
  z-index: 101;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text-light);
  border-radius: 2px;
  transition: all 0.3s var(--ease);
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile overlay nav */
.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  height: 100vh;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  z-index: 99;
  display: flex;
  flex-direction: column;
  padding: calc(var(--nav-h) + var(--space-8)) var(--space-8) var(--space-8);
  gap: var(--space-4);
  transition: right 0.4s var(--ease);
  border-left: 1px solid var(--glass-border);
}
.mobile-nav.open { right: 0; }
.mobile-nav .nav-link {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--glass-border);
}
.mobile-nav .nav-link:hover { color: var(--color-text-light); }
.mobile-nav .btn { margin-top: var(--space-4); width: 100%; }

/* Mobile overlay bg */
.nav-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 98;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.nav-overlay.active { opacity: 1; pointer-events: all; }

@media (min-width: 768px) {
  .nav-links { display: flex; }
  .hamburger { display: none; }
  .mobile-nav, .nav-overlay { display: none !important; }
}

/* ========================================
   HERO — Animation-first layout
   ======================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  padding-top: var(--nav-h);
  padding-bottom: 6vh;
}

/* Gradient scrim for text readability */
.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 55%;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(10, 10, 10, 0.3) 25%,
    rgba(10, 10, 10, 0.7) 60%,
    rgba(10, 10, 10, 0.92) 100%
  );
  z-index: 5;
  pointer-events: none;
}

#canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  max-width: 800px;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 800;
  line-height: 1.08;
  margin-bottom: var(--space-4);
  text-shadow: 0 2px 30px rgba(0,0,0,0.6);
}
.hero-title span {
  background: linear-gradient(135deg, #FFFFFF 0%, var(--color-brand-teal) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 0 1px 12px rgba(0,0,0,0.5);
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ========================================
   SECTION DIVIDERS
   ======================================== */
.section-divider {
  height: 1px;
  border: none;
  background: linear-gradient(90deg, transparent, var(--color-brand-teal), transparent);
  opacity: 0.2;
  margin: 0;
}

/* ========================================
   PROBLEM SECTION
   ======================================== */
.problem-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}
@media (min-width: 768px) {
  .problem-grid { grid-template-columns: 1fr 1fr; align-items: stretch; gap: var(--space-12); }
}

.section-label {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-brand-teal);
  margin-bottom: var(--space-4);
}

.section-title {
  color: #fff;
  margin-bottom: var(--space-4);
}

.blockquote-teal {
  border-left: 2px solid var(--color-brand-teal);
  padding-left: var(--space-4);
  margin: var(--space-6) 0;
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  font-style: italic;
}

.mantra {
  border-left: 2px solid var(--color-brand-teal);
  padding-left: var(--space-4);
  margin: var(--space-4) 0 0;
  color: var(--color-brand-teal);
  font-size: var(--text-base);
  font-style: italic;
  letter-spacing: 0.02em;
}

/* Terminal Block */
.terminal-block {
  background: rgba(15, 15, 15, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  color: var(--color-text-muted);
  font-size: 0.825rem;
  line-height: 1.9;
  overflow-x: auto;
}
.terminal-dots {
  display: flex;
  gap: 8px;
  margin-bottom: var(--space-4);
}
.terminal-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.terminal-dots span:nth-child(1) { background: #ff5f56; }
.terminal-dots span:nth-child(2) { background: #ffbd2e; }
.terminal-dots span:nth-child(3) { background: #27c93f; }

@media (max-width: 767px) {
  .terminal-block {
    font-size: 0.75rem;
    max-height: 280px;
    overflow-y: auto;
  }
}

/* ========================================
   PROJECT CARDS
   ======================================== */
.project-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  position: relative;
  overflow: hidden;
  transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--color-brand-teal), transparent);
  opacity: 0;
  transition: opacity var(--duration) var(--ease);
}
.project-card:hover::before { opacity: 1; }
.project-card:hover {
  border-color: rgba(78, 205, 184, 0.3);
  box-shadow: var(--shadow-glow);
}

.project-card__title {
  color: #fff;
  font-size: var(--text-2xl);
  margin-bottom: var(--space-2);
}

.project-card__tag {
  color: var(--color-brand-teal);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-4);
}

.project-card__desc {
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
  max-width: 800px;
  line-height: 1.7;
}

.project-card__features {
  display: grid;
  gap: var(--space-3);
}
.project-card__features li {
  position: relative;
  padding-left: var(--space-8);
  color: var(--color-text-muted);
  line-height: 1.6;
}
.project-card__features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 20px;
  height: 2px;
  background: var(--color-brand-teal);
  border-radius: 1px;
}

.project-card__actions {
  margin-top: var(--space-8);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ========================================
   GLASS INFO CARDS (Built in Production + About)
   ======================================== */
.info-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  transition: border-color 0.4s var(--ease);
}
.info-card:hover {
  border-color: rgba(78, 205, 184, 0.15);
}
.info-card__title {
  color: #fff;
  font-size: var(--text-2xl);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.info-card__title::before {
  content: '';
  width: 4px;
  height: 28px;
  background: var(--color-brand-teal);
  border-radius: 2px;
  flex-shrink: 0;
}

.info-card p {
  color: var(--color-text-muted);
  line-height: 1.7;
}
.info-card p + p { margin-top: var(--space-4); }

.info-card__links {
  margin-top: var(--space-6);
  display: flex;
  gap: var(--space-6);
}
.info-card__links a {
  color: var(--color-brand-teal);
  font-weight: 500;
  transition: color var(--duration) var(--ease);
}
.info-card__links a:hover { color: var(--color-teal-light); }

/* ========================================
   FOOTER
   ======================================== */
.footer {
  border-top: 1px solid var(--glass-border);
  position: relative;
  padding: var(--space-12) 0 var(--space-8);
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.footer::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-brand-teal), transparent);
}
.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.footer-brand img {
  width: 24px;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}
.footer-brand:hover img { opacity: 1; }
.footer-brand span {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--color-text-light);
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  margin-bottom: var(--space-4);
}
.footer-links a {
  color: var(--color-text-muted);
  transition: color 0.3s ease;
}
.footer-links a:hover { color: var(--color-brand-teal); }
.footer-links svg {
  width: 20px;
  height: 20px;
}

/* ========================================
   SCROLL ANIMATIONS
   ======================================== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.stagger-children .animate-on-scroll:nth-child(1) { transition-delay: 0ms; }
.stagger-children .animate-on-scroll:nth-child(2) { transition-delay: 120ms; }
.stagger-children .animate-on-scroll:nth-child(3) { transition-delay: 240ms; }
.stagger-children .animate-on-scroll:nth-child(4) { transition-delay: 360ms; }

/* Hero entrance animation */
.hero-content {
  animation: fadeUp 1s var(--ease) 0.3s forwards;
  opacity: 0;
}

/* ========================================
   RESPONSIVE — Mobile
   ======================================== */
@media (max-width: 767px) {
  .hero {
    min-height: 100svh;
    padding-bottom: 4vh;
  }
  .hero-title {
    font-size: clamp(2rem, 8vw, 2.8rem);
  }
  .hero-subtitle {
    font-size: var(--text-base);
  }
  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-cta .btn {
    width: 100%;
    min-height: 48px;
    font-size: var(--text-base);
  }
  .section {
    padding: var(--space-12) 0;
  }
  .project-card {
    padding: var(--space-6);
  }
  .info-card {
    padding: var(--space-6);
  }
  .problem-grid {
    gap: var(--space-6);
  }
}

/* ========================================
   NOSCRIPT FALLBACK
   ======================================== */
.noscript-hero {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  width: 300px;
  height: 300px;
  opacity: 0.3;
  z-index: 2;
}

/* ─── Language Pill ────────────────────────────────────────────────────── */

.lang-pill {
  display: inline-flex;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  margin-left: 8px;
}

.lang-pill button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-pill button.active {
  background: var(--color-brand-teal);
  color: var(--color-black);
}

.lang-pill button:hover:not(.active) {
  color: #fff;
  background: rgba(255,255,255,0.06);
}

/* In mobile nav, center the pill */
.mobile-nav .lang-pill {
  margin: 16px auto 0;
}

/* Footer privacy link */
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}
.footer-links a:hover {
  color: var(--accent);
}
.footer-links {
  gap: 16px;
}

/* Hide cookie banner's own lang toggle — site-wide pill handles it */
.cc-lang-toggle { display: none !important; }

/* Cookie manage icon — use site accent for outline + SVG */
#cc-manage-link {
  color: #5eead4 !important;
  border-color: #5eead4 !important;
}

/* ========================================
   NAV DROPDOWN
   ======================================== */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: color var(--duration) var(--ease);
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-body);
  padding: 0;
}
.nav-dropdown-toggle:hover,
.nav-dropdown-toggle:focus-visible {
  color: var(--color-text-light);
}
.nav-dropdown-toggle .chevron {
  width: 12px;
  height: 12px;
  transition: transform 0.25s var(--ease);
  opacity: 0.5;
}
.nav-dropdown:hover .chevron,
.nav-dropdown:focus-within .chevron {
  transform: rotate(180deg);
  opacity: 1;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 240px;
  background: rgba(15, 15, 15, 0.95);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-2) 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0s 0.25s;
  z-index: 200;
}
/* Bridge the hover gap between toggle and menu */
.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  width: 100%;
  height: 12px;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
  transition-delay: 0s;
}

.nav-dropdown-menu a {
  display: block;
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  transition: all 0.2s ease;
  white-space: nowrap;
}
.nav-dropdown-menu a:hover {
  color: var(--color-brand-teal);
  background: rgba(78, 205, 184, 0.06);
}
.nav-dropdown-menu a + a {
  border-top: 1px solid rgba(255,255,255,0.04);
}

/* Mobile nav — dropdown items are flat */
.mobile-nav .mobile-dropdown-label {
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-brand-teal);
  padding: var(--space-4) 0 var(--space-1);
  margin-top: var(--space-2);
  border-bottom: none;
}
.mobile-nav .mobile-dropdown-item {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  padding: var(--space-3) 0 var(--space-3) var(--space-6);
  border-bottom: 1px solid var(--glass-border);
  transition: color 0.2s ease;
}
.mobile-nav .mobile-dropdown-item:hover {
  color: var(--color-text-light);
}

/* ========================================
   PROJECT PAGE — Header
   ======================================== */
.page-header {
  padding: calc(var(--nav-h) + var(--space-16)) 0 var(--space-12);
  text-align: center;
  position: relative;
}
.page-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-brand-teal), transparent);
  opacity: 0.4;
}
.page-header__title {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 900;
  color: #fff;
  margin-bottom: var(--space-3);
  letter-spacing: -0.03em;
}
.page-header__tagline {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 640px;
  margin: 0 auto var(--space-6);
  line-height: 1.6;
}

/* Badges */
.badge-row {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 14px;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-brand-teal);
  border: 1px solid rgba(78, 205, 184, 0.25);
  border-radius: var(--radius-full);
  background: rgba(78, 205, 184, 0.06);
}
.badge svg {
  width: 14px;
  height: 14px;
}

/* Header CTAs */
.page-header__cta {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ========================================
   FEATURE GRID
   ======================================== */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}
@media (min-width: 768px) {
  .feature-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.feature-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.feature-card:hover {
  border-color: rgba(78, 205, 184, 0.2);
  box-shadow: 0 0 30px rgba(78, 205, 184, 0.06);
}
.feature-card__title {
  color: #fff;
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.feature-card__title::before {
  content: '';
  width: 3px;
  height: 20px;
  background: var(--color-brand-teal);
  border-radius: 2px;
  flex-shrink: 0;
}
.feature-card__desc {
  color: var(--color-text-muted);
  line-height: 1.7;
  font-size: var(--text-sm);
}

/* ========================================
   COMPARISON TABLE
   ======================================== */
.comparison-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: var(--space-8) 0;
}
.comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-sm);
  min-width: 580px;
}
.comparison-table thead th {
  padding: var(--space-4) var(--space-5);
  text-align: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-base);
  color: #fff;
  border-bottom: 2px solid var(--color-brand-teal);
}
.comparison-table thead th:first-child {
  text-align: left;
  border-bottom-color: var(--glass-border);
}
.comparison-table tbody td {
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--color-text-muted);
  vertical-align: top;
}
.comparison-table tbody td:first-child {
  font-weight: 600;
  color: var(--color-text-light);
  white-space: nowrap;
}
.comparison-table tbody td:nth-child(2),
.comparison-table tbody td:nth-child(3) {
  text-align: center;
}
.comparison-table tbody tr:hover td {
  background: rgba(78, 205, 184, 0.03);
}
.comparison-table .checkmark {
  color: var(--color-brand-teal);
  font-weight: 700;
}
.comparison-table .dash {
  color: rgba(255,255,255,0.15);
}
.comparison-table .highlight-col {
  background: rgba(78, 205, 184, 0.04);
}

/* ========================================
   CODE BLOCK (terminal style)
   ======================================== */
.code-block {
  background: rgba(15, 15, 15, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.code-block__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--glass-border);
}
.code-block__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.code-block__dot:nth-child(1) { background: #ff5f56; }
.code-block__dot:nth-child(2) { background: #ffbd2e; }
.code-block__dot:nth-child(3) { background: #27c93f; }
.code-block pre {
  padding: var(--space-5) var(--space-6);
  margin: 0;
  overflow-x: auto;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.825rem;
  line-height: 1.8;
  color: var(--color-text-muted);
  -webkit-overflow-scrolling: touch;
}
.code-block pre .comment { color: rgba(255,255,255,0.3); }
.code-block pre .cmd { color: var(--color-brand-teal); }

/* ========================================
   INTEGRATION GRID
   ======================================== */
.integration-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}
@media (min-width: 768px) {
  .integration-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (min-width: 1024px) {
  .integration-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.integration-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  transition: border-color 0.3s ease;
}
.integration-card:hover {
  border-color: rgba(78, 205, 184, 0.2);
}
.integration-card__name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-base);
  color: #fff;
  margin-bottom: var(--space-2);
}
.integration-card__desc {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}

/* ========================================
   CTA SECTION (project page footer)
   ======================================== */
.cta-section {
  text-align: center;
  padding: var(--space-16) 0 var(--space-8);
}
.cta-section .btn {
  font-size: var(--text-base);
  padding: var(--space-4) var(--space-8);
}
.cross-link {
  display: block;
  margin-top: var(--space-6);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  transition: color 0.2s ease;
}
.cross-link:hover {
  color: var(--color-brand-teal);
}
.cross-link strong {
  color: var(--color-text-light);
}

/* ========================================
   MEMORY TABLE (How It Works)
   ======================================== */
.memory-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: var(--space-6) 0;
}
.memory-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-sm);
  min-width: 500px;
}
.memory-table thead th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-weight: 700;
  color: var(--color-brand-teal);
  border-bottom: 1px solid rgba(78, 205, 184, 0.2);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.memory-table tbody td {
  padding: var(--space-3) var(--space-4);
  color: var(--color-text-muted);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: top;
}
.memory-table tbody td:first-child {
  font-weight: 600;
  color: var(--color-brand-teal);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: var(--text-xs);
}
.memory-table tbody tr:hover td {
  background: rgba(78, 205, 184, 0.03);
}

/* ========================================
   PROJECT PAGE — Section Spacing
   ======================================== */
.project-section {
  padding: var(--space-12) 0;
}
.project-section__label {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-brand-teal);
  margin-bottom: var(--space-4);
}
.project-section__title {
  color: #fff;
  font-size: var(--text-3xl);
  margin-bottom: var(--space-4);
}
.project-section__desc {
  color: var(--color-text-muted);
  max-width: 720px;
  line-height: 1.7;
}
.project-section__desc + .project-section__desc {
  margin-top: var(--space-4);
}

/* Bridge callout box */
.bridge-callout {
  background: rgba(78, 205, 184, 0.04);
  border: 1px solid rgba(78, 205, 184, 0.15);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  margin-top: var(--space-6);
}

/* ========================================
   ARCHITECTURE DIAGRAM — Interactive flow
   ======================================== */
.arch-diagram {
  margin-top: var(--space-8);
  position: relative;
}
.arch-diagram svg.arch-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.arch-lines line,
.arch-lines path {
  stroke: rgba(78, 205, 184, 0.2);
  stroke-width: 1.5;
  fill: none;
  transition: stroke 0.4s ease, stroke-opacity 0.4s ease;
}
.arch-lines .flow-dot {
  fill: var(--color-brand-teal);
  opacity: 0.6;
}
/* Animated data flow along paths */
@keyframes flowPulse {
  0% { stroke-dashoffset: 24; }
  100% { stroke-dashoffset: 0; }
}
.arch-lines .animated-line {
  stroke-dasharray: 6, 6;
  animation: flowPulse 1.8s linear infinite;
}

.arch-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: start;
  gap: var(--space-3);
  position: relative;
  z-index: 1;
}
.arch-flow--3col {
  grid-template-columns: 2fr auto 1.4fr auto 1fr;
  align-items: center;
}
.arch-flow--4col {
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: center;
}
/* Single-node columns vertically center relative to taller neighbours */
.arch-col--single {
  justify-content: center;
}

/* Column of stacked nodes */
.arch-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: center;
}
.arch-col__label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-brand-teal);
  text-align: center;
  margin-bottom: var(--space-2);
  opacity: 0.7;
}

/* Individual node */
.arch-node {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  text-align: center;
  cursor: default;
  transition: all 0.35s var(--ease);
  position: relative;
  width: 100%;
  min-width: 160px;
}
.arch-node:hover,
.arch-node.active {
  border-color: rgba(78, 205, 184, 0.4);
  background: rgba(78, 205, 184, 0.06);
  box-shadow: 0 0 24px rgba(78, 205, 184, 0.1), inset 0 0 16px rgba(78, 205, 184, 0.03);
  transform: translateY(-2px);
}
.arch-node__icon {
  width: 32px;
  height: 32px;
  margin: 0 auto var(--space-2);
  color: var(--color-brand-teal);
  opacity: 0.7;
  transition: opacity 0.3s ease;
}
.arch-node:hover .arch-node__icon,
.arch-node.active .arch-node__icon {
  opacity: 1;
}
.arch-node__name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
}
.arch-node__sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* Central hub node — larger, highlighted */
.arch-node--hub {
  background: rgba(78, 205, 184, 0.06);
  border-color: rgba(78, 205, 184, 0.25);
  padding: var(--space-6);
}
.arch-node--hub .arch-node__name {
  font-size: var(--text-base);
  color: var(--color-brand-teal);
}

/* Arrow connectors between columns */
.arch-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: var(--space-12);
  color: rgba(78, 205, 184, 0.35);
  transition: color 0.3s ease;
}
.arch-arrow svg {
  width: 32px;
  height: 32px;
}

/* Description panel — shows on node hover */
.arch-desc {
  margin-top: var(--space-6);
  min-height: 80px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: var(--space-5) var(--space-6);
  transition: all 0.35s ease;
}
.arch-desc__title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-brand-teal);
  margin-bottom: var(--space-2);
}
.arch-desc__text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}
.arch-desc--empty .arch-desc__title,
.arch-desc--empty .arch-desc__text {
  opacity: 0.4;
}

/* Memory types as inline badges in diagram */
.arch-memory-types {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin-top: var(--space-4);
  width: 100%;
}
/* Integrated pills — inside a tile */
.arch-node .arch-memory-types {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.arch-memory-type {
  font-size: 11px;
  font-weight: 600;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  letter-spacing: 0.04em;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  background: rgba(78, 205, 184, 0.1);
  color: var(--color-brand-teal);
  border: 1px solid rgba(78, 205, 184, 0.2);
  text-align: center;
  min-width: 0;
}
/* Odd last pill spans both cols → diamond/pyramid shape */
.arch-memory-types .arch-memory-type:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  justify-self: center;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

/* ========================================
   RESPONSIVE — Project pages
   ======================================== */
@media (max-width: 767px) {
  .page-header {
    padding-top: calc(var(--nav-h) + var(--space-10));
    padding-bottom: var(--space-8);
  }
  .page-header__cta {
    flex-direction: column;
    align-items: stretch;
  }
  .page-header__cta .btn {
    width: 100%;
  }
  .comparison-table {
    font-size: var(--text-xs);
  }
  .feature-card {
    padding: var(--space-5);
  }
  .code-block pre {
    font-size: 0.75rem;
    padding: var(--space-4);
  }
  /* Diagrams stack vertically on mobile */
  .arch-flow,
  .arch-flow--3col,
  .arch-flow--4col {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }
  .arch-arrow {
    padding: 0;
    transform: rotate(90deg);
  }
  .arch-node {
    min-width: unset;
  }
}
