/* ============================================================
   Isom NeuroSolutions Foundation (isomfoundation.com)
   Palette: deep navy + warm gold, echoing sister brand Isom MD
   Typography: EB Garamond (display, tracked uppercase) + Inter (body)
   ADA target: WCAG 2.1 Level AA
   ============================================================ */

:root {
  --navy: #0F2D52;
  --navy-deep: #081A33;
  --navy-mid: #1B4C87;
  --sky: #4A87C4;
  --gold: #C79A4B;
  --gold-deep: #A87C34;
  --gold-soft: #E7CFA0;

  --paper: #F8F6F1;
  --paper-2: #EFE9DC;
  --line: #E1DACB;
  --ink: #17222E;
  --ink-2: #34414F;
  --muted: #5B6673;
  --white: #FFFFFF;

  --shadow-card: 0 1px 2px rgba(15, 45, 82, 0.08), 0 10px 28px rgba(15, 45, 82, 0.10);
  --shadow-soft: 0 1px 2px rgba(15, 45, 82, 0.05), 0 4px 16px rgba(15, 45, 82, 0.08);

  --font-display: "EB Garamond", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --container: 1180px;
  --gutter: clamp(1rem, 3vw, 2rem);

  --radius: 3px;
  --radius-sm: 2px;
  --focus-ring: 0 0 0 3px #fff, 0 0 0 6px var(--gold-deep);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-2);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
@media (min-width: 1024px) { body { font-size: 18px; } }

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

/* ============ Accessibility primitives ============ */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  background: var(--navy);
  color: #fff;
  padding: 0.85rem 1.25rem;
  font-family: var(--font-body);
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 var(--radius) var(--radius);
}
.skip-link:focus {
  left: 1rem;
  top: 0;
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.cta-button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--gold-deep);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ============ Links & buttons base ============ */
a { color: var(--navy-mid); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; transition: color 0.15s; }
a:hover { color: var(--gold-deep); }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

/* ============ Reveal on scroll (gated behind html.js) ============ */
.reveal { opacity: 1; transform: none; }
html.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
html.js .reveal.in { opacity: 1; transform: none; }

/* ============ Type ============ */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 0.6em;
  color: var(--navy-deep);
}
h1 { font-size: clamp(2.4rem, 5.4vw, 4rem); text-transform: uppercase; letter-spacing: 0.04em; }
h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); text-transform: uppercase; letter-spacing: 0.03em; }
h3 { font-size: 1.45rem; letter-spacing: 0.01em; }
h4 { font-family: var(--font-body); font-size: 0.95rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold-deep); }

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 0.9rem;
}
.eyebrow.on-dark { color: var(--gold-soft); }

.lede { font-size: 1.2rem; color: var(--ink-2); max-width: 46rem; }
.lede.on-dark { color: #DCE4EE; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.95rem 1.6rem;
  border-radius: var(--radius);
  text-decoration: none;
  border: 2px solid transparent;
  min-height: 48px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  cursor: pointer;
}
.btn-gold { background: var(--gold); color: var(--navy-deep); border-color: var(--gold); }
.btn-gold:hover, .btn-gold:focus-visible { background: var(--gold-deep); border-color: var(--gold-deep); color: #fff; }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,0.6); }
.btn-outline-light:hover, .btn-outline-light:focus-visible { background: rgba(255,255,255,0.12); border-color: #fff; color: #fff; }
.btn-outline-navy { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-outline-navy:hover, .btn-outline-navy:focus-visible { background: var(--navy); color: #fff; }
.btn-navy { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-navy:hover, .btn-navy:focus-visible { background: var(--navy-deep); border-color: var(--navy-deep); }

/* ============ Header ============ */
.site-header {
  background: #fff;
  color: var(--navy-deep);
  border-bottom: 3px solid var(--gold);
  box-shadow: 0 1px 0 var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner { display: flex; align-items: center; gap: 2rem; padding-top: 1rem; padding-bottom: 1rem; min-height: 84px; }
.brand { display: flex; align-items: center; line-height: 1.05; color: var(--navy-deep); text-decoration: none; flex-shrink: 0; }
.brand:hover { color: var(--navy-deep); }
.brand-logo { height: 44px; width: auto; display: block; }
@media (min-width: 1024px) { .brand-logo { height: 52px; } }

.nav-disclosure { margin-left: auto; position: relative; }
.nav-disclosure > summary { display: none; }
.nav-disclosure > .site-nav { display: flex !important; }

.site-nav { gap: 0.15rem; align-items: center; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  color: var(--navy-deep);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  padding: 0.75rem 0.95rem;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  border-radius: var(--radius-sm);
  transition: border-color 0.2s, color 0.2s;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.site-nav a:hover, .site-nav a:focus-visible { color: var(--gold-deep); border-bottom-color: var(--gold); }
.site-nav a[aria-current] { color: var(--navy); border-bottom-color: var(--navy); }
.site-nav-cta { margin-left: 0.5rem; }

@media (max-width: 880px) {
  .header-inner { gap: 1rem; min-height: 68px; }
  .brand-logo { height: 34px; }
  .nav-disclosure > summary {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; cursor: pointer; color: var(--navy-deep);
    background: transparent; border: 2px solid var(--navy-deep); border-radius: var(--radius-sm);
    list-style: none; -webkit-tap-highlight-color: transparent; transition: background-color 0.2s, color 0.2s;
  }
  .nav-disclosure > summary::-webkit-details-marker { display: none; }
  .nav-disclosure > summary::marker { content: ""; }
  .nav-disclosure > summary:hover, .nav-disclosure > summary:focus-visible { background: var(--navy-deep); color: #fff; }
  .nav-toggle .bars { display: block; position: relative; width: 22px; height: 2px; background: currentColor; transition: background-color 0.2s; }
  .nav-toggle .bars::before, .nav-toggle .bars::after {
    content: ""; position: absolute; left: 0; width: 22px; height: 2px; background: currentColor; transition: transform 0.2s, top 0.2s;
  }
  .nav-toggle .bars::before { top: -7px; }
  .nav-toggle .bars::after { top: 7px; }
  .nav-disclosure[open] .nav-toggle .bars { background: transparent; }
  .nav-disclosure[open] .nav-toggle .bars::before { top: 0; transform: rotate(45deg); }
  .nav-disclosure[open] .nav-toggle .bars::after { top: 0; transform: rotate(-45deg); }

  .nav-disclosure > .site-nav { display: none !important; }
  .nav-disclosure[open] > .site-nav {
    display: flex !important;
    flex-direction: column;
    position: absolute;
    top: calc(100% + 1px);
    right: 0;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-card);
    padding: 0.5rem;
    min-width: 220px;
    border-radius: var(--radius);
  }
  .site-nav-cta { margin-left: 0; margin-top: 0.4rem; }
  .site-nav a { width: 100%; }
}

/* ============ Hero ============ */
.hero {
  position: relative;
  background: linear-gradient(155deg, var(--navy-deep) 0%, var(--navy) 55%, var(--navy-mid) 100%);
  color: #fff;
  overflow: hidden;
  padding: clamp(3.5rem, 9vw, 7.5rem) 0 clamp(3rem, 7vw, 5.5rem);
}
.hero-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  pointer-events: none;
}
.hero-inner { position: relative; max-width: 46rem; }
.hero h1 { color: #fff; margin-bottom: 0.5rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2rem; }

.page-hero {
  position: relative;
  background: linear-gradient(155deg, var(--navy-deep) 0%, var(--navy) 100%);
  color: #fff;
  overflow: hidden;
  padding: clamp(3rem, 7vw, 4.5rem) 0;
}
.page-hero .hero-pattern { opacity: 0.14; }
.page-hero h1 { color: #fff; }
.page-hero .lede { position: relative; }

/* ============ Quote band ============ */
.quote-band { background: var(--paper-2); padding: clamp(3rem, 6vw, 4.5rem) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.quote-band blockquote {
  margin: 0 auto;
  max-width: 48rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.3rem, 3vw, 1.85rem);
  line-height: 1.5;
  color: var(--navy-deep);
  text-align: center;
}
.quote-band cite { display: block; margin-top: 1.2rem; font-family: var(--font-body); font-style: normal; font-weight: 700; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-deep); text-align: center; }

/* ============ Sections ============ */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section-alt { background: var(--paper-2); }
.section-navy { background: var(--navy); color: #fff; }
.section-navy h2 { color: #fff; }
.section-head { max-width: 42rem; margin-bottom: clamp(2rem, 5vw, 3rem); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* ============ Pillars / cards ============ */
.pillars-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem; }
.pillar-card {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 2.2rem 1.9rem;
  box-shadow: var(--shadow-soft);
}
.pillar-icon { width: 46px; height: 46px; color: var(--navy); margin-bottom: 1.1rem; }
.pillar-card h3 { color: var(--navy-deep); margin-bottom: 0.6rem; }
.pillar-card p { margin: 0; color: var(--muted); }
@media (max-width: 900px) { .pillars-grid { grid-template-columns: 1fr; } }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 2.5rem; }
.stat { text-align: center; }
.stat-num { font-family: var(--font-display); font-size: clamp(2.2rem, 5vw, 3rem); color: var(--gold); font-weight: 700; }
.stat-label { font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; color: #C7D2DF; margin-top: 0.3rem; }
@media (max-width: 700px) { .stat-row { grid-template-columns: 1fr; gap: 2rem; } }

.two-col { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(2rem, 6vw, 4rem); align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

.info-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-soft);
}
.info-card h3 { color: var(--navy-deep); }
.info-card + .info-card { margin-top: 1.5rem; }

/* ============ CTA band ============ */
.cta-band {
  background: linear-gradient(155deg, var(--navy-deep), var(--navy-mid));
  color: #fff;
  padding: clamp(3rem, 7vw, 4.5rem) 0;
  text-align: center;
}
.cta-band h2 { color: #fff; }
.cta-band .lede { margin: 0 auto 2rem; text-align: center; }
.cta-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.9rem; }

/* ============ Founder / about ============ */
.founder-figure { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow-soft); }
.founder-figure h3 { margin-bottom: 0.2rem; }
.founder-role { font-size: 0.85rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-deep); margin-bottom: 1rem; }

/* ============ Forms ============ */
.form-field { margin-bottom: 1.3rem; }
.form-field label { display: block; font-weight: 700; font-size: 0.88rem; letter-spacing: 0.02em; color: var(--navy-deep); margin-bottom: 0.4rem; }
.form-field input, .form-field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid #C7C0AE;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-field input:focus, .form-field textarea:focus { outline: none; border-color: var(--navy-mid); box-shadow: 0 0 0 3px rgba(27, 76, 135, 0.18); }
.form-field textarea { min-height: 150px; resize: vertical; }
.form-field.invalid input, .form-field.invalid textarea { border-color: #B3261E; }
.field-err { color: #B3261E; font-size: 0.85rem; margin-top: 0.35rem; }
.form-error {
  background: #FBEAEA; color: #7A1F19; border: 1px solid #E3B4B0;
  padding: 0.9rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1.3rem; font-size: 0.92rem;
}
.form-success { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 2.5rem; text-align: center; box-shadow: var(--shadow-soft); }
.form-success h3 { color: var(--navy-deep); }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.75rem, 4vw, 2.5rem); box-shadow: var(--shadow-card); }
.contact-note { font-size: 0.85rem; color: var(--muted); margin-top: 1rem; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ============ FAQ ============ */
.faq-list { max-width: 44rem; }
.faq-item { border-bottom: 1px solid var(--line); padding: 1.1rem 0; }
.faq-item summary { cursor: pointer; font-weight: 700; color: var(--navy-deep); font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-family: var(--font-display); font-size: 1.4rem; color: var(--gold-deep); flex-shrink: 0; }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p { margin: 0.8rem 0 0; color: var(--muted); }

/* ============ Legal pages ============ */
.legal-content { max-width: 46rem; }
.legal-content h2 { font-size: 1.5rem; text-transform: none; letter-spacing: 0; margin-top: 2.2rem; }
.legal-content p, .legal-content li { color: var(--ink-2); }
.legal-content ul { padding-left: 1.3rem; }
.legal-updated { color: var(--muted); font-size: 0.9rem; margin-bottom: 2rem; }

/* ============ Footer ============ */
.site-footer { background: var(--navy-deep); color: #C7D2DF; padding: 3rem 0 0; border-top: 4px solid var(--gold); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 2.5rem; padding-bottom: 2.5rem; }
.footer-logo { height: 44px; width: auto; display: block; margin-bottom: 1rem; }
.footer-tagline { font-size: 0.95rem; color: #A9B7C6; line-height: 1.6; max-width: 26rem; }
.footer-col h4 { color: var(--gold); font-size: 0.82rem; letter-spacing: 0.12em; margin-bottom: 0.9rem; }
.footer-links { list-style: none; padding: 0; margin: 0; line-height: 2; }
.footer-links a { color: #C7D2DF; font-size: 0.95rem; text-decoration: none; }
.footer-links a:hover { color: var(--gold); text-decoration: underline; }
.footer-col address { font-style: normal; line-height: 1.9; color: #C7D2DF; font-size: 0.95rem; }
.footer-col address a { color: #fff; text-decoration: underline; text-decoration-color: rgba(255,255,255,0.4); }
.footer-col address a:hover { color: var(--gold); text-decoration-color: var(--gold); }

.footer-bottom { background: #000; padding: 1.25rem 0; font-size: 0.82rem; color: #8C99A6; }
.footer-bottom .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; }
.footer-bottom p { margin: 0; }
.footer-bottom-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.footer-bottom-links a { color: #8C99A6; text-decoration: underline; }
.footer-bottom-links a:hover { color: var(--gold); }
.footer-plug a { color: inherit; }

@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) {
  body { font-size: 16px; }
  .hero, .page-hero { padding-top: 2.75rem; padding-bottom: 2.5rem; }
  h1 { font-size: clamp(1.9rem, 8vw, 2.6rem); letter-spacing: 0.02em; }
  h2 { font-size: clamp(1.5rem, 7vw, 2rem); }
  .lede { font-size: 1.05rem; }
  .pillar-card, .info-card, .founder-figure { padding: 1.6rem 1.35rem; }
  .contact-form-card { padding: 1.5rem; }
  .quote-band blockquote { font-size: 1.2rem; }
  .stat-row { gap: 1.75rem; }
  .footer-logo { height: 36px; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero-actions, .cta-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn, .cta-actions .btn { width: 100%; }
  .btn { padding: 0.85rem 1.2rem; font-size: 0.86rem; }
}

/* High contrast / forced-colors mode */
@media (forced-colors: active) {
  .btn { border: 2px solid currentColor !important; }
  .pillar-card, .info-card, .contact-form-card, .founder-figure { border: 1px solid CanvasText; }
}

/* Print */
@media print {
  .site-header, .hero-pattern, .cta-band, .nav-disclosure, .btn { display: none !important; }
  body { background: #fff; color: #000; }
}
