/* Brain Trust Collectives - shared styles & design tokens */

:root {
  --navy: #1D4E6B;
  --navy-deep: #123349;
  --gold: #E8A93B;
  --maroon: #A93B42;
  --paper: #F2F4F3;
  --panel: #FFFFFF;
  --line: #C9D2D6;
  --ink: #14232E;
  --ink-soft: #3C4E5B;

  --font-display: 'IBM Plex Sans', system-ui, sans-serif;
  --font-body: 'IBM Plex Serif', Georgia, serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;

  --radius: 6px;
  --radius-lg: 14px;
  --max-width: 1180px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.6;
  overflow-x: hidden;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, .eyebrow, nav, button, .btn {
  font-family: var(--font-display);
}

h1, h2, h3, h4 {
  color: var(--navy-deep);
  line-height: 1.2;
  margin: 0 0 var(--space-2);
  font-weight: 600;
}

h1 { font-size: clamp(2rem, 4vw + 1rem, 3.4rem); }
h2 { font-size: clamp(1.5rem, 2.5vw + 1rem, 2.2rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 var(--space-2); color: var(--ink); }

a { color: var(--navy); }
a:hover { color: var(--maroon); }

img { max-width: 100%; display: block; }

ul { padding-left: 1.2rem; }

/* Focus visibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* Layout helpers */
.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--maroon);
  display: inline-block;
  margin-bottom: var(--space-1);
}

section {
  padding: var(--space-5) 0;
}

.section-alt {
  background: var(--panel);
}

/* Header / nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  border-top: 3px solid;
  border-image: linear-gradient(90deg, var(--gold), var(--maroon)) 1;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--navy-deep);
  text-decoration: none;
}

.brand img { width: 34px; height: 34px; }

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.main-nav ul {
  display: flex;
  gap: var(--space-3);
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.95rem;
}

.main-nav a:hover {
  color: var(--maroon);
}

.main-nav a[aria-current="page"] {
  color: var(--maroon);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.4rem 0.6rem;
  font-size: 1.1rem;
  cursor: pointer;
}

@media (max-width: 768px) {
  .nav-toggle { display: inline-block; }
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-2) var(--space-3);
    display: none;
  }
  .main-nav.is-open { display: flex; }
  .main-nav ul {
    flex-direction: column;
    gap: var(--space-2);
  }
}

/* Buttons */
.btn {
  display: inline-block;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn-primary {
  background: var(--gold);
  color: var(--navy-deep);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
}

.btn-primary:hover { background: #f0b756; color: var(--navy-deep); }

.btn-outline {
  background: transparent;
  border-color: var(--panel);
  color: var(--panel);
}
.btn-outline:hover { background: rgba(255,255,255,0.1); }

/* Hero (index only) */
.hero {
  background: radial-gradient(120% 140% at 12% 15%, #17435d 0%, var(--navy-deep) 55%, #0d2636 100%);
  color: var(--paper);
  padding: var(--space-6) 0 var(--space-5);
  overflow: hidden;
  position: relative;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-4);
  align-items: center;
}

.hero h1 { color: #fff; }
.hero .sub { color: #cfe0e8; font-size: 1.1rem; max-width: 46ch; }

.hero-stage {
  perspective: 1200px;
  display: flex;
  justify-content: center;
}

.hero-plane {
  width: min(340px, 70vw);
  will-change: transform;
  transform-style: preserve-3d;
}

.hero-plane img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: 0 30px 60px rgba(0,0,0,0.35);
}

@media (max-width: 768px) {
  .hero .wrap { grid-template-columns: 1fr; text-align: left; }
  .hero-stage { order: -1; margin-bottom: var(--space-3); }
}

@media (max-width: 480px) {
  section { padding: var(--space-4) 0; }
  .hero { padding: var(--space-5) 0 var(--space-4); }
}

/* Cards */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  box-shadow: 0 1px 2px rgba(18, 51, 73, 0.04);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(18, 51, 73, 0.1);
  border-color: var(--navy);
}

.card > a:last-child {
  margin-top: auto;
  padding-top: var(--space-2);
  font-weight: 600;
  text-decoration: none;
}

.team-card { border-top: 3px solid var(--gold); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-3);
}

/* Five verticals: sized so all five sit on one row at desktop widths
   instead of orphaning a lone fifth card onto its own line. */
.card-grid--verticals {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Icon badge used on the "Why Brain Trust" cards */
.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-2);
  color: #fff;
}

.card-icon svg { width: 20px; height: 20px; }

.card-icon--navy { background: var(--navy); }
.card-icon--gold { background: var(--gold); color: var(--navy-deep); }
.card-icon--maroon { background: var(--maroon); }

/* Step rail: "How We Work" process flow */
.step-rail {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  position: relative;
}

.step-rail::before {
  content: '';
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: 20px;
  width: 2px;
  background: var(--line);
  z-index: 0;
}

.step { position: relative; z-index: 1; }

.step {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.step-badge {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--navy-deep);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.95rem;
}

.step h3 { margin-bottom: 0.3rem; }
.step p { margin-bottom: 0; color: var(--ink-soft); }

@media (min-width: 769px) {
  .step-rail {
    flex-direction: row;
    gap: var(--space-3);
  }
  .step-rail::before {
    top: 20px;
    bottom: auto;
    left: calc(20px + var(--space-3));
    right: calc(20px + var(--space-3));
    width: auto;
    height: 2px;
  }
  .step {
    flex: 1;
    flex-direction: column;
  }
  .step-badge { margin-bottom: var(--space-2); }
}

.step-rail .reveal:nth-child(2) { transition-delay: 0.08s; }
.step-rail .reveal:nth-child(3) { transition-delay: 0.16s; }
.step-rail .reveal:nth-child(4) { transition-delay: 0.24s; }
.step-rail .reveal:nth-child(5) { transition-delay: 0.32s; }

.scope-note {
  border-left: 3px solid var(--maroon);
  background: #fbeceb;
  padding: var(--space-2);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--maroon);
}

.info-note {
  border-left: 3px solid var(--navy);
  background: #e9f0f4;
  padding: var(--space-2);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--navy);
}

.placeholder-note {
  border: 1px dashed var(--line);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: var(--space-2);
  border-radius: var(--radius);
  background: #eef1f0;
}

/* Reveal-on-scroll */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* Gentle stagger for cards revealing together in a grid */
.card-grid .reveal:nth-child(2) { transition-delay: 0.08s; }
.card-grid .reveal:nth-child(3) { transition-delay: 0.16s; }
.card-grid .reveal:nth-child(4) { transition-delay: 0.24s; }
.card-grid .reveal:nth-child(5) { transition-delay: 0.32s; }

/* Hero entrance (home page only) */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.hero .eyebrow { animation: fade-up 0.6s ease both; }
.hero h1 { animation: fade-up 0.6s ease 0.1s both; }
.hero .sub { animation: fade-up 0.6s ease 0.2s both; }
.hero .btn-primary { animation: fade-up 0.6s ease 0.3s both; }
.hero .btn-outline { animation: fade-up 0.6s ease 0.35s both; }
.hero-stage { animation: fade-up 0.7s ease 0.15s both; }

/* Forms */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: var(--space-2);
}

.form-field label {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.form-field input,
.form-field select,
.form-field textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  transition: border-color 0.15s ease;
}

.form-field input:hover,
.form-field select:hover,
.form-field textarea:hover {
  border-color: var(--navy);
}

.form-field.has-error input,
.form-field.has-error select,
.form-field.has-error textarea {
  border-color: var(--maroon);
}

.field-error {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--maroon);
}

.field-hint {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.form-field.has-error .field-hint {
  display: none;
}

.honeypot-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  margin-top: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}
.form-status[data-state="success"] { color: #1d6b3b; }
.form-status[data-state="error"] { color: var(--maroon); }

/* Footer */
.site-footer {
  background: var(--navy-deep);
  color: #cfe0e8;
  padding: var(--space-4) 0;
  margin-top: var(--space-5);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: 0.9rem;
}

.site-footer a { color: #cfe0e8; }
.site-footer a:hover { color: var(--gold); }

.legal-line {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #8fa9b6;
  margin-top: var(--space-3);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--space-4);
  align-items: start;
}

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

/* Contact page detail block */
.contact-detail dt {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: var(--space-2);
}
.contact-detail dd { margin: 0.2rem 0 0; }
