/* =====================================================================
   PathLab Pro — shared design system for the public site.
   Dark-first, glass + real 3D depth. No frameworks, no CDN scripts:
   every effect below is CSS or hand-rolled JS, so the only third-party
   host the site touches stays the Google Fonts pair already disclosed
   in privacy.html section 9.
   ===================================================================== */

:root {
    /* --- Base surfaces: deep clinical navy, not pure black (pure black
       crushes the glass blur and reads harsher on OLED phones). --- */
    --bg:            #05080F;
    --bg-2:          #080D18;
    --surface:       #0C1322;
    --surface-2:     #111A2C;

    /* --- Brand. Cyan reads "diagnostic/clinical", emerald reads
       "result verified", indigo carries over from the previous site so
       the app icon and the Play badge still look at home. --- */
    --cyan:          #22D3EE;
    --cyan-deep:     #0891B2;
    --emerald:       #34D399;
    --emerald-deep:  #059669;
    --indigo:        #6366F1;
    --violet:        #A78BFA;

    /* --- Text. Checked against --bg: ink 16.4:1, muted 7.6:1, faint
       4.7:1 — all above the 4.5:1 body minimum. --- */
    --ink:           #EAF2FB;
    --ink-muted:     #9DB2CC;
    --ink-faint:     #7C93B0;

    --line:          rgba(148, 190, 230, 0.14);
    --line-strong:   rgba(148, 190, 230, 0.28);

    --glass:         rgba(18, 28, 46, 0.55);
    --glass-2:       rgba(24, 36, 58, 0.72);
    --glass-brd:     rgba(180, 214, 245, 0.16);

    --grad-brand:    linear-gradient(135deg, var(--cyan) 0%, var(--emerald) 100%);
    --grad-ind:      linear-gradient(135deg, var(--indigo) 0%, var(--cyan) 100%);
    --grad-ink:      linear-gradient(180deg, #FFFFFF 0%, #B7CBE4 100%);

    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: 0 12px 32px -12px rgba(0, 0, 0, .65);
    --shadow-3: 0 32px 70px -24px rgba(0, 0, 0, .8);
    --glow-cyan: 0 0 0 1px rgba(34, 211, 238, .25), 0 18px 60px -18px rgba(34, 211, 238, .45);

    --r-sm: 10px;
    --r-md: 16px;
    --r-lg: 24px;
    --r-xl: 34px;

    /* Marketing page, so the spacing scale is roomy (density dial 4/10). */
    --sp-1: 8px;  --sp-2: 12px; --sp-3: 16px; --sp-4: 24px;
    --sp-5: 32px; --sp-6: 48px; --sp-7: 64px; --sp-8: 96px; --sp-9: 128px;

    --ease-out:  cubic-bezier(.16, 1, .3, 1);
    --ease-soft: cubic-bezier(.4, 0, .2, 1);
    --t-fast: 160ms;
    --t-mid:  320ms;
    --t-slow: 640ms;

    --nav-h: 68px;
    --maxw: 1200px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    /* 16px floor: anything smaller fails the body-text rule. */
    font-size: 16px;
    line-height: 1.65;
    color: var(--ink);
    background: var(--bg);
    overflow-x: hidden;
    /* Isolate the fixed 3D layers from the document flow so a tilted
       card can never widen the page and create a sideways scroll. */
    position: relative;
}

h1, h2, h3, h4, h5 {
    font-family: 'Outfit', system-ui, sans-serif;
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.02em;
}

/* Fluid type: no fixed px headline sizes, so 375px never overflows. */
h1 { font-size: clamp(2.25rem, 6.2vw, 4.35rem); }
h2 { font-size: clamp(1.75rem, 3.9vw, 2.85rem); }
h3 { font-size: clamp(1.12rem, 1.7vw, 1.4rem); }
h4 { font-size: 1.06rem; }

p  { color: var(--ink-muted); }

a { color: inherit; text-decoration: none; transition: color var(--t-fast) var(--ease-soft); }
a:hover { color: var(--cyan); }

img, svg, canvas { display: block; max-width: 100%; }
ul { list-style: none; }

/* Focus is never removed — only replaced with something visible on dark. */
:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
    border-radius: 6px;
}

::selection { background: rgba(34, 211, 238, .3); color: #fff; }

.skip-link {
    position: absolute; left: 50%; top: 8px; transform: translateX(-50%) translateY(-160%);
    background: var(--cyan-deep); color: #fff; padding: 10px 18px; border-radius: var(--r-sm);
    z-index: 2000; font-weight: 600; transition: transform var(--t-fast) var(--ease-out);
}
.skip-link:focus { transform: translateX(-50%) translateY(0); color: #fff; }

/* ------------------------------------------------------------------ */
/* Layout                                                              */
/* ------------------------------------------------------------------ */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--sp-4); }
.section { position: relative; padding: var(--sp-8) 0; }
.section--tight { padding: var(--sp-7) 0; }

.eyebrow {
    display: inline-flex; align-items: center; gap: var(--sp-1);
    font-size: .8125rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
    color: var(--cyan);
    padding: 7px 14px; border-radius: 100px;
    background: rgba(34, 211, 238, .09);
    border: 1px solid rgba(34, 211, 238, .22);
}
.eyebrow svg { width: 14px; height: 14px; fill: none; stroke: currentColor;
    stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.sec-head { max-width: 720px; margin: 0 auto var(--sp-7); text-align: center; }
.sec-head .eyebrow { margin-bottom: var(--sp-3); }
.sec-head h2 { margin-bottom: var(--sp-3); }
.sec-head h2 .grad {
    background: var(--grad-brand);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sec-head p { font-size: 1.06rem; }

.lead { font-size: clamp(1.02rem, 1.5vw, 1.22rem); color: var(--ink-muted); }
.mono { font-family: ui-monospace, 'SFMono-Regular', 'Cascadia Mono', Consolas, monospace; }

/* ------------------------------------------------------------------ */
/* Ambient background: fixed aurora blobs + WebGL canvas + grid.       */
/* All three sit behind content and never receive pointer events.      */
/* ------------------------------------------------------------------ */
.bg-layer {
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    overflow: hidden;
}
#gl-bg { width: 100%; height: 100%; opacity: .85; }

/* Fallback (and base tint under the canvas) if WebGL is unavailable. */
.bg-layer::before {
    content: ''; position: absolute; inset: -20%;
    background:
        radial-gradient(38% 42% at 18% 12%, rgba(99, 102, 241, .28), transparent 70%),
        radial-gradient(34% 38% at 84% 22%, rgba(34, 211, 238, .22), transparent 72%),
        radial-gradient(44% 40% at 62% 86%, rgba(5, 150, 105, .18), transparent 74%);
    filter: blur(10px);
}
.bg-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(148, 190, 230, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 190, 230, .055) 1px, transparent 1px);
    background-size: 64px 64px;
    /* Fade the grid out toward the edges so it reads as depth, not wallpaper. */
    mask-image: radial-gradient(70% 60% at 50% 30%, #000 20%, transparent 100%);
    -webkit-mask-image: radial-gradient(70% 60% at 50% 30%, #000 20%, transparent 100%);
}

/* ------------------------------------------------------------------ */
/* Navigation                                                          */
/* ------------------------------------------------------------------ */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 900;
    height: var(--nav-h);
    display: flex; align-items: center;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: background var(--t-mid) var(--ease-soft),
                border-color var(--t-mid) var(--ease-soft),
                backdrop-filter var(--t-mid) var(--ease-soft);
}
.nav.is-stuck {
    background: rgba(6, 11, 20, .72);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
    border-bottom-color: var(--line);
}
.nav-inner {
    width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--sp-4);
    display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 1.18rem; letter-spacing: -.02em; }
.brand img { width: 32px; height: 32px; border-radius: 9px; box-shadow: var(--shadow-1); }
.brand span { color: var(--ink); }
.brand:hover { color: var(--ink); }

.nav-links { display: flex; align-items: center; gap: var(--sp-1); }
.nav-links a {
    position: relative; padding: 9px 14px; border-radius: var(--r-sm);
    font-size: .94rem; font-weight: 550; color: var(--ink-muted);
}
.nav-links a:hover { color: var(--ink); background: rgba(148, 190, 230, .08); }
.nav-links a[aria-current="page"] { color: var(--ink); }
.nav-actions { display: flex; align-items: center; gap: var(--sp-2); }
/* Drawer-only "Get the app". On a 375px header the brand, the Play pill
   and the 44px toggle cannot all fit, so below 640px the pill moves into
   the menu rather than being dropped from the page. */
.nav-cta { display: none; }

.nav-toggle {
    display: none; width: 44px; height: 44px; border: 1px solid var(--line-strong);
    border-radius: var(--r-sm); background: var(--glass); color: var(--ink);
    cursor: pointer; align-items: center; justify-content: center;
}
.nav-toggle svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ------------------------------------------------------------------ */
/* Buttons — 44px minimum target, always with a visible hover state.   */
/* ------------------------------------------------------------------ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 46px; padding: 12px 24px;
    font-family: 'Outfit', sans-serif; font-size: .97rem; font-weight: 650;
    border-radius: 12px; border: 1px solid transparent; cursor: pointer;
    transition: transform var(--t-fast) var(--ease-out),
                box-shadow var(--t-fast) var(--ease-out),
                background var(--t-fast) var(--ease-soft),
                border-color var(--t-fast) var(--ease-soft);
    will-change: transform;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px) scale(.99); }

.btn-primary {
    background: var(--grad-brand); color: #04121A;
    box-shadow: 0 10px 30px -12px rgba(34, 211, 238, .7);
}
.btn-primary:hover { color: #04121A; transform: translateY(-2px); box-shadow: 0 18px 44px -14px rgba(34, 211, 238, .85); }

.btn-ghost {
    background: var(--glass); color: var(--ink);
    border-color: var(--glass-brd);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.btn-ghost:hover { color: var(--ink); border-color: var(--line-strong); background: var(--glass-2); transform: translateY(-2px); }

.btn-sm { min-height: 40px; padding: 8px 16px; font-size: .9rem; }

/* ------------------------------------------------------------------ */
/* Glass card + the 3D tilt shell used by features and stats           */
/* ------------------------------------------------------------------ */
.card {
    position: relative;
    background: var(--glass);
    border: 1px solid var(--glass-brd);
    border-radius: var(--r-lg);
    -webkit-backdrop-filter: blur(14px) saturate(130%);
    backdrop-filter: blur(14px) saturate(130%);
    box-shadow: var(--shadow-2);
    overflow: hidden;
}
/* Top light edge — the single cue that sells "pane of glass". */
.card::before {
    content: ''; position: absolute; inset: 0 0 auto 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent);
}

/* The tilt wrapper owns the perspective; the inner card is what rotates,
   so text stays on its own plane and never blurs from a parent filter. */
.tilt { perspective: 900px; }
.tilt-in {
    transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(0);
    transform-style: preserve-3d;
    transition: transform var(--t-mid) var(--ease-out);
}
.tilt.is-live .tilt-in { transition: transform 90ms linear; }
/* Pointer-tracked specular highlight. */
.tilt-glare {
    position: absolute; inset: 0; pointer-events: none; opacity: 0;
    background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 0%),
                rgba(255, 255, 255, .16), transparent 62%);
    transition: opacity var(--t-mid) var(--ease-soft);
}
.tilt:hover .tilt-glare, .tilt:focus-within .tilt-glare { opacity: 1; }
/* Children may be pushed forward in Z for real parallax inside the card. */
.pop-1 { transform: translateZ(22px); }
.pop-2 { transform: translateZ(42px); }
.pop-3 { transform: translateZ(64px); }

/* ------------------------------------------------------------------ */
/* Hero                                                                */
/* ------------------------------------------------------------------ */
.hero {
    position: relative;
    min-height: min(100svh, 900px);
    padding: calc(var(--nav-h) + var(--sp-8)) 0 var(--sp-8);
    display: flex; align-items: center;
}
.hero-grid {
    display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    gap: var(--sp-7); align-items: center; width: 100%;
}
.hero h1 { margin: var(--sp-4) 0 var(--sp-4); }
.hero h1 .grad {
    background: var(--grad-brand);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* Headline words rise in sequence; the delay is set inline per word. */
.rise { display: inline-block; }
.hero-copy .lead { max-width: 33rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin: var(--sp-5) 0 var(--sp-4); }

.hero-trust { display: flex; flex-wrap: wrap; gap: var(--sp-4); margin-top: var(--sp-4); }
.hero-trust li { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--ink-faint); }
.hero-trust svg { width: 17px; height: 17px; fill: var(--emerald); flex: 0 0 auto; }

.play-badge { display: inline-flex; }
.play-badge img { height: 54px; width: auto; }
.play-badge:hover { transform: translateY(-2px); }
.play-badge { transition: transform var(--t-fast) var(--ease-out); }

/* --- The 3D phone: a real preserve-3d stack, tilted by pointer/gyro. */
.stage {
    position: relative;
    perspective: 1400px;
    perspective-origin: 50% 40%;
    display: flex; align-items: center; justify-content: center;
    min-height: 560px;
}
.phone-rig {
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(var(--rx, 6deg)) rotateY(var(--ry, -16deg)) rotateZ(var(--rz, 0deg));
    transition: transform 400ms var(--ease-out);
    animation: float-y 7s var(--ease-soft) infinite;
}
.stage.is-live .phone-rig { transition: transform 120ms linear; animation: none; }
@keyframes float-y {
    0%, 100% { translate: 0 -10px; }
    50%      { translate: 0 10px; }
}
.phone {
    position: relative; width: 288px; height: 590px;
    border-radius: 44px;
    background: linear-gradient(155deg, #263449 0%, #0B1220 55%, #060A12 100%);
    padding: 11px;
    transform-style: preserve-3d;
    box-shadow:
        0 0 0 1.5px rgba(180, 214, 245, .22),
        0 46px 90px -30px rgba(0, 0, 0, .9),
        inset 0 1px 1px rgba(255, 255, 255, .18);
}
/* Side buttons, extruded in Z so the tilt reveals them. */
.phone::after {
    content: ''; position: absolute; right: -3px; top: 148px;
    width: 3px; height: 74px; border-radius: 3px;
    background: linear-gradient(180deg, #3A4C66, #1A2537);
    transform: translateZ(-6px);
}
.phone-screen {
    position: relative; width: 100%; height: 100%;
    border-radius: 34px; overflow: hidden;
    background: #060A12;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .9);
}
.phone-screen img {
    width: 100%; height: 100%; object-fit: cover;
    /* Every slide is stacked; only the active one is at opacity 1, so the
       swap costs no layout and cannot shift the page. */
    position: absolute; inset: 0;
    opacity: 0; transform: scale(1.04);
    transition: opacity 620ms var(--ease-soft), transform 900ms var(--ease-out);
}
.phone-screen img.is-on { opacity: 1; transform: scale(1); }
.phone-notch {
    position: absolute; top: 12px; left: 50%; translate: -50% 0;
    width: 92px; height: 22px; border-radius: 100px;
    background: #04070D; z-index: 3;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}
/* Screen glare rides above the screenshot, below the notch. */
.phone-glare {
    position: absolute; inset: 0; z-index: 2; pointer-events: none;
    background: linear-gradient(112deg, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, .03) 26%, transparent 44%);
    mix-blend-mode: screen;
}

/* Chips that float off the phone at different depths. */
.chip {
    position: absolute; z-index: 4;
    display: flex; align-items: center; gap: 10px;
    padding: 11px 15px; border-radius: 14px;
    background: var(--glass-2); border: 1px solid var(--glass-brd);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    box-shadow: var(--shadow-2);
    font-size: .84rem; font-weight: 600; color: var(--ink);
    white-space: nowrap;
}
.chip svg { width: 18px; height: 18px; flex: 0 0 auto; }
.chip small { display: block; font-size: .72rem; font-weight: 500; color: var(--ink-faint); }
.chip-a { top: 8%;  left: -14%; transform: translateZ(90px);  animation: float-y 6s var(--ease-soft) infinite; }
.chip-b { top: 42%; right: -18%; transform: translateZ(120px); animation: float-y 8s var(--ease-soft) .6s infinite reverse; }
.chip-c { bottom: 10%; left: -10%; transform: translateZ(70px); animation: float-y 9s var(--ease-soft) 1.2s infinite; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 0 4px rgba(52, 211, 153, .18); }

/* Floor glow under the rig, sold as a rotated plane. */
.stage-floor {
    position: absolute; bottom: 6%; left: 50%; width: min(420px, 70vw); height: 120px;
    translate: -50% 0;
    background: radial-gradient(closest-side, rgba(34, 211, 238, .3), transparent 78%);
    filter: blur(22px); transform: rotateX(74deg); pointer-events: none;
}

/* ------------------------------------------------------------------ */
/* Marquee strip (problem statement / trust line)                      */
/* ------------------------------------------------------------------ */
.strip {
    border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
    background: rgba(8, 13, 24, .6); padding: var(--sp-3) 0; overflow: hidden;
}
.marquee { display: flex; gap: var(--sp-6); width: max-content; animation: slide 34s linear infinite; }
.strip:hover .marquee, .marquee:focus-within { animation-play-state: paused; }
@keyframes slide { to { transform: translateX(-50%); } }
.marquee span {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: 'Outfit', sans-serif; font-size: .93rem; font-weight: 600;
    color: var(--ink-faint); letter-spacing: .04em; text-transform: uppercase;
}
.marquee svg { width: 16px; height: 16px; fill: var(--cyan); opacity: .85; }

/* ------------------------------------------------------------------ */
/* Feature grid — bento-ish, 3D tilt on each cell                      */
/* ------------------------------------------------------------------ */
.feat-grid {
    display: grid; gap: var(--sp-4);
    /* minmax(0, ...) rather than a bare 1fr: the wide cells hold a <pre>
       whose longest code line is ~396px, and a 1fr track floors at its
       item's min-content, which pushed the whole grid past a phone. */
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.feat-grid .tilt:nth-child(1) { grid-column: span 2; }
.feat-grid .tilt:nth-child(6) { grid-column: span 2; }
.feat {
    height: 100%; padding: var(--sp-5);
    display: flex; flex-direction: column; gap: var(--sp-3);
}
.feat-ico {
    width: 50px; height: 50px; border-radius: 15px;
    display: grid; place-items: center; flex: 0 0 auto;
    background: linear-gradient(150deg, rgba(34, 211, 238, .2), rgba(99, 102, 241, .18));
    border: 1px solid var(--glass-brd);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
}
.feat-ico svg { width: 25px; height: 25px; fill: none; stroke: var(--cyan); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.feat h3 { color: var(--ink); }
.feat p { font-size: .96rem; }
.feat .tag {
    margin-top: auto; align-self: flex-start;
    font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
    color: var(--emerald); padding: 5px 10px; border-radius: 7px;
    background: rgba(52, 211, 153, .1); border: 1px solid rgba(52, 211, 153, .22);
}
/* The wide cells get a decorative code sample instead of dead space. */
.feat-code {
    margin-top: var(--sp-2); padding: var(--sp-3);
    border-radius: var(--r-md); background: rgba(4, 8, 15, .66);
    border: 1px solid var(--line);
    font-family: ui-monospace, Consolas, monospace; font-size: .82rem; line-height: 1.9;
    color: var(--ink-faint); overflow-x: auto; min-width: 0;
}
.feat-code b { color: var(--cyan); font-weight: 600; }
.feat-code i { color: var(--emerald); font-style: normal; }

/* ------------------------------------------------------------------ */
/* 3D coverflow gallery                                                */
/* ------------------------------------------------------------------ */
.flow-outer { position: relative; }
.flow {
    position: relative; height: 620px;
    perspective: 1700px; perspective-origin: 50% 45%;
    display: flex; align-items: center; justify-content: center;
    /* Panning the deck with a drag must not also scroll the page sideways. */
    touch-action: pan-y;
}
.flow-item {
    position: absolute; width: 260px; height: 560px;
    border-radius: 32px; overflow: hidden;
    background: #070B14;
    border: 1px solid var(--glass-brd);
    box-shadow: var(--shadow-3);
    transition: transform 620ms var(--ease-out), opacity 620ms var(--ease-soft), filter 620ms var(--ease-soft);
    transform-style: preserve-3d;
    cursor: pointer;
    will-change: transform, opacity;
}
.flow-item img { width: 100%; height: 100%; object-fit: cover; }
/* Off-centre slides are dimmed and pushed back; the JS sets --i (offset). */
.flow-item[data-off="0"]  { z-index: 6; }
.flow-item.is-far { pointer-events: none; }
.flow-item::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(4, 8, 15, .82) 100%);
    opacity: 0; transition: opacity var(--t-mid) var(--ease-soft);
}
.flow-item[data-off="0"]::after { opacity: 1; }
.flow-cap {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
    padding: var(--sp-4) var(--sp-3);
    opacity: 0; transform: translateY(10px);
    transition: opacity var(--t-mid) var(--ease-soft), transform var(--t-mid) var(--ease-out);
}
.flow-item[data-off="0"] .flow-cap { opacity: 1; transform: none; }
.flow-cap h4 { font-size: 1rem; color: #fff; }
.flow-cap p { font-size: .84rem; margin-top: 2px; color: var(--ink-muted); }

.flow-nav { display: flex; align-items: center; justify-content: center; gap: var(--sp-3); margin-top: var(--sp-4); }
.flow-btn {
    width: 48px; height: 48px; border-radius: 50%;
    display: grid; place-items: center; cursor: pointer;
    background: var(--glass-2); border: 1px solid var(--glass-brd); color: var(--ink);
}
.flow-btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.flow-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.flow-dots { display: flex; gap: 8px; }
.flow-dot {
    width: 10px; height: 10px; padding: 0; border-radius: 50%; cursor: pointer;
    background: rgba(148, 190, 230, .25); border: 0;
    transition: background var(--t-fast), width var(--t-fast) var(--ease-out);
}
.flow-dot[aria-selected="true"] { background: var(--cyan); width: 26px; border-radius: 6px; }
/* The dot row is small on purpose, so give each one a 44px hit area. */
.flow-dots li { display: grid; place-items: center; min-width: 44px; min-height: 44px; }
.flow-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* ------------------------------------------------------------------ */
/* Pipeline: interactive 3D cube + step list                           */
/* ------------------------------------------------------------------ */
.pipe-grid { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: var(--sp-7); align-items: center; }

.cube-stage { perspective: 1200px; display: grid; place-items: center; min-height: 420px; }
.cube {
    position: relative; width: 200px; height: 200px;
    transform-style: preserve-3d;
    transform: rotateX(-18deg) rotateY(var(--spin, 0deg));
    transition: transform 900ms var(--ease-out);
}
.cube-face {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    padding: var(--sp-3); text-align: center;
    border-radius: 18px;
    background: var(--glass-2); border: 1px solid var(--glass-brd);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    box-shadow: inset 0 0 40px rgba(34, 211, 238, .07);
}
.cube-face svg { width: 34px; height: 34px; fill: none; stroke: var(--cyan); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cube-face b { font-family: 'Outfit', sans-serif; font-size: .95rem; }
.cube-face i { font-style: normal; font-size: .74rem; color: var(--ink-faint); letter-spacing: .1em; text-transform: uppercase; }
.cube-face:nth-child(1) { transform: translateZ(100px); }
.cube-face:nth-child(2) { transform: rotateY(90deg)  translateZ(100px); }
.cube-face:nth-child(3) { transform: rotateY(180deg) translateZ(100px); }
.cube-face:nth-child(4) { transform: rotateY(-90deg) translateZ(100px); }
.cube-face:nth-child(5) { transform: rotateX(90deg)  translateZ(100px); }
.cube-face:nth-child(6) { transform: rotateX(-90deg) translateZ(100px); }

.steps { display: flex; flex-direction: column; gap: var(--sp-2); }
.step {
    display: grid; grid-template-columns: 44px 1fr; gap: var(--sp-3);
    width: 100%; text-align: left; cursor: pointer;
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--r-md); border: 1px solid transparent; background: transparent;
    color: inherit; font: inherit;
    transition: background var(--t-fast) var(--ease-soft), border-color var(--t-fast), transform var(--t-fast) var(--ease-out);
}
.step:hover { background: rgba(148, 190, 230, .06); }
.step[aria-selected="true"] {
    background: var(--glass); border-color: var(--glass-brd); transform: translateX(4px);
}
.step-n {
    width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
    font-family: 'Outfit', sans-serif; font-weight: 700; font-size: .9rem;
    background: rgba(34, 211, 238, .12); color: var(--cyan);
    border: 1px solid rgba(34, 211, 238, .24);
}
.step[aria-selected="true"] .step-n { background: var(--grad-brand); color: #04121A; border-color: transparent; }
.step h4 { margin-bottom: 2px; }
.step p { font-size: .92rem; }

/* ------------------------------------------------------------------ */
/* Split feature rows (report / security)                              */
/* ------------------------------------------------------------------ */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-7); align-items: center; }
.split--flip .split-media { order: -1; }
.split-media { position: relative; }
.split-media > .card { position: relative; z-index: 1; }
.split-list { display: flex; flex-direction: column; gap: var(--sp-4); margin-top: var(--sp-5); }
.split-list li { display: grid; grid-template-columns: 26px 1fr; gap: var(--sp-3); }
.split-list svg { width: 22px; height: 22px; fill: none; stroke: var(--emerald); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; margin-top: 3px; }
.split-list h4 { margin-bottom: 3px; }
.split-list p { font-size: .95rem; }

/* Mock report page — a paper sheet standing in 3D space. */
.paper-stage { perspective: 1300px; display: grid; place-items: center; }
.paper {
    /* The scan sweep is absolute inside this sheet and must be clipped by it. */
    position: relative; overflow: hidden;
    width: 100%; max-width: 380px; aspect-ratio: 1 / 1.414;
    background: #FDFEFF; color: #101A28;
    border-radius: 8px; padding: 24px 22px;
    transform: rotateY(var(--ry, -14deg)) rotateX(var(--rx, 5deg));
    transform-style: preserve-3d;
    box-shadow: 0 50px 90px -34px rgba(0, 0, 0, .85), 0 0 0 1px rgba(255, 255, 255, .3);
    transition: transform 400ms var(--ease-out);
    font-size: 9px; line-height: 1.5;
}
.paper-stage.is-live .paper { transition: transform 110ms linear; }
.paper-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; border-bottom: 2px solid #0891B2; padding-bottom: 8px; }
.paper-hd b { font-family: 'Outfit', sans-serif; font-size: 14px; color: #0E7490; letter-spacing: -.02em; display: block; }
.paper-hd small { color: #64748B; font-size: 7.5px; }
.paper-qr { width: 34px; height: 34px; border-radius: 4px; background:
    repeating-conic-gradient(#101A28 0% 25%, #FDFEFF 0% 50%) 0 0 / 8px 8px; flex: 0 0 auto; }
.paper-band { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px 8px; margin: 10px 0; padding: 8px; background: #F1F7FB; border-radius: 4px; font-size: 7.5px; }
.paper-band span { color: #64748B; }
.paper-band b { color: #101A28; font-weight: 600; }
.paper table { width: 100%; border-collapse: collapse; font-size: 7.5px; }
.paper caption { text-align: left; color: #0E7490; font-size: 7px; letter-spacing: .1em;
    padding: 4px 0; font-family: ui-monospace, Consolas, monospace; text-transform: uppercase; }
.paper th { text-align: left; color: #0E7490; border-bottom: 1px solid #CBD5E1; padding: 4px 2px; font-size: 7px; text-transform: uppercase; letter-spacing: .06em; }
.paper td { padding: 3.5px 2px; border-bottom: 1px solid #EEF2F7; color: #334155; }
.paper td.hi { color: #B91C1C; font-weight: 700; }
.paper td.ok { color: #047857; font-weight: 600; }
.paper-ft { margin-top: 12px; display: flex; justify-content: space-between; align-items: flex-end; color: #64748B; font-size: 7px; }
.paper-sig { width: 74px; border-top: 1px solid #94A3B8; padding-top: 3px; text-align: center; }
/* Highlight sweep that runs down the sheet on reveal. */
.paper-scan {
    position: absolute; left: 0; right: 0; height: 34%;
    background: linear-gradient(180deg, transparent, rgba(34, 211, 238, .22), transparent);
    opacity: 0; pointer-events: none;
}
.paper-stage.is-in .paper-scan { animation: scan 2.4s var(--ease-soft) .3s 2; }
@keyframes scan {
    0%   { opacity: 0; transform: translateY(-40%); }
    18%  { opacity: 1; }
    82%  { opacity: 1; }
    100% { opacity: 0; transform: translateY(300%); }
}

/* ------------------------------------------------------------------ */
/* Stats, FAQ, CTA, footer                                             */
/* ------------------------------------------------------------------ */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-4); }
.stat { padding: var(--sp-5) var(--sp-4); text-align: center; }
.stat b {
    display: block; font-family: 'Outfit', sans-serif; font-weight: 800;
    font-size: clamp(1.9rem, 3.4vw, 2.7rem); letter-spacing: -.03em;
    background: var(--grad-ink); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat span { font-size: .88rem; color: var(--ink-faint); }

.faq { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--sp-2); }
.qa { border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(12, 19, 34, .5); overflow: hidden; }
.qa[open] { border-color: var(--line-strong); background: var(--glass); }
.qa summary {
    display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
    padding: var(--sp-4); cursor: pointer; list-style: none;
    font-family: 'Outfit', sans-serif; font-weight: 600; font-size: 1.02rem;
    min-height: 44px;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
    content: ''; width: 11px; height: 11px; flex: 0 0 auto;
    border-right: 2px solid var(--cyan); border-bottom: 2px solid var(--cyan);
    rotate: 45deg; transition: rotate var(--t-mid) var(--ease-out);
}
.qa[open] summary::after { rotate: 225deg; }
.qa-body { padding: 0 var(--sp-4) var(--sp-4); }
.qa-body p { font-size: .96rem; }

.cta-panel {
    position: relative; overflow: hidden;
    padding: var(--sp-8) var(--sp-5); text-align: center;
    border-radius: var(--r-xl);
    background:
        radial-gradient(60% 120% at 50% 0%, rgba(34, 211, 238, .18), transparent 70%),
        linear-gradient(180deg, rgba(18, 28, 46, .85), rgba(8, 13, 24, .9));
    border: 1px solid var(--glass-brd);
    box-shadow: var(--shadow-3);
}
.cta-panel h2 { margin-bottom: var(--sp-3); }
.cta-panel p { max-width: 46rem; margin: 0 auto var(--sp-5); }
.cta-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); justify-content: center; align-items: center; }

.site-foot { border-top: 1px solid var(--line); margin-top: var(--sp-8); padding: var(--sp-7) 0 var(--sp-5); background: rgba(5, 8, 15, .8); }
.foot-top { display: grid; grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); gap: var(--sp-6); }
.foot-brand p { font-size: .93rem; margin-top: var(--sp-3); max-width: 30rem; }
.foot-col h5 { font-family: 'Outfit', sans-serif; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: var(--sp-3); }
.foot-col a, .foot-col button {
    display: block; padding: 6px 0; font-size: .93rem; color: var(--ink-muted);
    background: none; border: 0; cursor: pointer; font: inherit; text-align: left;
}
.foot-col a:hover, .foot-col button:hover { color: var(--cyan); }
.foot-bot {
    margin-top: var(--sp-6); padding-top: var(--sp-4); border-top: 1px solid var(--line);
    display: flex; flex-wrap: wrap; gap: var(--sp-3); justify-content: space-between;
}
.foot-bot p { font-size: .86rem; color: var(--ink-faint); }

/* ------------------------------------------------------------------ */
/* Scroll progress bar                                                 */
/* ------------------------------------------------------------------ */
.progress {
    position: fixed; top: 0; left: 0; height: 2px; z-index: 950;
    width: 100%; transform: scaleX(var(--p, 0)); transform-origin: 0 50%;
    background: var(--grad-brand); pointer-events: none;
}

/* ------------------------------------------------------------------ */
/* Scroll reveal — the JS only toggles .is-in                          */
/* ------------------------------------------------------------------ */
.reveal {
    opacity: 0;
    transform: translate3d(0, 26px, -60px);
    transition: opacity var(--t-slow) var(--ease-soft), transform var(--t-slow) var(--ease-out);
}
.reveal.is-in { opacity: 1; transform: none; }
.reveal-l { transform: translate3d(-30px, 0, -40px) rotateY(6deg); }
.reveal-r { transform: translate3d(30px, 0, -40px) rotateY(-6deg); }
.reveal-s { transform: scale(.94) translateZ(-40px); }

/* ------------------------------------------------------------------ */
/* Legal / form pages (privacy, terms, deletion)                       */
/* ------------------------------------------------------------------ */
.doc { padding: calc(var(--nav-h) + var(--sp-7)) 0 var(--sp-8); }
.doc-card {
    max-width: 880px; margin: 0 auto; padding: clamp(var(--sp-4), 4vw, var(--sp-7));
    background: var(--glass); border: 1px solid var(--glass-brd); border-radius: var(--r-lg);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    box-shadow: var(--shadow-2);
}
.doc-card h1 { font-size: clamp(1.9rem, 4.4vw, 2.7rem); margin-bottom: var(--sp-2); }
.doc-meta { font-size: .88rem; color: var(--ink-faint); margin-bottom: var(--sp-5); }
.doc-body h2 { font-size: 1.32rem; margin: var(--sp-6) 0 var(--sp-3); color: var(--ink); }
.doc-body h3 { font-size: 1.06rem; margin: var(--sp-4) 0 var(--sp-2); color: var(--ink); }
.doc-body p, .doc-body li { font-size: .98rem; color: var(--ink-muted); }
.doc-body p { margin-bottom: var(--sp-3); }
.doc-body ul, .doc-body ol { margin: 0 0 var(--sp-4) var(--sp-4); }
.doc-body ul li { list-style: disc; margin-bottom: 8px; }
.doc-body ol li { list-style: decimal; margin-bottom: 8px; }
.doc-body a { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
.doc-body strong, .doc-body b { color: var(--ink); }
.doc-body code {
    font-family: ui-monospace, Consolas, monospace; font-size: .88em;
    background: rgba(34, 211, 238, .1); border: 1px solid rgba(34, 211, 238, .2);
    padding: 1px 6px; border-radius: 5px; color: var(--cyan);
}
.doc-body table { width: 100%; border-collapse: collapse; margin-bottom: var(--sp-4); font-size: .92rem; }
.doc-body th, .doc-body td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.doc-body th { color: var(--ink); font-family: 'Outfit', sans-serif; }
.doc-body td { color: var(--ink-muted); }
.callout {
    padding: var(--sp-4); border-radius: var(--r-md); margin-bottom: var(--sp-4);
    background: rgba(34, 211, 238, .07); border: 1px solid rgba(34, 211, 238, .2);
}
.callout--danger {
    background: rgba(239, 68, 68, .07); border-color: rgba(239, 68, 68, .3);
    border-left: 4px solid #EF4444; color: var(--ink); font-weight: 600;
}
.callout--warn { background: rgba(251, 191, 36, .07); border-color: rgba(251, 191, 36, .26); }
.callout p:last-child { margin-bottom: 0; }

/* Forms (deletion request) */
.field { margin-bottom: var(--sp-4); }
.field label { display: block; font-weight: 600; font-size: .94rem; margin-bottom: 7px; color: var(--ink); }
.field .hint { font-size: .84rem; color: var(--ink-faint); margin-top: 6px; }
.field input, .field select, .field textarea {
    width: 100%; min-height: 46px; padding: 12px 14px;
    background: rgba(5, 8, 15, .6); color: var(--ink);
    border: 1px solid var(--line-strong); border-radius: var(--r-sm);
    font: inherit; font-size: .97rem;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, .18);
}
.field input::placeholder, .field textarea::placeholder { color: #5C7391; }
.err { color: #FCA5A5; font-size: .86rem; margin-top: 6px; }

/* Consent checkbox. The generic .field rule stretches every input to 100%
   width and a 46px minimum height, which would blow up a checkbox, so the
   confirmation row is its own two-column grid instead of a .field. */
.check {
    display: grid; grid-template-columns: 22px 1fr; gap: 12px;
    align-items: start; margin: var(--sp-4) 0;
}
.check input[type="checkbox"] {
    width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--cyan);
    border-radius: 6px; cursor: pointer;
}
.check input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--cyan); outline-offset: 3px;
}
/* The deletion form is the only form on the public site; keep it readable
   rather than stretched across the full card width. */
.doc-body form { max-width: 560px; }
.doc-body form .btn { margin-top: var(--sp-2); }

.check label {
    font-size: .94rem; line-height: 1.55; color: var(--ink-muted);
    cursor: pointer; font-weight: 400;
}

/* ------------------------------------------------------------------ */
/* Lab objects — a 3D specimen rack, a DNA helix, an analyser trace and  */
/* a reference-range meter. These are what make the page read as a       */
/* pathology product rather than a generic SaaS page, so they are built  */
/* from real objects: the vial caps use the actual order-of-draw colours */
/* (lavender EDTA, red plain, gold SST, light-blue citrate, grey         */
/* fluoride) a technician would recognise on a bench.                    */
/* ------------------------------------------------------------------ */
.rack {
    position: absolute; bottom: -7%; right: -16%;
    display: flex; align-items: flex-end; gap: 8px;
    padding: 0 11px 15px;
    transform: translateZ(150px) rotateY(-9deg);
    transform-style: preserve-3d;
    animation: float-y 7.5s var(--ease-soft) .4s infinite;
}
/* The rack bar the tubes stand in. */
.rack::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 19px;
    border-radius: 5px;
    background: linear-gradient(180deg, rgba(148, 180, 214, .3), rgba(6, 10, 19, .95));
    border: 1px solid var(--glass-brd);
    box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .85), inset 0 1px 0 rgba(255, 255, 255, .16);
}
.vial {
    position: relative; z-index: 1;
    width: 22px; height: var(--h, 84px);
    border-radius: 2px 2px 11px 11px;
    border: 1px solid rgba(199, 222, 244, .34); border-top: 0;
    background: linear-gradient(100deg, rgba(255, 255, 255, .17), rgba(255, 255, 255, .03) 42%, rgba(255, 255, 255, .12));
    box-shadow: inset -3px 0 7px rgba(255, 255, 255, .15), inset 3px 0 9px rgba(0, 0, 0, .45);
    overflow: hidden;
}
/* Cap, in the draw-order colour. */
.vial::before {
    content: ''; position: absolute; top: 0; left: -2px; right: -2px; height: 13px;
    background: var(--cap); border-radius: 3px 3px 2px 2px;
    box-shadow: inset 0 -3px 5px rgba(0, 0, 0, .45), 0 1px 0 rgba(255, 255, 255, .28);
}
/* The specimen itself, with a lighter meniscus at the top of the column. */
.vial i {
    position: absolute; left: 0; right: 0; bottom: 0; height: var(--fill, 56%);
    background: var(--fluid); font-style: normal;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, .3);
}
/* One slow bubble, so the glass reads as holding liquid rather than paint. */
.vial i::after {
    content: ''; position: absolute; left: 40%; bottom: 6%;
    width: 4px; height: 4px; border-radius: 50%;
    background: rgba(255, 255, 255, .5);
    animation: bubble 4.2s var(--ease-soft) infinite;
}
.vial--edta     { --h: 84px; --fill: 62%; --cap: #B39DDB; --fluid: linear-gradient(180deg, #9F1239, #5B0E22); }
.vial--plain    { --h: 78px; --fill: 47%; --cap: #E11D48; --fluid: linear-gradient(180deg, #B91C3C, #6B1024); }
.vial--sst      { --h: 90px; --fill: 71%; --cap: #D4A017; --fluid: linear-gradient(180deg, #E3C15A, #A67C1A); }
.vial--citrate  { --h: 82px; --fill: 55%; --cap: #7DD3FC; --fluid: linear-gradient(180deg, #A31B3C, #64101F); }
.vial--fluoride { --h: 74px; --fill: 40%; --cap: #94A3B8; --fluid: linear-gradient(180deg, #7F1D2E, #4A0C18); }
.vial--sst i::after { animation-delay: 1.1s; }
.vial--citrate i::after { animation-delay: 2.2s; }
.vial--fluoride i::after { animation-delay: 3s; }
@keyframes bubble {
    0%   { opacity: 0; transform: translateY(0) scale(.6); }
    12%  { opacity: .75; }
    100% { opacity: 0; transform: translateY(-46px) scale(1.15); }
}

/* A DNA double helix: 18 rungs, each pre-rotated a fixed step around the
   Y axis. Spinning the one container then carries all of them, so the browser
   animates a single transform instead of eighteen. */
.helix-stage { position: absolute; left: -6%; top: -4%; width: 132px; height: 380px;
    perspective: 900px; pointer-events: none; z-index: 0; }
.helix { position: absolute; inset: 0; transform-style: preserve-3d;
    animation: helix-spin 16s linear infinite; }
.helix-rung { position: absolute; left: 6px; right: 6px; height: 12px; transform-style: preserve-3d; }
/* The two bases at the ends of each rung, one per strand. */
.helix-rung::before, .helix-rung::after {
    content: ''; position: absolute; top: 0; width: 12px; height: 12px; border-radius: 50%;
}
.helix-rung::before { left: 0;
    background: radial-gradient(circle at 34% 30%, #A5F3FC, #0E7490);
    box-shadow: 0 0 14px rgba(34, 211, 238, .75); }
.helix-rung::after { right: 0;
    background: radial-gradient(circle at 34% 30%, #A7F3D0, #047857);
    box-shadow: 0 0 14px rgba(52, 211, 153, .6); }
.helix-rung i { position: absolute; left: 12px; right: 12px; top: 5px; height: 2px;
    background: linear-gradient(90deg, rgba(34, 211, 238, .75), rgba(52, 211, 153, .75)); }
.helix-rung:nth-child(1) { top: 0px; transform: rotateY(0deg); }
.helix-rung:nth-child(2) { top: 19px; transform: rotateY(34deg); }
.helix-rung:nth-child(3) { top: 38px; transform: rotateY(68deg); }
.helix-rung:nth-child(4) { top: 57px; transform: rotateY(102deg); }
.helix-rung:nth-child(5) { top: 76px; transform: rotateY(136deg); }
.helix-rung:nth-child(6) { top: 95px; transform: rotateY(170deg); }
.helix-rung:nth-child(7) { top: 114px; transform: rotateY(204deg); }
.helix-rung:nth-child(8) { top: 133px; transform: rotateY(238deg); }
.helix-rung:nth-child(9) { top: 152px; transform: rotateY(272deg); }
.helix-rung:nth-child(10) { top: 171px; transform: rotateY(306deg); }
.helix-rung:nth-child(11) { top: 190px; transform: rotateY(340deg); }
.helix-rung:nth-child(12) { top: 209px; transform: rotateY(374deg); }
.helix-rung:nth-child(13) { top: 228px; transform: rotateY(408deg); }
.helix-rung:nth-child(14) { top: 247px; transform: rotateY(442deg); }
.helix-rung:nth-child(15) { top: 266px; transform: rotateY(476deg); }
.helix-rung:nth-child(16) { top: 285px; transform: rotateY(510deg); }
.helix-rung:nth-child(17) { top: 304px; transform: rotateY(544deg); }
.helix-rung:nth-child(18) { top: 323px; transform: rotateY(578deg); }
@keyframes helix-spin { to { transform: rotateY(360deg); } }

/* Analyser trace across the discipline strip. Decorative only - it carries no
   reading, so it is aria-hidden and makes no claim about any measurement. */
.strip { position: relative; }
.strip-trace { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .45;
    pointer-events: none; }
.strip-trace path {
    fill: none; stroke: var(--emerald); stroke-width: 1.7; stroke-linecap: round;
    filter: drop-shadow(0 0 5px rgba(52, 211, 153, .85));
    stroke-dasharray: 340 1200; stroke-dashoffset: 340;
    animation: trace 7s linear infinite;
}
@keyframes trace { to { stroke-dashoffset: -1200; } }

/* Reference-range meter - the one graphic on the page a pathologist reads
   every day: low / normal / high bands with the observed value marked. */
.range-meter { margin-top: var(--sp-3); display: grid; gap: 7px; }
.range-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-2); }
.range-top b { font-family: 'Outfit', sans-serif; font-size: .95rem; color: var(--ink); }
.range-top span { font-size: .8rem; color: var(--ink-faint); font-family: ui-monospace, Consolas, monospace; }
.range-bar { position: relative; height: 10px; border-radius: 99px;
    border: 1px solid var(--line-strong); overflow: visible;
    background: linear-gradient(90deg,
        rgba(251, 191, 36, .38) 0 24%, rgba(52, 211, 153, .5) 24% 72%, rgba(239, 68, 68, .38) 72% 100%);
}
.range-mark { position: absolute; top: -6px; left: var(--at, 50%);
    width: 3px; height: 20px; border-radius: 2px; background: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, .85); }
.range-mark--low { --at: 15%; }
.range-scale { display: flex; justify-content: space-between; font-size: .72rem;
    letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); }

/* Lab mark above each counter. */
.stat-ico { width: 40px; height: 40px; margin: 0 auto var(--sp-2); border-radius: 13px;
    display: grid; place-items: center;
    background: linear-gradient(150deg, rgba(34, 211, 238, .2), rgba(99, 102, 241, .18));
    border: 1px solid var(--glass-brd); }
.stat-ico svg { width: 21px; height: 21px; fill: none; stroke: var(--cyan);
    stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------------ */
/* Report page (report.html) — the only page a patient ever sees        */
/* ------------------------------------------------------------------ */
/* report.js shows and hides these sections through the hidden
   attribute, and several of them set a display of their own, which
   would beat the user agent's [hidden] rule. This is what keeps the
   loading card from sitting on top of the report once it arrives. */
[hidden] { display: none !important; }

.report { padding: calc(var(--nav-h) + var(--sp-6)) 0 var(--sp-7); }
.report-head { max-width: 40rem; margin: 0 auto var(--sp-5); text-align: center; }
.report-head h1 { font-size: clamp(1.9rem, 4.6vw, 2.9rem); margin: var(--sp-3) 0; }

/* The app icon as an authenticity seal. A patient arrives here from a
   sheet of paper, so the first thing on screen is the same mark that is
   printed beside the QR code they just scanned. */
.seal {
    display: grid; place-items: center; width: 84px; height: 84px;
    margin: 0 auto; border-radius: 26px;
    background: radial-gradient(circle at 30% 25%, rgba(34, 211, 238, .2), rgba(12, 19, 34, .85));
    border: 1px solid var(--glass-brd);
    box-shadow: var(--glow-cyan), var(--shadow-2);
}
.seal img { width: 52px; height: 52px; border-radius: 15px; }

.panel { padding: var(--sp-6) var(--sp-4); text-align: center; }
.panel h2 { font-size: clamp(1.18rem, 2.4vw, 1.5rem); margin-bottom: var(--sp-2); }
.panel p { font-size: .97rem; max-width: 34rem; margin: 0 auto; }
.panel--err h2 { color: #FCA5A5; }

.spinner {
    width: 38px; height: 38px; margin: 0 auto var(--sp-4);
    border: 3px solid rgba(148, 190, 230, .18);
    border-top-color: var(--cyan); border-radius: 50%;
    animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Which step failed, for whoever has to diagnose it. Never the token. */
.ref {
    margin-top: var(--sp-3); font-size: .78rem; letter-spacing: .08em;
    text-transform: uppercase; color: var(--ink-faint);
    font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
}

.report-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); justify-content: center; }

/* Dark surround, white sheet — the convention every PDF viewer uses,
   and the reason the report reads as paper rather than as page. */
.viewer {
    margin-top: var(--sp-4); border: 1px solid var(--glass-brd);
    border-radius: var(--r-lg); background: var(--surface);
    box-shadow: var(--shadow-3); overflow: hidden;
}
.viewer iframe { width: 100%; height: 78vh; min-height: 460px; border: 0; background: #fff; }

.assure { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); margin-top: var(--sp-5); }
.assure li {
    display: grid; grid-template-columns: 22px 1fr; gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-4); border: 1px solid var(--line);
    border-radius: var(--r-md); background: rgba(12, 19, 34, .5);
    font-size: .87rem; color: var(--ink-muted);
}
.assure svg {
    width: 20px; height: 20px; fill: none; stroke: var(--emerald);
    stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-top: 2px;
}
.assure b { display: block; color: var(--ink); font-family: 'Outfit', sans-serif; font-size: .92rem; }

.report-hint { text-align: center; font-size: .85rem; color: var(--ink-faint); margin-top: var(--sp-4); }

/* The report page's footer carries three columns, not four; the
   responsive rules below still collapse it at 1080 and 640. */
.foot-top--3 { grid-template-columns: 1.6fr minmax(0, 1fr) minmax(0, 1fr); }

/* ------------------------------------------------------------------ */
/* Responsive — mobile-first checks at 1440 / 1024 / 768 / 375         */
/* ------------------------------------------------------------------ */
@media (max-width: 1080px) {
    .hero-grid { grid-template-columns: minmax(0, 1fr); gap: var(--sp-6); }
    .hero { min-height: 0; padding-top: calc(var(--nav-h) + var(--sp-6)); text-align: center; }
    .hero-copy .lead, .sec-head { margin-left: auto; margin-right: auto; }
    .hero-cta, .hero-trust { justify-content: center; }
    .stage { min-height: 500px; }
    .feat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .feat-grid .tilt:nth-child(1), .feat-grid .tilt:nth-child(6) { grid-column: span 2; }
    /* minmax(0, ...): the security card in .split holds a <pre> whose longest
       line is ~396px, and a bare 1fr floors at the item's min-content, which
       pushed this section 102px past a 390px viewport. */
    .pipe-grid, .split { grid-template-columns: minmax(0, 1fr); gap: var(--sp-6); }
    .split--flip .split-media { order: 0; }
    .foot-top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5); }
}

@media (max-width: 860px) {
    .helix-stage { display: none; }
    .assure { grid-template-columns: minmax(0, 1fr); }
    .rack { right: -8%; transform: translateZ(90px) rotateY(-7deg) scale(.85); }
    .nav-links {
        position: fixed; inset: var(--nav-h) 0 auto 0;
        flex-direction: column; align-items: stretch; gap: 4px;
        padding: var(--sp-3) var(--sp-4) var(--sp-4);
        background: rgba(6, 11, 20, .96);
        -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
        border-bottom: 1px solid var(--line);
        /* A phone in landscape is still under 860px on some devices, and the
           drawer must not run off the bottom with the last link unreachable. */
        max-height: calc(100vh - var(--nav-h));
        max-height: calc(100svh - var(--nav-h));
        overflow-y: auto; overscroll-behavior: contain;
        /* Closed by default; opened by [data-open] on the nav. */
        transform: translateY(-12px); opacity: 0; visibility: hidden;
        transition: transform var(--t-mid) var(--ease-out), opacity var(--t-mid), visibility var(--t-mid);
    }
    .nav[data-open="true"] .nav-links { transform: none; opacity: 1; visibility: visible; }
    .nav[data-open="true"] { background: rgba(6, 11, 20, .96); }
    .nav-links a { padding: 13px 12px; font-size: 1rem; }
    .nav-toggle { display: flex; }
    .nav-actions .btn-desktop { display: none; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .flow { height: 540px; }
    .flow-item { width: 216px; height: 466px; }
    .section { padding: var(--sp-7) 0; }
}

@media (max-width: 640px) {
    /* Header row on a 360-414px phone: 48px of padding plus two 24px
       gaps left the Play pill and the toggle fighting for ~180px. */
    .nav-inner { padding: 0 var(--sp-3); gap: var(--sp-3); }
    .brand { font-size: 1.06rem; gap: 8px; }
    .brand img { width: 28px; height: 28px; }
    .nav-actions .btn-primary { display: none; }
    .nav-links .nav-cta {
        display: flex; align-items: center; justify-content: center;
        margin-top: var(--sp-2); min-height: 46px;
        background: var(--grad-brand); color: #04121A; font-weight: 700;
        border-radius: var(--r-sm);
    }
    /* .nav-links a:hover would otherwise flatten the gradient. */
    .nav-links .nav-cta:hover { background: var(--grad-brand); color: #04121A; }
    .rack { display: none; }
    .viewer iframe { height: 70vh; min-height: 380px; }
    :root { --sp-8: 72px; --sp-9: 88px; }
    .feat-grid { grid-template-columns: minmax(0, 1fr); }
    .feat-grid .tilt:nth-child(1), .feat-grid .tilt:nth-child(6) { grid-column: span 1; }
    .phone { width: 244px; height: 500px; border-radius: 38px; }
    .stage { min-height: 430px; }
    /* Chips would collide with a 244px phone on a 375px screen, so the two
       side ones are dropped rather than shrunk into illegibility. */
    .chip-b, .chip-c { display: none; }
    .chip-a { left: auto; right: -6%; top: 2%; }
    /* The deck's depth slides are meant to peek past the frame, and on a
       narrow screen they run off the viewport: harmless to look at (the body
       clips them) but they inflate documentElement.scrollWidth, which some
       mobile browsers turn into a pannable page. Clip at the container edge
       instead - overflow-x: clip rather than hidden, so focusing a slide can
       never scroll the deck sideways inside its own box. */
    .flow-outer { overflow-x: clip; }
    .flow { height: 460px; perspective: 1100px; }
    .flow-item { width: 178px; height: 386px; border-radius: 24px; }
    /* Eight dots with a 44px hit area each need 408px; a 390px phone leaves
       about 214px between the two arrows. The arrows and the swipe gesture
       carry navigation instead, and the status line that was screen-reader
       only becomes the visible position indicator. */
    /* The code sample is wider than a phone card and scrolls sideways; fade
       its right edge so the cut reads as "more to the right" and not as a
       clipped layout. Decorative content (aria-hidden), so nothing is lost. */
    .feat-code {
        font-size: .78rem; padding: var(--sp-3) var(--sp-2);
        -webkit-mask-image: linear-gradient(90deg, #000 84%, transparent);
        mask-image: linear-gradient(90deg, #000 84%, transparent);
    }
    .flow-dots { display: none; }
    /* The sideways reveal variants slide content 30px past a 390px edge
       before they settle - transient document overflow, and it reads as a
       wobble on a phone. Everything falls back to the vertical fade. */
    .reveal-l, .reveal-r { transform: translate3d(0, 26px, -60px); }
    .reveal-s { transform: scale(.97) translateZ(-40px); }
    .flow-live {
        position: static; width: auto; height: auto; overflow: visible;
        clip-path: none; margin-top: var(--sp-2); text-align: center;
        font-size: .86rem; color: var(--ink-faint);
    }
    .foot-top { grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); }
    .cta-panel { padding: var(--sp-7) var(--sp-4); }
    .marquee { animation-duration: 24s; }
}

@media (max-width: 400px) {
    .phone { width: 216px; height: 444px; }
    .stage { min-height: 380px; }
    /* Full-width buttons, but never the .btn-sm ones: those live in the
       header row next to the brand and the menu toggle. */
    .btn:not(.btn-sm) { width: 100%; }
    .hero-cta { flex-direction: column; align-items: stretch; }
    .play-badge { justify-content: center; }
}

/* Wide screens: let the 3D breathe rather than stretching text lines. */
@media (min-width: 1440px) {
    :root { --maxw: 1280px; }
}

/* ------------------------------------------------------------------ */
/* Reduced motion — every non-essential animation resolves to its      */
/* final state instead of being merely slowed down.                    */
/* ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
    .reveal { opacity: 1 !important; transform: none !important; }
    .phone-rig { animation: none; transform: rotateX(4deg) rotateY(-12deg); }
    .chip { animation: none; }
    .marquee { animation: none; transform: none; flex-wrap: wrap; width: 100%; justify-content: center; row-gap: var(--sp-2); }
    .paper-scan { display: none; }
    .tilt-in, .paper, .cube { transition: none; }
    .rack { animation: none; }
    .vial i::after { display: none; }
    .helix { animation: none; transform: rotateY(24deg); }
    .strip-trace path { animation: none; stroke-dasharray: none; stroke-dashoffset: 0; opacity: .6; }
    /* The one exception: this spinner is the only signal that the
       report is still loading, so it keeps turning — slowly, and a
       38px ring is not what triggers vestibular discomfort. */
    .spinner { animation: spin 1.6s linear infinite !important; }
}

/* Users who explicitly prefer light: keep the dark art direction (the
   product is a dark-first brand) but lift the page background enough
   that a bright-room reader is not squinting at a black slab. */
@media (prefers-contrast: more) {
    :root {
        --ink-muted: #C3D5EA;
        --ink-faint: #A8BDD6;
        --line: rgba(148, 190, 230, .28);
        --glass: rgba(18, 28, 46, .82);
        --glass-2: rgba(24, 36, 58, .92);
    }
}

@media print {
    .nav, .bg-layer, .progress, .flow-nav, .cta-panel, .site-foot { display: none !important; }
    body { background: #fff; color: #000; }
    .doc-card { box-shadow: none; border: 0; background: none; }
    .doc-body p, .doc-body li, .doc-meta { color: #222; }
}
