/* ==========================================================================
   Red Neuron Lab — Design System
   Sections: 1. Tokens  2. Reset  3. Layout  4. Header/Nav  5. Buttons
   6. Hero  7. Sections & Cards  8. Footer  9. Forms  10. Utilities  11. Responsive
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  --color-primary: #A855F7;
  --color-primary-dark: #8A2BE0;
  --color-primary-light: rgba(168, 85, 247, 0.12);
  --color-accent: #D8477A;
  --color-accent-warm: #F0615A;
  --brand-gradient: linear-gradient(180deg, #7C3AED 0%, #5B21B6 100%);
  --color-ink: #F5F3FA;
  --color-ink-soft: #D6CEE8;
  --color-body: #A99FC0;
  --color-muted: #7C7292;
  --color-border: rgba(255, 255, 255, 0.1);
  --color-surface: #0A0812;
  --color-surface-alt: #120E1E;
  --color-dark: #000000;
  --color-dark-alt: #0F0818;
  --color-success: #14A44D;

  --font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.5);

  --container-width: 1200px;
  --header-height: 76px;
}

/* 2. Reset ------------------------------------------------------------------ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-base);
  color: var(--color-body);
  background: var(--color-surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, h5 { color: var(--color-ink); line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: 3rem; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 2.25rem; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 1.375rem; font-weight: 700; }
p { margin: 0 0 1em; }
button { font-family: inherit; cursor: pointer; }

/* 3. Layout ------------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}
main { display: block; padding-top: var(--header-height); }
.section { padding: 88px 0; }
.section-alt { background: var(--color-surface-alt); }
.section-dark { background: var(--color-dark); color: #C6CFE0; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-header { max-width: 640px; margin: 0 auto 56px; text-align: center; }
.section-header.align-left { margin-left: 0; text-align: left; }
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 12px;
}

.subnav {
  position: sticky;
  top: var(--header-height);
  z-index: 500;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.subnav-list {
  display: flex;
  gap: 8px;
  padding: 12px 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.subnav-list::-webkit-scrollbar { display: none; }
.subnav-link {
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-ink-soft);
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.subnav-link:hover { color: var(--color-primary); background: var(--color-primary-light); }
.subnav-link.active { color: #fff; background: var(--color-primary); }

/* 4. Header / Nav ------------------------------------------------------------ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  z-index: 1000;
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { height: 40px; width: auto; }
.brand-name { font-weight: 800; font-size: 1.1rem; color: #fff; white-space: nowrap; }

.main-nav { flex: 1; display: flex; justify-content: center; }
.nav-list { display: flex; gap: 6px; background: rgba(255,255,255,0.04); border: 1px solid var(--color-border); border-radius: 999px; padding: 4px; }
.nav-item { position: relative; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-ink-soft);
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover, .nav-link.active { color: #fff; background: rgba(168, 85, 247, 0.25); }
.caret { flex-shrink: 0; color: currentColor; transition: transform 0.15s; }
.nav-item.has-dropdown:hover .caret,
.nav-item.has-dropdown.nav-open-child .caret { transform: rotate(180deg); }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 280px;
  background: #120E1E;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(8px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}
.nav-item.has-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.dropdown-item { display: block; padding: 10px 12px; border-radius: var(--radius-sm); }
.dropdown-item:hover { background: rgba(255,255,255,0.06); }
.dropdown-item-label { display: block; font-weight: 700; color: var(--color-ink); font-size: 0.92rem; }
.dropdown-item-desc { display: block; font-size: 0.82rem; color: var(--color-muted); margin-top: 2px; }

.header-actions { display: flex; align-items: center; gap: 12px; }
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--color-ink); border-radius: 2px; }

/* 5. Buttons ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 2px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-sm { padding: 9px 18px; font-size: 0.88rem; }
.btn-primary {
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 2px 8px rgba(91,33,182,0.4);
}
.btn-primary:hover { filter: brightness(1.15); }
.btn-outline { border-color: var(--color-border); color: var(--color-ink); background: transparent; }
.btn-outline:hover { border-color: var(--color-primary); color: var(--color-primary); }
.btn-white { background: #fff; color: var(--color-dark); }
.btn-white:hover { background: #EDE0FA; }
.btn-ghost-light { border-color: rgba(255,255,255,0.3); color: #fff; }
.btn-ghost-light:hover { border-color: #fff; }
.btn-group { display: flex; gap: 14px; flex-wrap: wrap; }

/* 6. Hero ------------------------------------------------------------------ */
.hero {
  position: relative;
  background: #000;
  color: #fff;
  padding: 160px 0 140px;
  overflow: hidden;
  text-align: center;
}
.hero::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 900px; height: 900px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(168,85,247,0.55) 0%, rgba(178,62,140,0.28) 35%, transparent 68%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 700px; height: 700px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 0 0 90px rgba(255,255,255,0.02), 0 0 0 180px rgba(255,255,255,0.015);
  pointer-events: none;
}
.hero-inner { position: relative; display: flex; flex-direction: column; align-items: center; }
.hero-content { max-width: 780px; }
.hero .eyebrow { color: #D6B6F5 !important; font-size: 0.95rem; }
.hero h1 { color: #fff; font-size: 3.8rem; margin-bottom: 20px; line-height: 1.08; }
.hero-subtitle { font-size: 1.15rem; color: #C9BEDD; max-width: 620px; margin: 0 auto 36px; }
.hero .btn-group { justify-content: center; }
.hero-stats { display: flex; gap: 40px; margin-top: 48px; justify-content: center; }
.hero-stat-value { font-size: 2rem; font-weight: 800; color: #fff; }
.hero-stat-label { font-size: 0.85rem; color: #8FA0BE; text-transform: uppercase; letter-spacing: 0.05em; }

.page-hero {
  position: relative;
  background: #000;
  color: #fff;
  padding: 90px 0 64px;
  overflow: hidden;
}
.page-hero::before {
  content: "";
  position: absolute;
  top: -20%; left: 50%;
  width: 700px; height: 700px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(168,85,247,0.35) 0%, transparent 65%);
  pointer-events: none;
}
.page-hero .container { position: relative; }
.page-hero h1 { color: #fff; margin-bottom: 12px; }
.page-hero-subtitle { color: #C9BEDD; font-size: 1.1rem; max-width: 640px; }

.gateway-hero-inner { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; margin-bottom: 48px; }
.gateway-hero-content h1 { font-size: 3rem; }
.gateway-hero-image {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.gateway-hero-image img { border-radius: var(--radius-md); }

.gateway-spec-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.gateway-spec-box { background: var(--color-surface-alt); padding: 22px 24px; }
.gateway-spec-box h4 { color: #fff; font-size: 0.95rem; font-weight: 700; margin: 0 0 6px; text-transform: uppercase; letter-spacing: 0.03em; }
.gateway-spec-box p { color: var(--color-muted); font-size: 0.88rem; margin: 0; }

.gateway-browse { display: grid; grid-template-columns: 260px 1fr; gap: 40px; align-items: start; padding-top: 40px; }
.gateway-filters {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
  position: sticky;
  top: calc(var(--header-height) + 24px);
}
.gateway-filter-group { border-top: 1px solid var(--color-border); padding: 18px 0; }
.gateway-filter-group:first-of-type { border-top: none; padding-top: 0; }
.gateway-filter-group h4 { color: var(--color-ink); font-size: 0.9rem; font-weight: 700; margin: 0 0 12px; }
.gateway-filter-option { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--color-body); margin-bottom: 10px; cursor: not-allowed; }
.gateway-filter-option input { accent-color: var(--color-primary); }
.gateway-results-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 24px; }
.gateway-results-count { color: var(--color-muted); font-size: 0.9rem; }

/* 7. Sections & Cards -------------------------------------------------------- */
.grid { display: grid; gap: 28px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 32px;
  transition: box-shadow 0.15s, transform 0.15s;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.3rem;
  margin-bottom: 20px;
}

.product-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: rgba(168,85,247,0.4); }
.product-card-compare {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 0;
  font-size: 0.82rem;
  color: var(--color-muted);
  cursor: not-allowed;
}
.product-card-compare input { accent-color: var(--color-primary); }
.product-card-link { display: flex; flex-direction: column; flex: 1; }
.product-card-image { aspect-ratio: 4/3; overflow: hidden; }
.product-card-image img { width: 100%; height: 100%; object-fit: cover; }
.product-card-body { padding: 18px 22px 22px; }
.product-card-category { display: block; font-size: 0.78rem; color: var(--color-muted); margin-top: 4px; }
.product-card-title { font-size: 1.15rem; margin: 0; color: #fff; }
.product-card-desc { font-size: 0.88rem; color: var(--color-muted); margin: 14px 0 0; line-height: 1.7; }

.stat-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding: 56px 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.stat-item { text-align: center; }
.stat-value { font-size: 2.4rem; font-weight: 800; color: var(--color-primary); }
.stat-label { font-size: 0.9rem; color: var(--color-muted); margin-top: 4px; }

.logo-strip { display: flex; align-items: center; justify-content: center; gap: 56px; flex-wrap: wrap; opacity: 0.6; }
.logo-strip img { height: 28px; filter: grayscale(1); }

.cta-band {
  background: var(--brand-gradient);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 64px;
  text-align: center;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,0.85); max-width: 560px; margin-left: auto; margin-right: auto; }

.spec-table { width: 100%; border-collapse: collapse; }
.spec-table tr { border-bottom: 1px solid var(--color-border); }
.spec-table td { padding: 14px 0; font-size: 0.95rem; }
.spec-table td:first-child { font-weight: 700; color: var(--color-ink); width: 40%; }
.spec-table td:last-child { color: var(--color-body); }

.breadcrumbs { font-size: 0.85rem; color: var(--color-muted); margin-bottom: 8px; }
.breadcrumbs a { color: var(--color-muted); }
.breadcrumbs a:hover { color: var(--color-primary); }

.tag-list { display: flex; gap: 10px; flex-wrap: wrap; }
.tag { padding: 6px 14px; background: var(--color-surface-alt); border-radius: 999px; font-size: 0.82rem; font-weight: 600; color: var(--color-ink-soft); }

.coming-soon-badge {
  display: inline-block;
  padding: 6px 14px;
  border: 1px dashed var(--color-border);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-muted);
}

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }

.team-card { text-align: center; }
.team-photo { width: 100%; aspect-ratio: 1; border-radius: var(--radius-md); overflow: hidden; margin-bottom: 16px; background: var(--color-surface-alt); }
.team-photo img { width: 100%; height: 100%; object-fit: cover; }

.team-bio-card {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 28px;
}
.team-bio-header { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.team-bio-photo {
  width: 72px; height: 72px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--color-surface);
  flex-shrink: 0;
}
.team-bio-info { flex: 1; }
.team-bio-role { display: block; color: var(--color-accent-warm); font-weight: 600; font-size: 0.9rem; margin-top: 2px; }
.team-bio-linkedin {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.06);
  color: var(--color-ink-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 800;
  flex-shrink: 0;
}
.team-bio-linkedin:hover { background: var(--color-primary); color: #fff; }
.team-bio-text { color: var(--color-body); font-size: 0.95rem; margin: 0; }

.blog-card-image { aspect-ratio: 16/9; border-radius: var(--radius-md); overflow: hidden; margin-bottom: 16px; background: var(--color-surface-alt); }
.blog-card-image img { width: 100%; height: 100%; object-fit: cover; }
.blog-card-meta { font-size: 0.82rem; color: var(--color-muted); margin-bottom: 8px; }

.empty-state {
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 48px 24px;
  text-align: center;
  color: var(--color-muted);
}
.empty-state p { margin: 0; }

/* 8. Footer ------------------------------------------------------------------ */
.site-footer { background: var(--color-dark); color: #97A3BC; padding: 72px 0 24px; }
.footer-top { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 32px; padding-bottom: 48px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.footer-brand-mark { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.footer-logo { height: 32px; }
.footer-brand-name { font-weight: 800; font-size: 1.05rem; color: #fff; }
.footer-tagline { font-size: 0.92rem; max-width: 240px; }
.footer-social { display: flex; gap: 10px; margin-top: 16px; }
.social-link {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
}
.social-link:hover { background: var(--color-primary); }
.footer-heading { color: #fff; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 18px; }
.footer-list li { margin-bottom: 12px; font-size: 0.9rem; }
.footer-list a:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 24px; font-size: 0.85rem; flex-wrap: wrap; gap: 12px; }
.footer-legal { display: flex; gap: 20px; }
.footer-legal a:hover { color: #fff; }

/* 9. Forms ------------------------------------------------------------------ */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-weight: 700; font-size: 0.88rem; color: var(--color-ink); margin-bottom: 8px; }
.form-control {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--color-surface);
}
.form-control:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-light); }
textarea.form-control { resize: vertical; min-height: 140px; }
.contact-card { background: var(--color-surface-alt); border-radius: var(--radius-md); padding: 40px; }

.legal-content h2 { font-size: 1.3rem; margin-top: 2.2em; }
.legal-content h2:first-of-type { margin-top: 1.6em; }
.legal-content p { font-size: 0.95rem; line-height: 1.75; }
.legal-content ul { list-style: disc; padding-left: 1.4em; margin: 0 0 1em; }
.legal-content li { font-size: 0.95rem; line-height: 1.75; margin-bottom: 0.4em; }
.legal-content a { color: var(--color-primary); }
.legal-content a:hover { text-decoration: underline; }

/* 10. Utilities ---------------------------------------------------------------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

.chat-bubble {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  z-index: 900;
  transition: transform 0.15s;
}
.chat-bubble:hover { transform: scale(1.06); }

/* 11. Responsive ------------------------------------------------------------- */
@media (max-width: 960px) {
  .main-nav {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-surface);
    overflow-y: auto;
    z-index: 999;
  }
  .main-nav.nav-open { display: block; }
  .nav-list { flex-direction: column; gap: 0; padding: 12px; }
  .nav-item { width: 100%; }
  .nav-link { padding: 14px 16px; width: 100%; }
  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    display: none;
    min-width: 0;
    padding: 0 0 8px 16px;
  }
  .nav-item.has-dropdown.nav-open-child .dropdown-menu { display: block; }
  .header-actions .btn-primary { display: none; }
  .nav-toggle { display: flex; }
  .hero-inner, .two-col { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2.4rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stat-band { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: repeat(2, 1fr); }
  .subnav-list { padding: 10px 24px; margin: 0 -24px; }
  .subnav-link { padding: 7px 14px; font-size: 0.85rem; }
  .gateway-hero-inner { grid-template-columns: 1fr; }
  .gateway-spec-strip { grid-template-columns: repeat(2, 1fr); }
  .gateway-browse { grid-template-columns: 1fr; }
  .gateway-filters { position: static; }
}
@media (max-width: 600px) {
  h1 { font-size: 2.2rem; }
  h2 { font-size: 1.75rem; }
  .section { padding: 56px 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stat-band { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .footer-top { grid-template-columns: 1fr; }
  .cta-band { padding: 40px 24px; }
  .gateway-spec-strip { grid-template-columns: 1fr; }
}
