/*!
 * Bactiq v1 · styles
 * Author: Ifedayo Adeyefa
 * Layout: one stage (headline, live 3D match, two readouts) above a black footer that holds the waitlist.
 */
:root {
  --mist: #E6E6EE; --mist-hi: #F7F7FB; --mist-lo: #D0D0DC;
  --ink: #111116; --ink-2: #585868; --line: rgba(17,17,22,.11);
  --night: #000; --night-2: #9C9CAD; --night-line: rgba(255,255,255,.15);
  --indigo: #3B3FD8; --indigo-lt: #9497FF;
  --resist: #D93D42; --suscept: #0E9F86;
  --display: "Noto Sans Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --body: "Onest", "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --latin: "Noto Sans", "Onest", system-ui, sans-serif;
  --tap: 34px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body { background: var(--night); color: var(--ink); font: 16px/1.4 var(--body); -webkit-font-smoothing: antialiased; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }

/* ---------- hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column;
  min-height: max(720px, min(100svh, 1000px));
  background: radial-gradient(120% 92% at 50% 40%, var(--mist-hi) 0%, var(--mist) 48%, var(--mist-lo) 100%);
}
#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
#leaders { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
#leaders path { fill: none; stroke: var(--ink); stroke-opacity: .32; }
#leaders circle { fill: var(--mist-hi); stroke: var(--ink); stroke-opacity: .55; }

.nav { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px clamp(16px, 3vw, 32px); }
.brand { display: inline-flex; color: var(--ink); --logo-dot: var(--indigo); border-radius: 6px; }
.logo { display: block; height: 28px; width: auto; aspect-ratio: 4986 / 1050; }
.nav-right { display: flex; align-items: center; gap: 8px; }
.lang { position: relative; display: inline-flex; align-items: center; }
.lang svg { position: absolute; left: 10px; width: 14px; height: 14px; pointer-events: none; }
.lang select {
  appearance: none; -webkit-appearance: none; height: var(--tap); padding: 0 28px 0 30px;
  border: 1px solid var(--line); border-radius: 8px; color: var(--ink); font: inherit; font-size: 13.5px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23111116' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 11px center;
}
.lang select:hover { border-color: rgba(17,17,22,.25); }
.btn-dark {
  display: inline-flex; align-items: center; justify-content: center; height: var(--tap); padding: 0 14px;
  border: 0; border-radius: 8px; background: var(--ink); color: #fff; font-size: 13.5px; font-weight: 500;
  white-space: nowrap; text-decoration: none; cursor: pointer;
}
.btn-dark:hover { background: #2a2a35; }

.hero-copy { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: clamp(4px, 2.4vh, 28px) 16px clamp(8px, 2vh, 24px); text-align: center; }
/* Headline stays on one line: font-size = min(64px, (100vw − 32px) / w), w = headline width in em.
   A mono glyph with −.04em tracking is ≈ .56em, so w ≈ .56 × characters (+ a small margin). */
.hero h1 { --w: 15.4; margin: 0; font: 380 min(64px, calc((100vw - 32px) / var(--w)))/1.1 var(--display); letter-spacing: -.04em; white-space: nowrap; }
:lang(ig) .hero h1 { --w: 10.4; }
:lang(ha) .hero h1, :lang(yo) .hero h1 { --w: 16.6; }
.sub { margin: 0; max-width: 56ch; color: var(--ink-2); font-size: clamp(15px, 1.15vw, 17px); line-height: 1.5; text-wrap: pretty; }
.cta { height: 46px; padding: 0 22px; border-radius: 10px; font-size: 15px; margin-top: 4px; }

/* the 3D rig is framed into this box; the still shows until WebGL draws, and stays if it can't */
.stage-box { position: relative; z-index: 0; flex: 1 1 auto; min-height: 300px; pointer-events: none; }
.stage-box::before { content: ""; position: absolute; inset: 2% 4% 4%; background: url("still.webp") center / contain no-repeat; transition: opacity .5s; }
.gl-live .stage-box::before { opacity: 0; }
.play {
  position: absolute; left: 50%; bottom: 44px; transform: translateX(-50%); pointer-events: auto;
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 14px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font-size: 13.5px; cursor: pointer;
}
.play:hover { border-color: rgba(17,17,22,.3); }
.play[hidden] { display: none; }

/* readouts */
.hud-row { position: absolute; z-index: 2; left: clamp(16px, 4.5vw, 64px); right: clamp(16px, 4.5vw, 64px); bottom: 56px; display: flex; justify-content: space-between; align-items: flex-end; pointer-events: none; }
.hud {
  width: 236px; padding: 14px 16px 13px; border: 1px solid rgba(255,255,255,.75); border-radius: 12px;
  background: rgba(255,255,255,.52); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 1px 0 rgba(17,17,22,.04), 0 18px 40px -24px rgba(30,30,70,.35);
  font-size: 12.5px; line-height: 1.35; font-variant-numeric: tabular-nums;
}
.hud-k { margin: 0 0 10px; color: var(--ink-2); font-size: 11.5px; transition: color .25s; }
.hud-k.model { color: var(--indigo); font-weight: 600; }
.drugs { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.drugs li { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--ink-2); transition: color .2s; }
.drugs li[data-s="testing"] { color: var(--ink); }
.drugs li[data-s="R"] .dn { text-decoration: line-through; text-decoration-color: rgba(217,61,66,.55); }
.drugs li[data-s="S"] { color: var(--ink); font-weight: 600; }
.badge { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid var(--line); border-radius: 5px; color: transparent; font-size: 11px; font-weight: 700; transition: background-color .2s, border-color .2s; }
.drugs li[data-s="testing"] .badge { border-color: var(--indigo); animation: pulse .9s ease-in-out infinite; }
.drugs li[data-s="R"] .badge { background: var(--resist); border-color: var(--resist); color: #fff; }
.drugs li[data-s="S"] .badge { background: var(--suscept); border-color: var(--suscept); color: #fff; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(59,63,216,.16); } }
.status { min-height: 2.75em; margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line); }
.status.scan { color: var(--indigo); font-weight: 500; }
.status.match { color: var(--suscept); font-weight: 600; }
.legend { display: flex; gap: 14px; margin: 8px 0 0; color: var(--ink-2); font-size: 11px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend b { display: grid; place-items: center; width: 14px; height: 14px; border-radius: 4px; color: #fff; font-size: 9px; }
.legend .r { background: var(--resist); }
.legend .s { background: var(--suscept); }
.org { min-height: 1.35em; margin: 0; font: italic 500 16px var(--latin); letter-spacing: -.01em; }
.org .rom { font-style: normal; }
.illness { margin: 2px 0 0; color: var(--ink-2); font-size: 11.5px; }
.tag { display: inline-block; min-height: 18px; margin-top: 7px; padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); font-size: 11px; }
.grids { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.mini { display: grid; grid-template-columns: repeat(3, 15px); gap: 3px; }
.mini i { position: relative; width: 15px; height: 15px; border-radius: 3.5px; background: rgba(17,17,22,.08); transition: background-color .25s, opacity .25s; }
.mini i.unk { background: rgba(17,17,22,.14); }
.mini i.unk::after { content: "?"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-2); font: 600 9px/1 var(--display); }
.mini.model i { opacity: .38; }
.mini.model i.ok { opacity: 1; }
.mini.model i.ok::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #fff; }
.eq { width: 12px; color: var(--ink-2); font: 15px var(--display); text-align: center; }
.fit { display: flex; align-items: baseline; gap: 8px; margin: 12px 0 0; color: var(--ink-2); }
.fit b { color: var(--ink); font: 400 22px var(--display); letter-spacing: -.04em; }
.cmp { min-height: 1.35em; margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--line); color: var(--ink-2); font: 11px var(--display); letter-spacing: -.02em; transition: color .25s; }
.cmp.full { color: var(--indigo); font-weight: 500; }
.note { position: absolute; z-index: 2; left: 50%; bottom: 18px; transform: translateX(-50%); margin: 0; color: var(--ink-2); font-size: 11.5px; white-space: nowrap; }
.no-gl .hud-row, .no-gl #leaders { display: none; }

/* ---------- footer ---------- */
.foot { padding: clamp(64px, 8vw, 104px) clamp(16px, 4vw, 48px) 28px; background: var(--night); color: #fff; }
.foot-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.4fr); gap: clamp(44px, 7vw, 112px); max-width: 1180px; margin: 0 auto; }
.brand-col .brand { color: #fff; --logo-dot: var(--indigo-lt); }
.brand-col .logo { height: 30px; }
.tagline { margin: 30px 0 14px; font: 380 clamp(22px, 2.1vw, 28px)/1.15 var(--display); letter-spacing: -.035em; }
.small { max-width: 34ch; margin: 0; color: var(--night-2); font-size: 14px; line-height: 1.5; }
.wl h2 { margin: 0 0 12px; font: 380 clamp(20px, 2.15vw, 31px)/1.15 var(--display); letter-spacing: -.04em; white-space: nowrap; }
@media (max-width: 560px) { .wl h2 { white-space: normal; } }
.wl .lede { max-width: 52ch; margin: 0 0 28px; color: var(--night-2); line-height: 1.55; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field label { color: var(--night-2); font-size: 12.5px; }
.in {
  width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--night-line); border-radius: 9px;
  background: rgba(255,255,255,.035); color: #fff; font: inherit; font-size: 15px; transition: border-color .15s, background-color .15s;
}
.in::placeholder { color: rgba(255,255,255,.32); }
.in:hover { border-color: rgba(255,255,255,.32); }
.in:focus-visible { outline: 2px solid var(--indigo-lt); outline-offset: 2px; border-color: rgba(255,255,255,.5); background: rgba(255,255,255,.06); }
select.in {
  appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background: rgba(255,255,255,.035) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23ffffff' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 15px center;
}
select.in:invalid { color: rgba(255,255,255,.4); }
select.in option { background: #111; color: #fff; }
.submit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-top: 22px; }
.btn-light { height: 46px; padding: 0 22px; border: 0; border-radius: 9px; background: #fff; color: #000; font-size: 15px; font-weight: 600; cursor: pointer; }
.btn-light:hover { background: #E4E4EE; }
.btn-light:focus-visible { outline-color: var(--indigo-lt); }
.btn-light[disabled], .btn-dark[disabled] { opacity: .6; cursor: progress; }
.form-status { min-height: 1.4em; margin: 16px 0 0; font-size: 14px; }
.form-status[data-kind="ok"] { color: #62E3C4; }
.form-status[data-kind="err"] { color: #FF8E91; }
.form-status[data-kind="warn"] { color: #F3C66E; }
.foot-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; max-width: 1180px; margin: clamp(64px, 8vw, 96px) auto 0; padding-top: 20px; border-top: 1px solid var(--night-line); color: var(--night-2); font-size: 13px; }
.linkish { padding: 0; border: 0; background: none; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkish:hover { color: #fff; }
.linkish:focus-visible { outline-color: var(--indigo-lt); }

/* ---------- contact dialog ---------- */
dialog.contact { width: min(500px, calc(100vw - 32px)); max-height: calc(100svh - 32px); padding: 0; border: 0; border-radius: 16px; background: var(--mist-hi); color: var(--ink); box-shadow: 0 40px 90px -24px rgba(20,20,60,.5); }
dialog.contact::backdrop { background: rgba(10,10,24,.42); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.dlg { position: relative; display: flex; flex-direction: column; gap: 16px; padding: 28px; }
.dlg h2 { margin: 0; padding-right: 44px; font: 400 26px var(--display); letter-spacing: -.04em; }
.dlg .lede { margin: -6px 0 4px; color: var(--ink-2); font-size: 14.5px; line-height: 1.5; }
.dlg .field label { color: var(--ink-2); }
.dlg .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.in-l { width: 100%; height: 44px; padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font: inherit; font-size: 15px; }
.in-l:hover { border-color: rgba(17,17,22,.25); }
textarea.in-l { height: auto; min-height: 120px; padding: 11px 13px; line-height: 1.45; resize: vertical; }
.dlg .btn-dark { align-self: flex-start; height: 44px; padding: 0 20px; font-size: 15px; }
.dlg .form-status[data-kind="ok"] { color: var(--suscept); }
.dlg .form-status[data-kind="err"] { color: var(--resist); }
.dlg .form-status[data-kind="warn"] { color: #9A6400; }
.x { position: absolute; top: 16px; right: 16px; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); cursor: pointer; }
.x:hover { border-color: rgba(17,17,22,.3); }

/* ---------- motion (only with .js-motion: set in <head> unless reduced motion is on) ---------- */
:root { --ease-out: cubic-bezier(.16, 1, .3, 1); --ease-io: cubic-bezier(.65, 0, .35, 1); }
@keyframes m-up { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } }
@keyframes m-down { from { opacity: 0; transform: translateY(-12px); } }
@keyframes m-fade { from { opacity: 0; } }
@keyframes m-show { to { opacity: 1; } }

/* words rise out of a mask; the mask is padded so accents and descenders aren't clipped */
.w { display: inline-block; overflow: hidden; vertical-align: bottom; padding: .14em .02em .12em; margin: -.14em -.02em -.12em; }
.wi { display: inline-block; will-change: transform; }
.js-motion .is-split .wi { transform: translateY(110%) rotate(2deg); filter: blur(4px); opacity: 0;
  transition: transform 1.1s var(--ease-out), filter .9s var(--ease-out), opacity .6s ease;
  transition-delay: calc(var(--d0, 0s) + var(--i) * 70ms); }
.js-motion .is-split.is-in .wi { transform: none; filter: none; opacity: 1; }
.js-motion .hero h1 { --d0: .25s; }
.js-motion .hero h1.quick { --d0: 0s; }
.js-motion .hero h1:not(.is-split) { opacity: 0; animation: m-show .4s 1.2s forwards; }   /* fallback if motion.js never runs */

/* hero entrance */
.js-motion .nav > * { animation: m-down .9s var(--ease-out) .1s backwards; }
.js-motion .nav-right { animation-delay: .2s; }
.js-motion .hero .sub { animation: m-up 1s var(--ease-out) .75s backwards; }
.js-motion .cta { animation: m-up 1s var(--ease-out) .9s backwards; }
.js-motion .hud-row .hud { animation: m-up 1.1s var(--ease-out) 1.5s backwards; }
.js-motion .hud-row .hud + .hud { animation-delay: 1.65s; }
.js-motion #leaders { animation: m-fade 1.2s ease 2s backwards; }
.js-motion #stage { clip-path: circle(0% at 50% 62%); transition: clip-path 1.8s var(--ease-io); }
.js-motion .gl-live #stage { clip-path: circle(120% at 50% 62%); }
.js-motion .hero .note { animation: m-fade 1.2s ease 1.4s backwards; }


/* scroll reveals (data-reveal is added by motion.js) */
.js-motion [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .9s ease, transform 1.1s var(--ease-out); transition-delay: calc(var(--r, 0) * 90ms); }
.js-motion [data-reveal].is-in { opacity: 1; transform: none; }

/* small hover motion on the primary buttons */
.btn-dark, .btn-light { transition: background-color .2s, transform .35s var(--ease-out); }
.js-motion .cta:hover, .js-motion .btn-light:hover { transform: translateY(-2px); }

/* ---------- phones and small tablets ---------- */
@media (max-width: 820px) {
  :root { --tap: 40px; }
  .hero { min-height: 100svh; }
  .nav { padding: 12px 16px; }
  .logo { height: 24px; }
  .hero-copy { gap: 12px; padding-top: 8px; }
  .stage-box { min-height: 280px; }
  .play { bottom: 10px; }
  .hud-row { position: relative; left: auto; right: auto; bottom: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: stretch; padding: 0 12px 48px; }
  .hud { width: auto; padding: 12px 12px 11px; font-size: 12px; }
  .legend { display: none; }
  .grids { gap: 6px; }
  .mini { grid-template-columns: repeat(3, 12px); gap: 2px; }
  .mini i { width: 12px; height: 12px; border-radius: 3px; }
  .mini.model i.ok::after { inset: 4px; }
  .org { font-size: 14px; }
  #leaders { display: none; }
  .note { bottom: 16px; }
  /* 16px stops iOS zooming into fields on focus */
  .in, .in-l { font-size: 16px; }
}
@media (max-width: 760px) {
  .foot-grid, .fields, .dlg .row2 { grid-template-columns: 1fr; }
  .dlg { padding: 24px 20px; }
  .btn-light { width: 100%; }
}
@media (max-width: 380px) {
  .lang select { padding-right: 22px; font-size: 13px; }
  .btn-dark { padding: 0 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .drugs li[data-s="testing"] .badge { animation: none; }
}
