/* ===== Meta-Analysis Research Hub — Design Tokens =====
   Signature: the forest plot — the one chart every meta-analyst lives inside.
   Used as hero motif, section dividers, and loading/interaction cues.
*/

:root {
  --ink: #0B2545;
  --ivory: #F4F8F9;
  --ivory-dim: #E7EFF1;
  --slate: #0E7C86;
  --slate-dim: #4FA3AC;
  --teal: #0E7C86;
  --gold: #16506B;
  --line: #DCE6EA;
  --white: #FFFFFF;

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --max-w: 1120px;
}

@font-face { font-family: "Fraunces"; src: local("Fraunces"); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 32px; }

/* ---------- Nav ---------- */
header.site-nav {
  border-bottom: 1px solid var(--line);
  background: var(--ivory);
  position: sticky; top: 0; z-index: 50;
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px; max-width: var(--max-w); margin: 0 auto;
}
.brand {
  font-family: var(--font-display);
  font-weight: 600; font-size: 1.15rem; letter-spacing: 0.01em;
  display: flex; align-items: center; gap: 10px;
}
.brand .mark { color: var(--teal); font-family: var(--font-mono); font-size: 0.95rem; }
.brand-mark { flex-shrink: 0; display: block; }
nav.links { display: flex; gap: 28px; font-size: 0.92rem; }
nav.links a {
  position: relative; padding: 4px 0; color: var(--ink); opacity: 0.75;
  transition: opacity .2s ease;
}
nav.links a:hover, nav.links a.active { opacity: 1; }
nav.links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; background: var(--teal);
}
.nav-cta {
  border: 1px solid var(--ink); border-radius: 3px; padding: 8px 16px;
  font-size: 0.85rem; font-family: var(--font-mono);
  transition: background .2s ease, color .2s ease;
  white-space: nowrap;
}
.nav-cta:hover { background: var(--ink); color: var(--white); }

.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--ink); border-radius: 4px;
  width: 38px; height: 34px; padding: 0; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  flex-shrink: 0;
}
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--ink); }

.mobile-menu {
  display: none;
  flex-direction: column;
  border-bottom: 1px solid var(--line);
  background: var(--ivory);
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  padding: 14px 32px; font-size: 0.95rem; border-top: 1px solid var(--line);
}
.mobile-menu a.active { color: var(--teal); font-weight: 600; }

/* ---------- Hero ---------- */
.hero {
  padding: 80px 0 60px;
}
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center;
}
.eyebrow {
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--teal); margin-bottom: 18px; display: block;
}
h1 {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(2.3rem, 4vw, 3.4rem);
  line-height: 1.08; margin: 0 0 22px; letter-spacing: -0.01em;
}
h1 em { font-style: italic; color: var(--teal); }
.hero p.lead {
  font-size: 1.12rem; color: #3a4658; max-width: 46ch; margin-bottom: 32px;
}
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 13px 24px; border-radius: 3px; font-size: 0.95rem;
  font-weight: 500; transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary { background: var(--ink); color: var(--white); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(23,38,63,0.25); }
.btn-secondary { border: 1px solid var(--ink); color: var(--ink); }
.btn-secondary:hover { background: var(--ivory-dim); }

/* Forest plot SVG */
.hero-photo {
  position: relative;
  background: radial-gradient(circle at 82% 18%, #0F4C5C 0%, var(--ink) 55%),
              linear-gradient(135deg, var(--ink) 0%, #0B2545 100%);
  padding: 90px 0 130px; overflow: hidden;
}
.hero-photo::before {
  content: ""; position: absolute; inset: 0; opacity: 0.5;
  background-image:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 46px 46px;
}
.hero-photo::after {
  content: ""; position: absolute; right: -10%; top: -10%; width: 60%; height: 140%;
  background: radial-gradient(circle, rgba(14,124,134,0.35) 0%, transparent 70%);
}
.hero-photo .wrap { position: relative; z-index: 2; max-width: 720px; }
.hero-photo .eyebrow { color: #7FD8CF; }
.hero-photo h1 { color: var(--white); }
.hero-photo h1 em { color: #4FC9BC; }
.hero-photo p.lead { color: #C7D3DC; }
.hero-photo .btn-secondary { color: var(--white); border-color: rgba(255,255,255,0.4); }
.hero-photo .btn-secondary:hover { background: rgba(255,255,255,0.08); }
.hero-photo .btn-primary { background: var(--teal); }
.hero-photo.hero-sub { padding: 70px 0 60px; }
.hero-photo.hero-sub h1 { font-size: clamp(2rem, 3.4vw, 2.7rem); }
  background: var(--white); border: 1px solid var(--line); border-radius: 6px;
  padding: 26px 24px 18px;
}
.forest-wrap .fp-caption {
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--slate-dim);
  display: flex; justify-content: space-between; margin-bottom: 10px;
}
svg.forest text { font-family: var(--font-mono); }
.fp-row-label { font-size: 10px; fill: var(--ink); }
.fp-diamond { fill: var(--teal); }
.fp-line { stroke: var(--line); }
.fp-ci { stroke: var(--slate); stroke-width: 2; }
.fp-square { fill: var(--slate); }
.fp-pooled-label { font-size: 10.5px; fill: var(--teal); font-weight: 600; }

/* Hero image carousel */
.carousel {
  position: relative; width: 100%; height: 300px; overflow: hidden; border-radius: 3px;
  background: var(--white);
}
.carousel-slide {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  object-fit: contain; opacity: 0; transition: opacity 0.6s ease;
  pointer-events: none;
}
.carousel-slide.active { opacity: 1; }
.carousel-dots {
  display: flex; justify-content: center; gap: 6px; margin-top: 12px;
}
.carousel-dots .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--line);
  border: none; padding: 0; cursor: pointer; transition: background 0.2s ease;
}
.carousel-dots .dot.active { background: var(--teal); }
@media (max-width: 880px) { .carousel { height: 220px; } }

/* ---------- Sections ---------- */
section { padding: 64px 0; }
.section-head { max-width: 62ch; margin-bottom: 40px; }
.section-head .eyebrow { margin-bottom: 10px; }
h2 { font-family: var(--font-display); font-size: clamp(1.7rem, 2.6vw, 2.3rem); margin: 0 0 12px; font-weight: 600; }
h2 + p { color: #4a5568; font-size: 1.02rem; }

.divider {
  border: none; height: 1px; background: var(--line); margin: 0;
}

/* ---------- Cards / grid ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }

.card {
  background: var(--white); border: 1px solid var(--line); border-radius: 6px;
  padding: 26px 24px; transition: border-color .2s ease, transform .2s ease;
}
.card:hover { border-color: var(--teal); transform: translateY(-3px); }
.card .tag {
  font-family: var(--font-mono); font-size: 0.7rem; color: var(--gold);
  text-transform: uppercase; letter-spacing: 0.08em; display: block; margin-bottom: 10px;
}
.card h3 { font-family: var(--font-display); font-size: 1.15rem; margin: 0 0 8px; }
.card p { margin: 0; color: #4a5568; font-size: 0.95rem; }
.card-link {
  display: inline-block; margin-top: 14px; color: var(--teal);
  font-family: var(--font-mono); font-size: 0.85rem; font-weight: 500;
}
.card-link:hover { text-decoration: underline; }

/* ---------- Design taxonomy strip ---------- */
.taxonomy {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.taxonomy span {
  font-family: var(--font-mono); font-size: 0.8rem; padding: 7px 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--white);
  color: var(--ink);
}
.taxonomy span.primary { border-color: var(--slate); color: var(--slate); }
.taxonomy span.secondary { border-color: var(--teal); color: var(--teal); }

/* ---------- Portfolio badges ---------- */
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.badges .badge {
  font-family: var(--font-mono); font-size: 0.7rem; padding: 4px 10px;
  border-radius: 999px; border: 1px solid var(--line); color: var(--slate);
  background: var(--ivory-dim); white-space: nowrap;
}
.badges .badge.q1 { border-color: var(--teal); color: var(--teal); }
.badges .badge.q2 { border-color: var(--gold); color: var(--gold); }
.badges .badge.pubmed { border-color: var(--slate); color: var(--slate); }

/* ---------- Process ---------- */
.process { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.process .step { padding: 26px 20px; border-right: 1px solid var(--line); }
.process .step:last-child { border-right: none; }
.process .step .num { font-family: var(--font-mono); color: var(--teal); font-size: 0.85rem; }
.process .step h4 { font-family: var(--font-display); margin: 10px 0 6px; font-size: 1.05rem; }
.process .step p { margin: 0; font-size: 0.88rem; color: #52607a; }

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--ink); color: var(--white); border-radius: 8px; padding: 48px 44px;
  display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
}
.cta-band h3 { font-family: var(--font-display); font-size: 1.5rem; margin: 0 0 6px; }
.cta-band p { margin: 0; opacity: 0.75; }
.cta-band .btn-primary { background: var(--teal); }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--line); padding: 36px 0; margin-top: 40px;
}
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-inner .small { font-size: 0.85rem; color: #6b7688; font-family: var(--font-mono); }

/* ---------- About page ---------- */
.about-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: start; }
.portrait-frame {
  aspect-ratio: 4/5; border-radius: 6px; background: linear-gradient(160deg, var(--slate) 0%, var(--ink) 100%);
  display: flex; align-items: center; justify-content: center; color: var(--white);
  font-family: var(--font-display); font-size: 3.2rem; border: 1px solid var(--line);
}
.credentials { display: flex; flex-direction: column; gap: 14px; margin-top: 26px; }
.credentials .item { display: flex; gap: 14px; align-items: flex-start; }
.credentials .item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); margin-top: 8px; flex-shrink: 0; }

.float-stat {
  position: absolute; bottom: -18px; right: -18px; z-index: 3;
  background: var(--white); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 14px 30px rgba(11,37,69,0.16); padding: 16px 18px; max-width: 190px;
}
.float-stat .num { font-family: var(--font-display); font-weight: 600; font-size: 1.7rem; color: var(--teal); line-height: 1; }
.float-stat .label { font-size: 0.76rem; color: #5c7080; margin-top: 6px; line-height: 1.3; }
@media (max-width: 880px) {
  .float-stat { position: static; margin-top: -30px; margin-left: auto; width: fit-content; }
}

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.field { margin-bottom: 18px; display: flex; flex-direction: column; gap: 6px; }
.field label { font-family: var(--font-mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--slate-dim); }
.field input, .field select, .field textarea {
  border: 1px solid var(--line); border-radius: 4px; padding: 11px 12px; font-family: var(--font-body);
  font-size: 0.95rem; background: var(--white); color: var(--ink);
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--teal); outline-offset: 1px;
}
.contact-info .item { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.contact-info .item .k { font-family: var(--font-mono); font-size: 0.78rem; color: var(--slate-dim); width: 90px; flex-shrink: 0; }
.contact-info .item .v { font-size: 0.98rem; }
.submit-note { font-size: 0.82rem; color: #6b7688; margin-top: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .hero-grid, .about-grid, .contact-grid, .grid-3, .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .process { grid-template-columns: repeat(2, 1fr); }
  .process .step { border-bottom: 1px solid var(--line); }
  nav.links { display: none; }
  .nav-toggle { display: flex; }
  .nav-cta { display: none; }
  .nav-inner { padding: 16px 20px; }
  .wrap { padding: 0 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* focus visibility */
a:focus-visible, button:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* ---------- Logo marquee (auto-scrolling trust strip) ---------- */
.marquee-wrap {
  overflow: hidden; position: relative; padding: 28px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex; gap: 48px; width: max-content;
  animation: marquee-scroll 28s linear infinite;
}
.marquee-wrap:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.marquee-badge {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  font-family: var(--font-mono); font-weight: 600; font-size: 0.98rem;
  color: #5c7080; white-space: nowrap; opacity: 0.85;
}
.marquee-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); flex-shrink: 0; }

/* ---------- Floating WhatsApp button ---------- */
.whatsapp-fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 100;
  width: 58px; height: 58px; border-radius: 50%;
  background: #25D366; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 22px rgba(0,0,0,0.22);
  transition: transform 0.2s ease;
}
.whatsapp-fab:hover { transform: scale(1.08); }
.whatsapp-fab svg { width: 30px; height: 30px; }

/* ---------- Stat bar (overlapping hero, Nexora-style) ---------- */
.stat-bar {
  background: var(--white); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 30px rgba(11,37,69,0.08);
  padding: 28px 20px; margin-top: -30px; position: relative; z-index: 5;
  display: grid; grid-template-columns: repeat(5, 1fr);
}
.stat-bar .stat { display: flex; align-items: center; gap: 12px; padding: 0 12px; border-right: 1px solid var(--line); }
.stat-bar .stat:last-child { border-right: none; }
.stat-bar .stat .icon {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--ivory-dim); color: var(--teal); font-size: 1.05rem;
}
.stat-bar .stat .num { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; color: var(--ink); line-height: 1.1; }
.stat-bar .stat .label { font-size: 0.72rem; color: #5c7080; }
@media (max-width: 880px) {
  .stat-bar { grid-template-columns: repeat(2, 1fr); gap: 20px 0; }
  .stat-bar .stat { border-right: none; border-bottom: 1px solid var(--line); padding-bottom: 16px; }
}

/* ---------- Icon badges for service cards ---------- */
.icon-badge {
  width: 46px; height: 46px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; margin-bottom: 14px;
}
.icon-badge.b-teal { background: #E3F2F1; color: var(--teal); }
.icon-badge.b-navy { background: #E8EDF3; color: var(--ink); }
.icon-badge.b-slate { background: #EAF4F5; color: var(--slate-dim); }
