/* ==============================================================
   Q.bio — Marketing site primitives
   Sits on top of tokens.css. Adds a marketing-scale type system,
   a shared topbar/footer, and motion utilities.
   ============================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300;9..144,400;9..144,500&display=swap');

:root {
  /* Marketing display scale (above portal's 22px max) */
  --d-1: clamp(48px, 7.2vw, 104px);   /* hero */
  --d-2: clamp(36px, 4.8vw, 64px);    /* section */
  --d-3: clamp(28px, 3.2vw, 44px);    /* sub-section */
  --d-4: clamp(22px, 2.0vw, 28px);    /* card title */

  --ink-1: #07203F;                   /* deep navy ink, marketing only */
  --ink-2: #052B5E;
  --warm-1: #F6F2EC;                  /* warm cream surface */
  --warm-2: #EFE9DF;
  --grid-line: rgba(7, 32, 63, 0.06);

  --max: 1280px;
  --pad: clamp(20px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: clip; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg-0);
  color: var(--fg-1);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 15px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ===== Type ===== */
.display, h1.display, h2.display {
  font-family: var(--font-display);
  color: var(--ink-1);
  letter-spacing: -0.025em;
  font-weight: 500;
  line-height: 1.02;
}
.display.serif {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-feature-settings: 'ss01', 'ss02';
  letter-spacing: -0.015em;
  line-height: 1.05;
}
.eyebrow {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--fg-2);
}
.eyebrow .blue { color: var(--q-blue); }

.lede {
  font-size: clamp(16px, 1.3vw, 19px);
  line-height: 1.55;
  color: var(--fg-3);
  max-width: 56ch;
  font-weight: 400;
}

/* ===== Buttons ===== */
.q-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  border-radius: var(--r-pill);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
  letter-spacing: -0.005em;
}
.q-btn.primary { background: var(--ink-1); color: #fff; }
.q-btn.primary:hover { background: #000; }
.q-btn.ghost { background: transparent; color: var(--ink-1); }
.q-btn.ghost:hover { background: rgba(7,32,63,0.06); }
.q-btn.outline { background: transparent; color: var(--ink-1); border-color: rgba(7,32,63,0.15); }
.q-btn.outline:hover { border-color: var(--ink-1); }
.q-btn.blue { background: var(--q-blue); color: #fff; }
.q-btn.blue:hover { background: var(--q-blue-hover); }
.q-btn.sm { height: 36px; padding: 0 14px; font-size: 13px; }
.q-btn.lg { height: 52px; padding: 0 28px; font-size: 15px; }
.q-btn .arr {
  width: 16px; height: 16px;
  transition: transform .2s ease;
}
.q-btn:hover .arr { transform: translateX(3px); }

/* ===== Topbar =====
   Default state = the "sticky" frosted-glass look used on every non-landing
   page from first paint, and on the landing page after scrolling past the hero.
   The "transparent over hero" state is the override below, scoped to
   body.has-hero-overlay .q-top:not(.scrolled).
   All token-driven colors are CSS variables so the per-page inline <style>
   blocks (.q-actions .ghost, .q-menu-btn) automatically pick the right state
   without needing per-page edits. */
.q-top {
  --topbar-bg: rgba(255,255,255,0.82);
  --topbar-border: rgba(7,32,63,0.08);
  --topbar-shadow: 0 6px 24px -16px rgba(7,32,63,0.18);
  --topbar-blur: saturate(160%) blur(14px);
  --topbar-ink: var(--ink-1);
  --topbar-ink-soft: var(--fg-3);
  --topbar-wordmark: var(--ink-1);
  --topbar-text-shadow: none;
  --topbar-action-ink: var(--ink-1);
  --topbar-action-hover-bg: rgba(7,32,63,0.05);
  --topbar-action-hover-ink: var(--ink-1);
  --topbar-menu-border: rgba(7,32,63,0.12);
  --topbar-menu-bg: #fff;
  --topbar-menu-ink: var(--ink-1);
  --topbar-primary-bg: var(--ink-1);
  --topbar-primary-ink: #fff;

  position: sticky; top: 0; z-index: 50;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  box-shadow: var(--topbar-shadow);
  backdrop-filter: var(--topbar-blur);
  -webkit-backdrop-filter: var(--topbar-blur);
  transition: background .25s ease, border-color .25s ease, box-shadow .25s ease, backdrop-filter .25s ease;
}

/* Transparent state — landing page only, only while still above the hero.
   Text colors locked at full white with a heavier shadow so legibility holds
   across both dark and bright video frames. */
body.has-hero-overlay .q-top {
  /* Lift the topbar out of flow so the hero can extend up under it. */
  position: fixed;
  top: 0; left: 0; right: 0;
}
body.has-hero-overlay .q-top:not(.scrolled) {
  --topbar-bg: transparent;
  --topbar-border: transparent;
  --topbar-shadow: none;
  --topbar-blur: none;
  --topbar-ink: #fff;
  --topbar-ink-soft: #fff;
  --topbar-wordmark: #fff;
  --topbar-text-shadow: 0 1px 2px rgba(0,0,0,0.5), 0 0 18px rgba(0,0,0,0.35);
  --topbar-action-ink: #fff;
  --topbar-action-hover-bg: rgba(255,255,255,0.14);
  --topbar-action-hover-ink: #fff;
  --topbar-menu-border: rgba(255,255,255,0.32);
  --topbar-menu-bg: transparent;
  --topbar-menu-ink: #fff;
  --topbar-primary-bg: #fff;
  --topbar-primary-ink: var(--ink-1);
}

/* Token consumers — apply state-driven colors everywhere. Scoped under .q-top
   so they win against per-page inline <style> rules without page edits. */
.q-top .q-brand .wm { background-color: var(--topbar-wordmark); }
.q-top .q-nav a {
  color: var(--topbar-ink-soft);
  text-shadow: var(--topbar-text-shadow);
}
.q-top .q-nav a:hover {
  color: var(--topbar-action-hover-ink);
  background: var(--topbar-action-hover-bg);
}
.q-top .q-nav a.active { color: var(--topbar-ink); }
.q-top .q-actions .signin { color: var(--topbar-ink-soft); }
.q-top .q-actions .signin:hover { color: var(--topbar-action-hover-ink); }
.q-top .q-actions .ghost {
  color: var(--topbar-action-ink);
  text-shadow: var(--topbar-text-shadow);
}
.q-top .q-actions .ghost:hover {
  background: var(--topbar-action-hover-bg);
  color: var(--topbar-action-hover-ink);
}
.q-top .q-menu-btn {
  background: var(--topbar-menu-bg);
  border-color: var(--topbar-menu-border);
  color: var(--topbar-menu-ink);
}
.q-top .q-actions .q-btn.primary {
  background: var(--topbar-primary-bg) !important;
  color: var(--topbar-primary-ink) !important;
  border-color: var(--topbar-primary-bg) !important;
}
.q-top .q-actions .q-btn.primary:hover {
  background: var(--topbar-primary-bg) !important;
  filter: brightness(0.94);
}
.q-top-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px var(--pad);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
}
.q-brand { display: inline-flex; align-items: center; gap: 10px; }
.q-brand .chip { display: none; }
.q-brand .wm {
  display: inline-block;
  width: 64px;
  height: 30px;
  -webkit-mask: url('../assets/logos/qbio-wordmark-white.png') no-repeat center / contain;
          mask: url('../assets/logos/qbio-wordmark-white.png') no-repeat center / contain;
  background-color: #fff;
  color: transparent;
  font-size: 0;
  overflow: hidden;
  text-indent: -9999px;
  white-space: nowrap;
  transition: background-color .25s ease;
}
.q-brand .wm .dot { display: none; }
.q-nav {
  display: flex; gap: 4px; justify-self: center;
}
.q-nav a {
  padding: 10px 14px;
  font-size: 13.5px;
  white-space: nowrap;
  font-weight: 500;
  color: rgba(255,255,255,0.78);
  border-radius: var(--r-md);
  transition: color .15s ease, background .15s ease;
}
.q-nav a:hover { color: #fff; background: rgba(255,255,255,0.08); }
.q-nav a.active {
  color: #fff;
  position: relative;
}
.q-nav a.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 14px;
  height: 1.5px;
  background: var(--q-blue);
  border-radius: 1px;
  transform: translateX(-50%);
}
.q-actions { display: inline-flex; align-items: center; gap: 8px; }
.q-actions .signin {
  font-size: 13.5px; font-weight: 500; color: rgba(255,255,255,0.78);
  padding: 10px 12px; border-radius: var(--r-md);
}
.q-actions .signin:hover { color: #fff; }

/* ===== Footer ===== */
.q-foot {
  border-top: 1px solid rgba(7,32,63,0.06);
  padding: 64px var(--pad) 40px;
  background: var(--bg-0);
  margin-top: 40px;
}
.q-foot-inner {
  max-width: var(--max); margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
  gap: 40px;
}
.q-foot h5 {
  font-size: 11px; font-weight: 500; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--fg-2);
  margin: 0 0 16px;
}
.q-foot ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.q-foot ul a {
  font-size: 13px; color: var(--fg-1);
  transition: color .15s ease;
}
.q-foot ul a:hover { color: var(--q-blue); }
.q-foot .sub {
  font-size: 12px; color: var(--fg-3); margin-top: 12px; line-height: 1.6;
}
.q-foot .legal {
  max-width: var(--max); margin: 48px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(7,32,63,0.06);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--fg-3); flex-wrap: wrap; gap: 12px;
}

/* ===== Section / Layout ===== */
.q-section {
  padding: clamp(64px, 9vw, 128px) var(--pad);
}
.q-wrap {
  max-width: var(--max);
  margin: 0 auto;
}
.q-container { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }

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

@media (max-width: 880px) {
  .q-grid-2, .q-grid-3, .q-grid-4 { grid-template-columns: 1fr; }
  .q-nav { display: none; }
  .q-foot-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .q-foot-inner { grid-template-columns: 1fr; gap: 28px; }
  .q-foot .legal { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ===== Motion ===== */
.fade-up {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .8s ease, transform .8s ease;
}
.fade-up.in {
  opacity: 1;
  transform: translateY(0);
}
.fade-up.delay-1 { transition-delay: 0.08s; }
.fade-up.delay-2 { transition-delay: 0.16s; }
.fade-up.delay-3 { transition-delay: 0.24s; }
.fade-up.delay-4 { transition-delay: 0.32s; }
.fade-up.delay-5 { transition-delay: 0.40s; }

@media (prefers-reduced-motion: reduce) {
  .fade-up { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ===== Marquee strip ===== */
.q-marquee {
  display: flex; gap: 56px;
  align-items: center;
  white-space: nowrap;
  font-size: 13.5px;
  color: var(--fg-3);
}

/* ===== Reveal-on-hover utility for body system map etc. ===== */
.q-reveal-target { transition: opacity .3s ease, transform .3s ease; }

/* ===== Tag / pill (marketing) ===== */
.q-tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  font-size: 12px; font-weight: 500;
  border-radius: var(--r-pill);
  background: rgba(15,117,255,0.08);
  color: var(--q-blue);
}
.q-tag.warm { background: var(--warm-1); color: var(--ink-1); }
.q-tag.dot::before {
  content: ""; width: 6px; height: 6px;
  border-radius: 50%; background: currentColor;
}

/* ===== Topbar mobile ===== */
@media (max-width: 600px) {
  .q-top-inner { grid-template-columns: auto 1fr; gap: 12px; }
  .q-actions .signin { display: none; }
}
/* End of topbar — older overrides removed, all handled by .q-top tokens above. */

/* Mobile tap-target accessibility — bump topbar primary CTA to closer to 44px */
@media (max-width: 600px) {
  .q-top .q-actions .q-btn.sm { height: 40px; padding: 0 16px; font-size: 13.5px; }
}


/* ===== Hairline divider ===== */
.q-hr { border: 0; border-top: 1px solid rgba(7,32,63,0.08); margin: 0; }


/* End of file — topbar styles tokenized at the top. */

/* Footer logo — render in black (mask-fill) */
.q-foot .q-brand .wm { background-color: #000; }
