/* ==========================================================================
   Avant Genomics — shared stylesheet
   Loaded by every page. Mobile-first: base rules target small screens,
   breakpoints layer on enhancements for tablet (>=768px) and desktop (>=1080px).
   ========================================================================== */

/* ---- Reset & base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Jost', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; }
h1, h2, h3, p { margin: 0; }
::selection { background: rgba(0,163,180,.35); }

/* ---- Design tokens ---- */
:root {
  --teal: #00A3B4;
  --teal-bright: #2DD4E6;
  --ink: #0B2430;
  --slate: #4C6570;
  --slate-light: #5B7079;
}

/* Dark theme (Home) */
body.theme-dark {
  background: linear-gradient(160deg, #0A2A38, #04141B 70%);
  color: #EAF1F3;
}
/* Light theme (Technology / Company) */
body.theme-light {
  background: #F5F9FA;
  color: var(--ink);
}
/* Deep theme (News) */
body.theme-deep {
  background: #12303B;
  color: #EAF1F3;
}

.theme-dark a:hover, .theme-light a:hover { color: var(--teal-bright); }
.theme-deep a:hover { color: #7FE8F2; }

/* ---- Layout helpers ---- */
/* Page gutters. Declared as padding-inline so that any block padding set on
   the same element (section rhythm) can never wipe out the side margins. */
.wrap, .wrap-narrow, .wrap-mid { margin: 0 auto; padding-inline: 20px; width: 100%; }
.wrap { max-width: 1200px; }
.wrap-narrow { max-width: 900px; }
.wrap-mid { max-width: 1100px; }
@media (min-width: 480px) { .wrap, .wrap-narrow, .wrap-mid { padding-inline: 28px; } }
@media (min-width: 768px) { .wrap, .wrap-narrow, .wrap-mid { padding-inline: 40px; } }

section, .site-footer { position: relative; overflow: hidden; }

/* Soft ambient glow blobs — plain CSS, no scroll-linked JS (cheap, GPU-friendly) */
.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(30px);
  pointer-events: none;
  z-index: 0;
}

/* ---- Navigation ---- */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.theme-light .site-nav { border-bottom-color: rgba(5,48,76,.08); background: rgba(255,255,255,.75); }
.theme-dark .site-nav { background: rgba(8,26,36,.6); }
.theme-deep .site-nav { background: rgba(18,48,59,.75); border-bottom-color: rgba(255,255,255,.1); }

.site-nav .brand { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.site-nav .brand img { height: 34px; width: auto; }
.site-nav .brand .tagline { display: none; font-size: 15px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }

.nav-links {
  display: none;
  gap: 28px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-links a { transition: color .2s; }
.theme-light .nav-links a { color: var(--slate); }
.theme-dark .nav-links a, .theme-deep .nav-links a { color: #93A7B0; }
.nav-links a[aria-current="page"] { color: currentColor; font-weight: 500; }
.theme-light .nav-links a[aria-current="page"] { color: var(--ink); }
.theme-dark .nav-links a[aria-current="page"], .theme-deep .nav-links a[aria-current="page"] { color: #EAF1F3; }

.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border: none;
  background: transparent;
  color: currentColor;
  cursor: pointer;
}
.nav-toggle svg { width: 24px; height: 24px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

/* Mobile menu: a standard dropdown panel anchored under the nav bar,
   not a full-screen takeover. Collapsed height keeps it out of flow. */
.mobile-menu {
  position: fixed;
  top: var(--nav-h, 68px);
  left: 0; right: 0;
  z-index: 48;
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  visibility: hidden;
  transition: grid-template-rows .25s ease, visibility .25s;
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(14px);
}
.mobile-menu.open { grid-template-rows: 1fr; visibility: visible; }
.mobile-menu > .mobile-menu-inner { min-height: 0; }
.theme-light .mobile-menu { background: rgba(245,249,250,.98); }
.theme-light .mobile-menu.open { border-bottom-color: rgba(5,48,76,.1); }
.theme-dark .mobile-menu { background: rgba(10,42,56,.98); }
.theme-deep .mobile-menu { background: rgba(18,48,59,.98); }
.theme-dark .mobile-menu.open, .theme-deep .mobile-menu.open { border-bottom-color: rgba(255,255,255,.12); }
.mobile-menu a {
  display: flex; align-items: center;
  min-height: 52px;
  padding: 0 20px;
  font-size: 17px; font-weight: 400;
  border-top: 1px solid rgba(127,127,127,.14);
}
.mobile-menu a:first-child { border-top: none; }
.mobile-menu a[aria-current="page"] { color: var(--teal); font-weight: 500; }
@media (min-width: 480px) { .mobile-menu a { padding: 0 28px; } }
@media (prefers-reduced-motion: reduce) { .mobile-menu { transition: none; } }

@media (min-width: 768px) {
  .site-nav { padding: 22px clamp(28px, 4vw, 40px); }
  .site-nav .brand img { height: 46px; }
  .mobile-menu { display: none; }
  .site-nav .brand .tagline { display: block; }
  .nav-links { display: flex; font-size: 17px; gap: 34px; }
  .nav-toggle { display: none; }
}
@media (min-width: 1080px) {
  .site-nav .brand img { height: 52px; }
  .nav-links { font-size: 18px; }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 28px;
  min-height: 48px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
  border: 1px solid transparent;
}
.btn-solid { background: var(--teal); color: #021C22; }
.btn-solid:hover { background: var(--teal-bright); }
.btn-outline-dark { border-color: rgba(223,224,225,.2); color: #EAF1F3; font-weight: 500; background: transparent; }
.btn-outline-dark:hover { color: var(--teal-bright); border-color: var(--teal-bright); }
.btn-outline-light { border-color: rgba(5,48,76,.2); color: var(--ink); font-weight: 500; background: transparent; }
.btn-outline-light:hover { color: var(--teal); border-color: var(--teal); }

/* ---- Typography scale ---- */
.eyebrow { font-size: 16px; letter-spacing: .18em; text-transform: uppercase; color: var(--teal); font-weight: 500; margin-bottom: 20px; }
.theme-deep .eyebrow { color: #7FE8F2; }
h1 { font-size: clamp(34px, 9vw, 90px); line-height: 1.03; font-weight: 600; letter-spacing: -.02em; margin-bottom: 24px; }
h2 { font-size: clamp(26px, 5vw, 52px); line-height: 1.08; font-weight: 500; letter-spacing: -.015em; margin-bottom: 24px; }
h3 { font-size: 19px; font-weight: 600; }
.lede { font-size: clamp(16px, 2vw, 21px); line-height: 1.55; font-weight: 300; max-width: 56ch; }
.theme-light .lede { color: var(--slate); }
.theme-dark .lede { color: #93A7B0; }
.theme-deep .lede { color: #B7CDD3; }
.body-text { font-size: 15px; line-height: 1.65; font-weight: 300; }
.theme-light .body-text { color: var(--slate); }
.theme-dark .body-text { color: #93A7B0; }
.theme-deep .body-text { color: #B7CDD3; }

/* ---- Reveal-on-scroll (progressive enhancement) ----
   Default state is fully visible; JS adds .js-reveal (hidden) then
   .is-visible (animated in) via IntersectionObserver. No-JS and
   prefers-reduced-motion users simply see content already in place. */
.reveal.js-reveal { opacity: 0; transform: translateY(24px); }
.reveal.js-reveal.is-visible {
  opacity: 1; transform: none;
  transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1);
}
@media (prefers-reduced-motion: reduce) {
  .reveal.js-reveal { opacity: 1; transform: none; }
}

/* ---- Hero sections ---- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  padding: 130px 0 60px;
  min-height: 60vh;
}
@media (min-width: 768px) { .hero { padding-top: 170px; padding-bottom: 80px; min-height: 70vh; } }

/* ---- Stat rows ---- */
.stat-row { display: flex; flex-wrap: wrap; gap: 28px 48px; margin-top: 48px; padding-top: 28px; border-top: 1px solid rgba(255,255,255,.1); }
.theme-light .stat-row { border-top-color: rgba(5,48,76,.08); }
.stat-value { font-size: clamp(28px, 4vw, 48px); font-weight: 500; letter-spacing: -.01em; }
.stat-label { font-size: 15px; letter-spacing: .08em; text-transform: uppercase; margin-top: 6px; font-weight: 500; }
.theme-light .stat-label { color: var(--slate-light); }
.theme-dark .stat-label { color: #5E727C; }

/* ---- Cards ---- */
.card-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }
.card {
  padding: 28px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.1);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
}
.theme-light .card { border-color: rgba(5,48,76,.1); background: linear-gradient(180deg, rgba(5,48,76,.05), rgba(5,48,76,.015)); }
.card h3 { margin-bottom: 10px; letter-spacing: -.01em; }
.card p { font-size: 17px; line-height: 1.6; font-weight: 300; }
.theme-light .card p { color: var(--slate); }
.theme-dark .card p { color: #8FA3AD; }

/* ---- Instrument teaser (Home) ---- */
.instrument {
  position: relative;
  width: min(680px, 88vw);
  aspect-ratio: 4/3;
  margin: 0 auto;
}
.instrument img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  filter: brightness(.34) saturate(.6) contrast(1.2);
  opacity: .55;
}
.cartridge-hero-img { width: 100%; max-width: 640px; }
.instrument-halo {
  position: absolute; inset: 12% 22% 16% 22%;
  border-radius: 16px;
  box-shadow: 0 0 0 3px rgba(45,212,230,.65), 0 0 26px 10px rgba(45,212,230,.55), 0 0 50px 20px rgba(0,163,180,.35);
  pointer-events: none;
}
.instrument-stripe {
  position: absolute; left: 22.5%; right: 22.7%; top: 45.97%; height: 1.87%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2DD4E6, #7FE8F2, #2DD4E6);
  animation: stripeBreathe 3.6s ease-in-out infinite;
}
@keyframes stripeBreathe { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
.led-track { position: relative; width: min(260px, 60vw); height: 7px; border-radius: 5px; background: rgba(255,255,255,.07); overflow: hidden; margin: 26px auto 0; box-shadow: inset 0 1px 3px rgba(0,0,0,.4); }
.led-dot {
  position: absolute; top: 0; left: 0; width: 26%; height: 100%; border-radius: 5px;
  background: #2DD4E6; box-shadow: 0 0 10px 2px #2DD4E6, 0 0 26px 9px rgba(0,163,180,.6);
  animation: ledSweep 3.6s ease-in-out infinite;
}
@keyframes ledSweep { 0%, 100% { left: 2%; } 50% { left: 72%; } }
@media (prefers-reduced-motion: reduce) {
  .instrument-stripe, .led-dot { animation: none; }
  .instrument-stripe { opacity: .85; }
  .led-dot { left: 26%; }
}

/* ---- Process track (Home + Technology) ---- */
.process-flow { display: flex; flex-direction: column; align-items: center; gap: 28px; }
@media (min-width: 900px) { .process-flow { flex-direction: row; justify-content: center; } }
.process-vial { width: 42px; height: 125px; border: 2px solid rgba(255,255,255,.35); border-radius: 13px 13px 21px 21px; position: relative; overflow: hidden; background: rgba(255,255,255,.03); }
.theme-light .process-vial { border-color: rgba(5,48,76,.3); }
.process-vial .fill { position: absolute; left: 0; right: 0; bottom: 0; height: 58%; background: linear-gradient(180deg, #E4C77A, #C9A24E); }
.process-track { width: min(440px, 80vw); padding-top: 22px; }
.process-track .rail { position: relative; height: 2px; background: rgba(0,163,180,.18); border-radius: 2px; margin: 0 9px; }
.process-track .rail-fill { position: absolute; left: 0; top: 0; height: 2px; background: var(--teal); border-radius: 2px; transition: width .4s ease; }
.process-nodes { display: flex; justify-content: space-between; margin-top: -6px; }
.process-node { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 20%; }
.process-node .dot { width: 13px; height: 13px; border-radius: 50%; background: #0B4869; border: 2px solid var(--teal); transition: background .3s; }
.process-node.active .dot { background: var(--teal); }
.process-node .label { font-size: 15px; font-weight: 500; color: #8FA3AD; transition: color .3s; text-align: center; }
.process-node.active .label { color: var(--teal); }
.process-advantage { min-height: 56px; font-size: 17px; line-height: 1.55; text-align: center; margin-top: 12px; }
.theme-light .process-advantage { color: var(--slate); }
.theme-dark .process-advantage { color: #B9C9CF; }
.process-rungs { display: flex; flex-direction: column; gap: 6px; align-items: center; }
@media (min-width: 900px) { .process-rungs { flex-direction: row; } }
.process-rungs .rung { display: flex; align-items: center; gap: 3px; }
.process-rungs .rung span { width: 9px; height: 9px; border-radius: 50%; display: block; }
.process-rungs .rung .bar { width: 22px; height: 2.5px; background: rgba(255,255,255,.4); }

/* ---- Team & advisors ---- */
.team-grid { display: grid; gap: 24px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 560px) { .team-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .team-grid { grid-template-columns: repeat(4, 1fr); gap: 28px; } }
.team-card figure { margin: 0 0 16px; position: relative; width: 100%; padding-top: 100%; border-radius: 16px; overflow: hidden; background: rgba(5,48,76,.04); }
.team-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.team-card .name-row { display: flex; align-items: center; gap: 8px; }
.team-card .name { font-size: 16px; font-weight: 500; letter-spacing: -.005em; }
.team-card .role { font-size: 15px; color: var(--teal); font-weight: 500; margin-top: 2px; }

.advisor-grid { display: grid; gap: 18px 28px; grid-template-columns: 1fr; margin-top: 28px; }
@media (min-width: 640px) { .advisor-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .advisor-grid { grid-template-columns: repeat(3, 1fr); } }
.advisor { padding: 18px 0; border-top: 1px solid rgba(5,48,76,.1); }
.advisor .name-row { display: flex; align-items: center; gap: 8px; }
.advisor .name { font-size: 16px; font-weight: 500; letter-spacing: -.005em; }
.advisor .role { font-size: 15px; color: var(--teal); font-weight: 500; margin-top: 2px; }
.advisor .affiliation { font-size: 16px; color: var(--slate); font-weight: 300; margin-top: 3px; }

.linkedin-link { color: var(--slate); flex-shrink: 0; transition: color .2s; display: inline-flex; min-width: 24px; min-height: 24px; align-items: center; justify-content: center; }
.theme-dark .linkedin-link, .theme-deep .linkedin-link { color: #5E727C; }
.linkedin-link:hover { color: var(--teal); }
.theme-deep .linkedin-link:hover { color: #7FE8F2; }

/* ---- Workflow list (Technology) ---- */
.workflow-item { display: flex; gap: 20px; align-items: flex-start; padding: 26px 0; border-top: 1px solid rgba(5,48,76,.1); }
.workflow-item img { width: 72px; height: 72px; object-fit: contain; flex-shrink: 0; }
.workflow-item h3 { margin-bottom: 8px; }
.workflow-item p { font-size: 17px; color: var(--slate); font-weight: 300; line-height: 1.6; }
@media (min-width: 640px) { .workflow-item img { width: 90px; height: 90px; } }

/* ---- Comparison bars (Technology) ---- */
.compare-panel { max-width: 760px; margin: 0 auto 48px; border-radius: 20px; background: linear-gradient(180deg, rgba(0,163,180,.06), rgba(0,163,180,.02)); border: 1px solid rgba(0,163,180,.35); padding: clamp(20px, 3vw, 36px); }
.compare-bar { position: relative; height: 14px; border-radius: 7px; background: rgba(5,48,76,.08); overflow: hidden; margin-bottom: 8px; }
.compare-bar .fill { position: absolute; left: 0; top: 0; height: 100%; border-radius: 7px; }
.compare-bar .threshold { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); opacity: .4; }
.compare-legend { display: flex; flex-wrap: wrap; gap: 8px; font-size: 15px; color: #5B7079; font-weight: 400; }

/* ---- Footer ---- */
.site-footer { padding: 60px 0 48px; border-top: 1px solid rgba(255,255,255,.08); }
.theme-light .site-footer { border-top-color: rgba(5,48,76,.06); }
.footer-cta { display: flex; flex-wrap: wrap; gap: 14px; margin: 24px 0 48px; }
.backed-by-label { font-size: 15px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 16px; font-weight: 500; }
.theme-dark .backed-by-label { color: #5E727C; }
.vc-row { display: flex; flex-wrap: wrap; gap: 24px 36px; align-items: center; background: #fff; border-radius: 16px; padding: 20px clamp(20px,3vw,32px); margin-bottom: 48px; }
.vc-row img { height: 32px; width: auto; max-width: 140px; object-fit: contain; }
.vc-row .plain { font-size: 15px; color: #4C6570; font-weight: 500; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; padding-top: 28px; border-top: 1px solid rgba(255,255,255,.08); font-size: 16px; font-weight: 300; }
.theme-light .footer-bottom { border-top-color: rgba(5,48,76,.08); color: var(--slate-light); }
.theme-dark .footer-bottom, .theme-deep .footer-bottom { border-top-color: rgba(255,255,255,.08); color: #5E727C; }
.theme-deep .footer-bottom { color: #B7CDD3; }
.footer-bottom .logo { height: 44px; width: auto; }
.footer-contact { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
@media (min-width: 640px) {
  .vc-row img { height: 40px; }
  .footer-bottom .logo { height: 52px; }
}

/* ---- News page ---- */
.year-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 36px; }
.year-btn {
  padding: 8px 18px; min-height: 40px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25);
  background: transparent; color: #B7CDD3; font-size: 16px; font-weight: 500; cursor: pointer;
  font-family: 'Jost', sans-serif; transition: all .2s;
}
.year-btn.active, .year-btn[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: #021C22; }
.news-item { display: flex; flex-wrap: wrap; gap: 20px; padding: 28px 0; border-top: 1px solid rgba(255,255,255,.12); }
.news-item .date { font-family: 'IBM Plex Mono', monospace; font-size: 15px; color: #B7CDD3; margin-bottom: 10px; }
.news-item .thumb { width: 130px; flex-shrink: 0; }
.news-item img { width: 130px; height: 92px; object-fit: cover; border-radius: 12px; box-shadow: 0 10px 24px rgba(0,0,0,.3); }
.news-item .content { flex: 1; min-width: 220px; }
.news-item .headline { font-size: 19px; font-weight: 500; letter-spacing: -.01em; line-height: 1.3; margin-bottom: 8px; }
.news-item .read-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 16px; font-weight: 500; color: #7FE8F2; min-height: 32px; }
@media (min-width: 640px) { .news-item .thumb, .news-item img { width: 150px; } .news-item img { height: 104px; } }

/* Skip link for keyboard users */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--teal); color: #021C22; padding: 12px 20px; font-weight: 600;
}
.skip-link:focus { left: 12px; top: 12px; }

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