/* BrainQA · one screen + two pop-ups. Layout follows design/landing-redesign-2026-11-18.pdf; colours from Brand/ logo files. */

@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url(/assets/fonts/Barlow-400.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url(/assets/fonts/Barlow-500.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url(/assets/fonts/Barlow-600.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url(/assets/fonts/BarlowCondensed-600.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url(/assets/fonts/BarlowCondensed-700.woff2) format("woff2"); }
@font-face { font-family: "Saira Semi Condensed"; font-weight: 700; font-display: swap; src: url(/assets/fonts/SairaSemiCondensed-700.woff2) format("woff2"); }

:root {
  --paper:  #F0EFEA;   /* brand banner ground */
  --surf:   #FFFFFF;
  --ink:    #1D1F20;   /* wordmark "Brain" */
  --muted:  #5B6163;
  --line:   #D8D6CE;
  --teal:   #247580;   /* wordmark "QA" */
  --deep:   #12333A;   /* dark plate */
  --sky:    #7FC2CC;   /* QA on dark */
  --debt:   #C4831A;   /* the unproven part */
  --bad:    #B5452F;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body:    "Barlow", "Helvetica Neue", Arial, sans-serif;
  --mark:    "Saira Semi Condensed", "Barlow Condensed", sans-serif;
  --pad: clamp(20px, 5vw, 80px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--body); font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

/* ── One screen ───────────────────────────────── */
.screen { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: auto auto 1fr auto; }

.banner { background: var(--deep); color: #E7EEEF; text-align: center; font-size: .88rem; padding: 8px var(--pad); }
.banner a { color: var(--sky); font-weight: 600; text-underline-offset: 3px; }

.nav { display: flex; align-items: center; justify-content: space-between; padding: 18px var(--pad); }
.nav nav { display: flex; align-items: center; gap: 28px; }
.nav-link { text-decoration: none; font-weight: 500; color: var(--muted); }
.nav-link:hover { color: var(--ink); }
.wordmark { font-family: var(--mark); font-weight: 700; font-size: 1.6rem; line-height: 1; text-decoration: none; }
.wordmark span { color: var(--teal); }

.btn { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; padding: 14px 22px; font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer; transition: background-color .15s, border-color .15s; }
.btn-sm { padding: 10px 16px; font-size: .95rem; }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: #1C5F68; }
.btn-line { background: var(--surf); border: 1.5px solid var(--line); }
.btn-line:hover { border-color: var(--ink); }
.btn-paper { background: var(--paper); color: var(--ink); }
.btn-paper:hover { background: #fff; }
.btn:disabled { opacity: .6; cursor: default; }

/* ── Hero ─────────────────────────────────────── */
.hero { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 80px); align-items: center; padding: clamp(16px, 4vh, 48px) var(--pad); }
.badge { display: inline-block; border: 1.5px solid var(--teal); color: var(--teal); border-radius: 6px; padding: 3px 10px; font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; margin-bottom: clamp(16px, 3vh, 28px); }
h1 { font-family: var(--display); font-weight: 700; font-size: clamp(2.4rem, min(5.4vw, 8.5vh), 5.4rem); line-height: 1.02; letter-spacing: -0.01em; max-width: 17ch; margin-bottom: clamp(16px, 3vh, 28px); text-wrap: balance; }
.lead { font-size: clamp(1.05rem, 1.35vw, 1.25rem); color: var(--muted); max-width: 46ch; margin-bottom: clamp(20px, 4vh, 36px); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: clamp(20px, 4vh, 36px); }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: .88rem; color: var(--muted); }
.chips li { position: relative; }
.chips li + li::before { content: ""; position: absolute; left: -12px; top: 50%; width: 3px; height: 3px; border-radius: 50%; background: #A7AAA6; }

/* Signature panel, shared */
.sig { background: var(--surf); border-radius: 18px; padding: clamp(22px, 2.4vw, 34px); box-shadow: 0 1px 0 var(--line), 0 30px 60px -30px rgba(18, 51, 58, .35); }
.sig figcaption { margin-top: 18px; font-size: .75rem; color: #8B8F8C; }

/* ── Debt meter ───────────────────────────── */
.meter { --s: 0; --v: 0; }
.m-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.m-label { font-weight: 500; color: var(--muted); }
.m-num { font-family: var(--display); font-weight: 700; font-size: clamp(1.8rem, 2.6vw, 2.6rem); line-height: 1; font-variant-numeric: tabular-nums; }
.m-num-teal { color: var(--teal); }
.m-track { position: relative; height: 14px; border-radius: 7px; background: #EEEDE8; margin-bottom: 26px; overflow: hidden; }
.m-bar { position: absolute; top: 0; bottom: 0; left: 0; }
.m-shipped { width: calc(var(--s) * 100%); background: var(--ink); border-radius: 7px; }
/* Proven | known but unproven | unknown, left to right */
.m-verified { width: calc(var(--v) * 100%); background: var(--teal); }
.m-known { left: calc(var(--v) * 100%); width: calc(var(--k) * 100%); background: repeating-linear-gradient(-45deg, var(--debt) 0 5px, #E3B567 5px 10px); }
.m-unknown { left: calc((var(--v) + var(--k)) * 100%); width: calc(var(--u) * 100%); background: var(--bad); }
.m-key { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; margin: -16px 0 22px; font-size: .8rem; color: var(--muted); }
.m-key li { display: flex; align-items: center; gap: 6px; }
.m-key i { width: 9px; height: 9px; border-radius: 2px; }
.m-key .k-ok { background: var(--teal); } .m-key .k-known { background: var(--debt); } .m-key .k-unknown { background: var(--bad); }
.m-unknown-line { font-size: .85rem; color: var(--bad); font-weight: 600; margin-top: 6px; transition: color .4s; }
.meter.closed .m-unknown-line { color: var(--teal); }
.m-gap { display: flex; justify-content: space-between; align-items: baseline; padding-top: 18px; border-top: 1px solid var(--line); }
.m-gap-label { font-weight: 600; color: var(--debt); transition: color .4s; }
.m-gap-num { font-family: var(--display); font-weight: 700; font-size: clamp(3rem, 5vw, 4.6rem); line-height: .9; color: var(--debt); font-variant-numeric: tabular-nums; transition: color .4s; }
.meter.closed .m-gap-label, .meter.closed .m-gap-num { color: var(--teal); }

/* ── Footer ───────────────────────────────────── */
.foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 24px; line-height: 1.4; padding: 16px var(--pad) 20px; font-size: .85rem; color: var(--muted); }
.foot a { text-underline-offset: 3px; }
.foot span { flex: 1 1 auto; max-width: 820px; font-size: .78rem; }

/* ── Pop-ups ──────────────────────────────────── */
.pop { margin: auto; width: min(640px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); border: 0; border-radius: 16px; padding: clamp(24px, 4vw, 40px); background: var(--surf); color: var(--ink); overflow: auto; }
.pop:focus, .pop:focus-visible { outline: none; }
.pop::backdrop { background: rgba(18, 51, 58, .55); backdrop-filter: blur(3px); }
.pop[open] { animation: pop-in .22s ease-out; }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
#pilot { width: min(600px, calc(100vw - 24px)); }
.lead-form label .opt { font-weight: 400; color: var(--muted); font-size: .8rem; margin-left: 4px; }
.lead-form label:has(.opt) { display: block; }
.lead-form label:has(.opt) select { margin-top: 6px; display: block; }
.pop-dark { width: min(460px, calc(100vw - 24px)); background: var(--deep); color: #EEF3F3; }
.x { position: absolute; top: 12px; right: 14px; width: 40px; height: 40px; border: 0; background: none; font-size: 1.9rem; line-height: 1; cursor: pointer; color: inherit; opacity: .6; }
.x:hover { opacity: 1; }
.pop-k { font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--teal); margin-bottom: 6px; }
.pop-dark .pop-k { color: var(--sky); }
.pop h2 { font-family: var(--display); font-weight: 700; font-size: clamp(1.9rem, 3.4vw, 2.4rem); line-height: 1.05; margin-bottom: 8px; padding-right: 32px; }
.pop-sub { color: var(--muted); margin-bottom: 22px; }
.pop-dark .pop-sub { color: #A9BFC3; }
.lead-form label { display: flex; flex-direction: column; gap: 6px; font-size: .88rem; font-weight: 600; margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.lead-form input[type=text], .lead-form input[type=email], .lead-form select { font-weight: 400; font-size: 1rem; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; width: 100%; }
.lead-form select { -webkit-appearance: none; appearance: none; padding-right: 36px; line-height: 1.4; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235B6163' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center; }
.lead-form input[type=text], .lead-form input[type=email] { line-height: 1.4; }
.pop-dark select { background-color: #1B434B !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23A9BFC3' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important; background-repeat: no-repeat !important; background-position: right 14px center !important; }
.pop-dark input[type=text], .pop-dark input[type=email], .pop-dark select { background: #1B434B; border-color: #2B5962; color: #fff; }
.lead-form input:focus, .lead-form select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(36, 117, 128, .18); }
.lead-form [aria-invalid="true"] { border-color: var(--bad) !important; }
.checks { border: 0; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.checks legend { font-size: .88rem; font-weight: 600; margin-bottom: 8px; }
.checks legend small { font-weight: 400; color: var(--muted); margin-left: 6px; }
.checks.invalid label { border-color: var(--bad); }
input[type=radio] { accent-color: var(--teal); width: 16px; height: 16px; }
.checks label { flex-direction: row; align-items: center; gap: 8px; margin: 0; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 8px; font-weight: 500; cursor: pointer; }
.checks label:has(input:checked) { border-color: var(--teal); background: #EAF4F5; }
.lead-form .consent { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; font-size: .85rem; color: var(--muted); margin: 6px 0 18px; }
.pop-dark .consent { color: #A9BFC3; }
.consent input { margin-top: 3px; flex: none; }
input[type=checkbox] { accent-color: var(--teal); width: 16px; height: 16px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.status { margin-top: 12px; font-size: .9rem; min-height: 1.3em; }
.status.error { color: var(--bad); }
.pop-dark .status.error { color: #FFB4A3; }
.direct { margin-top: 14px; font-size: .85rem; color: #A9BFC3; }
.direct a { color: var(--sky); }
.done { padding: 8px 0; }
.done-text { color: var(--muted); margin: 8px 0 20px; }
.pop-dark .done-text { color: #A9BFC3; }
.pop-dark .btn-paper { width: 100%; }
html:has(dialog[open]) { overflow: hidden; }

/* ── Short screens: keep it to one screen ─────── */
@media (max-height: 880px) and (min-width: 901px) {
  .nav { padding-top: 12px; padding-bottom: 12px; }
  .hero { padding-top: 8px; padding-bottom: 8px; }
  .badge { margin-bottom: 14px; }
  h1 { margin-bottom: 14px; }
  .lead, .actions { margin-bottom: 20px; }
  .foot { padding-top: 10px; padding-bottom: 12px; }
}

/* ── Small screens ────────────────────────────── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; align-content: center; gap: 28px; }
  h1 { font-size: clamp(2.2rem, 9vw, 3.6rem); }
  .sig { max-width: 520px; }
}
@media (max-width: 600px) {
  .hero { padding-top: 12px; gap: 24px; }
  .badge { margin-bottom: 14px; }
  h1 { font-size: clamp(2rem, 9.4vw, 2.6rem); margin-bottom: 14px; }
  .lead { font-size: 1rem; margin-bottom: 18px; }
  .actions { margin-bottom: 18px; }
  .btn { padding: 12px 18px; }
  .chips { font-size: .8rem; }
  .banner { font-size: .8rem; }
  .nav-link { display: none; }
  .actions .btn { flex: 1 1 100%; }
  .grid { grid-template-columns: 1fr; }
  .pop, #pilot { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .pop[open] { animation: none; }
  * { transition: none !important; }
}
