/* ==========================================================================
   BioForge Scientific, LLC — Site Stylesheet
   Brand palette and typography per BioForge Scientific Brand Identity Guide.
   Colors: Primary Navy #0B1A3E, Deep Navy #0F2454, Brand Gold #C9A84C,
   Light Gold #E8C97A, Steel Blue #4A7BA7, White, Light Gray #F4F5F7.
   Typeface: Inter (per brand guide "Helvetica / Inter").
   ========================================================================== */

/* ---------- Design Tokens ---------- */
:root {
  /* Brand colors (exact per brand guide) */
  --navy: #0B1A3E;          /* Primary Navy — dominant brand color */
  --deep-navy: #0F2454;     /* Deep Navy — secondary header/accent bg */
  --gold: #C9A84C;          /* Brand Gold — accent, dividers */
  --light-gold: #E8C97A;    /* Light Gold — subheads/taglines on dark */
  --steel: #4A7BA7;         /* Steel Blue — helix strand accent */
  --white: #FFFFFF;
  --light-gray: #F4F5F7;    /* Document backgrounds, card fills */

  /* Derived neutrals */
  --ink: #101828;           /* body text on light */
  --ink-muted: #475069;     /* secondary text on light */
  --ink-faint: #63697d;
  --border: #E1E4EC;
  --border-navy: rgba(201, 168, 76, 0.28); /* gold-tinted border on navy */
  --on-navy: #E9ECF4;       /* body text on navy */
  --on-navy-muted: #A9B4CC;

  /* Typography scale */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --text-hero: clamp(2.6rem, 5.4vw, 4.25rem);
  --text-2xl: clamp(2rem, 3.6vw, 3rem);
  --text-xl: clamp(1.5rem, 2.4vw, 2rem);
  --text-lg: clamp(1.2rem, 1.6vw, 1.4rem);
  --text-base: 1.05rem;
  --text-sm: 0.9375rem;
  --text-xs: 0.8125rem;

  /* Spacing */
  --space-1: 0.25rem;  --space-2: 0.5rem;  --space-3: 0.75rem;
  --space-4: 1rem;     --space-6: 1.5rem;  --space-8: 2rem;
  --space-12: 3rem;    --space-16: 4rem;   --space-20: 5rem;
  --space-24: 6rem;    --space-32: 8rem;

  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(11, 26, 62, 0.06), 0 1px 3px rgba(11, 26, 62, 0.08);
  --shadow-md: 0 6px 20px rgba(11, 26, 62, 0.10);
  --shadow-lg: 0 18px 48px rgba(11, 26, 62, 0.16);
  --maxw: 1160px;
  --maxw-prose: 68ch;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Reset / Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.18; color: var(--navy); margin: 0 0 var(--space-4); letter-spacing: -0.01em; }
h1 { font-size: var(--text-hero); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
p { margin: 0 0 var(--space-4); }
a { color: #1a3a7a; text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; transition: color 0.2s var(--ease); }
a:hover { color: #8a6d1f; }

/* Links inside dark (navy/deep) sections must be light for contrast */
.section--navy a:not(.btn), .section--deep a:not(.btn),
.hero a:not(.btn), .page-head a:not(.btn),
.cta-band a:not(.btn), .footer__disclaimer a { color: var(--light-gold); }
.section--navy a:not(.btn):hover, .section--deep a:not(.btn):hover,
.hero a:not(.btn):hover, .page-head a:not(.btn):hover,
.cta-band a:not(.btn):hover, .footer__disclaimer a:hover { color: #f3dca0; }
ul, ol { margin: 0 0 var(--space-4); padding-left: 1.35rem; }
li { margin-bottom: 0.4rem; }
strong { color: var(--navy); }

/* ---------- Skip link & focus ---------- */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--gold); color: var(--navy); padding: 0.75rem 1.25rem;
  font-weight: 600; border-radius: 0 0 var(--radius) 0; text-decoration: none;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 3px; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 2.5rem); }
.section { padding-block: clamp(var(--space-16), 8vw, var(--space-32)); }
.section--tight { padding-block: clamp(var(--space-12), 6vw, var(--space-20)); }
.section--navy { background: var(--navy); color: var(--on-navy); }
.section--deep { background: var(--deep-navy); color: var(--on-navy); }
.section--gray { background: var(--light-gray); }
.section--navy h1, .section--navy h2, .section--navy h3, .section--navy h4,
.section--deep h1, .section--deep h2, .section--deep h3, .section--deep h4 { color: var(--white); }

.eyebrow {
  display: inline-block; font-size: var(--text-xs); font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase; color: #7d6119;
  margin-bottom: var(--space-3);
}
.section--navy .eyebrow, .section--deep .eyebrow,
.hero .eyebrow, .page-head .eyebrow, .cta-band .eyebrow { color: var(--light-gold); }
.lead { font-size: var(--text-lg); color: var(--ink-muted); max-width: var(--maxw-prose); }
.section--navy .lead, .section--deep .lead { color: var(--on-navy); }
.prose { max-width: var(--maxw-prose); }
.prose h2 { margin-top: var(--space-12); font-size: var(--text-xl); }
.prose h3 { margin-top: var(--space-8); font-size: var(--text-lg); }
.text-center { text-align: center; }
.mx-auto { margin-inline: auto; }

/* Gold divider rule */
.rule { width: 64px; height: 3px; background: var(--gold); border: 0; margin: var(--space-4) 0; border-radius: 2px; }
.rule--center { margin-inline: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: var(--text-sm); font-weight: 600; text-decoration: none;
  padding: 0.8rem 1.6rem; border-radius: var(--radius); border: 1.5px solid transparent;
  cursor: pointer; transition: all 0.22s var(--ease); line-height: 1;
}
.btn--primary { background: var(--gold); color: var(--navy); }
.btn--primary:hover { background: var(--light-gold); color: var(--navy); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn--outline { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn--outline:hover { background: var(--navy); color: var(--white); }
.btn--ghost-light { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.5); }
.btn--ghost-light:hover { background: var(--white); color: var(--navy); border-color: var(--white); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11, 26, 62, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-navy);
  transition: box-shadow 0.3s var(--ease);
}
.site-header.scrolled { box-shadow: 0 6px 24px rgba(0,0,0,0.28); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 74px; }
.nav__menu { display: flex; align-items: center; gap: var(--space-2); }
.nav__brand { display: inline-flex; align-items: center; text-decoration: none; }
.nav__brand img { height: 40px; width: auto; }
.nav__links { display: flex; align-items: center; gap: var(--space-2); list-style: none; margin: 0; padding: 0; }
.nav__links a {
  color: var(--on-navy); text-decoration: none; font-size: var(--text-sm); font-weight: 500;
  padding: 0.55rem 0.75rem; border-radius: 8px; white-space: nowrap; transition: all 0.18s var(--ease);
}
.nav__links a:hover, .nav__links a:focus-visible { color: var(--white); background: rgba(255,255,255,0.08); }
.nav__links a[aria-current="page"] { color: var(--light-gold); }
.nav__links a[aria-current="page"]::after {
  content: ""; display: block; height: 2px; background: var(--gold); margin-top: 3px; border-radius: 2px;
}
.nav__cta { margin-left: var(--space-2); flex-shrink: 0; }
.nav__toggle {
  display: none; background: transparent; border: 0; cursor: pointer; padding: 0.5rem;
  color: var(--white); border-radius: 8px;
}
.nav__toggle svg { width: 26px; height: 26px; }

@media (max-width: 960px) {
  .nav__toggle { display: inline-flex; }
  .nav__menu {
    position: fixed; inset: 74px 0 auto 0; background: var(--navy);
    border-bottom: 1px solid var(--border-navy); padding: var(--space-4) clamp(1.25rem,4vw,2.5rem) var(--space-6);
    display: none; flex-direction: column; align-items: stretch; gap: var(--space-2);
    max-height: calc(100vh - 74px); overflow-y: auto;
  }
  .nav__menu.open { display: flex; }
  .nav__links { flex-direction: column; align-items: stretch; gap: 0; width: 100%; }
  .nav__links a { padding: 0.9rem 0.5rem; border-radius: 8px; font-size: 1rem; }
  .nav__links a[aria-current="page"]::after { display: none; }
  .nav__cta { margin: var(--space-3) 0 0; }
  .nav__cta .btn { width: 100%; justify-content: center; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; background: var(--navy); color: var(--white);
  padding-block: clamp(var(--space-20), 12vw, 8.5rem);
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(900px 500px at 78% 12%, rgba(74,123,167,0.28), transparent 62%),
    radial-gradient(700px 460px at 12% 96%, rgba(201,168,76,0.14), transparent 60%),
    linear-gradient(160deg, var(--deep-navy), var(--navy) 70%);
  z-index: 0;
}
.hero > .container { position: relative; z-index: 1; }
.hero h1 { color: var(--white); max-width: 16ch; }
.hero .accent { color: var(--light-gold); }
.hero__lead { font-size: var(--text-lg); color: var(--on-navy); max-width: 56ch; margin-bottom: var(--space-8); }
.hero__grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: var(--space-12); align-items: center; }
.hero__art { display: flex; justify-content: center; align-items: center; }
.hero__art img { max-height: 340px; width: auto; filter: drop-shadow(0 20px 50px rgba(0,0,0,0.45)); }
@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; gap: var(--space-8); }
  .hero__art { order: -1; }
  .hero__art img { max-height: 200px; }
}

/* ---------- Cards / Grids ---------- */
.grid { display: grid; gap: var(--space-6); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }

.card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--space-8); box-shadow: var(--shadow-sm); transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card h3 { font-size: var(--text-lg); }
.card p:last-child { margin-bottom: 0; }
.card__icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--light-gray); color: var(--deep-navy); margin-bottom: var(--space-4);
  border: 1px solid var(--border);
}
.card__icon svg { width: 24px; height: 24px; }
.card--navy { background: var(--deep-navy); border-color: var(--border-navy); color: var(--on-navy); }
.card--navy h3 { color: var(--white); }
.card--navy .card__icon { background: rgba(255,255,255,0.06); border-color: var(--border-navy); color: var(--light-gold); }

/* Status tag / badges */
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: var(--space-4); list-style: none; padding: 0; }
.tag {
  font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.02em;
  padding: 0.28rem 0.7rem; border-radius: 999px; border: 1px solid;
}
.tag--licensed  { color: #1f5c3d; background: #e7f3ec; border-color: #bfe0cc; }
.tag--pending   { color: #7a5a12; background: #fbf1d9; border-color: #ecd8a6; }
.tag--preclin   { color: #2a4d78; background: #e7eef8; border-color: #c4d5ec; }
.tag--dev       { color: #6b4a86; background: #f0e9f7; border-color: #d9c8ea; }
.tag--deployed  { color: #17506e; background: #e2f0f6; border-color: #b7dae8; }
.tag--research  { color: #5a5a5a; background: #eef0f2; border-color: #d5d9df; }

/* Tech portfolio detail block */
.tech {
  scroll-margin-top: 128px; padding: var(--space-8) 0; border-top: 1px solid var(--border);
}
.tech:first-of-type { border-top: 0; }
.tech__head { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--space-3); }
.tech h3 { font-size: var(--text-xl); margin-bottom: var(--space-3); }
.tech__grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: var(--space-8); align-items: start; }
@media (max-width: 820px) { .tech__grid { grid-template-columns: 1fr; gap: var(--space-4); } }

/* Two-column split */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(var(--space-8), 5vw, var(--space-20)); align-items: center; }
.split--wide-left { grid-template-columns: 1.2fr 0.8fr; }
@media (max-width: 820px) { .split, .split--wide-left { grid-template-columns: 1fr; gap: var(--space-8); } }

/* Pull quote */
.pullquote {
  border-left: 4px solid var(--gold); padding: var(--space-4) 0 var(--space-4) var(--space-6);
  font-size: var(--text-lg); font-style: italic; color: var(--ink-muted); max-width: 60ch;
}
.section--navy .pullquote, .section--deep .pullquote { color: var(--light-gold); border-color: var(--gold); }
.pullquote cite { display: block; margin-top: var(--space-3); font-size: var(--text-sm); font-style: normal; color: var(--ink-faint); }
.section--navy .pullquote cite { color: var(--on-navy-muted); }

/* Stats */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-8); }
@media (max-width: 640px) { .stat-row { grid-template-columns: 1fr; gap: var(--space-6); } }
.stat { text-align: center; }
.stat__num { font-size: var(--text-2xl); font-weight: 800; color: var(--gold); line-height: 1; letter-spacing: -0.02em; }
.stat__label { font-size: var(--text-sm); color: var(--on-navy-muted); margin-top: var(--space-2); }

/* Definition list for facts */
.factlist { display: grid; gap: 0; margin: 0; }
.factlist div { display: grid; grid-template-columns: 200px 1fr; gap: var(--space-4); padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
.factlist dt { font-weight: 600; color: var(--navy); margin: 0; }
.factlist dd { margin: 0; color: var(--ink-muted); }
@media (max-width: 620px) { .factlist div { grid-template-columns: 1fr; gap: 0.25rem; } }

/* ---------- Callout / Disclaimer box ---------- */
.callout {
  background: var(--light-gray); border: 1px solid var(--border); border-left: 4px solid var(--gold);
  border-radius: var(--radius); padding: var(--space-6);
}
.callout h3 { font-size: var(--text-lg); margin-bottom: var(--space-2); }
.callout p:last-child { margin-bottom: 0; }
.callout--sm { font-size: var(--text-sm); color: var(--ink-muted); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4) var(--space-6); }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.field label { display: block; font-size: var(--text-sm); font-weight: 600; color: var(--navy); margin-bottom: 0.4rem; }
.field .req { color: #b3452f; }
.field input, .field select, .field textarea {
  width: 100%; font-family: inherit; font-size: var(--text-base); color: var(--ink);
  padding: 0.75rem 0.9rem; border: 1.5px solid var(--border); border-radius: var(--radius);
  background: var(--white); transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--steel); box-shadow: 0 0 0 3px rgba(74,123,167,0.18);
}
.field textarea { min-height: 150px; resize: vertical; }
.field .hint { font-size: var(--text-xs); color: var(--ink-faint); margin-top: 0.35rem; }
.form-note { font-size: var(--text-xs); color: var(--ink-faint); margin-top: var(--space-4); }
.form-status { margin-top: var(--space-4); padding: var(--space-4); border-radius: var(--radius); font-size: var(--text-sm); display: none; }
.form-status.show { display: block; }
.form-status.info { background: #e7eef8; border: 1px solid #c4d5ec; color: #2a4d78; }
.form-status.error { background: #fdecea; border: 1px solid #f5c6c0; color: #8a2b1c; }
/* Honeypot */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: var(--on-navy-muted); padding-block: var(--space-16) var(--space-8); border-top: 3px solid var(--gold); }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--space-8); }
@media (max-width: 820px) { .footer__grid { grid-template-columns: 1fr 1fr; gap: var(--space-8); } }
@media (max-width: 480px) { .footer__grid { grid-template-columns: 1fr; } }
.footer__brand img { height: 42px; width: auto; margin-bottom: var(--space-4); }
.footer__brand p { font-size: var(--text-sm); max-width: 34ch; }
.site-footer h4 { color: var(--white); font-size: var(--text-sm); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: var(--space-4); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.65rem; }
.site-footer a { color: var(--on-navy-muted); text-decoration: none; font-size: var(--text-sm); }
.site-footer a:hover { color: var(--light-gold); }
.footer__bottom { border-top: 1px solid var(--border-navy); margin-top: var(--space-12); padding-top: var(--space-6); display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: space-between; align-items: center; }
.footer__bottom p { font-size: var(--text-xs); margin: 0; color: var(--on-navy-muted); }
.footer__disclaimer { font-size: var(--text-xs); line-height: 1.55; color: var(--on-navy-muted); max-width: 100%; margin-top: var(--space-6); padding-top: var(--space-6); border-top: 1px solid var(--border-navy); }

/* ---------- Page header (interior) ---------- */
.page-head { background: var(--navy); color: var(--white); padding-block: clamp(var(--space-16), 9vw, var(--space-24)); position: relative; overflow: hidden; }
.page-head::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(760px 420px at 85% 20%, rgba(74,123,167,0.24), transparent 60%), linear-gradient(165deg, var(--deep-navy), var(--navy));
  z-index: 0;
}
.page-head > .container { position: relative; z-index: 1; }
.page-head h1 { color: var(--white); margin-bottom: var(--space-4); }
.page-head p { color: var(--on-navy); max-width: 62ch; font-size: var(--text-lg); margin: 0; }
.breadcrumb { font-size: var(--text-xs); color: var(--on-navy-muted); margin-bottom: var(--space-4); }
.breadcrumb a { color: var(--light-gold); text-decoration: underline; text-underline-offset: 2px; }
.breadcrumb a:hover { color: #f3dca0; }

/* On-page anchor nav (portfolio) */
.anchor-nav { position: sticky; top: 74px; z-index: 40; background: var(--light-gray); border-bottom: 1px solid var(--border); }
.anchor-nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem; list-style: none; margin: 0; padding: 0.75rem 0; overflow-x: auto; }
.anchor-nav a { font-size: var(--text-sm); color: var(--ink-muted); text-decoration: none; padding: 0.4rem 0.75rem; border-radius: 999px; white-space: nowrap; }
.anchor-nav a:hover { background: var(--white); color: var(--navy); box-shadow: var(--shadow-sm); }

/* Legend */
.legend { display: flex; flex-wrap: wrap; gap: var(--space-4); font-size: var(--text-sm); color: var(--ink-muted); }
.legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.legend .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* CTA band */
.cta-band { background: linear-gradient(135deg, var(--deep-navy), var(--navy)); color: var(--white); border-radius: var(--radius-lg); padding: clamp(var(--space-8), 5vw, var(--space-16)); text-align: center; }
.cta-band h2 { color: var(--white); }
.cta-band p { color: var(--on-navy); max-width: 54ch; margin-inline: auto; margin-bottom: var(--space-6); }
.cta-band .btn-row { justify-content: center; }

/* Utility */
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.stack > * + * { margin-top: var(--space-4); }
.divider { height: 1px; background: var(--border); border: 0; margin: 0; }
.small-print { font-size: var(--text-xs); color: #5b6377; }

/* 404 */
.notfound { min-height: 60vh; display: grid; place-items: center; text-align: center; }
.notfound .code { font-size: clamp(4rem, 14vw, 9rem); font-weight: 800; color: #9a7d24; line-height: 1; letter-spacing: -0.04em; }
