/* ==========================================================================
   FT Ventures — Free Tools Portal
   Shared brand tokens + component styles.
   This is the first piece of shared, reusable code across the tools —
   the seed of the "module registry" the audit calls for. Every page in the
   portal links this file so branding lives in ONE place, not copy-pasted.
   ========================================================================== */

:root {
  /* Ink & ground */
  --ink:        #12233B;
  --ink-soft:   #3E5068;
  --ink-faint:  #5C6A7C;   /* measured: 4.5:1 AA on every surface below */
  --ground:     #FBF8F2;
  --panel:      #FFFFFF;
  --panel-soft: #FAF6EE;
  --line:       #E7E1D5;
  --line-soft:  #F0EBE0;

  /* Accents */
  --gold:       #B68A3E;
  --gold-bright:#D9B064;
  --gold-soft:  #F3EAD6;
  --gold-ink:   #7A5A1E;   /* gold as TEXT — --gold is a surface/large-display colour */
  --positive:   #107953;
  --positive-soft:#DDF0E7;
  --negative:   #B3413A;
  --negative-soft:#F6E2E0;

  /* Type */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono:  ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Shape */
  --radius:  12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(18,35,59,.04), 0 10px 28px -14px rgba(18,35,59,.14);
  --shadow-lg: 0 22px 50px -24px rgba(18,35,59,.30);
  --maxw: 1120px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; overflow-x: clip; } /* guard: no accidental horizontal scroll on mobile (clip keeps position:sticky working) */

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; line-height: 1.13; letter-spacing: -.01em; text-wrap: balance; }

a { color: var(--gold-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 760px; }

/* ---- Site header ---- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(251,248,242,.82);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 7px; flex: none;
  background: var(--ink); color: var(--gold);
  display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 15px;
}
.brand .name { font-family: var(--serif); font-size: 18px; font-weight: 600; letter-spacing: .01em; color: var(--ink); }
.brand .name small { display: block; font-family: var(--sans); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-ink); margin-top: -2px; }
.site-nav { display: flex; gap: 20px; align-items: center; }
.site-nav a { color: var(--ink-soft); font-size: 14px; font-weight: 500; }
.site-nav a:hover { color: var(--ink); text-decoration: none; }
@media (max-width: 640px) { .site-nav .hide-sm { display: none; } }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-size: 14.5px; font-weight: 600; line-height: 1;
  padding: 11px 20px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform .1s ease, background .15s ease, box-shadow .15s ease, border-color .15s ease;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn-gold { background: var(--gold); color: #1a130a; box-shadow: 0 6px 18px -4px rgba(182,138,62,.4); }
.btn-gold:hover { background: var(--gold-bright); }
.btn-navy { background: var(--ink); color: #fff; }
.btn-navy:hover { background: #1c3455; }
.btn-ghost { background: var(--panel); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--gold); }
.btn-sm { padding: 8px 15px; font-size: 13px; }

.eyebrow { font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-ink); margin: 0 0 12px; }

/* ---- Cards ---- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }

/* ---- Generic inputs ---- */
label.fld { display: block; }
.fld > span { display: block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 5px; }
.inp {
  width: 100%; background: var(--panel-soft); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 9px 11px; font: inherit; font-weight: 600;
  color: var(--ink); transition: border-color .15s ease, background .15s ease;
}
.inp:focus { outline: none; border-color: var(--gold); background: #fff; box-shadow: 0 0 0 3px var(--gold-soft); }

/* ---- Keyboard focus ----
   One deliberate ring for everything interactive, so a keyboard user can always
   see where they are. :focus-visible keeps it off mouse clicks. The gold ring is
   paired with a light halo so it reads on both the cream ground and the navy
   bands. Anything that sets its own ring (.inp above) keeps it. */
a:focus-visible,
button:focus-visible,
select:focus-visible,
textarea:focus-visible,
input:focus-visible,
[tabindex]:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
/* on the navy bands a gold-on-navy ring is low contrast, so brighten it */
.site-footer a:focus-visible,
.band-navy a:focus-visible, .band-navy button:focus-visible {
  outline-color: var(--gold-bright);
}
/* ---- Reduced motion ----
   One site-wide answer for anyone who has asked their system for less movement.
   Two details this project got wrong before:
   - `*` does NOT match pseudo-elements, so a pulsing `::before` dot kept
     animating right through a rule that looked like it covered everything.
   - Suppressing an entrance animation must never leave content behind. Every
     animation here is decorative or animates *into* a state the element already
     has statically, so removing it reveals rather than hides. Anything added
     later that starts at opacity:0 must reset itself in this block.
   scripts/check-reduced-motion.mjs loads every page in both settings and fails
   if something still moves — or if anything ends up invisible. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  html { scroll-behavior: auto !important; }
}

.inp.num { text-align: right; font-variant-numeric: tabular-nums; }

input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; background: var(--line); border-radius: 3px; outline: none; }
/* the line above removes the browser's own ring, so put one back — a slider with
   no focus indicator is unusable from the keyboard (WCAG 2.4.7) */
input[type=range]:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; height: 16px; width: 16px; border-radius: 50%; background: var(--gold); cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
input[type=range]::-moz-range-thumb { height: 16px; width: 16px; border: none; border-radius: 50%; background: var(--gold); cursor: pointer; }

/* ---- Tables ---- */
.tbl-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); }
table.data { width: 100%; border-collapse: collapse; background: var(--panel); font-size: 13.5px; }
table.data th { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); text-align: right; padding: 10px 12px; border-bottom: 2px solid var(--line); white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--line-soft); font-variant-numeric: tabular-nums; }
table.data tr:last-child td { border-bottom: none; }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--line); margin-top: 64px; padding: 34px 0; color: var(--ink-faint); font-size: 13px; }
.site-footer .cols { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-start; }
.site-footer a { color: var(--ink-soft); }

/* ---- Utility ---- */
.muted { color: var(--ink-faint); }
.pill { display: inline-block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-ink); }
.pos { color: var(--positive); }
.neg { color: var(--negative); }
.grid { display: grid; gap: 16px; }
.hr { height: 1px; background: var(--line); border: 0; margin: 20px 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
