/* WiseBenefits: large type, strong contrast, big targets. */

/* Atkinson Hyperlegible Next, designed by the Braille Institute for low-vision readers.
   SIL Open Font License 1.1. Self-hosted so no visitor data goes to a font service. */
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  src: url('/assets/fonts/atkinson-hyperlegible-next-latin.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --surface-2: #f2efe8;
  --ink: #1b2220;
  --muted: #4b5754;
  --line: #d6d0c4;
  --brand: #0e5a51;
  --brand-strong: #0a453e;
  --brand-soft: #e3f1ee;
  --on-brand: #ffffff;
  --accent: #e9a23b;
  --accent-soft: #fbefd9;
  --ok: #1d6a3a;
  --ok-soft: #e4f3e8;
  --warn: #7a4d00;
  --warn-soft: #fcf1dc;
  --no: #9a2a2a;
  --no-soft: #f9e5e3;
  --focus: #1a56d6;
  --link: #0b5e8f;
  --shadow: 0 1px 2px rgba(20, 30, 28, 0.06), 0 4px 16px rgba(20, 30, 28, 0.06);
  --radius: 12px;
  --font: 'Atkinson Hyperlegible Next', 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111715;
    --surface: #182120;
    --surface-2: #1f2a28;
    --ink: #eaefed;
    --muted: #b3bfbb;
    --line: #34423f;
    --brand: #7fd6c7;
    --brand-strong: #a6e6db;
    --brand-soft: #1b3531;
    --on-brand: #0b1d1a;
    --accent: #f0b85e;
    --accent-soft: #3a2e17;
    --ok: #86d7a2;
    --ok-soft: #173325;
    --warn: #f1c46f;
    --warn-soft: #36291a;
    --no: #f2a39a;
    --no-soft: #3a1f1d;
    --focus: #8ab4ff;
    --link: #8cc8f0;
    --shadow: none;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 112.5%; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
}

img, svg { max-width: 100%; height: auto; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--focus);
  border-radius: 8px;
  font-weight: 700;
}
.skip-link:focus { top: 1rem; }

.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;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 1rem; }
.narrow { max-width: 760px; margin: 0 auto; padding: 0 1rem; }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  min-height: 68px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.logo-mark { width: 34px; height: 34px; flex: none; }
.logo em { font-style: normal; color: var(--brand); }
.site-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0; padding: 0; }
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.75rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  border-radius: 8px;
}
.site-nav a:hover { background: var(--surface-2); }
.site-nav a[aria-current="page"] { color: var(--brand); text-decoration: underline; text-underline-offset: 0.3em; }

/* Type */
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.6vw, 2.8rem); margin: 0 0 0.75rem; }
h2 { font-size: 1.5rem; margin: 2.25rem 0 0.75rem; }
h3 { font-size: 1.2rem; margin: 1.75rem 0 0.5rem; }
p, ul, ol { margin: 0 0 1rem; }
li { margin-bottom: 0.35rem; }
.muted { color: var(--muted); }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 44rem; }
.kicker {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 0.5rem;
}
.updated { font-size: 0.9rem; color: var(--muted); }

.breadcrumb { font-size: 0.9rem; margin: 1.25rem 0 0; color: var(--muted); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0; margin: 0; }
.breadcrumb li:not(:last-child)::after { content: '›'; margin-left: 0.4rem; }

.page-head { padding: 1.5rem 0 0.5rem; }

main { display: block; padding-bottom: 3rem; }

/* Home hero */
.hero {
  padding: 3rem 0 2.25rem;
  background: linear-gradient(180deg, var(--brand-soft), var(--bg));
  border-bottom: 1px solid var(--line);
}
@media (min-width: 880px) {
  .hero {
    background:
      radial-gradient(circle at 94% 10%, var(--accent-soft) 0 120px, transparent 121px),
      linear-gradient(180deg, var(--brand-soft), var(--bg));
  }
}
.hero-grid { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 880px) { .hero-grid { grid-template-columns: 1.25fr 1fr; } }
.hero h1 { max-width: 18ch; }
.hero-art { max-width: 420px; justify-self: center; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

.facts { display: grid; gap: 1rem; margin: 2rem 0 0; padding: 0; list-style: none; }
@media (min-width: 700px) { .facts { grid-template-columns: repeat(3, 1fr); } }
.facts li {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.facts strong { display: block; font-size: 1.6rem; color: var(--brand); line-height: 1.15; }

/* Buttons */
.btn, button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.6rem 1.25rem;
  border-radius: 10px;
  border: 2px solid var(--brand);
  background: var(--brand);
  color: var(--on-brand);
  font: 700 1rem var(--font);
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn-secondary { background: transparent; color: var(--brand); }
.btn-secondary:hover { background: var(--brand-soft); color: var(--brand-strong); }

/* Tool cards */
.tool-grid { display: grid; gap: 1rem; margin: 1rem 0 1.25rem; padding: 0; list-style: none; }
@media (min-width: 640px) { .tool-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .tool-grid { grid-template-columns: repeat(3, 1fr); } }
.tool-card {
  position: relative;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.tool-card:hover { border-color: var(--brand); }
.tool-card h3 { margin: 0.25rem 0 0; font-size: 1.15rem; }
.tool-card h3 a { color: var(--ink); text-decoration: none; }
.tool-card h3 a::after { content: ''; position: absolute; inset: 0; border-radius: var(--radius); }
.tool-card h3 a:focus-visible { outline: none; }
.tool-card:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.tool-card p { margin: 0; color: var(--muted); }
.tool-icon { width: 44px; height: 44px; color: var(--brand); }
.tool-tag { font-size: 0.8rem; font-weight: 700; color: var(--brand); }

/* Path diagram */
.path { margin: 1.25rem 0; }
.path svg { display: block; width: 100%; max-width: 760px; height: auto; }

/* Calculator panel */
.tool-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow);
}
@media (min-width: 640px) { .tool-panel { padding: 1.75rem; } }
.tool-panel > h2:first-child { margin-top: 0; }

fieldset { border: 0; padding: 0; margin: 0 0 1.5rem; min-width: 0; }
legend { font-weight: 700; font-size: 1.05rem; padding: 0; margin-bottom: 0.5rem; }
.field { margin: 0 0 1.35rem; }
.field > label:not(.choice), .label { display: block; font-weight: 700; margin-bottom: 0.35rem; }
.hint { display: block; font-size: 0.92rem; color: var(--muted); margin: 0 0 0.5rem; }
input[type="text"], input[type="email"], input[type="date"], input[type="number"], select {
  width: 100%;
  max-width: 26rem;
  min-height: 52px;
  padding: 0.5rem 0.85rem;
  border: 2px solid var(--muted);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: 1.05rem var(--font);
}
select { appearance: auto; }
input:focus-visible, select:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-color: var(--focus); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--no); }
.money { position: relative; max-width: 26rem; }
.money::before { content: '$'; position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; pointer-events: none; }
.money input { padding-left: 1.9rem; }
.pair { display: flex; gap: 0.75rem; flex-wrap: wrap; max-width: 26rem; }
.pair > div { flex: 1 1 8rem; }
.pair select { width: 100%; }

.choice {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  min-height: 48px;
  padding: 0.7rem 0.85rem;
  margin: 0 0 0.5rem;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}
.choice:hover { border-color: var(--brand); }
.choice input { width: 1.35rem; height: 1.35rem; margin: 0.15rem 0 0; flex: none; accent-color: var(--brand); }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice input:focus-visible { outline: none; }
.choices-inline { display: grid; gap: 0.5rem; }
@media (min-width: 640px) { .choices-inline { grid-template-columns: repeat(3, 1fr); } .choices-inline .choice { margin: 0; } }

.category {
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
}
.category legend { font-size: 1.1rem; }
.category p { margin: 0 0 0.6rem; color: var(--muted); }

.field-error { color: var(--no); font-weight: 700; margin: 0.4rem 0 0; }
.field-error::before { content: '⚠ '; }

.form-actions { margin-top: 0.5rem; }

/* Results */
.result {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  background: var(--brand-soft);
  border: 2px solid var(--brand);
}
.result[hidden] { display: none; }
.result h2 { margin-top: 0.25rem; }
.result h2:focus { outline: none; }
.result h2:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.result-big { font-size: clamp(1.8rem, 1.4rem + 1.8vw, 2.4rem); font-weight: 800; line-height: 1.15; margin: 0.5rem 0 0.25rem; color: var(--brand-strong); }
.result-mid { font-size: 1.4rem; font-weight: 800; margin: 1rem 0 0.25rem; color: var(--brand-strong); }
.result-sub { color: var(--muted); margin-bottom: 1rem; }
.verdict { margin: 0; }
.verdict-tag { display: inline-block; padding: 0.2rem 0.7rem; border-radius: 999px; font-weight: 800; font-size: 0.9rem; border: 2px solid currentColor; }
.verdict-likely .verdict-tag { color: var(--ok); background: var(--ok-soft); }
.verdict-maybe .verdict-tag, .verdict-maybe-not .verdict-tag { color: var(--warn); background: var(--warn-soft); }
.verdict-unlikely .verdict-tag, .verdict-not-yet .verdict-tag { color: var(--no); background: var(--no-soft); }
.route-list { padding-left: 1.2rem; }
.notes { font-size: 0.95rem; color: var(--muted); padding-left: 1.2rem; }

table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.25rem; font-size: 0.98rem; background: var(--surface); }
caption { text-align: left; font-weight: 700; padding: 0 0 0.5rem; }
th, td { text-align: left; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--surface-2); }
td { font-variant-numeric: tabular-nums; }
.breakdown td { text-align: right; white-space: nowrap; }
.breakdown thead th:not(:first-child) { text-align: right; }
.breakdown tr.total th, .breakdown tr.total td { font-weight: 800; border-top: 2px solid var(--ink); }
.table-scroll { overflow-x: auto; }

/* Callouts */
.callout {
  border-left: 5px solid var(--brand);
  background: var(--surface);
  padding: 1rem 1.1rem;
  border-radius: 0 10px 10px 0;
  margin: 1.25rem 0;
}
.callout p:last-child { margin-bottom: 0; }
.callout-warn { border-left-color: var(--accent); background: var(--warn-soft); }
.callout-quote { font-size: 1.05rem; }
.callout-quote q { font-style: italic; }

/* Article body */
.body h2 { border-top: 1px solid var(--line); padding-top: 1.75rem; }
.sources { font-size: 0.95rem; }
.sources li { margin-bottom: 0.5rem; }

.faq h3 { margin-top: 1.25rem; }

/* Kit card */
.kit-card {
  margin: 2.5rem 0;
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--brand);
  color: var(--on-brand);
}
.kit-card a { color: inherit; }
.kit-label { display: block; font-size: 0.85rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 0.35rem; opacity: 0.9; }
.kit-card h2, .kit-card h3 { color: inherit; margin: 0 0 0.5rem; font-size: 1.35rem; border: 0; padding: 0; }
.kit-card p { margin: 0 0 1rem; }
.kit-card label { display: block; font-weight: 700; margin-bottom: 0.4rem; }
.kit-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.kit-row input { flex: 1 1 240px; max-width: none; border-color: transparent; }
.kit-row button {
  min-height: 52px; padding: 0 1.25rem; border-radius: 10px; border: 2px solid var(--on-brand);
  background: var(--on-brand); color: var(--brand); font: 700 1rem var(--font); cursor: pointer;
}
.kit-row button:disabled { opacity: 0.7; cursor: wait; }
.kit-card :focus-visible { outline-color: var(--accent); }
.kit-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.kit-note { font-size: 0.92rem; margin: 0.75rem 0 0; opacity: 0.95; }
.kit-done { font-weight: 700; margin: 0; }
.kit-done:focus { outline: none; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 2rem 0 2.5rem; font-size: 0.95rem; color: var(--muted); }
.site-footer nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; padding: 0; margin: 0 0 1rem; }
.site-footer nav a { display: inline-flex; min-height: 44px; align-items: center; }
.site-footer p { max-width: 52rem; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media print {
  .site-header, .site-footer, .kit-card, .form-actions, .skip-link { display: none; }
  body { background: #fff; color: #000; }
}
