/* ===========================
   Zebra Diagnostics — Styles
   =========================== */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --bg-card: #ffffff;
  --text: #1a1a2e;
  --text-muted: #4a4a5e;
  --text-dim: #8a8a9e;
  --accent: #2b5eda;
  --accent-glow: rgba(43, 94, 218, 0.08);
  --accent-warm: #c4651a;
  --border: #e0e2e8;
  --border-light: #ecedf2;
  --serif: 'Source Serif 4', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --max-width: 1120px;
  --max-width-narrow: 720px;
}

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

body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.85; }

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

/* --- Layout --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: var(--max-width-narrow); margin: 0 auto; padding: 0 24px; }

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: background 0.3s, box-shadow 0.3s;
}

.nav.scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--border-light);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.logo-zebra { color: var(--text); }
.logo-dx { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  opacity: 1;
}

.nav-cta {
  background: var(--accent);
  color: #ffffff !important;
  padding: 8px 20px;
  border-radius: 6px;
  font-weight: 600 !important;
}

.nav-cta:hover { opacity: 0.9; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: 8px;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-muted);
  opacity: 1;
}

/* --- Hero --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 24px 80px;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero-eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(36px, 5.5vw, 60px);
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 28px;
  color: var(--text);
}

.hero-accent {
  color: var(--accent-warm);
}

.hero-sub {
  font-size: 19px;
  line-height: 1.75;
  color: var(--text-muted);
  margin-bottom: 40px;
  max-width: 640px;
}

.hero-sub strong {
  color: var(--text);
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.hero-source {
  font-size: 13px;
  color: var(--text-dim);
  font-style: italic;
}

/* --- Sections --- */
.section {
  padding: 100px 24px;
}

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

.section-alt {
  background: var(--bg);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.section-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.section h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 20px;
}

.section-lead {
  font-size: 18px;
  line-height: 1.75;
  color: var(--text-muted);
  max-width: 640px;
  margin-bottom: 56px;
}

/* --- Stats Grid --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 56px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 28px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.stat-number {
  font-size: 48px;
  font-weight: 700;
  color: var(--accent-warm);
  line-height: 1.1;
  margin-bottom: 12px;
}

.stat-label {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
}

.stat-source {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 8px;
}

/* --- Crisis Detail --- */
.crisis-detail {
  max-width: 720px;
}

.crisis-detail h3 {
  font-family: var(--serif);
  font-size: 24px;
  margin-bottom: 16px;
  color: var(--text);
}

.crisis-detail p {
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.8;
}

.crisis-detail strong {
  color: var(--text);
}

/* --- Demo Block --- */
.demo-block {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: center;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  margin-bottom: 48px;
}

.demo-scenario,
.demo-output {
  padding: 0;
}

.demo-scenario h4,
.demo-output h4 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.demo-scenario p {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.7;
}

.demo-arrow {
  font-size: 28px;
  color: var(--accent);
  font-weight: 300;
}

.diagnosis-list {
  list-style: none;
  counter-reset: dx;
}

.diagnosis-list li {
  counter-increment: dx;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 15px;
}

.diagnosis-list li:last-child { border-bottom: none; }

.diagnosis-list li::before {
  content: counter(dx) ".";
  color: var(--text-dim);
  font-weight: 600;
  margin-right: 12px;
  min-width: 20px;
}

.dx-name {
  flex: 1;
  color: var(--text);
  font-weight: 500;
}

.dx-prob {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
  background: var(--accent-glow);
  padding: 3px 10px;
  border-radius: 4px;
}

/* --- Solution Detail --- */
.solution-detail {
  max-width: 720px;
  margin-bottom: 56px;
}

.solution-detail p {
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.8;
}

.solution-detail strong {
  color: var(--text);
}

/* --- How Grid --- */
.how-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.how-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 28px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.how-icon {
  font-size: 28px;
  margin-bottom: 16px;
}

.how-card h4 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 10px;
}

.how-card p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-muted);
}

/* --- Benefits Grid --- */
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.benefit {
  padding: 28px 0;
  border-top: 2px solid var(--border);
}

.benefit h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 10px;
}

.benefit p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-muted);
}

/* --- Signals Grid --- */
.signals-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 48px;
}

.signal {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 40px;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

.signal-icon {
  font-size: 20px;
}

/* --- Vision Detail --- */
.vision-detail {
  max-width: 720px;
}

.vision-detail p {
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 16px;
}

.vision-detail strong {
  color: var(--text);
}

.vision-detail h3 {
  font-family: var(--serif);
  font-size: 22px;
  margin-top: 32px;
  margin-bottom: 16px;
  color: var(--text);
}

.vision-outcomes {
  list-style: none;
  padding: 0;
}

.vision-outcomes li {
  padding: 8px 0;
  padding-left: 24px;
  position: relative;
  color: var(--text-muted);
  font-size: 16px;
}

.vision-outcomes li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* --- Libby Section --- */
.section-libby {
  background: var(--bg-alt);
  text-align: center;
  padding: 100px 24px;
}

.libby-quote {
  font-family: var(--serif);
  font-size: clamp(22px, 3.5vw, 30px);
  font-style: italic;
  line-height: 1.5;
  color: var(--text);
  border: none;
  margin-bottom: 28px;
  padding: 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.libby-text {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 36px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Contact Section --- */
#contact {
  text-align: center;
  padding: 100px 24px;
}

#contact .section-lead {
  margin-left: auto;
  margin-right: auto;
}

.contact-form {
  margin-top: 24px;
}

.form-row {
  display: flex;
  gap: 12px;
  max-width: 480px;
  margin: 0 auto;
}

.form-input {
  flex: 1;
  padding: 14px 18px;
  font-size: 1rem;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: var(--accent);
}

.form-input::placeholder {
  color: var(--text-muted);
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border-light);
  padding: 48px 24px;
  text-align: center;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.footer-logo {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.footer-tagline {
  font-size: 14px;
  color: var(--text-dim);
}

.footer-links {
  display: flex;
  gap: 24px;
  margin-top: 4px;
}

.footer-links a {
  font-size: 13px;
  color: var(--text-dim);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--text-muted);
  opacity: 1;
}

.footer-legal {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 8px;
}

/* ===========================
   Essay Page
   =========================== */
.page-essay {
  background: var(--bg);
}

.essay {
  max-width: var(--max-width-narrow);
  margin: 0 auto;
  padding: 0 24px;
}

.essay-header {
  padding-top: 140px;
  padding-bottom: 60px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}

.essay-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

.essay-header h1 {
  font-family: var(--serif);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 12px;
}

.essay-subtitle {
  font-family: var(--serif);
  font-size: 22px;
  font-style: italic;
  color: var(--text-muted);
}

.essay-body h2 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  margin-top: 56px;
  margin-bottom: 20px;
  color: var(--text);
}

.essay-body p {
  color: var(--text-muted);
  line-height: 1.85;
  margin-bottom: 20px;
  font-size: 17px;
}

.essay-body p:first-of-type {
  font-size: 20px;
}

.essay-body strong {
  color: var(--text);
  font-weight: 600;
}

.essay-body em {
  font-style: italic;
  color: var(--text);
}

.essay-dx-list {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 32px;
  margin: 28px 0;
  list-style: none;
  counter-reset: essay-dx;
}

.essay-dx-list li {
  counter-increment: essay-dx;
  padding: 8px 0;
  color: var(--text-muted);
  font-size: 16px;
  border-bottom: 1px solid var(--border-light);
}

.essay-dx-list li:last-child { border-bottom: none; }

.essay-dx-list li::before {
  content: counter(essay-dx) ".";
  color: var(--accent);
  font-weight: 600;
  margin-right: 10px;
}

.essay-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 48px 0;
  margin-top: 64px;
  border-top: 1px solid var(--border);
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    padding: 24px;
    gap: 20px;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .hero {
    min-height: auto;
    padding: 120px 24px 60px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .hero-sub {
    font-size: 17px;
  }

  .section {
    padding: 64px 24px;
  }

  .demo-block {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 24px;
  }

  .demo-arrow {
    transform: rotate(90deg);
    text-align: center;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .how-grid {
    grid-template-columns: 1fr;
  }

  .stat-number {
    font-size: 36px;
  }

  .essay-header {
    padding-top: 100px;
  }

  .essay-footer {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 16px;
  }

  .hero h1 {
    font-size: 28px;
  }

  .section h2 {
    font-size: 26px;
  }

  .signals-grid {
    gap: 10px;
  }

  .signal {
    padding: 8px 16px;
    font-size: 13px;
  }
}
