/* Baynum Financial & Analytics - site styles (Nov 2026 redesign)
   Calm ledger look from Thomas's portfolio + dragon blue and chest gold.
   Colours and contrast ratios: trucking-site/01-designer-audit.md, section 3. */

/* ---------- Theme tokens ---------- */
:root {
  color-scheme: light;
  --bg:#FBFAF6; --surface:#FFFFFF; --surface-2:#F1EFE8;
  --border:#E3E0D6; --border-strong:#8C8A80;
  --text:#22231F; --muted:#5E5D57; --heading:#0B2A6F;
  --brand:#0047C8; --brand-hover:#003A9E; --on-brand:#FFFFFF;
  --focus:#0060F0; --glow-rgb:0 96 240;
  --tag-bg:#E6EEFC; --tag-text:#0B2A6F;
  --gold:#F5C842; --gold-text:#7A5600; --gold-tint:#FFF6DD;
  --error:#A3201A; --error-border:#B3261E; --error-bg:#FDECEA;
  --ok:#1F6B45;
  --font-sans:"Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif:"Source Serif 4", Georgia, "Times New Roman", serif;
  --fs-sm:1rem; --fs-base:1.125rem; --fs-lg:1.25rem; --fs-h3:1.375rem;
  --fs-h2:clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  --fs-h1:clamp(1.875rem, 1.4rem + 2vw, 2.75rem);
  --fs-kpi:clamp(1.5rem, 1.2rem + 1vw, 2rem);
  --gutter:16px; --max:1120px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg:#15171C; --surface:#1E2128; --surface-2:#262A32;
    --border:#3A3E46; --border-strong:#6B6F78;
    --text:#ECEAE3; --muted:#B4B2A9; --heading:#ECEAE3;
    --brand:#7FB0FF; --brand-hover:#A9C9FF; --on-brand:#0B0D12;
    --focus:#7FB0FF; --glow-rgb:127 176 255;
    --tag-bg:#1D2B4A; --tag-text:#CFE0FF;
    --gold:#F2C94C; --gold-text:#F2C94C; --gold-tint:#3A3220;
    --error:#FFB4AE; --error-border:#FF6B60; --error-bg:#3A1F1F;
    --ok:#8FD6AE;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:#15171C; --surface:#1E2128; --surface-2:#262A32;
  --border:#3A3E46; --border-strong:#6B6F78;
  --text:#ECEAE3; --muted:#B4B2A9; --heading:#ECEAE3;
  --brand:#7FB0FF; --brand-hover:#A9C9FF; --on-brand:#0B0D12;
  --focus:#7FB0FF; --glow-rgb:127 176 255;
  --tag-bg:#1D2B4A; --tag-text:#CFE0FF;
  --gold:#F2C94C; --gold-text:#F2C94C; --gold-tint:#3A3220;
  --error:#FFB4AE; --error-border:#FF6B60; --error-bg:#3A1F1F;
  --ok:#8FD6AE;
}
@media (min-width:768px) { :root { --gutter:24px; } }
@media (min-width:1024px) { :root { --gutter:32px; } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing:border-box; }
html { background:var(--bg); font-size:100%; -webkit-text-size-adjust:100%; scroll-behavior:smooth; }
body { margin:0; background:var(--bg); color:var(--text); font:400 var(--fs-base)/1.6 var(--font-sans); }
img { max-width:100%; height:auto; display:block; }
h1, h2, h3, .lede-serif { font-family:var(--font-serif); font-weight:600; color:var(--heading); line-height:1.2; text-wrap:balance; }
h1 { font-size:var(--fs-h1); margin:0 0 .5rem; }
h2 { font-size:var(--fs-h2); margin:0 0 .75rem; }
h3 { font-size:var(--fs-h3); margin:0 0 .4rem; }
p, li { max-width:68ch; }
p { margin:0 0 1rem; }
a { color:var(--brand); text-underline-offset:.2em; }
a:hover { color:var(--brand-hover); }
.lede { font-size:var(--fs-lg); color:var(--text); margin-bottom:1.25rem; }
.fine, small { font-size:var(--fs-sm); color:var(--muted); }
.num, .kpi strong, td.num { font-variant-numeric:tabular-nums; }
.visually-hidden { position:absolute !important; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.skip-link { position:absolute; left:-999px; top:8px; z-index:20; background:var(--surface); padding:8px 12px; border-radius:6px; }
.skip-link:focus { left:8px; }

/* ---------- Layout ---------- */
.wrap { width:100%; max-width:var(--max); margin:0 auto; padding:0 var(--gutter); }
.section { padding:48px 0; }
.section + .section { border-top:1px solid var(--border); }
@media (min-width:1024px) { .section { padding:64px 0; } }
.hero { padding:32px 0 40px; }
@media (min-width:1024px) { .hero { padding:56px 0 56px; } }
.hero-grid { display:grid; gap:32px; align-items:center; }
@media (min-width:900px) { .hero-grid { grid-template-columns:minmax(0,1.3fr) minmax(0,.7fr); } }
.hero-grid > * { min-width:0; }
.hero-art { max-width:320px; margin:0 auto; }
.hero-art img { width:100%; height:auto; border-radius:16px; }
.hero-art figcaption { margin-top:8px; font-size:.9375rem; color:var(--muted); text-align:center; }
@media (max-width:899px) { .hero-art { display:none; } }
.grid { display:grid; gap:16px; grid-template-columns:repeat(auto-fit, minmax(260px, 1fr)); }
.grid-2 { display:grid; gap:16px; }
@media (min-width:720px) { .grid-2 { grid-template-columns:1fr 1fr; } }
.split { display:grid; gap:32px; }
@media (min-width:900px) { .split { grid-template-columns:1fr 1fr; align-items:start; } }

/* ---------- Header and navigation ---------- */
.site-header { position:relative; z-index:10; background:var(--bg); border-bottom:1px solid var(--border); }
@media (min-width:900px) { .site-header { position:sticky; top:0; } }
.header-bar { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; padding-top:8px; padding-bottom:8px; }
.brand { display:flex; align-items:center; gap:10px; margin-right:auto; min-height:48px; color:var(--heading); text-decoration:none; font:600 1.0625rem/1.15 var(--font-serif); }
.brand img { width:auto; height:40px; }
.brand small { display:block; font:400 .8125rem var(--font-sans); color:var(--muted); }
@media (max-width:420px) { .brand small { display:none; } }
@media (max-width:359px) { .brand span { display:none; } }
.nav-toggle { min-height:44px; min-width:72px; font:600 1rem var(--font-sans); color:var(--text); background:var(--surface); border:2px solid var(--border-strong); border-radius:8px; cursor:pointer; }
#site-nav { flex-basis:100%; }
.nav-list { list-style:none; margin:0; padding:0; display:flex; flex-wrap:wrap; gap:4px 16px; }
.nav-list a { display:flex; align-items:center; min-height:44px; padding:0 4px; color:var(--text); text-decoration:none; font-weight:600; }
.nav-list a:hover { color:var(--brand); }
.nav-list a[aria-current="page"] { box-shadow:inset 0 -3px 0 var(--brand); color:var(--brand); }
.js #site-nav { display:none; }
.js #site-nav.is-open { display:block; }
.js .nav-list { flex-direction:column; gap:0; }
.js .nav-list a { min-height:52px; border-top:1px solid var(--border); font-size:var(--fs-lg); }
.theme-toggle { min-height:44px; min-width:44px; display:inline-flex; align-items:center; justify-content:center; color:var(--text); background:var(--surface); border:2px solid var(--border-strong); border-radius:8px; cursor:pointer; }
@media (min-width:900px) {
  /* Desktop: brand, Book button and theme on the first row; menu on its own row under them */
  .nav-toggle { display:none !important; }
  .header-cta { order:2; }
  .theme-toggle { order:3; }
  .js #site-nav, #site-nav { display:block; flex-basis:100%; order:4; }
  .js .nav-list { flex-direction:row; gap:4px 22px; }
  .js .nav-list a { min-height:44px; border-top:0; font-size:1rem; }
}
@media (min-width:1360px) {
  /* Wide screens: everything on one row */
  .js #site-nav, #site-nav { flex-basis:auto; order:2; margin-left:8px; }
  .header-cta { order:3; }
  .theme-toggle { order:4; }
  .js .nav-list { gap:4px 18px; }
  .brand { margin-right:auto; }
}
.cred-strip { background:var(--surface-2); border-bottom:1px solid var(--border); font-size:.9375rem; color:var(--text); }
.cred-strip .wrap { display:flex; flex-wrap:wrap; gap:2px 14px; padding-top:8px; padding-bottom:8px; }
.cred-strip span + span::before { content:"·"; margin-right:14px; color:var(--muted); }
.cred-strip a { color:inherit; display:inline-block; min-height:44px; padding:11px 0; }
.cred-strip .wrap { align-items:center; padding-top:0 !important; padding-bottom:0 !important; }
@media (max-width:599px) {
  .cred-strip { font-size:.875rem; }
  .cred-strip .wrap { gap:2px 12px; }
  .cred-strip span + span::before { content:none; }
  .hide-sm { display:none; }
  .brand { font-size:1rem; }
  .brand img { height:34px; }
}

/* ---------- Offer banner ---------- */
.offer { border:2px solid var(--gold); background:var(--gold-tint); border-radius:10px; padding:14px 16px; margin:0 0 1.25rem; }
.offer strong { color:var(--gold-text); }
.offer p { margin:0; }

/* ---------- Buttons ---------- */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:.5rem; min-height:48px; padding:12px 20px; border-radius:8px; font:600 1.0625rem/1.2 var(--font-sans); text-decoration:none; border:2px solid transparent; cursor:pointer; transition:background-color .15s, border-color .15s, box-shadow .2s, transform .1s; }
.btn-primary { background:var(--brand); color:var(--on-brand); }
.btn-primary:hover { background:var(--brand-hover); color:var(--on-brand); }
.btn-secondary { background:var(--surface); color:var(--brand); border-color:var(--brand); }
.btn-secondary:hover { background:var(--tag-bg); }
.btn-sm { min-height:44px; padding:8px 14px; font-size:1rem; }
.header-cta { gap:0; }
.btn-block { width:100%; }
@media (min-width:640px) { .btn-block { width:auto; } }
.btn-row { display:flex; flex-wrap:wrap; gap:12px; align-items:center; margin:1rem 0; }

/* ---------- Cards, tiles, callouts, tags ---------- */
.card { border:1px solid var(--border); border-radius:10px; padding:24px; background:var(--surface); }
.card p:last-child { margin-bottom:0; }
a.card-link { display:block; text-decoration:none; color:var(--text); min-height:88px; transition:border-color .15s, box-shadow .2s; }
a.card-link:hover { border-color:var(--brand); box-shadow:0 0 0 3px rgb(var(--glow-rgb) / .18); }
a.card-link h3, a.card-link .card-title { color:var(--brand); }
a.card-link h3::after, a.card-link .card-title::after { content:" →"; }
.card-title { font-size:var(--fs-h3); margin:0 0 .4rem; }
.audience-cards { display:grid; gap:16px; margin-top:1.5rem; }
@media (min-width:720px) { .audience-cards { grid-template-columns:1fr 1fr; } }
.kpis { display:grid; gap:12px; grid-template-columns:repeat(auto-fit, minmax(170px, 1fr)); margin:1rem 0 0; }
.kpi { background:var(--surface-2); border-radius:10px; padding:16px 18px; }
.kpi strong { display:block; font:600 var(--fs-kpi)/1.1 var(--font-sans); color:var(--brand); margin-bottom:4px; }
.kpi span { font-size:.9375rem; color:var(--muted); }
.kpi .sample { display:inline-block; margin-top:6px; font-size:.8125rem; font-weight:700; color:var(--gold-text); }
.callout { border-left:4px solid var(--brand); padding:12px 16px; margin:1.25rem 0; background:transparent; }
.callout p:last-child { margin-bottom:0; }
.callout-gold { border-left-color:var(--gold); background:var(--gold-tint); border-radius:0 8px 8px 0; }
.tags { display:flex; flex-wrap:wrap; gap:6px; margin:0 0 1rem; padding:0; list-style:none; }
.tag { display:inline-block; font-size:.875rem; padding:3px 10px; border-radius:6px; background:var(--tag-bg); color:var(--tag-text); }
.chip-gold { display:inline-block; font-size:.8125rem; font-weight:700; padding:2px 8px; border-radius:6px; background:var(--gold); color:#22231F; }
.steps { counter-reset:step; list-style:none; padding:0; margin:0; display:grid; gap:16px; }
@media (min-width:720px) { .steps { grid-template-columns:repeat(3, 1fr); } }
.steps li { counter-increment:step; position:relative; padding:20px 20px 20px 64px; border:1px solid var(--border); border-radius:10px; background:var(--surface); }
.steps li::before { content:counter(step); position:absolute; left:18px; top:18px; width:32px; height:32px; border-radius:50%; display:grid; place-items:center; background:var(--brand); color:var(--on-brand); font-weight:700; }
.checklist { padding-left:0; list-style:none; }
.checklist li { position:relative; padding-left:30px; margin-bottom:.5rem; }
.checklist li::before { content:"✓"; position:absolute; left:4px; color:var(--ok); font-weight:700; }
.nolist li::before { content:"✕"; color:var(--error); }
.photo { width:200px; border-radius:14px; }
@media (max-width:600px) { .photo { width:160px; } }
.sample-banner { max-width:none; margin:0; position:sticky; top:0; z-index:5; background:var(--gold-tint); border-bottom:2px solid var(--gold); color:var(--text); font-weight:700; text-align:center; padding:10px 16px; }
@media (min-width:900px) { .sample-banner { top:var(--header-h, 0px); } }

/* ---------- Tables (stack into cards on phones) ---------- */
.price-table { width:100%; border-collapse:collapse; background:var(--surface); border:1px solid var(--border); border-radius:10px; overflow:hidden; }
.price-table th, .price-table td { text-align:left; padding:14px 16px; border-bottom:1px solid var(--border); vertical-align:top; }
.price-table thead th { background:var(--surface-2); font-size:.9375rem; }
@media (max-width:640px) {
  .price-table thead { display:none; }
  .price-table tr { display:block; border-bottom:1px solid var(--border); padding:8px 0; }
  .price-table td { display:block; border:0; padding:4px 16px; }
  .price-table td::before { content:attr(data-label) ": "; font-weight:600; color:var(--muted); }
}

/* ---------- FAQ ---------- */
details.faq { border:1px solid var(--border); border-radius:10px; background:var(--surface); margin-bottom:10px; }
details.faq summary { min-height:52px; padding:14px 18px; cursor:pointer; font-weight:600; list-style-position:inside; }
details.faq > div { padding:0 18px 16px; }

/* ---------- Footer ---------- */
.site-footer { border-top:1px solid var(--border); background:var(--surface-2); margin-top:24px; padding:40px 0 32px; font-size:1rem; }
.footer-grid { display:grid; gap:24px; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); }
.site-footer h2 { font-size:1.0625rem; margin-bottom:.5rem; }
.site-footer ul { list-style:none; margin:0; padding:0; }
.site-footer li a { display:inline-flex; min-height:40px; align-items:center; }
.footer-legal { margin-top:24px; padding-top:16px; border-top:1px solid var(--border); color:var(--muted); font-size:.9375rem; }
.footer-legal strong { color:var(--text); }
.footer-legal a { display:inline-block; min-height:44px; padding:11px 0; }
.social { display:flex; gap:10px; margin-top:8px; }
.social a { width:44px; height:44px; display:inline-flex; align-items:center; justify-content:center; border-radius:50%; border:1px solid var(--border-strong); color:var(--text); }
.social svg { width:20px; height:20px; fill:currentColor; }

/* ---------- Glow: landing on a section, pressing and focusing ---------- */
:where(section, article, .card, .kpi, .callout, h2, h3, .field)[id] { scroll-margin-top:6rem; }
@media (max-width:1023px) { :where(section, article, .card, .callout, h2, h3, .field)[id] { scroll-margin-top:1rem; } }
:target, .is-landed { border-radius:10px; animation:target-glow 2.4s ease-out 1; }
@keyframes target-glow {
  0%   { box-shadow:0 0 0 6px rgb(var(--glow-rgb) / .45), 0 0 24px rgb(var(--glow-rgb) / .35); background-color:rgb(var(--glow-rgb) / .10); }
  60%  { box-shadow:0 0 0 6px rgb(var(--glow-rgb) / .25), 0 0 16px rgb(var(--glow-rgb) / .15); background-color:rgb(var(--glow-rgb) / .06); }
  100% { box-shadow:0 0 0 6px rgb(var(--glow-rgb) / 0); background-color:transparent; }
}
[tabindex="-1"]:focus { outline:none; }
a, button, summary, .btn, input, select, textarea { -webkit-tap-highlight-color:transparent; }
:where(a, button, summary, .btn, input, select, textarea):focus-visible { outline:3px solid var(--focus); outline-offset:3px; box-shadow:0 0 0 7px rgb(var(--glow-rgb) / .22); border-radius:6px; }
.btn:active, a.card-link:active { transform:translateY(1px); box-shadow:0 0 0 4px rgb(var(--glow-rgb) / .35), 0 0 18px rgb(var(--glow-rgb) / .45); }
a:not(.btn):not(.card-link):active { background-color:rgb(var(--glow-rgb) / .14); border-radius:4px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior:auto; }
  *, *::before, *::after { animation-duration:.01ms !important; transition-duration:.01ms !important; }
  :target, .is-landed { animation:none; box-shadow:inset 4px 0 0 var(--focus); background-color:rgb(var(--glow-rgb) / .08); }
  .btn:active, a.card-link:active { transform:none; }
}
@media (forced-colors: active) {
  :where(a, button, summary, .btn, input, select, textarea):focus-visible { outline:3px solid Highlight; box-shadow:none; }
  :target, .is-landed { outline:3px solid Highlight; animation:none; }
}

/* ---------- Forms and the red "Information needed" box ---------- */
.form { max-width:640px; }
.field { margin:0 0 20px; padding:12px; border:2px solid transparent; border-radius:8px; }
fieldset.field { min-width:0; }
label, legend { display:block; font-weight:600; margin-bottom:6px; }
.hint, .optional { display:block; color:var(--muted); font-size:var(--fs-sm); font-weight:400; margin:0 0 6px; }
.optional { display:inline; }
input[type=text], input[type=email], input[type=tel], input:not([type]), select, textarea {
  width:100%; min-height:48px; padding:10px 12px; font:inherit; font-size:max(1rem, 16px);
  color:var(--text); background:var(--surface); border:2px solid var(--border-strong); border-radius:6px;
}
textarea { min-height:120px; }
.money { position:relative; }
.money::before { content:"$"; position:absolute; left:12px; top:50%; transform:translateY(-50%); color:var(--muted); pointer-events:none; }
.money input { padding-left:26px; }
.choice { display:flex; gap:10px; align-items:center; min-height:44px; font-weight:400; margin:0; }
.choice input { width:22px; height:22px; accent-color:var(--brand); flex:0 0 auto; }
.field.is-invalid { border-color:var(--error-border); border-left-width:6px; background:var(--error-bg); }
.field.is-invalid input, .field.is-invalid select, .field.is-invalid textarea { border-color:var(--error-border); }
.field-error { display:flex; gap:8px; align-items:flex-start; margin:8px 0 0; color:var(--error); font-weight:600; }
.field-error[hidden] { display:none; }
.field-error::before { content:""; flex:0 0 20px; height:20px; margin-top:2px; background:currentColor;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 1 21h22L12 2zm0 6 1 .9-.4 6.6h-1.2L11 8.9 12 8zm0 9.2a1.3 1.3 0 1 1 0 2.6 1.3 1.3 0 0 1 0-2.6z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 1 21h22L12 2zm0 6 1 .9-.4 6.6h-1.2L11 8.9 12 8zm0 9.2a1.3 1.3 0 1 1 0 2.6 1.3 1.3 0 0 1 0-2.6z'/%3E%3C/svg%3E") center/contain no-repeat; }
.form-summary { margin:0 0 20px; padding:16px; border:2px solid var(--error-border); border-left-width:6px; border-radius:8px; background:var(--error-bg); color:var(--text); }
.form-summary[hidden] { display:none; }
.form-summary__title { display:flex; gap:8px; align-items:center; margin:0 0 6px; font-size:var(--fs-lg); color:var(--error); }
.form-summary a { color:var(--error); font-weight:600; }
.form-done { border:2px solid var(--ok); border-radius:10px; padding:20px; background:var(--surface); }
@media (forced-colors: active) { .field.is-invalid, .form-summary { border-color:Mark; } .field-error::before { background:CanvasText; } }

/* ---------- Calculator ---------- */
.calc { display:grid; gap:24px; }
@media (max-width:959px) { .calc-result { order:-1; } }
@media (min-width:960px) { .calc { grid-template-columns:1fr 380px; align-items:start; } .calc-result { position:sticky; top:calc(var(--header-h, 0px) + 16px); } }
.calc-fields { display:grid; gap:0 16px; }
@media (min-width:640px) { .calc-fields { grid-template-columns:1fr 1fr; } }
.calc-result { border:2px solid var(--brand); border-radius:12px; padding:20px; background:var(--surface); }
.calc-result .big { font:600 clamp(2rem, 1.6rem + 2vw, 2.75rem)/1.1 var(--font-sans); color:var(--brand); font-variant-numeric:tabular-nums; margin:4px 0 8px; }
.calc-result dl { display:grid; grid-template-columns:1fr auto; gap:6px 12px; margin:12px 0; }
.calc-result dt { color:var(--muted); }
.calc-result dd { margin:0; font-weight:600; text-align:right; font-variant-numeric:tabular-nums; }
.calc-say { font-weight:600; }
.is-loss { color:var(--error); }
.is-gain { color:var(--ok); }
.example-note { display:inline-block; font-size:.875rem; font-weight:700; color:var(--gold-text); }

/* ---------- Sample dashboard chart ---------- */
.bars { display:grid; gap:10px; margin:1rem 0; }
.bar-row { display:grid; grid-template-columns:150px 1fr 64px; gap:10px; align-items:center; font-size:1rem; }
@media (max-width:520px) { .bar-row { grid-template-columns:1fr 56px; } .bar-row .bar { grid-column:1 / -1; order:3; } }
.bar { height:18px; background:var(--surface-2); border-radius:9px; overflow:hidden; }
.bar i { display:block; height:100%; background:var(--brand); border-radius:9px; }
.bar-row.gold .bar i { background:var(--gold); }
.bar-row b { text-align:right; font-variant-numeric:tabular-nums; }

/* Calculator: "Example" tags. A box with a made-up number has a dashed border and a tag. */
.ex-tag { display:inline-block; margin-left:6px; padding:0 8px; border:1.5px dashed var(--gold-text); border-radius:999px; font-size:.75rem; font-weight:700; line-height:1.5; color:var(--gold-text); vertical-align:middle; }
.field:not(.is-example) .ex-tag { display:none; }
.field.is-example input { border-style:dashed; }
.calc-notes { margin:12px 0; padding:0; list-style:none; }
.calc-notes li { margin-top:8px; padding-left:12px; border-left:3px solid var(--gold); font-size:.9375rem; }
