/* Epistat Therapeutics - hand-written stylesheet (no framework).
   Palette and type derived from the logo and website-plan.md design system.
   Fonts are system stacks for now (no external CDN); self-hosted Space Grotesk
   + Source Serif 4 woff2 can be dropped into /static/fonts and referenced via
   the --font-head / --font-body variables without touching the rest. */

:root {
  /* Palette (sampled from the logo) */
  --ink:        #1B2350;   /* deep navy: text, dark surfaces */
  --indigo:     #3A3A78;   /* basal-cell indigo */
  --purple:     #7E73A8;   /* brand purple */
  --lilac:      #CFC9E4;
  --lilac-pale: #EDEAF4;
  --peach:      #E7A98A;   /* warm accent - used sparingly */
  --peach-deep: #D8875F;   /* accent that holds contrast on white */
  --peach-pale: #F5D3BE;
  --bg:         #FBFAF8;   /* warm near-white */
  --surface:    #FFFFFF;
  --muted:      #5B5F79;   /* body text on light */
  --border:     #E7E4EE;

  --font-head: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-body: 'Source Serif 4', Georgia, 'Iowan Old Style', 'Times New Roman', serif;

  --maxw: 1150px;
  --readw: 720px;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(27, 35, 80, 0.10);
  --shadow-sm: 0 8px 24px rgba(27, 35, 80, 0.07);
  --nav-h: 94px;
  --accent: #3A3A78;        /* logo indigo - primary CTA colour */
  --accent-strong: #1B2350; /* navy - CTA hover */
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; display: block; }
a { color: var(--indigo); text-decoration: none; }
a:hover { color: var(--purple); }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--ink); font-weight: 600; line-height: 1.12; letter-spacing: -0.01em; margin: 0 0 0.5em; }
p { margin: 0 0 1.1em; }
strong { font-weight: 600; }

/* Layout */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: var(--readw); margin-inline: auto; }
section { padding: 96px 0; }
.eyebrow {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--purple);
  margin: 0 0 1.1em;
}
.lead { font-size: 1.28rem; line-height: 1.55; color: var(--ink); }
.muted { color: var(--muted); }

/* Buttons */
.btn {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  padding: 14px 28px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .25s ease, background .25s ease, color .2s ease;
  text-align: center;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 24px rgba(58,58,120,.26); }
.btn-primary:hover { background: var(--accent-strong); color: #fff; transform: translateY(-2px); box-shadow: 0 14px 30px rgba(27,35,80,.34); }
.btn-outline { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-outline:hover { background: var(--accent); color: #fff; transform: translateY(-2px); }
.btn-light { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.6); backdrop-filter: blur(4px); }
.btn-light:hover { background: #fff; color: var(--ink); }

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  background: rgba(251, 250, 248, 0.82);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease, box-shadow .3s ease;
}
.nav.scrolled { border-color: var(--border); box-shadow: 0 2px 20px rgba(27,35,80,.05); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.nav-brand img { height: 60px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a {
  font-family: var(--font-head); font-size: 0.95rem; font-weight: 500; color: var(--ink);
  letter-spacing: 0.01em;
}
.nav-links a:hover, .nav-links a.active { color: var(--purple); }
.nav-links .btn { padding: 9px 20px; font-size: 0.9rem; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; transition: .25s; }

/* Home page uses sans-serif throughout. (The footer is sans site-wide too.) */
.home-sans { font-family: var(--font-head); }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: calc(100svh - var(--nav-h)); display: flex; align-items: center; overflow: hidden; color: #fff; }
/* On desktop, anchor the hero content in the upper-middle so the doors do not
   sit too low on tall viewports. On mobile the centred layout reads well. */
@media (min-width: 761px) {
  .hero { align-items: flex-start; min-height: 0; }
  .hero-inner { padding-top: 8vh; padding-bottom: 13vh; }
}
.hero-video, .hero-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.hero-poster { display: none; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(180deg, rgba(20,26,60,.62) 0%, rgba(20,26,60,.32) 40%, rgba(20,26,60,.72) 100%),
    radial-gradient(120% 90% at 20% 20%, rgba(58,58,120,.35), transparent 60%);
}
.hero-inner { position: relative; z-index: 2; padding: 70px 0; width: 100%; }
.hero .eyebrow { color: var(--lilac); }
.hero h1 { color: #fff; font-size: clamp(2.4rem, 5.4vw, 4rem); max-width: 16ch; text-shadow: 0 2px 30px rgba(10,14,40,.35); }
.hero .sub { font-size: clamp(1.05rem, 2vw, 1.35rem); max-width: 44ch; color: rgba(255,255,255,.92); margin-bottom: 2rem; }

/* Two-door split */
.doors { display: flex; gap: 16px; flex-wrap: wrap; }
.door {
  flex: 1 1 240px; min-width: 220px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 22px 26px; border-radius: var(--radius);
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.35);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  color: #fff; font-family: var(--font-head); font-weight: 600; font-size: 1.1rem;
  transition: transform .2s ease, background .25s ease, border-color .25s ease;
}
.door small { display: block; font-family: var(--font-body); font-weight: 400; font-size: .82rem; color: rgba(255,255,255,.75); letter-spacing: 0; margin-top: 3px; }
.door .arrow { font-size: 1.4rem; transition: transform .2s ease; }
.door:hover { transform: translateY(-3px); background: rgba(255,255,255,.18); border-color: #fff; color: #fff; }
.door:hover .arrow { transform: translateX(4px); }

/* ---------- Teaser panels ---------- */
.teaser { background: var(--surface); border-top: 1px solid var(--border); }
.teaser-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.teaser-card { padding: 8px 4px; text-align: center; }
.teaser-card .hexmark { margin-bottom: 16px; }
.teaser-illus { width: auto; height: 92px; display: block; margin: 0 auto 12px; }
.teaser-card h3 { font-size: 1.15rem; margin-bottom: .3em; }
.teaser-card p { color: var(--muted); font-size: 1rem; margin: 0; }
.teaser .more { text-align: center; margin-top: 56px; }

/* ---------- Affiliation strip ---------- */
.affil { background: var(--lilac-pale); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.affil .wrap { display: flex; align-items: center; justify-content: center; gap: 40px; flex-wrap: wrap; padding: 34px 24px; }
.affil .label { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .18em; font-size: .72rem; color: var(--muted); font-weight: 600; }
.affil img.kcl { height: 62px; width: auto; }
.affil img.badge { height: 78px; width: auto; }

/* ---------- Generic section helpers ---------- */
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-dark { background: var(--ink); color: rgba(255,255,255,.9); }
.section-dark h1, .section-dark h2, .section-dark h3 { color: #fff; }
.section-dark .eyebrow { color: var(--lilac); }
.section-dark a { color: var(--lilac); }
.prose p { font-size: 1.12rem; }
.prose p.lead { font-size: 1.3rem; }

/* Section title block */
.stitle { max-width: 760px; margin: 0 auto 56px; text-align: center; }
.stitle h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); }

/* ---------- Investor narrative (chapters) ---------- */
.chapter { padding: 74px 0; border-bottom: 1px solid var(--border); }
.chapter:last-of-type { border-bottom: 0; }
.chapter .grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: start; }
.chapter h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
.chapter .body p { font-size: 1.14rem; color: var(--ink); }
.chapter .num { font-family: var(--font-head); font-size: .8rem; letter-spacing: .2em; color: var(--purple); text-transform: uppercase; }

/* Full-width illustration bands (investor page) */
.illus-band { margin: 12px 0; text-align: center; }
.illus-band img { width: 100%; max-width: 940px; height: auto; border-radius: 16px; box-shadow: var(--shadow-sm); }
.illus-band.banner img { max-width: 1040px; }
/* Full-width white hero image (investor page top). The intro above it has no
   divider line and only a small white gap; the image sits flush on the section
   below. */
.inv-intro { border: 0; padding-bottom: 6px; }
.hero-illus { background: #fff; font-size: 0; position: relative; }
.hero-illus img { display: block; width: 100%; height: auto; }
.hero-illus::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 140px; background: linear-gradient(to bottom, rgba(255,255,255,0), #fff);
  pointer-events: none;
}

/* Stat tiles */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 8px 0 0; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 24px; box-shadow: var(--shadow-sm); }
.stat .big { font-family: var(--font-head); font-weight: 600; font-size: 1.6rem; letter-spacing: -0.02em; color: var(--ink); line-height: 1.05; }
.stat .lab { font-size: .95rem; color: var(--muted); margin-top: 8px; }
.stats.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .stats.four { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .stats.four { grid-template-columns: 1fr; } }

/* Pipeline graphic */
.pipeline { display: flex; gap: 0; margin-top: 8px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.pipe-stage { flex: 1; padding: 18px 14px; text-align: center; font-family: var(--font-head); font-size: .9rem; background: var(--surface); border-right: 1px solid var(--border); color: var(--muted); position: relative; }
.pipe-stage:last-child { border-right: 0; }
.pipe-stage.active { background: linear-gradient(180deg, var(--lilac-pale), #fff); color: var(--ink); font-weight: 600; }
.pipe-stage.active::after { content: "we are here"; position: absolute; left: 0; right: 0; bottom: 6px; font-family: var(--font-body); font-size: .66rem; letter-spacing: .04em; color: var(--purple); text-transform: uppercase; }

/* ---------- Market page ---------- */
.scenarios { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.scn { border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 24px; background: var(--surface); box-shadow: var(--shadow-sm); }
.scn .tag { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .14em; font-size: .7rem; color: var(--purple); }
.scn .fig { font-family: var(--font-head); font-weight: 600; font-size: 2.3rem; margin: 10px 0 4px; }
.scn .fig span { font-size: 1rem; color: var(--muted); font-weight: 400; }
.scn.base { border-color: var(--purple); box-shadow: 0 14px 40px rgba(126,115,168,.18); }
.callout-box { background: var(--lilac-pale); border-left: 4px solid var(--purple); border-radius: 8px; padding: 22px 26px; margin: 30px 0; }
.callout-box p:last-child { margin-bottom: 0; }
.sources { font-size: .92rem; color: var(--muted); }
.sources li { margin-bottom: 6px; }

/* ---------- Team ---------- */
.team-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
.member { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.member img { width: 100%; aspect-ratio: 4/5; object-fit: cover; object-position: 50% 25%; }
.member .info { padding: 26px 26px 30px; }
.member .info h3 { font-size: 1.35rem; margin-bottom: 2px; }
.member .role { font-family: var(--font-head); font-size: .9rem; color: var(--purple); margin-bottom: 14px; }
.member .info p { color: var(--muted); font-size: 1rem; margin: 0; }

/* ---------- Forms ---------- */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px; box-shadow: var(--shadow); max-width: 640px; margin: 0 auto; }
.field { margin-bottom: 18px; }
.field label { display: block; font-family: var(--font-head); font-size: .88rem; font-weight: 500; margin-bottom: 7px; color: var(--ink); }
.field input, .field textarea {
  width: 100%; padding: 13px 16px; font-family: var(--font-body); font-size: 1rem;
  color: var(--ink); background: var(--bg); border: 1.5px solid var(--border); border-radius: 10px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(126,115,168,.15); }
.field textarea { min-height: 120px; resize: vertical; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: .88rem; color: var(--muted); margin-top: 4px; }
.form-status { margin-top: 14px; font-family: var(--font-head); font-size: .95rem; min-height: 1.2em; }
.form-status.ok { color: #2f7d4f; }
.form-status.err { color: #b0413e; }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: rgba(255,255,255,.72); padding: 66px 0 34px; font-size: .95rem; font-family: var(--font-head); }
.footer a { color: rgba(255,255,255,.72); }
.footer a:hover { color: #fff; }
.footer .cols { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; }
.footer h4 { color: #fff; font-size: .8rem; text-transform: uppercase; letter-spacing: .16em; margin-bottom: 14px; }
.footer .brandline img { height: 30px; opacity: .95; margin-bottom: 16px; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 9px; }
.footer .affil-note { display: flex; align-items: center; gap: 16px; margin-top: 18px; }
.footer .affil-note img { height: 40px; }
.footer .affil-note img.badge { height: 56px; }
.footer .fine { margin-top: 44px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.14); font-size: .82rem; color: rgba(255,255,255,.5); display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* ---------- Hexagon motif mark ---------- */
.hexmark { width: 38px; height: 44px; display: inline-block; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .chapter .grid { grid-template-columns: 1fr; gap: 22px; }
  .teaser-grid, .scenarios, .stats { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr; }
  .footer .cols { grid-template-columns: 1fr; gap: 30px; }
}
@media (max-width: 760px) {
  body { font-size: 17px; }
  section { padding: 64px 0; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; align-items: flex-start; gap: 18px;
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--border); padding: 22px 24px;
  }
  .nav-toggle { display: block; }
  .stats { grid-template-columns: 1fr 1fr; }
  .form-card { padding: 26px; }
  .affil .wrap { gap: 26px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
  .hero-video { display: none; }
  .hero-poster { display: block; }
}

/* Scroll-reveal (progressive; no-JS shows everything) */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }
