/* ==========================================================================
   Claimledge — Institutional-Editorial Design System (STRICTLY MOBILE-FIRST)
   Base = the phone layout. Media queries only add enhancements.
   Palette: #F4F4F6 bg / #0F1115 ink / #D1D1D6 line / #1A365D accent (CTAs only)
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  --bg: #F4F4F6;
  --surface: #FFFFFF;
  --ink: #0F1115;
  --ink-2: #43454C;
  --ink-3: #6D7078;
  --line: #D1D1D6;
  --line-soft: #E4E4E9;
  --skeleton: #ECECEF;
  --accent: #1A365D;
  --accent-dark: #122747;

  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --container: 1180px;
  --radius: 2px;
  --header-h: 60px;
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.6; font-kerning: normal; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- 3. Typography ---------- */
h1, h2, h3, .serif { font-family: var(--serif); font-weight: 600; letter-spacing: -0.012em; line-height: 1.12; color: var(--ink); }
.num, input, select, .result-figure, .breakdown-value { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.eyebrow { display: block; font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; }
.standfirst { font-size: 18px; line-height: 1.55; color: var(--ink-2); max-width: 38ch; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; color: var(--ink-3); margin-top: 16px; }
.meta-row li { list-style: none; display: flex; align-items: center; gap: 7px; }
.meta-row li::before { content: ""; width: 5px; height: 5px; background: var(--ink-3); flex: none; }

/* ---------- 4. Layout utilities ---------- */
.container { max-width: var(--container); margin-inline: auto; padding-inline: 20px; }
.section { padding: 40px 0; }
.section + .section { border-top: 1px solid var(--line-soft); }
.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--bg); padding: 12px 16px; z-index: 999; font-size: 14px; text-decoration: none; }
.skip-link:focus { left: 8px; }

/* ---------- 5. Header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 100; }
.site-header__inner { max-width: var(--container); margin-inline: auto; padding-inline: 20px; height: var(--header-h); display: flex; align-items: center; justify-content: space-between; }
.wordmark { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.wordmark__name { font-family: var(--serif); font-size: 22px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.wordmark__tag { display: none; }
.site-nav { display: none; }

@media (min-width: 768px) {
  .wordmark__tag { display: inline-block; font-family: var(--sans); font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); border-left: 1px solid var(--line); padding-left: 10px; margin-left: 2px; }
  .site-nav { display: flex; gap: 26px; font-size: 13.5px; white-space: nowrap; }
  .site-nav a { color: var(--ink-2); text-decoration: none; padding: 6px 0; border-bottom: 1px solid transparent; }
  .site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
}

/* ---------- 6. Breadcrumbs ---------- */
.breadcrumbs { font-size: 12.5px; color: var(--ink-3); padding: 16px 0 0; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.breadcrumbs li + li::before { content: "/"; margin-right: 8px; color: var(--line); }
.breadcrumbs a { color: var(--ink-3); text-decoration: none; }
.breadcrumbs a:hover { color: var(--ink); text-decoration: underline; }
.breadcrumbs [aria-current] { color: var(--ink); font-weight: 500; }

/* ---------- 7. Page heads ---------- */
.page-head { padding: 32px 0; }
.hero { padding: 48px 0; }
.page-head h1, .hero h1 { font-size: clamp(32px, 6vw, 56px); max-width: 22ch; margin-bottom: 18px; letter-spacing: -0.02em; }
@media (min-width: 768px) {
  .page-head { padding: 48px 0 40px; }
  .hero { padding: 72px 0 64px; }
}

/* ---------- 8. Ad slots (CLS-locked) ---------- */
.ad-slot { position: relative; display: flex; align-items: center; justify-content: center; background: var(--skeleton); border: 1px dashed var(--line); overflow: hidden; }
.ad-slot::before { content: "ADVERTISEMENT"; font-size: 10px; font-weight: 600; letter-spacing: 0.16em; color: var(--ink-3); }
.ad-slot > ins { position: absolute; inset: 0; }

.ad-slot--leaderboard { min-height: 50px; max-width: 728px; margin: 20px 0; }
@media (min-width: 768px) { .ad-slot--leaderboard { min-height: 90px; max-width: 970px; margin: 24px 0; } }

.ad-slot--infeed { min-height: 250px; margin: 32px 0; }
@media (min-width: 768px) { .ad-slot--infeed { min-height: 280px; } }

.ad-slot--sidebar { display: none; width: 300px; min-width: 300px; height: 600px; }
@media (min-width: 1024px) { .ad-slot--sidebar { display: flex; } }

.ad-slot--filled::before { display: none; }
.ad-slot--filled { background: transparent; border: 1px solid transparent; }

/* ---------- 9. Tool layout ---------- */
.tool-layout { display: grid; grid-template-columns: 1fr; gap: 32px; align-items: start; padding-bottom: 48px; }
.tool-sidebar { display: none; }
@media (min-width: 1024px) {
  .tool-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .tool-sidebar { display: block; position: sticky; top: calc(var(--header-h) + 20px); }
}

/* ---------- 10. Calculator ---------- */
.calculator { background: var(--surface); border: 1px solid var(--line); }
.calculator__header { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.calculator__title { font-size: 21px; }
.calculator__badge { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); flex: none; }
.calculator__body { padding: 24px 22px 28px; }
@media (min-width: 1024px) { .calculator__body { padding: 32px; } }

.field-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.field--full { grid-column: 1 / -1; }
@media (min-width: 768px) { .field-grid { grid-template-columns: 1fr 1fr; gap: 20px 24px; } }

.field label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 7px; }
.field .hint { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 6px; font-weight: 400; line-height: 1.5; }

.input-wrap { position: relative; }
.input-wrap .prefix { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 15px; pointer-events: none; }
.input-wrap .prefix + input { padding-left: 28px; }

input[type="text"], input[type="number"], select {
  width: 100%; height: 48px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font-size: 16px; padding: 0 14px;
  appearance: none; transition: border-color 0.12s ease;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%230F1115' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}
input[type="text"]:hover, select:hover { border-color: var(--ink-3); }
input[type="text"]:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 32px; background: transparent; border: none; padding: 0; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: var(--line); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); margin-top: -8px; border: none; }
input[type="range"]::-moz-range-track { height: 2px; background: var(--line); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: none; }

.range-value { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--ink); border: 1px solid var(--line); padding: 2px 8px; }

.radio-group { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-group label { display: inline-flex; align-items: center; gap: 9px; padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; font-size: 14px; font-weight: 500; min-height: 48px; }
.radio-group input[type="radio"] { accent-color: var(--accent); margin: 0; width: 17px; height: 17px; flex: none; }
.radio-group label:has(input:checked) { border-color: var(--accent); border-width: 2px; padding: 12px 14px; }

.btn-row { display: flex; flex-direction: column; gap: 14px; margin-top: 26px; }
@media (min-width: 600px) { .btn-row { flex-direction: row; align-items: center; } }

.btn-primary { width: 100%; min-height: 52px; background: var(--accent); color: #FFFFFF; border: 1px solid var(--accent); border-radius: var(--radius); font-size: 15px; font-weight: 600; cursor: pointer; transition: background 0.12s ease; touch-action: manipulation; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:active { transform: translateY(1px); }
@media (min-width: 600px) { .btn-primary { flex: 1; } }

.btn-text { min-height: 48px; min-width: 48px; background: none; border: none; font-size: 13.5px; color: var(--ink-3); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 10px 14px; }
.btn-text:hover { color: var(--ink); }

/* ---------- 11. Results ---------- */
.results { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--ink); margin-top: 28px; }
.results__header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line-soft); }
.results__label { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.results__body { padding: 22px; }
@media (min-width: 768px) { .results__body { padding: 28px 24px; } }

.result-figure { font-size: clamp(30px, 6vw, 40px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; color: var(--ink); min-height: 1.1em; }
.result-caption { font-size: 13.5px; color: var(--ink-2); margin-top: 10px; max-width: 62ch; line-height: 1.55; }
.result-midpoint { margin-top: 16px; font-size: 13.5px; color: var(--ink-3); }
.result-midpoint strong { color: var(--ink); font-weight: 600; }

.range-track { position: relative; height: 6px; background: var(--skeleton); border: 1px solid var(--line-soft); margin: 22px 0 7px; }
.range-fill { position: absolute; top: -1px; bottom: -1px; background: var(--ink); min-width: 2px; transition: left 0.2s ease, width 0.2s ease; }
.range-scale { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }

.breakdown { margin-top: 24px; border-top: 1px solid var(--line); }
.breakdown-row { display: flex; justify-content: space-between; align-items: baseline; gap: 22px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.breakdown-row .breakdown-label { color: var(--ink-2); }
.breakdown-row .breakdown-value { font-weight: 600; white-space: nowrap; text-align: right; }
.breakdown-row--total .breakdown-label { color: var(--ink); font-weight: 700; }
.breakdown-row--total .breakdown-value { font-size: 15px; font-weight: 700; }

.results__note { margin-top: 20px; padding-top: 15px; border-top: 1px dashed var(--line); font-size: 12.5px; line-height: 1.65; color: var(--ink-3); }

/* ---------- 12. Hub cards ---------- */
.category-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 24px; }
@media (min-width: 768px) { .category-head { flex-direction: row; align-items: baseline; justify-content: space-between; } }
.category-head h2 { font-size: 30px; }
.category-head .count { font-family: var(--mono); font-size: 12px; color: var(--ink-3); flex: none; }

.tool-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; } }
@media (min-width: 1024px) { .tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }

.tool-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); padding: 22px; text-decoration: none; color: inherit; transition: border-color 0.14s ease; min-height: 48px; }
.tool-card:hover { border-color: var(--ink); }
.tool-card__kicker { font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 9px; }
.tool-card__title { font-size: 21px; margin-bottom: 10px; }
.tool-card__desc { font-size: 14px; line-height: 1.6; color: var(--ink-2); flex: 1; }
.tool-card__foot { display: flex; justify-content: space-between; align-items: center; border-top: 16px solid transparent; padding-top: 14px; font-size: 12.5px; color: var(--ink-3); }
.tool-card__cta { font-weight: 600; color: var(--accent); }
.tool-card:hover .tool-card__cta { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 13. Principles ---------- */
.principles { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 768px) { .principles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.principle { border: 1px solid var(--line); background: var(--surface); padding: 22px; }
.principle__index { font-family: var(--mono); font-size: 11px; color: var(--ink-3); display: block; margin-bottom: 10px; }
.principle h3 { font-size: 19px; margin-bottom: 8px; }
.principle p { font-size: 14px; color: var(--ink-2); }

/* ---------- 14. Prose ---------- */
.prose { max-width: 74ch; padding: 8px 0 48px; }
.prose h2 { font-size: 27px; margin: 44px 0 14px; padding-top: 28px; border-top: 1px solid var(--line); }
.prose h2:first-child { border-top: none; padding-top: 0; margin-top: 40px; }
.prose h3 { font-size: 19px; margin: 28px 0 10px; }
.prose p { margin-bottom: 16px; color: var(--ink-2); line-height: 1.65; }
.prose ul, .prose ol { margin: 0 0 18px 22px; color: var(--ink-2); }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--ink-3); }
.prose strong { color: var(--ink); }
.prose a { color: var(--accent); text-underline-offset: 3px; }
.formula { font-family: var(--mono); font-size: 13px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--ink); padding: 16px 18px; margin: 20px 0; overflow-x: auto; white-space: nowrap; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 20px 0; background: var(--surface); }
.data-table th, .data-table td { border: 1px solid var(--line); padding: 11px 14px; text-align: left; vertical-align: top; }
.data-table thead th { background: var(--bg); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }

/* ---------- 15. FAQ ---------- */
.faq { border-top: 1px solid var(--line); margin-top: 8px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 18px; cursor: pointer; padding: 18px 0; font-size: 15.5px; font-weight: 600; list-style: none; min-height: 48px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--serif); font-size: 22px; font-weight: 400; color: var(--ink-3); flex: none; }
.faq details[open] summary::after { content: "–"; }
.faq .faq-answer { padding: 0 0 20px; color: var(--ink-2); font-size: 14.5px; max-width: 70ch; line-height: 1.65; }

/* ---------- 16. Disclaimer ---------- */
.disclaimer { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--ink); padding: 18px 20px 20px; font-size: 13px; line-height: 1.65; color: var(--ink-2); margin: 28px 0; }
.disclaimer__title { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink); margin-bottom: 8px; }
.disclaimer--compact { border: none; border-left: 3px solid var(--line); background: transparent; padding: 4px 0 4px 14px; margin: 18px 0 0; font-size: 12.5px; }

/* ---------- 17. Footer ---------- */
.site-footer { background: var(--ink); color: #A9ACB5; margin-top: 56px; }
.site-footer a { color: #D8DAE0; text-decoration: none; display: inline-block; padding: 4px 0; }
.site-footer a:hover { color: #FFFFFF; text-decoration: underline; text-underline-offset: 3px; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 32px 20px; padding: 44px 0 32px; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 1.4fr repeat(3, 1fr); } }
.footer-brand .wordmark__name { color: #F4F4F6; }
.footer-brand p { font-size: 13.5px; margin-top: 14px; max-width: 34ch; color: #A9ACB5; }
.footer-col h4 { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #7C808A; margin-bottom: 14px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; font-size: 14px; }
.footer-legal { border-top: 1px solid #25262b; padding-top: 20px; font-size: 12px; line-height: 1.7; color: #7C808A; }
.footer-legal .row { display: flex; flex-direction: column; gap: 6px 24px; margin-top: 12px; }
@media (min-width: 768px) { .footer-legal .row { flex-direction: row; justify-content: space-between; } }

/* ---------- 18. Reduced motion & print ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
@media print {
  .site-header, .site-footer, .ad-slot, .tool-sidebar, .breadcrumbs, .btn-row, .skip-link { display: none !important; }
  body { background: #FFFFFF; }
  .calculator, .results { border-color: #000; }
}


/* Required-field states: red for missing, but only shown when clicked */
input.required-missing { border-color: #B42318 !important; box-shadow: 0 0 0 2px rgba(180, 35, 24, 0.12), 0 0 0 1px #B42318; }
label .req { color: #B42318; font-weight: 700; font-size: 12px; margin-left: 3px; }

.form-error {
  color: #A61B1B; background: #FEF6F5; border: 1px solid #F3C6C1;
  padding: 10px 15px; margin: 18px 0 0; font-size: 13px; font-weight: 500;
  border-radius: var(--radius); line-height: 1.5;
}
