/*
 * Infolytics Precision Design Standard v1.0, applied to the web.
 * Governing principle: white canvas + Deep Teal structure + Gold precision accents.
 * Layout: single left-aligned column (max 820px). Landing = cover; report = Precision Proposal-style sections.
 * Single light theme by design (the standard is a white-canvas system).
 * Type sizes keep the standard's ratios, scaled from its 10pt print body to a 16px web body.
 */
:root {
  /* Closed palette (§2.1) */
  --deep-teal: #154B4D;
  --gold: #FFE085;
  --white: #FFFFFF;
  --soft-teal-grey: #EEF4F3;
  --mid-teal-grey: #71898A;
  --charcoal: #253238;
  --rule-grey: #D7DEE2;

  /* Typography (§4): Aptos family; system sans as fallback where Aptos is not installed */
  --f-display: "Aptos Display", "Aptos", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --f-text: "Aptos", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  --fs-cover: clamp(34px, 6.4vw, 50px);   /* cover title 28–34pt ratio */
  --fs-h1: clamp(26px, 4.2vw, 30px);      /* H1 18–20pt ratio */
  --fs-h2: 22px;                          /* H2 13–15pt ratio */
  --fs-h3: 18px;                          /* H3 10.5–11.5pt ratio */
  --fs-body: 16px;                        /* body 9.5–10.5pt */
  --fs-table: 15px;                       /* table 8.5–9.5pt ratio */
  --fs-meta: 12.5px;                      /* metadata 7–8pt ratio */

  --r: 4px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--white);
  color: var(--charcoal);
  font: 400 var(--fs-body)/1.6 var(--f-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.wrap { width: 100%; max-width: 820px; margin: 0 auto; padding-inline: 20px; }
main.wrap { flex: 1; padding-block: 36px 64px; }
h1, h2, h3 { font-family: var(--f-display); color: var(--deep-teal); text-wrap: balance; margin: 0; line-height: 1.15; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--deep-teal); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.meta { font-size: var(--fs-meta); color: var(--mid-teal-grey); }
.label { /* small uppercase descriptor (cover descriptor / IDs) */
  font: 600 var(--fs-meta)/1.4 var(--f-text);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid-teal-grey);
}

/* ---------- Header (§5.1) and footer (§5.2) ---------- */
.topbar { border-bottom: 1px solid var(--rule-grey); background: var(--white); }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-block: 12px; }
.lockup { display: inline-flex; align-items: center; gap: 8px; font: 700 15px/1 var(--f-display); letter-spacing: 0.16em; color: var(--deep-teal); text-decoration: none; }
.lockup img { height: 68px; width: auto; display: block; border-radius: 2px; }
@media (max-width: 640px) { .lockup img { height: 54px; } }
.lockup .pt { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 1.5px var(--deep-teal); }
.doc-id { font: 600 var(--fs-meta)/1.4 var(--f-text); letter-spacing: 0.08em; text-transform: uppercase; color: var(--mid-teal-grey); }
.doc-id b { color: var(--deep-teal); font-weight: 600; }

.foot { border-top: 1px solid var(--rule-grey); }
.foot-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-block: 16px; font-size: var(--fs-meta); color: var(--mid-teal-grey); }

/* ---------- Signature motif (§2.3): thin Deep Teal line ending in a Gold point ---------- */
.motif { display: flex; align-items: center; width: min(100%, 360px); margin-block: 20px 22px; }
.motif::before { content: ""; flex: 1; height: 2px; background: var(--deep-teal); }
.motif::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px var(--deep-teal); flex: none; }

/* ---------- Status (§9.1) ---------- */
.status { display: inline-block; font: 600 var(--fs-meta)/1 var(--f-text); letter-spacing: 0.08em; padding: 6px 9px; border-radius: 2px; background: var(--deep-teal); color: var(--white); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px solid var(--deep-teal); background: var(--deep-teal); color: var(--white);
  padding: 13px 22px; border-radius: var(--r); font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(0.88); }
.btn.outline { background: var(--white); color: var(--deep-teal); }
.btn.outline:hover { background: var(--soft-teal-grey); }
.btn.quiet { background: transparent; border-color: var(--rule-grey); color: var(--charcoal); }
.btn.quiet:hover { border-color: var(--deep-teal); }
.linkish { background: none; border: 0; padding: 0; color: var(--deep-teal); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 15px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

/* ---------- Landing = cover ---------- */
.cover { padding-block: 8px 8px; }
.cover h1 { font-size: var(--fs-cover); font-weight: 700; max-width: 18ch; margin-top: 12px; }
.cover .lede { color: var(--charcoal); max-width: 58ch; font-size: 18px; }
.cover .promise { margin-top: 14px; font-weight: 600; color: var(--deep-teal); max-width: 58ch; }
.cover .row { margin-top: 26px; }
.cover .assure { margin-top: 12px; }

.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 40px; border-top: 2px solid var(--deep-teal); border-bottom: 1px solid var(--rule-grey); }
.fact { padding: 16px 0; }
.fact + .fact { border-left: 1px solid var(--rule-grey); padding-left: 18px; }
.fact b { display: block; font: 700 34px/1.05 var(--f-display); color: var(--deep-teal); font-variant-numeric: tabular-nums; }
.fact span { font-size: 14px; color: var(--mid-teal-grey); }

/* Numbered sections: Gold number in a Deep Teal chip + Deep Teal title (§4, §7) */
.section { margin-top: 52px; }
.sec-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.sec-no { flex: none; min-width: 34px; height: 30px; padding-inline: 6px; display: grid; place-items: center; background: var(--deep-teal); color: var(--gold); font: 700 14px/1 var(--f-display); border-radius: 2px; font-variant-numeric: tabular-nums; }
.sec-head h2 { font-size: var(--fs-h1); font-weight: 700; }
.section p.intro { max-width: 62ch; margin-bottom: 16px; }

/* ---------- Precision table family (§9) ---------- */
.tbl-wrap { overflow-x: auto; }
table.pt { width: 100%; border-collapse: collapse; font-size: var(--fs-table); }
table.pt th { background: var(--deep-teal); color: var(--white); font-weight: 600; text-align: left; padding: 11px 12px; font-size: 13.5px; letter-spacing: 0.02em; }
table.pt td { padding: 12px; border-bottom: 1px solid var(--rule-grey); vertical-align: top; background: var(--white); }
table.pt td.c, table.pt th.c { text-align: center; }
table.pt td.r, table.pt th.r { text-align: right; }
table.pt .dim-name { font-weight: 600; color: var(--deep-teal); }
table.pt .sub { display: block; font-size: 14px; color: var(--charcoal); margin-top: 2px; }
.flag { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 1.5px var(--deep-teal); margin-left: 8px; vertical-align: 1px; }

/* ---------- Precision Map (§11–13): left-to-right process flow ---------- */
.pmap { display: flex; align-items: stretch; gap: 0; overflow-x: auto; padding-bottom: 4px; }
.pnode { flex: 1 1 0; min-width: 104px; padding: 12px 10px; border: 1.5px solid var(--deep-teal); background: var(--white); color: var(--deep-teal); font-size: 14px; font-weight: 600; text-align: center; display: grid; place-items: center; line-height: 1.3; }
.pnode.primary { background: var(--deep-teal); color: var(--white); border-radius: 8px; }
.pnode.milestone { position: relative; }
.pnode.milestone::after { content: ""; position: absolute; top: -6px; right: -6px; width: 11px; height: 11px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 1.5px var(--deep-teal); }
.parrow { flex: none; width: 22px; align-self: center; height: 2px; background: var(--deep-teal); position: relative; }
.parrow::after { content: ""; position: absolute; right: -1px; top: -4px; border: 5px solid transparent; border-left: 7px solid var(--deep-teal); border-right: 0; }
.figcap { margin-top: 10px; font-size: var(--fs-meta); color: var(--mid-teal-grey); }
.figcap b { color: var(--deep-teal); font-weight: 600; }

.steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 0; border-top: 1px solid var(--rule-grey); }
.steps li { display: grid; grid-template-columns: 26px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule-grey); }
.steps li::before { content: ""; width: 9px; height: 9px; margin-top: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 1.5px var(--deep-teal); justify-self: center; }

/* ---------- Callout library (§10) ---------- */
.callout { padding: 16px 18px; border-radius: var(--r); background: var(--soft-teal-grey); }
.callout .ctype { display: block; font: 700 12px/1.3 var(--f-text); letter-spacing: 0.12em; color: var(--deep-teal); margin-bottom: 6px; }
.callout.exclusion { background: var(--white); border: 1.5px solid var(--deep-teal); }
.callout.risk { background: var(--soft-teal-grey); }
.callout.risk .ctype { display: inline-block; background: var(--gold); color: var(--deep-teal); padding: 4px 7px; border-radius: 2px; }
.callouts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.testbar { margin-top: 24px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 14px; }

/* ---------- Progress ---------- */
.progress { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
.progress .grp { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.progress i { display: block; height: 5px; background: var(--rule-grey); }
.progress i.done { background: var(--deep-teal); }
.progress i.unsure { background: var(--mid-teal-grey); }
.progress i.cur { background: var(--gold); box-shadow: inset 0 0 0 1px var(--deep-teal); }
.qmeta { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 30px; }

/* ---------- Question ---------- */
.qcard h2 { font-size: clamp(23px, 4.4vw, 28px); font-weight: 700; margin: 0 0 24px; max-width: 30ch; }
.opts { display: grid; gap: 10px; }
.opt {
  display: grid; grid-template-columns: 28px 1fr; gap: 14px; align-items: center; text-align: left;
  width: 100%; padding: 14px 16px; background: var(--white); border: 1.5px solid var(--rule-grey); border-radius: var(--r); cursor: pointer;
}
.opt:hover { border-color: var(--deep-teal); }
.opt .k { font: 600 13px/26px var(--f-text); width: 26px; height: 26px; text-align: center; border: 1.5px solid var(--rule-grey); border-radius: 2px; color: var(--mid-teal-grey); font-variant-numeric: tabular-nums; }
.opt[aria-checked="true"] { border-color: var(--deep-teal); background: var(--soft-teal-grey); }
.opt[aria-checked="true"] .k { background: var(--gold); border-color: var(--deep-teal); color: var(--deep-teal); }
.opt.unsure { border-style: dashed; }
.unsure-wrap { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--rule-grey); display: grid; gap: 8px; }
.qnav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; }

/* ---------- Score head ---------- */
.scorehead { display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 28px; align-items: center; }
.gauge { width: 100%; height: auto; display: block; }
.gauge .val { font: 700 46px var(--f-display); fill: var(--deep-teal); }
.gauge .of { font: 600 11px var(--f-text); fill: var(--mid-teal-grey); letter-spacing: 0.1em; }
.band-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.band-name { font: 700 var(--fs-h1)/1.15 var(--f-display); color: var(--deep-teal); }
.scorehead .summary { margin-top: 8px; max-width: 52ch; }
.scorehead .row { margin-top: 14px; }
.conf { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--charcoal); padding: 6px 10px; border: 1px solid var(--rule-grey); border-radius: 2px; }
.conf .bars { display: inline-flex; gap: 2px; }
.conf .bars i { width: 5px; height: 12px; background: var(--rule-grey); }
.conf .bars i.on { background: var(--deep-teal); }

/* ---------- Gate form ---------- */
.gate { margin-top: 36px; padding: 24px; background: var(--soft-teal-grey); border-radius: var(--r); }
.gate h2 { font-size: var(--fs-h2); font-weight: 700; }
.gate .incl { margin: 10px 0 20px; padding-left: 20px; font-size: 15px; }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 5px; min-width: 0; align-content: start; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13.5px; font-weight: 600; color: var(--deep-teal); }
.field input, .field select { width: 100%; padding: 11px 12px; border: 1.5px solid var(--rule-grey); border-radius: var(--r); background: var(--white); color: var(--charcoal); }
.field input:focus, .field select:focus { border-color: var(--deep-teal); outline: none; }
.field .err { font-size: 13px; color: var(--deep-teal); font-weight: 600; }
.field .err::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 1.5px var(--deep-teal); margin-right: 7px; }
.field.invalid input, .field.invalid select { border-color: var(--deep-teal); box-shadow: inset 4px 0 0 var(--gold); }
.consents { display: grid; gap: 12px; margin-top: 20px; }
.consent { display: grid; grid-template-columns: 20px 1fr; gap: 10px; font-size: 14.5px; align-items: start; }
.consent input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--deep-teal); }
.gate .actions { margin-top: 22px; }
.formerr { color: var(--deep-teal); font-weight: 600; font-size: 14px; margin-top: 12px; }

/* ---------- Report ---------- */
.rep-head h1 { font-size: var(--fs-cover); font-weight: 700; margin-top: 10px; }
.rep-meta { display: flex; gap: 8px 22px; flex-wrap: wrap; padding: 12px 0; border-block: 1px solid var(--rule-grey); font-size: var(--fs-meta); color: var(--mid-teal-grey); }
.rep-meta b { color: var(--deep-teal); font-weight: 600; }
.rep-score { margin-top: 30px; }
.track { height: 8px; background: var(--soft-teal-grey); position: relative; min-width: 90px; }
.track > span { position: absolute; inset: 0 auto 0 0; background: var(--deep-teal); }
.track .t { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--white); }
.scorecell { display: grid; grid-template-columns: minmax(80px, 1fr) 54px; gap: 10px; align-items: center; }
.scorecell .n { text-align: right; font-weight: 600; color: var(--deep-teal); font-variant-numeric: tabular-nums; }
.bandtag { display: inline-block; font: 600 12px/1 var(--f-text); letter-spacing: 0.06em; text-transform: uppercase; padding: 5px 7px; border: 1px solid var(--deep-teal); color: var(--deep-teal); border-radius: 2px; white-space: nowrap; }
.bandtag.engineered { background: var(--deep-teal); color: var(--white); }
.bandtag.na { border-color: var(--rule-grey); color: var(--mid-teal-grey); }

.prios { display: grid; gap: 14px; }
.prio-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 4px; }
.prio h3 { font-size: var(--fs-h3); font-weight: 700; margin-top: 8px; }
.prio .score { font-weight: 600; color: var(--deep-teal); font-size: 14px; font-variant-numeric: tabular-nums; }
.prio dl { margin: 10px 0 0; display: grid; gap: 10px; }
.prio dt { font: 700 11.5px/1.4 var(--f-text); letter-spacing: 0.1em; text-transform: uppercase; color: var(--mid-teal-grey); }
.prio dd { margin: 2px 0 0; font-size: 15.5px; }
.prio ul { margin: 4px 0 0; padding-left: 18px; font-size: 15.5px; }

.reco { padding: 26px 24px; background: var(--deep-teal); color: var(--white); border-radius: var(--r); }
.reco .rlabel { font: 700 12px/1.3 var(--f-text); letter-spacing: 0.12em; color: var(--gold); }
.reco h3 { color: var(--white); font-size: var(--fs-h1); font-weight: 700; margin: 8px 0 10px; }
.reco p { max-width: 62ch; }
.reco .why { margin-top: 10px; opacity: 0.88; }
.reco .outs { margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.22); }
.reco .outs ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.reco .outs li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; }
.reco .outs li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); margin-top: 8px; }
.reco .row { margin-top: 22px; }
.reco .btn { background: var(--white); color: var(--deep-teal); border-color: var(--white); }
.reco .btn:hover { background: var(--soft-teal-grey); border-color: var(--soft-teal-grey); }
.reco .btn.outline { background: transparent; color: var(--white); border-color: rgba(255, 255, 255, 0.6); }
.reco .btn.outline:hover { background: rgba(255, 255, 255, 0.08); }
.reco .email { user-select: all; font-weight: 600; }
.unknowns { margin-top: 12px; font-size: 14.5px; }
.endnotes { margin-top: 40px; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--deep-teal); color: var(--white); padding: 10px 16px; border-radius: var(--r); font-size: 14px; }

@media (max-width: 640px) {
  main.wrap { padding-block: 26px 52px; }
  .fact b { font-size: 28px; }
  .fact + .fact { padding-left: 12px; }
  .pmap { flex-direction: column; overflow: visible; }
  .pnode { min-width: 0; padding: 11px; }
  .parrow { width: 2px; height: 18px; align-self: center; }
  .parrow::after { right: auto; top: auto; bottom: -1px; left: -4px; border: 5px solid transparent; border-top: 7px solid var(--deep-teal); border-bottom: 0; }
  .callouts { grid-template-columns: 1fr; }
  .fgrid { grid-template-columns: 1fr; }
  .scorehead { grid-template-columns: 1fr; }
  .scorehead .gauge { max-width: 230px; }
  table.pt .wcol { display: none; }
  table.pt th, table.pt td { padding: 10px 8px; }
  .scorecell { grid-template-columns: minmax(60px, 1fr) 46px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.fade-in { animation: fin .22s ease-out; }
@keyframes fin { from { opacity: .5; transform: translateY(3px); } to { opacity: 1; transform: none; } }
