/* ============================================================
   NerveDX — Design System
   Enterprise EEG neuroinformatics platform
   Palette derived from the NerveDX brand study
   ============================================================ */

:root {
  /* Brand colours */
  --ink: #14212b;              /* deep blue-black ink */
  --ink-soft: #22313d;
  --muted: #5a6b76;            /* muted slate */
  --paper: #f7f4ef;            /* warm paper */
  --paper-2: #eee9df;          /* deeper paper */
  --line: #d7cfc3;             /* hairline */
  --accent: #0f6e56;           /* deep clinical green */
  --accent-bright: #178a6a;
  --accent-soft: #e3efe9;
  --taken: #8a3b2d;            /* warm signal red */
  --white: #ffffff;

  /* Typography */
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-sans: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;

  /* Layout */
  --maxw: 1140px;
  --radius: 10px;
  --shadow: 0 6px 24px rgba(20, 33, 43, 0.08);
  --shadow-lg: 0 16px 48px rgba(20, 33, 43, 0.14);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  line-height: 1.65;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 12% 0%, #eef3ee 0%, transparent 45%),
    radial-gradient(ellipse at 90% 4%, #f2eadd 0%, transparent 40%),
    var(--paper);
  font-size: 16px;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 0.6em;
}

p { margin: 0 0 1.1em; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 244, 239, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}
.logo:hover { text-decoration: none; }
.logo-img {
  display: block;
  width: 194px;
  height: 58px;
  object-fit: contain;
}
@media (max-width: 480px) {
  .logo-img {
    width: 168px;
    height: 50px;
  }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 500;
}
.nav-links a:hover { color: var(--accent); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--accent); }

.nav-cta {
  background: var(--accent);
  color: var(--white) !important;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
}
.nav-cta:hover { background: var(--accent-bright); text-decoration: none; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.75rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--accent);
  color: var(--white);
}
.btn-primary:hover { background: var(--accent-bright); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-light {
  background: var(--white);
  color: var(--ink);
}
.btn-light:hover { background: var(--paper-2); }

/* ---------- Sections ---------- */
.section {
  padding: 5.5rem 0;
}
.section-alt { background: var(--white); }
.section-tint { background: linear-gradient(180deg, var(--paper-2) 0%, var(--paper) 100%); }

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
}

.section-head {
  max-width: 720px;
  margin-bottom: 2.75rem;
}
.section-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.section-head p { color: var(--muted); font-size: 1.08rem; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 6rem 0 5.5rem;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(15, 110, 86, 0.14) 0%, transparent 42%),
    radial-gradient(circle at 8% 85%, rgba(20, 33, 43, 0.10) 0%, transparent 45%),
    linear-gradient(180deg, #f3f7f3 0%, var(--paper) 60%);
  z-index: -1;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3rem;
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.3rem, 5vw, 3.7rem);
  margin-bottom: 1.1rem;
}
.hero h1 em {
  font-style: italic;
  color: var(--accent);
}
.hero .lede {
  font-size: 1.22rem;
  color: var(--muted);
  max-width: 34rem;
  margin-bottom: 2rem;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.audience-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
  margin-top: 1.8rem;
  max-width: 39rem;
}
.audience-nav a {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
  background: rgba(255,255,255,0.56);
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.25;
}
.audience-nav a:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
  background: var(--white);
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  padding-top: 1.75rem;
}
.hero-stats strong {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--ink);
  display: block;
}
.hero-stats span { color: var(--muted); font-size: 0.88rem; }

/* Hero visual — abstract EEG waveform */
.eeg-visual {
  background: var(--ink);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 1.25rem;
  color: var(--white);
  position: relative;
}
.eeg-visual .panel-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #9fb3bf;
  padding: 0 0.35rem 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 1rem;
}
.eeg-visual .panel-top .dot { color: var(--accent-bright); }
.eeg-rows { display: flex; flex-direction: column; gap: 0.85rem; }
.eeg-row { display: flex; align-items: center; gap: 0.7rem; }
.eeg-row .label {
  font-size: 0.7rem;
  color: #7d93a1;
  width: 42px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.eeg-row svg { flex: 1; height: 26px; }

/* ---------- Feature grid ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.9rem;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card .icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  margin-bottom: 1.1rem;
}
.card h3 { font-size: 1.25rem; }
.card p { color: var(--muted); font-size: 0.97rem; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.6rem; }

.evidence-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  box-shadow: var(--shadow);
}
.evidence-item {
  background: var(--white);
  padding: 1.45rem;
}
.evidence-item strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.55rem;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 0.35rem;
}
.evidence-item span {
  color: var(--muted);
  font-size: 0.9rem;
}

.roadmap {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  counter-reset: roadmap;
}
.roadmap-item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
  position: relative;
}
.roadmap-item::before {
  counter-increment: roadmap;
  content: "0" counter(roadmap);
  display: block;
  font-family: var(--font-serif);
  color: var(--accent);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}
.roadmap-item h3 {
  font-size: 1.08rem;
  margin-bottom: 0.45rem;
}
.roadmap-item p {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0;
}

.proof-panel {
  background: var(--ink);
  color: var(--white);
  border-radius: var(--radius);
  padding: 2.2rem;
  box-shadow: var(--shadow-lg);
}
.proof-panel h3 { font-size: 1.45rem; }
.proof-panel p { color: #cfe0da; }
.proof-panel .checks li { color: #dce8e4; }

/* ---------- Workflow / pipeline ---------- */
.flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
}
.flow-step {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.flow-step .step-no {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--accent-soft);
  line-height: 1;
  display: block;
  margin-bottom: 0.7rem;
}
.flow-step h4 { font-size: 1.05rem; margin-bottom: 0.3rem; }
.flow-step p { color: var(--muted); font-size: 0.9rem; margin: 0; }

/* ---------- Split / feature rows ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  align-items: center;
}
.split .visual {
  background: linear-gradient(140deg, var(--ink) 0%, var(--accent) 130%);
  border-radius: 16px;
  min-height: 300px;
  color: var(--white);
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-shadow: var(--shadow-lg);
}
.split ul.checks { list-style: none; margin: 0 0 1.4rem; padding: 0; }
.split ul.checks li { padding-left: 1.9rem; position: relative; margin-bottom: 0.75rem; color: var(--ink-soft); }
.split ul.checks li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 700;
}

/* ---------- Quote ---------- */
.quote {
  background: var(--ink);
  color: var(--white);
  border-radius: 16px;
  padding: 3rem 3.5rem;
  text-align: center;
}
.quote blockquote {
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  font-style: italic;
  line-height: 1.45;
  max-width: 46rem;
  margin: 0 auto 1.5rem;
}
.quote cite { font-style: normal; color: #9fb3bf; font-size: 0.95rem; }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(120deg, var(--accent) 0%, var(--accent-bright) 100%);
  border-radius: 18px;
  color: var(--white);
  padding: 3rem 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow-lg);
}
.cta-band h2 { margin: 0 0 0.4rem; font-size: 2rem; }
.cta-band p { margin: 0; color: rgba(255,255,255,0.9); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.data th, table.data td { text-align: left; padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: var(--paper-2);
}
table.data tbody tr:last-child td { border-bottom: 0; }
.pill {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
}
.pill-green { background: var(--accent-soft); color: var(--accent); }
.pill-red { background: #f6e3de; color: var(--taken); }

/* ---------- Forms ---------- */
.form-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 2.2rem;
  box-shadow: var(--shadow);
}
.form-row { margin-bottom: 1.3rem; }
.form-row label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.4rem; }
.form-row label .req { color: var(--taken); }
.form-row input,
.form-row textarea,
.form-row select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.98rem;
  background: var(--paper);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15,110,86,0.14);
  background: var(--white);
}
.form-row textarea { resize: vertical; min-height: 120px; }
.form-row .hint { font-size: 0.82rem; color: var(--muted); margin-top: 0.3rem; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }

/* CAPTCHA */
.captcha-box {
  border: 1px dashed var(--line);
  background: var(--paper);
  border-radius: 10px;
  padding: 1.1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-top: 0.5rem;
}
.captcha-question {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  min-width: 120px;
}
.captcha-input { width: 120px; }
.captcha-result { font-size: 0.88rem; margin-top: 0.5rem; min-height: 1.2em; }
.captcha-result.error { color: var(--taken); font-weight: 600; }
.form-message { display: none; margin-top: 1rem; padding: 0.85rem 1rem; border-radius: 8px; font-size: 0.95rem; }
.form-message.success { display: block; background: var(--accent-soft); color: var(--accent); }
.form-message.error { display: block; background: #f6e3de; color: var(--taken); }

/* ---------- Contact info cards ---------- */
.contact-methods { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.4rem; }
.contact-method { text-align: center; }
.contact-method .icon { margin-inline: auto; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: #98a9b3;
  padding: 3.5rem 0 2.5rem;
  margin-top: 2rem;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2.5rem; }
.footer-grid h4 { color: var(--white); font-size: 1rem; margin-bottom: 0.9rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 0.5rem; }
.footer-grid a { color: #98a9b3; font-size: 0.92rem; }
.footer-grid a:hover { color: var(--white); }
.footer-brand p { font-size: 0.92rem; max-width: 22rem; margin: 0.8rem 0 1rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
}
.footer-bottom a { color: #98a9b3; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { padding: 4rem 0 2rem; }
.page-hero h1 { font-size: clamp(2rem, 4vw, 3rem); }
.page-hero .lede { color: var(--muted); font-size: 1.15rem; max-width: 44rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid, .split { grid-template-columns: 1fr; gap: 2.2rem; }
  .grid-3, .grid-2, .contact-methods { grid-template-columns: 1fr 1fr; }
  .flow, .evidence-strip, .roadmap { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 1rem 1.5rem 1.5rem;
    align-items: flex-start;
    gap: 1rem;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
}

@media (max-width: 560px) {
  .grid-3, .grid-2, .flow, .audience-nav, .evidence-strip, .roadmap, .contact-methods, .footer-grid, .form-grid-2 { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr; gap: 0.9rem; }
  .quote, .cta-band { padding: 2rem 1.4rem; }
  .cta-band { flex-direction: column; align-items: flex-start; }
  .captcha-box { flex-direction: column; align-items: flex-start; }
  .section { padding: 3.5rem 0; }
  .hero { padding: 4.3rem 0 4rem; }
  .hero h1 { font-size: 2.55rem; }
  .hero .lede {
    font-size: 1.05rem;
    line-height: 1.55;
  }
  .hero-actions .btn,
  .audience-nav a {
    width: 100%;
    text-align: center;
  }
  .ndx-banner { padding: 0.85rem 1rem; }
  .ndx-banner p { font-size: 0.9rem; line-height: 1.45; }
  .ndx-banner .ndx-actions { width: 100%; gap: 0.5rem; }
  .ndx-btn { padding: 0.5rem 0.85rem; }
}
