/* ═══════════════════════════════════════════════════════════════
   BRAIN STEM AI — Common Styles (shared across pages)
   ═══════════════════════════════════════════════════════════════ */

/* ─── RESET & BASE ─── */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--void);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

::selection { background: var(--cyan-400); color: var(--void); }

a {
  color: var(--cyan-400);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover { color: var(--cyan-200); }

/* ─── AMBIENT BACKGROUND GRID ─── */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.15;
  pointer-events: none;
  z-index: -1;
}

/* ─── NAVIGATION ─── */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.25rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(6, 10, 13, 0.7);
  backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--border-subtle);
  transition: all 0.3s ease;
}

.nav.scrolled { padding: 0.75rem 2.5rem; background: rgba(6, 10, 13, 0.92); }

.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-logo-img { height: 26px; width: 26px; object-fit: contain; }
.nav-wordmark { font-family: system-ui, -apple-system, sans-serif; font-size: 18px; font-weight: 500; color: var(--text-primary); }
.nav-wordmark span { color: var(--cyan-400); }

.nav-links { display: flex; align-items: center; gap: 2rem; list-style: none; }
.nav-links a { font-size: 0.875rem; font-weight: 400; color: var(--text-secondary); letter-spacing: 0.02em; transition: color 0.2s ease; }
.nav-links a:hover, .nav-links a.active { color: var(--text-primary); }

.nav-cta {
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  background: transparent;
  border: 1px solid var(--cyan-400);
  color: var(--cyan-400) !important;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: all 0.25s ease;
}

.nav-cta:hover {
  background: var(--cyan-400);
  color: var(--void) !important;
  box-shadow: 0 0 20px var(--cyan-glow);
}

/* ─── BUTTONS ─── */

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 2rem;
  background: var(--cyan-400);
  color: var(--void);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-primary:hover {
  background: var(--cyan-300);
  color: var(--void);
  box-shadow: 0 4px 30px var(--cyan-glow-strong);
  transform: translateY(-1px);
}

.btn-primary svg { width: 16px; height: 16px; transition: transform 0.2s ease; }
.btn-primary:hover svg { transform: translateX(3px); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-ghost:hover { color: var(--text-primary); border-color: var(--text-dim); }

/* ─── SECTION COMMONS ─── */

.section {
  position: relative;
  z-index: 1;
  padding: var(--space-3xl) 2.5rem;
  max-width: 1300px;
  margin: 0 auto;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--space-md);
}

.section-label::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 1px;
  transform: rotate(45deg);
}

.section-heading {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 4vw, 3.5rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.section-heading em { font-style: italic; color: var(--cyan-300); }

.section-description {
  font-size: 1.125rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 600px;
  margin-bottom: var(--space-xl);
}

/* ─── SECTION ALT (surface background band) ─── */

.section-alt {
  max-width: none;
  background: var(--surface);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.section-alt .section-inner { max-width: 1300px; margin: 0 auto; }

/* ─── EYEBROW PATTERN (shared across hero variants) ─── */

.hero-eyebrow, .page-hero-eyebrow, .cs-hero-eyebrow, .info-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan-400);
  margin-bottom: var(--space-md);
}

.hero-eyebrow::before, .page-hero-eyebrow::before, .cs-hero-eyebrow::before, .info-eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--cyan-400);
}

/* ─── DIAGRAM FRAME (shared image container with caption) ─── */

.section-diagram, .human-diagram, .impact-diagram, .evolution-diagram, .comparison-diagram, .feature-map-frame {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.section-diagram img, .human-diagram img, .impact-diagram img, .evolution-diagram img, .comparison-diagram img, .feature-map-frame img {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

.section-diagram:hover img, .human-diagram:hover img, .impact-diagram:hover img, .evolution-diagram:hover img, .comparison-diagram:hover img { opacity: 1; }

.section-diagram-caption, .human-diagram-caption, .impact-diagram-caption, .evolution-diagram-caption, .comparison-diagram-caption, .feature-map-caption {
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  text-align: center;
  padding: 0.75rem;
  background: var(--surface);
  border-top: 1px solid var(--border-subtle);
}

.comparison-diagram-caption { background: var(--surface-raised); }

/* ─── CARD GLOW BORDER (hover reveal top-line) ─── */

.capability-card::before, .service-card::before, .team-card::before, .form-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan-400), transparent);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.form-card::before { opacity: 1; }

.capability-card:hover::before, .service-card:hover::before, .team-card:hover::before { opacity: 1; }

/* ─── TAG / PILL PATTERN ─── */

.service-tag, .member-highlight {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3rem 0.75rem;
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  color: var(--text-dim);
}

/* ─── CTA SECTION ─── */

.cta-section {
  position: relative;
  z-index: 1;
  padding: var(--space-3xl) 2.5rem;
  text-align: center;
}

.cta-section .section-heading { max-width: 700px; margin: 0 auto var(--space-sm); }
.cta-section .section-description { max-width: 560px; margin: 0 auto var(--space-lg); }

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

/* ─── FOOTER (full) ─── */

.footer {
  position: relative;
  z-index: 1;
  padding: var(--space-xl) 2.5rem var(--space-lg);
  border-top: 1px solid var(--border-subtle);
}

.footer-inner {
  max-width: 1300px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
}

.footer-brand p {
  font-size: 0.875rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--text-dim);
  margin-top: 1rem;
  max-width: 300px;
}

.footer-col h4 {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
}

.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.footer-col a { font-size: 0.875rem; color: var(--text-secondary); }
.footer-col a:hover { color: var(--text-primary); }

.footer-bottom {
  max-width: 1300px;
  margin: var(--space-lg) auto 0;
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.footer-legal { display: flex; gap: 1.5rem; }
.footer-legal a { color: var(--text-dim); font-size: 0.75rem; }

/* ─── FOOTER (simplified — contact/case-study) ─── */

.footer-copy { font-size: 0.75rem; color: var(--text-dim); }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: var(--text-dim); font-size: 0.75rem; }

/* ─── ANIMATIONS ─── */

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

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

@keyframes scrollPulse {
  0% { top: -100%; }
  100% { top: 200%; }
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.7s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal.visible { opacity: 1; transform: translateY(0); }

/* ─── UTILITY CLASSES ─── */

.text-dim { color: var(--text-dim); }
.text-cyan { color: var(--cyan-500); }
.text-primary-bold { color: var(--text-primary); font-weight: 500; }

/* ─── RESPONSIVE ─── */

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

@media (max-width: 768px) {
  .nav { padding: 1rem 1.25rem; }
  .nav-links { display: none; }
  .section { padding: var(--space-2xl) 1.25rem; }
  .cta-actions { flex-direction: column; align-items: center; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
}
