/* ─────────────────────────────────────────────────────────────────────────
   Cogniscan marketing site: homepage (#landing-screen), /request-demo.html
   and /assessments.html. Everything is scoped to `.site` so it cannot leak
   into the clinician app screens that share index.html.

   Theme: light by default, dark when <html> has `.dark` (set before paint by
   the inline script in each page head). `.island-dark` keeps a region dark in
   both themes (hero video, stream media, treatment chart).

   Motion: the base styles are the settled, fully readable layout (used on
   small screens, with reduced motion, and before JS runs). JS adds `.motion`
   to the homepage root to enable the pinned scroll effects; progress values
   arrive as CSS custom properties (--hero-e, --statement, --streams, …).
   ───────────────────────────────────────────────────────────────────────── */

/* ─── tokens ──────────────────────────────────────────────────────────── */
.site {
    --bg: #f9f9ff;
    --fg: #181c23;
    --muted: #4a5061;
    --faint: #5b6170;
    --line: #e0e2ed;
    --line2: #c1c6d7;
    --surface: #ffffff;
    --surface2: #f1f3fe;
    --panel-border: #e0e2ed;
    --body2: #414754;
    --accent-text: #0059bb;
    --accent-line: #0059bb;
    --unlit: #d3d7e3;
    --dim-title: #6b7182;
    --chip-muted: #6b7182;
    --nav-bg: rgba(255, 255, 255, 0.86);
    --dash: #c1c6d7;
    --step-bg: rgba(0, 89, 187, 0.1);
    --ok: #0f766e;
    --ok-bg: rgba(15, 118, 110, 0.12);
    --danger: #b91c1c;
    --mind: #6d28d9;
    --brain: #0059bb;
    --body: #0f766e;
    --mind-chip-bg: rgba(109, 40, 217, 0.1);
    --mind-chip-fg: #5b21b6;
    --brain-chip-bg: rgba(0, 89, 187, 0.1);
    --brain-chip-fg: #004493;
    --body-chip-bg: rgba(15, 118, 110, 0.1);
    --body-chip-fg: #115e59;
    --clin-chip-bg: rgba(180, 83, 9, 0.1);
    --clin-chip-fg: #92400e;
    --grid: rgba(24, 28, 35, 0.06);
    --btn: #2563eb;
    --btn-hover: #1d4ed8;
    --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

    background: var(--bg);
    color: var(--fg);
    font-family: var(--font);
    font-size: 18px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    color-scheme: light;
}

.dark .site,
.site .island-dark {
    --bg: #0b1120;
    --fg: #f1f5f9;
    --muted: #94a3b8;
    --faint: #64748b;
    --line: #1c2740;
    --line2: #2a3651;
    --surface: #0e1830;
    --surface2: #111a2c;
    --panel-border: #1f2b45;
    --body2: #cbd5e1;
    --accent-text: #7cb1ff;
    --accent-line: #5b9dff;
    --unlit: #2a3548;
    --dim-title: #64748b;
    --chip-muted: #475569;
    --nav-bg: rgba(11, 17, 32, 0.84);
    --dash: #3b4a6b;
    --step-bg: rgba(91, 157, 255, 0.14);
    --ok: #34d3bd;
    --ok-bg: rgba(52, 211, 189, 0.16);
    --danger: #f87171;
    --mind: #b794f6;
    --brain: #5b9dff;
    --body: #34d3bd;
    --mind-chip-bg: rgba(183, 148, 246, 0.14);
    --mind-chip-fg: #d6c2fb;
    --brain-chip-bg: rgba(91, 157, 255, 0.14);
    --brain-chip-fg: #bcd6ff;
    --body-chip-bg: rgba(52, 211, 189, 0.14);
    --body-chip-fg: #a7efe4;
    --clin-chip-bg: rgba(247, 160, 97, 0.14);
    --clin-chip-fg: #fbc9a3;
    --grid: rgba(148, 163, 184, 0.07);
    color-scheme: dark;
}

.site .island-dark {
    color: var(--fg);
}

html:has(body > .site-page) {
    background: #f9f9ff;
}

html.dark:has(body > .site-page) {
    background: #0b1120;
}

/* ─── base ────────────────────────────────────────────────────────────── */
.site *,
.site *::before,
.site *::after {
    box-sizing: border-box;
}

.site img {
    max-width: 100%;
    display: block;
}

.site h1,
.site h2,
.site h3 {
    margin: 0;
    font-family: var(--font);
    font-weight: 800;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.site p {
    margin: 0;
    text-wrap: pretty;
}

.site a {
    color: var(--accent-text);
}

.site a:hover {
    color: var(--fg);
}

.site :focus-visible {
    outline: 2px solid var(--accent-text);
    outline-offset: 2px;
}

.site .hidden {
    display: none !important;
}

.site .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site .container {
    width: min(1200px, calc(100% - 96px));
    margin: 0 auto;
}

.site .eyebrow {
    margin: 0 0 18px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-text);
}

.site .lead {
    font-size: clamp(17px, 1.6vw, 20px);
    line-height: 1.55;
    color: var(--muted);
}

.site .h2 {
    font-size: clamp(30px, 3.4vw, 44px);
    line-height: 1.12;
    letter-spacing: -0.025em;
}

.site .gridbg {
    background-image:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 48px 48px;
}

/* ─── nav ─────────────────────────────────────────────────────────────── */
.site .nav {
    position: sticky;
    top: 0;
    z-index: 50;
    height: 72px;
    background: var(--nav-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

.site .nav-inner {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.site .nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--fg);
    font-weight: 800;
    font-size: 20px;
    letter-spacing: -0.02em;
}

.site .nav-logo {
    width: 38px;
    height: 34px;
    -o-object-fit: contain;
       object-fit: contain;
}

.site .nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    font-size: 15px;
    font-weight: 600;
}

.site .nav-links a,
.site .nav-back {
    color: var(--muted);
    text-decoration: none;
}

.site .nav-links a:hover,
.site .nav-back:hover {
    color: var(--fg);
}

.site .nav-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 14px;
    font-size: 15px;
    font-weight: 600;
}

.site .nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.site .icon-btn {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 999px;
    border: 1px solid var(--line2);
    background: transparent;
    color: var(--fg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.site .icon-btn:hover {
    border-color: var(--accent-line);
}

.site .pill-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid var(--line2);
    border-radius: 999px;
    color: var(--fg);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}

.site .pill-link:hover {
    border-color: var(--accent-line);
    color: var(--fg);
}

.site .nav-progress {
    position: absolute;
    left: 0;
    bottom: -1px;
    height: 2px;
    width: calc(var(--page, 0) * 100%);
    background: var(--accent-line);
}

/* ─── buttons, links, tags ────────────────────────────────────────────── */
.site .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 26px;
    border: 0;
    border-radius: 14px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.site .btn-primary {
    background: var(--btn);
    color: #ffffff;
}

.site .btn-primary:hover {
    background: var(--btn-hover);
    color: #ffffff;
}

.site .btn-primary:disabled {
    opacity: 0.7;
    cursor: wait;
}

.site .btn-ghost {
    background: transparent;
    color: var(--fg);
    border: 1px solid var(--line2);
}

.site .btn-block {
    width: 100%;
}

.site .text-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    font-size: 15px;
    font-weight: 700;
    color: var(--accent-text);
    text-decoration: none;
}

.site .tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

.site .tag b {
    font-weight: 800;
    opacity: 0.7;
}

.site .tag-mind { background: var(--mind-chip-bg); color: var(--mind-chip-fg); }
.site .tag-brain { background: var(--brain-chip-bg); color: var(--brain-chip-fg); }
.site .tag-body { background: var(--body-chip-bg); color: var(--body-chip-fg); }
.site .tag-clin { background: var(--clin-chip-bg); color: var(--clin-chip-fg); }
.site .tag-self { background: var(--surface2); color: var(--body2); }

.site .badge-own {
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid var(--mind);
    color: var(--mind);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ─── media slots (drop files into public/media/) ─────────────────────── */
.site .media-slot {
    position: relative;
    overflow: hidden;
    background-color: var(--surface);
}

.site .media-slot > .media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
       object-fit: cover;
    z-index: 0;
}

.site .media-slot > img.media {
    opacity: 0;
    transition: opacity 0.4s ease;
}

.site .media-slot > img.media.is-loaded {
    opacity: 1;
}

.site .media-slot > .media.is-missing {
    display: none;
}

.site .media-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.site .media-fallback img {
    width: 30%;
    max-width: 180px;
    opacity: 0.35;
}

.site .media-slot > .media.is-loaded ~ .media-fallback {
    display: none;
}

/* Small label for staged or AI-generated imagery; only shown once the image loads. */
.site .media-note {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 2;
    display: none;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(11, 17, 32, 0.6);
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 600;
}

.site .media-slot > .media.is-loaded ~ .media-note {
    display: block;
}

/* EEG traces drawn over the hero and brain media */
.site .traces {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    padding: 40px 0;
    pointer-events: none;
}

.site .trace-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-left: 32px;
}

.site .trace-row span {
    width: 44px;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #64748b;
}

.site .trace-wrap {
    flex-grow: 1;
    height: 56px;
    overflow: hidden;
    position: relative;
}

.site .trace {
    position: absolute;
    left: 0;
    top: 0;
    width: 200%;
    height: 56px;
    animation: site-eeg-scroll 9s linear infinite;
}

.site .trace.slow {
    animation-duration: 13s;
}

.site .trace path {
    fill: none;
    stroke-width: 1.6;
}

.site .paused .trace,
.site .paused .lib-track,
.site.paused .trace,
.site.paused .lib-track {
    animation-play-state: paused;
}

@keyframes site-eeg-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* ─── hero ────────────────────────────────────────────────────────────── */
.site .hero-sticky {
    padding: 56px 0 48px;
}

.site .hero h1 {
    font-size: clamp(40px, 6vw, 76px);
    line-height: 1.04;
    letter-spacing: -0.035em;
}

.site .hero-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 48px;
    margin-top: 28px;
}

.site .hero-row .lead {
    max-width: 780px;
    font-size: clamp(17px, 1.5vw, 19px);
}

.site .hero-ctas {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    flex-shrink: 0;
}

.site .hero-card {
    position: relative;
    width: min(1200px, calc(100% - 96px));
    height: clamp(320px, 52vh, 560px);
    margin: 40px auto 0;
    border-radius: 28px;
    border: 1px solid var(--panel-border);
}

.site .hero-caption {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 0 48px;
    text-align: center;
    background: rgba(8, 13, 26, 0.62);
    pointer-events: none;
}

.site .hero-caption p:first-child {
    font-size: calc(36px + 40px * var(--hero-cap, 0));
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.04;
}

.site .hero-caption p:last-child {
    max-width: 640px;
    font-size: 20px;
    line-height: 1.55;
    color: #cbd5e1;
}

.site .media-toggle {
    position: absolute;
    right: 20px;
    bottom: 20px;
    z-index: 4;
    background: rgba(11, 17, 32, 0.8);
}

/* ─── problem statement ───────────────────────────────────────────────── */
.site .statement {
    padding: 120px 0;
}

.site .statement-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 72px;
    align-items: end;
}

.site .statement-text {
    font-size: clamp(30px, 3.6vw, 46px);
    line-height: 1.24;
    letter-spacing: -0.025em;
}

.site .word {
    transition: color 0.3s ease;
}

.site .em,
.site .word.em {
    color: var(--accent-text);
}

.site .stat-num {
    font-size: clamp(96px, 10vw, 148px);
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: -0.05em;
}

.site .stat-num small {
    margin-left: 8px;
    font-size: 44px;
    letter-spacing: -0.02em;
    color: var(--accent-text);
}

.site .stat-caption {
    margin: 18px 0 8px;
    font-size: 20px;
    line-height: 1.4;
    font-weight: 700;
}

.site .stat-source {
    font-size: 14px;
    color: var(--muted);
}

/* ─── three streams ───────────────────────────────────────────────────── */
.site .streams {
    padding: 120px 0;
}

.site .streams-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 64px;
    align-items: center;
}

.site .media-panel {
    position: relative;
    height: 640px;
    background-color: var(--surface);
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--panel-border);
}

.site .layer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(1.04);
    transition: opacity 0.5s ease, transform 0.6s ease;
}

.site .streams[data-active="0"] .layer-0,
.site .streams[data-active="1"] .layer-1,
.site .streams[data-active="2"] .layer-2 {
    opacity: 1;
    transform: none;
}

.site .layer > .media-slot {
    position: absolute;
    inset: 0;
    background: transparent;
}

/* Assessment picker (layer 0) */
.site .picker {
    position: relative;
    z-index: 2;
    width: 400px;
    max-width: calc(100% - 48px);
    height: calc(100% - 110px);
    max-height: 580px;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    color: #0f172a;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
}

.site .picker-head {
    padding: 22px 22px 14px;
    border-bottom: 1px solid #e2e8f0;
}

.site .picker-head p {
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.site .picker-search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
}

.site .picker-list {
    position: relative;
    flex-grow: 1;
    overflow: hidden;
}

.site .picker-list::before,
.site .picker-list::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    z-index: 1;
    pointer-events: none;
}

.site .picker-list::before {
    top: 0;
    height: 28px;
    background: linear-gradient(#f8fafc, rgba(248, 250, 252, 0));
}

.site .picker-list::after {
    bottom: 0;
    height: 48px;
    background: linear-gradient(rgba(248, 250, 252, 0), #f8fafc);
}

.site .lib-track {
    animation: site-lib-scroll 48s linear infinite;
}

@keyframes site-lib-scroll {
    from { transform: translateY(0); }
    to { transform: translateY(-50%); }
}

.site .lib-cat {
    padding: 14px 22px 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #475569;
}

.site .lib-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 22px;
    border-top: 1px solid #eef2f7;
}

.site .lib-row > div {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.site .lib-name {
    font-size: 14px;
    line-height: 1.3;
    font-weight: 700;
}

.site .lib-tag {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.site .lib-tag.own { background: #ede9fe; color: #5b21b6; }
.site .lib-tag.caregiver { background: #e0f2fe; color: #075985; }
.site .lib-tag.clinician { background: #fef3c7; color: #92400e; }

.site .lib-q {
    flex-shrink: 0;
    padding: 3px 8px;
    border-radius: 6px;
    background: #eef2ff;
    color: #1e3a8a;
    font-size: 12px;
    font-weight: 800;
}

/* Brain layer (layer 1) */
.site .layer-1 .traces {
    padding: 64px 0 150px;
}

.site .fnirs {
    position: absolute;
    left: 28px;
    right: 28px;
    bottom: 28px;
    z-index: 2;
    display: flex;
    gap: 16px;
    align-items: flex-end;
    padding: 18px 20px;
    border-radius: 16px;
    background: rgba(11, 17, 32, 0.85);
    border: 1px solid var(--line2);
}

.site .fnirs-title {
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.site .fnirs-bars {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    height: 56px;
}

.site .fnirs-bars i {
    display: block;
    width: 8px;
    border-radius: 3px;
    background: #f7a061;
}

.site .fnirs-bars i.hbr {
    background: #3b5b99;
}

/* Body layer (layer 2) */
.site .wear-card {
    position: relative;
    z-index: 2;
    width: 400px;
    max-width: calc(100% - 48px);
    padding: 28px;
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid var(--line2);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
}

.site .wear-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 22px;
}

.site .wear-metrics div {
    padding: 12px 14px;
    border-radius: 12px;
    background: #16213a;
}

/* Stream list */
.site .streams-list {
    position: relative;
    padding-left: 22px;
}

.site .rail {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    border-radius: 2px;
    background: var(--line);
}

.site .rail i {
    display: block;
    width: 2px;
    height: calc(var(--streams, 1) * 100%);
    border-radius: 2px;
    background: var(--accent-line);
}

.site .stream-item {
    display: flex;
    gap: 18px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.site .stream-item:last-child {
    border-bottom: 0;
}

.site .stream-num,
.site .stream-label {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--chip-muted);
    transition: color 0.4s ease;
}

.site .stream-num {
    width: 30px;
    flex-shrink: 0;
    padding-top: 3px;
}

.site .stream-label {
    margin-bottom: 4px;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.site .stream-item h3 {
    font-size: 22px;
    line-height: 1.15;
    color: var(--dim-title);
    transition: font-size 0.45s ease, color 0.45s ease;
}

.site .stream-body {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, opacity 0.4s ease;
}

.site .stream-body > p {
    margin: 12px 0 14px;
    font-size: 17px;
    line-height: 1.6;
    color: var(--body2);
}

.site .stream-body .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.site .own-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--body2);
}

.site .stream-item.open h3 {
    font-size: 34px;
    color: var(--fg);
}

.site .stream-item.open .stream-body {
    max-height: 900px;
    opacity: 1;
}

.site .stream-item.open.mind .stream-num,
.site .stream-item.open.mind .stream-label { color: var(--mind); }
.site .stream-item.open.brain .stream-num,
.site .stream-item.open.brain .stream-label { color: var(--brain); }
.site .stream-item.open.body .stream-num,
.site .stream-item.open.body .stream-label { color: var(--body); }

.site .stream-note {
    margin-top: 24px;
    font-size: 16px;
    line-height: 1.55;
    color: var(--body2);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.site .stream-note strong {
    color: var(--fg);
}

/* ─── treatment trend ─────────────────────────────────────────────────── */
.site .trend {
    padding: 120px 0;
}

.site .trend-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 48px;
    margin-bottom: 32px;
}

.site .trend-head .lead {
    max-width: 470px;
    font-size: 18px;
}

.site .chart-card {
    position: relative;
    padding: 24px 28px 16px;
    border-radius: 24px;
    background: var(--surface);
    border: 1px solid var(--panel-border);
}

.site .chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 700;
    color: var(--body2);
}

.site .chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.site .chart-legend i {
    display: block;
    width: 22px;
    height: 3px;
    border-radius: 2px;
}

.site .chart-legend i.dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    border: 2px solid var(--fg);
}

.site .chart svg {
    display: block;
    width: 100%;
    height: auto;
}

.site .chart text {
    font-family: var(--font);
}

.site .chart .fade {
    transition: opacity 0.35s ease;
}

.site .chart-note {
    position: absolute;
    left: calc(28px + 53%);
    top: 96px;
    width: 300px;
    padding: 16px 18px;
    border-radius: 16px;
    background: rgba(11, 17, 32, 0.92);
    border: 1px solid var(--line2);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.site .chart-note p:first-child {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.site .chart-note p:last-child {
    margin-top: 8px;
    font-size: 16px;
    line-height: 1.5;
    font-weight: 600;
}

/* ─── proof ───────────────────────────────────────────────────────────── */
.site .proof {
    padding: 150px 0 130px;
}

.site .proof-grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 72px;
    align-items: center;
}

.site .proof-media {
    height: 560px;
    border-radius: 24px;
    border: 1px solid var(--panel-border);
    background-color: var(--surface2);
}

.site .quote-mark {
    height: 56px;
    font-size: 120px;
    line-height: 0.6;
    font-weight: 800;
    color: var(--accent-line);
}

.site .quote {
    margin: 0;
}

.site .quote p {
    font-size: clamp(28px, 3vw, 40px);
    line-height: 1.28;
    letter-spacing: -0.02em;
    font-weight: 800;
}

.site .quote footer {
    /* reset app-wide footer styles from main.css */
    position: static;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    margin-top: 22px;
    font-size: 17px;
    font-weight: 600;
    color: var(--muted);
}

.site .proof-stats {
    display: flex;
    gap: 40px;
    margin-top: 44px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

.site .proof-stats strong {
    display: block;
    font-size: 28px;
    letter-spacing: -0.02em;
}

.site .proof-stats span {
    display: block;
    margin-top: 4px;
    font-size: 15px;
    color: var(--muted);
}

/* ─── request clinician access ────────────────────────────────────────── */
.site .request {
    padding: 20px 0 140px;
}

.site .request-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 440px;
    gap: 64px;
    padding: 64px;
    border-radius: 32px;
    background: var(--surface);
    border: 1px solid var(--panel-border);
}

.site .request-copy {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.site .request-media {
    aspect-ratio: 1400 / 827;
    border-radius: 18px;
    border: 1px solid var(--panel-border);
    background-color: var(--surface2);
}

/* The report crop is a white document page in both themes. */
.site .request-media > .media {
    -o-object-fit: contain;
       object-fit: contain;
    background: #ffffff;
}

/* ─── forms ───────────────────────────────────────────────────────────── */
.site .form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.site .field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.site .field label,
.site .field-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--body2);
}

.site .field label .opt {
    font-weight: 600;
    color: var(--muted);
}

.site .field label .req {
    color: var(--accent-text);
}

.site .field input,
.site .field select,
.site .field textarea {
    min-height: 48px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--line2);
    background: var(--bg);
    color: var(--fg);
    font-family: inherit;
    font-size: 16px;
}

.site .field select {
    padding: 0 12px;
}

.site .field textarea {
    padding: 12px 14px;
    line-height: 1.5;
    resize: vertical;
}

.site .field input::-moz-placeholder, .site .field textarea::-moz-placeholder {
    color: var(--faint);
}

.site .field input::placeholder,
.site .field textarea::placeholder {
    color: var(--faint);
}

.site .field [aria-invalid="true"] {
    border-color: var(--danger);
}

.site .form-status {
    min-height: 0;
    font-size: 15px;
    line-height: 1.5;
    color: var(--muted);
}

.site .form-status:empty {
    display: none;
}

.site .form-status.error { color: var(--danger); }
.site .form-status.success { color: var(--ok); }

.site .form-alt {
    margin-top: 2px;
    text-align: center;
    font-size: 15px;
    color: var(--muted);
}

.site .hp-field {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.site .chip-opt {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--line2);
    background: var(--bg);
    color: var(--body2);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.site .chip-opt input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--accent-line);
}

.site .chip-opt:has(input:checked) {
    border-color: var(--accent-line);
    background: var(--step-bg);
    color: var(--fg);
}

.site .chip-opt:has(input:focus-visible) {
    outline: 2px solid var(--accent-text);
    outline-offset: 2px;
}

.site .chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ─── overview video dialog ───────────────────────────────────────────── */
.site .overview-dialog {
    width: min(960px, calc(100% - 32px));
    padding: 0;
    border: 0;
    border-radius: 20px;
    background: #000000;
    color: #ffffff;
}

.site .overview-dialog::backdrop {
    background: rgba(2, 6, 23, 0.8);
}

.site .overview-dialog video {
    display: block;
    width: 100%;
    height: auto;
}

.site .overview-dialog .icon-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.5);
}

/* ─── footer ──────────────────────────────────────────────────────────── */
.site .site-footer {
    border-top: 1px solid var(--line);
    padding: 40px 0 48px;
}

.site .footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.site .footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    font-size: 14px;
    font-weight: 600;
}

.site .footer-links a {
    color: var(--muted);
    text-decoration: none;
}

.site .footer-links a:hover {
    color: var(--fg);
}

.site .footer-social {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.site .social-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--line2);
    border-radius: 999px;
    color: var(--body2);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.site .social-link:hover {
    border-color: var(--accent-line);
    color: var(--fg);
}

.site .site-footer small {
    width: 100%;
    font-size: 13px;
    color: var(--faint);
}

/* ─── scroll motion (homepage, JS adds .motion) ───────────────────────── */
.site.motion .hero {
    height: 190vh;
}

.site.motion .hero-sticky {
    position: sticky;
    top: 72px;
    height: calc(100vh - 72px);
    padding: 0;
    overflow: hidden;
}

.site.motion .hero-text {
    position: absolute;
    left: 0;
    right: 0;
    top: 48px;
    opacity: calc(1 - var(--hero-t, 0));
    transform: translateY(calc(var(--hero-t, 0) * -80px));
}

.site.motion .hero-card {
    position: absolute;
    left: 50%;
    bottom: calc(32px * (1 - var(--hero-e, 0)));
    width: calc(min(1200px, 100% - 96px) * (1 - var(--hero-e, 0)) + 100% * var(--hero-e, 0));
    height: max(240px, calc(100vh - 572px + 500px * var(--hero-e, 0)));
    margin: 0;
    border-radius: calc(28px * (1 - var(--hero-e, 0)));
    transform: translateX(-50%);
}

.site.motion .hero-caption {
    display: flex;
    opacity: var(--hero-cap, 0);
}

.site.motion .statement {
    height: 240vh;
    padding: 0;
}

.site.motion .statement-sticky,
.site.motion .streams-sticky,
.site.motion .trend-sticky {
    position: sticky;
    top: 72px;
    height: calc(100vh - 72px);
    display: flex;
    align-items: center;
}

.site.motion .statement-sticky > .container,
.site.motion .streams-sticky > .container,
.site.motion .trend-sticky > .container {
    width: min(1200px, calc(100% - 96px));
}

.site.motion .word {
    color: var(--unlit);
}

.site.motion .word.lit {
    color: var(--fg);
}

.site.motion .word.lit.em {
    color: var(--accent-text);
}

.site.motion .stat {
    opacity: var(--stat, 0);
    transform: translateY(calc((1 - var(--stat, 0)) * 40px));
}

.site.motion .streams {
    height: 340vh;
    padding: 0;
}

.site.motion .media-panel {
    height: calc(100vh - 200px);
}

.site.motion .stream-note {
    opacity: var(--note, 0);
    transform: translateY(calc((1 - var(--note, 0)) * 16px));
}

.site.motion .trend {
    height: 240vh;
    padding: 0;
}

.site.motion .trend .fade {
    opacity: 0;
}

.site.motion .trend.show-dot0 .dot0,
.site.motion .trend.show-marker .marker,
.site.motion .trend.show-marker .dot1,
.site.motion .trend.show-end .dot2,
.site.motion .trend.show-end .end-labels {
    opacity: 1;
}

.site.motion .chart-note {
    opacity: 0;
    transform: translateY(12px);
}

.site.motion .trend.show-note .chart-note {
    opacity: 1;
    transform: none;
}

.site.motion .proof-media {
    opacity: var(--proof-img, 0);
    transform: translateY(calc((1 - var(--proof-img, 0)) * 40px));
}

.site.motion .proof-stats {
    opacity: var(--proof-stat, 0);
    transition: opacity 0.3s ease;
}

.site.motion .request-panel {
    opacity: calc(0.2 + 0.8 * var(--req, 0));
    transform: translateY(calc((1 - var(--req, 0)) * 48px));
}

@media (prefers-reduced-motion: reduce) {
    .site .trace,
    .site .lib-track {
        animation: none;
    }

    .site .layer,
    .site .stream-body,
    .site .stream-item h3,
    .site .word {
        transition: none;
    }
}

/* ─── responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1080px) {
    .site .nav-links {
        display: none;
    }

    .site .request-panel {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 900px) {
    .site .container,
    .site .hero-card {
        width: calc(100% - 40px);
    }

    .site .hero-row,
    .site .trend-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
    }

    .site .hero-ctas {
        align-items: flex-start;
    }

    .site .statement,
    .site .streams,
    .site .trend {
        padding: 80px 0;
    }

    .site .statement-grid,
    .site .streams-grid,
    .site .proof-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 40px;
    }

    .site .media-panel {
        height: 520px;
    }

    .site .chart-note {
        position: static;
        width: auto;
        margin-top: 16px;
    }

    .site .proof {
        padding: 80px 0;
    }

    .site .proof-media {
        height: 420px;
    }

    .site .request-panel {
        padding: 32px 24px;
        gap: 32px;
    }

    .site .nav-back span {
        display: none;
    }
}

@media (max-width: 520px) {
    .site .trace-row span {
        display: none;
    }

    .site .trace-row {
        padding-left: 12px;
    }

    .site .proof-stats {
        flex-direction: column;
        gap: 20px;
    }
}

/* ─── standalone pages (request-demo.html, assessments.html) ──────────── */
body.site-page {
    margin: 0;
}

.site.site-root {
    min-height: 100vh;
}

.site .page-main {
    padding: 72px 0 96px;
}

.site .page-title {
    font-size: clamp(38px, 4.4vw, 56px);
    line-height: 1.06;
    letter-spacing: -0.035em;
    margin-bottom: 18px;
}

.site .card {
    padding: 36px;
    border-radius: 24px;
    background: var(--surface);
    border: 1px solid var(--panel-border);
}

/* Request a demo */
.site .demo-grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 72px;
    align-items: start;
}

.site .demo-aside {
    position: sticky;
    top: 120px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.site .steps {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.site .steps li {
    display: flex;
    gap: 16px;
}

.site .step-num {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 999px;
    background: var(--step-bg);
    color: var(--accent-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 800;
}

.site .steps strong {
    display: block;
    margin-bottom: 2px;
    font-size: 17px;
}

.site .steps span {
    font-size: 15px;
    line-height: 1.55;
    color: var(--muted);
}

.site .schedule-slot {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-radius: 16px;
    border: 1.5px dashed var(--dash);
    font-size: 15px;
}

.site .privacy-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--muted);
}

.site .demo-form {
    gap: 30px;
}

.site .demo-form fieldset {
    margin: 0;
    padding: 0;
    border: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.site .demo-form legend {
    padding: 0;
    margin-bottom: 14px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.site .grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.site .consent {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--body2);
    cursor: pointer;
}

.site .consent input {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    flex-shrink: 0;
    accent-color: var(--accent-line);
}

.site .form-footer {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.site .success-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding: 48px 40px;
}

.site .success-icon {
    width: 56px;
    height: 56px;
    border-radius: 999px;
    background: var(--ok-bg);
    color: var(--ok);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Assessment library */
.site .lib-intro {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 64px;
    align-items: end;
    margin-bottom: 48px;
}

.site .stat-tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.site .stat-tile {
    padding: 18px 20px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--panel-border);
}

.site .stat-tile strong {
    display: block;
    font-size: 34px;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.site .stat-tile span {
    display: block;
    margin-top: 2px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--muted);
}

.site .filter-bar {
    position: sticky;
    top: 72px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px 0;
    margin-bottom: 12px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}

.site .filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.site .filter-label {
    width: 110px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.site .filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--line2);
    background: transparent;
    color: var(--body2);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.site .filter-btn span {
    font-weight: 800;
    opacity: 0.6;
}

.site .filter-btn[aria-pressed="true"] {
    border-color: var(--accent-line);
    background: var(--step-bg);
    color: var(--fg);
}

.site .filter-sep {
    width: 1px;
    height: 28px;
    margin: 0 6px;
    background: var(--line2);
}

.site .filter-count {
    margin-left: auto;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
}

.site .lib-group {
    padding: 36px 0 8px;
}

.site .lib-group-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 18px;
}

.site .lib-group-head h2 {
    font-size: 26px;
}

.site .lib-group-head span {
    font-size: 15px;
    font-weight: 700;
    color: var(--muted);
}

.site .lib-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.site .lib-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 22px;
    border-radius: 18px;
    background: var(--surface);
    border: 1px solid var(--panel-border);
}

.site .lib-card .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.site .lib-card .tag {
    padding: 3px 9px;
    font-size: 12px;
    font-weight: 800;
}

.site .lib-card h3 {
    font-size: 18px;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.site .lib-card p {
    flex-grow: 1;
    font-size: 15px;
    line-height: 1.55;
    color: var(--muted);
}

.site .lib-card-meta {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-size: 14px;
    font-weight: 700;
    color: var(--body2);
}

.site .lib-card-meta span + span {
    color: var(--muted);
}

.site .lib-empty {
    padding: 64px 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.site .cta-panel {
    margin-top: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    padding: 48px 56px;
    border-radius: 28px;
    background: var(--surface);
    border: 1px solid var(--panel-border);
}

.site .lib-note {
    font-size: 13px;
    color: var(--faint);
}

@media (max-width: 1080px) {
    .site .lib-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .site .demo-grid,
    .site .lib-intro {
        grid-template-columns: minmax(0, 1fr);
        gap: 40px;
    }

    .site .demo-aside {
        position: static;
    }

    .site .card {
        padding: 24px;
    }

    .site .grid-2 {
        grid-template-columns: minmax(0, 1fr);
    }

    .site .filter-bar {
        position: static;
    }

    .site .filter-label {
        width: 100%;
    }

    .site .filter-count {
        margin-left: 0;
    }

    .site .cta-panel {
        flex-direction: column;
        align-items: flex-start;
        padding: 32px 24px;
    }
}

@media (max-width: 640px) {
    .site .lib-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
