/* Stylesheet for generated content pages (see scripts/build-content.mjs).
   Matches the app's brand tokens — blue-600 -> indigo-600 on slate neutrals —
   without pulling in the 3.3MB React bundle. */

:root {
  --blue: #2563eb;
  --indigo: #4f46e5;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #64748b;
  --rule: #e2e8f0;
  --rule-soft: #eef2f7;
  --bg: #ffffff;
  --bg-2: #f8fafc;
  --bg-3: #f1f5f9;
  --accent-soft: #eff6ff;
  --ok: #0f766e;
  --ok-soft: #ecfdf5;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  --measure: 44rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --blue: #7aa2ff; --indigo: #9b8cff;
    --ink: #e6edf5; --ink-2: #a2b0c0; --ink-3: #7c8998;
    --rule: #26303c; --rule-soft: #1c242e;
    --bg: #0d1117; --bg-2: #131a22; --bg-3: #19212b;
    --accent-soft: #16243f;
    --ok: #5bbfae; --ok-soft: #10251f;
    --warn: #d59a4a; --warn-soft: #2a2010;
  }
}

* { box-sizing: border-box; }

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

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

.wrap { max-width: 68rem; margin: 0 auto; padding: 0 1.25rem; }

.skip {
  position: absolute; left: -9999px;
  background: var(--blue); color: #fff; padding: .6rem 1rem; z-index: 100;
}
.skip:focus { left: 1rem; top: 1rem; }

a { color: var(--blue); text-underline-offset: 2px; }
a:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 2px; }

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
  position: sticky; top: 0; z-index: 20;
}
.hdr { display: flex; align-items: center; gap: 1.5rem; height: 62px; }
.brand { display: flex; align-items: center; flex: 0 0 auto; }
.brand img { height: 26px; width: auto; display: block; }
@media (prefers-color-scheme: dark) { .brand img { filter: brightness(0) invert(1); } }

.hdr-nav { display: flex; gap: 1.35rem; flex: 1 1 auto; }
.hdr-nav a {
  color: var(--ink-2); text-decoration: none; font-size: 14.5px; font-weight: 500;
  white-space: nowrap;
}
.hdr-nav a:hover { color: var(--blue); }

.hdr-cta { display: flex; align-items: center; gap: 1rem; flex: 0 0 auto; }
.hdr-cta .lnk { color: var(--ink-2); text-decoration: none; font-size: 14.5px; font-weight: 500; }
.hdr-cta .lnk:hover { color: var(--blue); }

@media (max-width: 880px) {
  .hdr { flex-wrap: wrap; height: auto; padding-top: .75rem; padding-bottom: .75rem; gap: .75rem 1rem; }
  .hdr-nav { order: 3; flex-basis: 100%; overflow-x: auto; padding-bottom: 2px; }
  .hdr-cta { margin-left: auto; }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--blue), var(--indigo));
  color: #fff; text-decoration: none; font-weight: 600;
  padding: .8rem 1.4rem; border-radius: .6rem; font-size: 15.5px;
  border: 0; cursor: pointer; font-family: inherit;
}
.btn:hover { filter: brightness(1.07); }
.btn-sm { padding: .5rem .9rem; font-size: 14px; border-radius: .45rem; }
@media (prefers-color-scheme: dark) { .btn { color: #0b1220; } }

/* ---------- breadcrumbs ---------- */

.crumbs { margin: 1.5rem 0 0; font-size: 13.5px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0; }
.crumbs li { color: var(--ink-3); }
.crumbs li + li::before { content: '/'; margin-right: .4rem; color: var(--rule); }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--blue); text-decoration: underline; }

/* ---------- prose ---------- */

.prose { max-width: var(--measure); padding: 1.75rem 0 4.5rem; }
.prose.wide { max-width: 100%; }

.prose h1 {
  font-size: clamp(1.95rem, 4.4vw, 2.7rem);
  line-height: 1.12; letter-spacing: -.022em; font-weight: 800;
  margin: .4rem 0 1rem; text-wrap: balance;
}
.prose .intro { font-size: 1.2rem; line-height: 1.55; color: var(--ink-2); margin: 0 0 1.9rem; }

.prose h2 {
  font-size: 1.5rem; line-height: 1.25; letter-spacing: -.015em; font-weight: 700;
  margin: 2.7rem 0 .85rem; text-wrap: balance;
}
.prose h3 {
  font-size: 1.14rem; line-height: 1.35; font-weight: 700;
  margin: 1.9rem 0 .55rem;
}
.prose p { margin: 0 0 1.05rem; }
.prose ul, .prose ol { margin: 0 0 1.15rem; padding-left: 1.3rem; }
.prose li { margin-bottom: .45rem; }
.prose li::marker { color: var(--ink-3); }
.prose strong { font-weight: 700; }

code {
  font-family: var(--mono); font-size: .87em;
  background: var(--bg-3); padding: .1rem .35rem; border-radius: 3px;
}

/* ---------- answer block (AEO) ---------- */

.answer {
  background: var(--accent-soft);
  border-left: 3px solid var(--blue);
  border-radius: 0 .5rem .5rem 0;
  padding: 1.05rem 1.25rem;
  margin: 0 0 1.75rem;
}
.answer p { margin: 0; font-size: 1.05rem; line-height: 1.6; }

/* ---------- callouts ---------- */

.callout { border-radius: .55rem; padding: 1rem 1.2rem; margin: 1.6rem 0; border: 1px solid var(--rule); }
.callout p { margin: 0; font-size: .97rem; }
.callout-note { background: var(--bg-2); }
.callout-tip { background: var(--ok-soft); border-color: transparent; }
.callout-warn { background: var(--warn-soft); border-color: transparent; }

/* ---------- tables ---------- */

.tw { overflow-x: auto; margin: 1.5rem 0; }
table { border-collapse: collapse; width: 100%; min-width: 30rem; font-size: 14.5px; }
thead th {
  text-align: left; font-weight: 600; font-size: 12px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--ink-3);
  border-bottom: 2px solid var(--rule); padding: 0 .9rem .55rem 0; white-space: nowrap;
}
tbody td {
  padding: .7rem .9rem .7rem 0; border-bottom: 1px solid var(--rule-soft);
  vertical-align: top; color: var(--ink-2);
}
tbody td:first-child { color: var(--ink); font-weight: 500; }
tbody tr:last-child td { border-bottom: 0; }

/* ---------- faq ---------- */

.faq { margin: 1.5rem 0; }
.faq-item { border-top: 1px solid var(--rule); padding: 1.1rem 0; }
.faq-item:last-child { border-bottom: 1px solid var(--rule); }
.faq-item h3 { margin: 0 0 .4rem; font-size: 1.03rem; }
.faq-item p { margin: 0; color: var(--ink-2); }

/* ---------- cta ---------- */

.cta {
  background: linear-gradient(135deg, var(--blue), var(--indigo));
  border-radius: 1rem; padding: 2.2rem 1.75rem; margin: 3rem 0 0; text-align: center;
  color: #fff;
}
.cta h2 { margin: 0 0 .5rem; color: #fff; font-size: 1.5rem; }
.cta p { margin: 0 0 1.35rem; color: rgba(255,255,255,.88); }
.cta .btn { background: #fff; color: var(--blue); }
@media (prefers-color-scheme: dark) {
  .cta { color: #0b1220; }
  .cta h2 { color: #0b1220; }
  .cta p { color: rgba(11,18,32,.8); }
  .cta .btn { background: #0d1117; color: var(--blue); }
}
.cta-fine { display: block; margin-top: .7rem; font-size: 13px; opacity: .8; }

/* ---------- related ---------- */

.related { margin: 2.75rem 0 0; border-top: 1px solid var(--rule); padding-top: 1.4rem; }
.related h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin: 0 0 .8rem; font-weight: 600; }
.related ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem .95rem; }
.related li { margin: 0; font-size: 14.5px; }

/* ---------- index grids ---------- */

.cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: 1rem; margin: 1.6rem 0; }
.card {
  border: 1px solid var(--rule); border-radius: .65rem; padding: 1.15rem 1.2rem;
  text-decoration: none; color: inherit; display: block; background: var(--bg);
}
.card:hover { border-color: var(--blue); background: var(--bg-2); }
.card h3 { margin: 0 0 .35rem; font-size: 1rem; font-weight: 650; }
.card p { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.5; }

.linklist { columns: 2; column-gap: 2rem; list-style: none; padding: 0; margin: 1.4rem 0; }
.linklist li { margin: 0 0 .5rem; break-inside: avoid; font-size: 15px; }
@media (max-width: 640px) { .linklist { columns: 1; } }

/* ---------- calculators ---------- */

.calc { border: 1px solid var(--rule); border-radius: .8rem; padding: 1.5rem; margin: 1.75rem 0; background: var(--bg-2); }
.calc-row { display: grid; grid-template-columns: 1fr 8.5rem; gap: .8rem 1rem; align-items: center; margin-bottom: .9rem; }
.calc label { font-size: 14.5px; font-weight: 500; }
.calc input {
  font: inherit; font-size: 15px; padding: .5rem .65rem; width: 100%;
  border: 1px solid var(--rule); border-radius: .4rem;
  background: var(--bg); color: var(--ink); font-variant-numeric: tabular-nums;
}
.calc input:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.calc-out {
  border-top: 2px solid var(--rule); margin-top: 1.2rem; padding-top: 1.2rem;
  display: flex; flex-wrap: wrap; gap: 1.5rem;
}
.calc-out div { flex: 1 1 8rem; }
.calc-out .v {
  font-size: 1.85rem; font-weight: 750; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; display: block; line-height: 1.1;
}
.calc-out .v.hero { color: var(--blue); }
.calc-out .k { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-top: .3rem; display: block; }

/* ---------- scorecard builder ---------- */

.sc-rows { margin: 1rem 0; }
.sc-row { display: grid; grid-template-columns: 1fr 6rem 2rem; gap: .6rem; margin-bottom: .55rem; align-items: center; }
.sc-row input { font: inherit; font-size: 14.5px; padding: .45rem .6rem; border: 1px solid var(--rule); border-radius: .4rem; background: var(--bg); color: var(--ink); width: 100%; }
.sc-del { background: none; border: 1px solid var(--rule); border-radius: .35rem; color: var(--ink-3); cursor: pointer; font-size: 15px; line-height: 1; padding: .4rem; font-family: inherit; }
.sc-del:hover { color: var(--warn); border-color: var(--warn); }
.btn-ghost {
  background: none; border: 1px solid var(--rule); color: var(--ink-2);
  padding: .5rem .9rem; border-radius: .45rem; font: inherit; font-size: 14px;
  font-weight: 500; cursor: pointer;
}
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }
.sc-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }
.sc-preview { margin-top: 1.5rem; }

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--rule); background: var(--bg-2); padding: 2.75rem 0 2rem; margin-top: 3rem; }
.foot-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 1.75rem; }
.foot-col h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); margin: 0 0 .7rem; font-weight: 600; }
.foot-col ul { list-style: none; padding: 0; margin: 0; }
.foot-col li { margin-bottom: .42rem; }
.foot-col a { color: var(--ink-2); text-decoration: none; font-size: 14px; }
.foot-col a:hover { color: var(--blue); }
.foot-base {
  border-top: 1px solid var(--rule); margin-top: 2rem; padding-top: 1.25rem;
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between;
  font-size: 13px; color: var(--ink-3);
}

@media print { .site-header, .site-footer, .cta, .related { display: none; } }
