/* pSEO Tech — design system
   Tokens first: every page inherits this file. Light + dark schemes,
   WCAG AA pairs verified in the sprint report. No webfonts, no images:
   the system is type, color, and spacing only. */

:root {
  --paper: #f7f5ed;
  --card: #fffdf7;
  --ink: #172f33;
  --muted: #4d5f62;
  --brand: #2f5a84;
  --brand-solid: #2f5a84;
  --on-brand: #ffffff;
  --line: #c9d2c6;
  --line-strong: #a9b8a4;
  --accent: #a86a10;
  --good: #256b31;
  --warn: #8f5a00;
  --bad: #b3261e;
  --out-bg: #e9f0e1;
  --chip-bg: #edf1e4;
  --shadow: 0 1px 2px rgb(23 47 51 / 0.06), 0 10px 30px -18px rgb(23 47 51 / 0.35);
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1618;
    --card: #172324;
    --ink: #e8ece1;
    --muted: #a3b3ab;
    --brand: #8ab6e2;
    --brand-solid: #2c537c;
    --on-brand: #ffffff;
    --line: #2a3b3e;
    --line-strong: #3d5457;
    --accent: #e8a33d;
    --good: #82c98b;
    --warn: #e3aa55;
    --bad: #f0938a;
    --out-bg: #182720;
    --chip-bg: #1d2c2a;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 12px 32px -18px rgb(0 0 0 / 0.8);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html {
  overflow-wrap: anywhere;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.65 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--brand); color: var(--on-brand); }

a { color: var(--brand); text-underline-offset: 4px; }
a:hover { text-decoration-thickness: 2px; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* SC 2.4.11: a focused or anchor-jumped target scrolled to the start edge
   must land below the sticky header, never underneath it. The header is
   ~73px tall on wide screens and ~115px stacked on small ones. */
a, button, input, textarea, select, summary, [tabindex], [id] {
  scroll-margin-top: 132px;
}

.skip {
  position: absolute;
  top: -80px;
  left: 16px;
}
.skip:focus {
  top: 12px;
  background: var(--card);
  color: var(--ink);
  padding: 10px 16px;
  z-index: 20;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

/* ---------- chrome ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap,
.site-foot .wrap,
main .wrap {
  max-width: 1140px;
  margin: auto;
  padding-inline: 30px;
}
.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block: 16px;
}
.brand {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.7px;
  text-decoration: none;
  color: var(--ink);
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}
.brand .mark {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  color: var(--brand);
}
.brand:hover { text-decoration: none; }
.main-nav { display: flex; gap: 24px; flex-wrap: wrap; }
.main-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  padding-block: 4px;
}
.main-nav a:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 5px; }
.main-nav a[aria-current="page"] {
  color: var(--brand);
  box-shadow: inset 0 -3px 0 var(--accent);
}

main .wrap { padding-block: 10px 70px; }

.breadcrumbs { font-size: 14px; color: var(--muted); padding-top: 18px; }
.breadcrumbs a { color: var(--muted); display: inline-block; padding-block: 6px; }

.site-foot {
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}
.site-foot .wrap { padding-block: 34px 48px; }
.site-foot strong { color: var(--ink); font-size: 16px; }
.site-foot nav { display: flex; gap: 20px; flex-wrap: wrap; margin: 16px 0; }
.site-foot a { color: var(--muted); }
.site-foot nav a { padding-block: 6px; }

/* ---------- type ---------- */

h1, h2, h3 { color: var(--ink); }
h1 {
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-weight: 700;
  font-size: clamp(36px, 5.6vw, 64px);
  line-height: 1.08;
  letter-spacing: -1.2px;
  margin: 18px 0 22px;
}
.prose h1 { font-size: clamp(34px, 5vw, 50px); }
h2 { font-size: clamp(24px, 3vw, 30px); line-height: 1.2; letter-spacing: -0.6px; margin: 40px 0 14px; }
h3 { font-size: 20px; line-height: 1.3; margin: 22px 0 8px; }
.lead { font-size: 21px; line-height: 1.55; max-width: 46em; color: var(--muted); }
.eyebrow {
  font-size: 12px; font-weight: 750; letter-spacing: 2.2px;
  text-transform: uppercase; color: var(--brand); margin: 0;
}
.prose { max-width: 800px; margin-inline: auto; }
.prose p, .prose li { max-width: 72ch; }
.prose h2 { margin-top: 42px; }
.small { font-size: 14px; color: var(--muted); }
.byline { font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 40px; padding-top: 18px; }

/* ---------- hero + cards ---------- */

.hero { padding: 56px 0 8px; max-width: 920px; }
.hero .lead { margin-bottom: 28px; }

.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; margin: 30px 0 50px; }
.cards.three { grid-template-columns: repeat(3, 1fr); }
.card {
  display: block;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform 160ms ease, border-color 160ms ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--line-strong); text-decoration: none; }
.card .kicker { color: var(--brand); font-weight: 700; font-size: 13px; letter-spacing: 1.6px; text-transform: uppercase; }
.card h2, .card h3 { margin: 8px 0 8px; font-size: 22px; }
.card p { color: var(--muted); margin: 0 0 12px; }
.card .go { color: var(--brand); font-weight: 700; }

.facts {
  display: flex; gap: 14px 34px; flex-wrap: wrap;
  padding: 20px 0; border-block: 1px solid var(--line);
  font-size: 14px; font-weight: 600;
}
.facts span::before { content: "✓ "; color: var(--good); font-weight: 800; }

/* ---------- tools ---------- */

.tool {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  margin: 28px 0;
  box-shadow: var(--shadow);
}
.tool h2:first-child { margin-top: 0; }
label { font-size: 14px; font-weight: 650; display: block; }
input, textarea, select {
  display: block; width: 100%;
  font: inherit; font-size: 16px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  margin-top: 6px;
  color: var(--ink);
  background: var(--paper);
}
textarea { min-height: 190px; resize: vertical; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14.5px; line-height: 1.55; }
textarea.short { min-height: 120px; }
.help { font-size: 14px; color: var(--muted); font-weight: 400; margin: 6px 0 0; }

button, .button {
  display: inline-block;
  background: var(--brand-solid);
  color: var(--on-brand);
  padding: 12px 22px;
  border: 0; border-radius: 9px;
  font: inherit; font-weight: 650;
  text-decoration: none; cursor: pointer;
}
button:hover, .button:hover { filter: brightness(1.1); text-decoration: none; }
button.secondary, .button.secondary {
  background: transparent; color: var(--brand);
  border: 1.5px solid currentColor;
}
button:disabled { opacity: 0.55; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
[hidden] { display: none !important; }

.options { display: flex; flex-wrap: wrap; gap: 10px 26px; margin: 16px 0 4px; }
.options label { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; cursor: pointer; }
.options input { width: 24px; height: 24px; flex: 0 0 24px; margin: 0; accent-color: var(--brand-solid); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin: 22px 0 6px; }
.stat { background: var(--chip-bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.stat .n { font-size: 30px; font-weight: 800; letter-spacing: -0.8px; line-height: 1.1; display: block; }
.stat .l { font-size: 13px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; }
.stat.alert .n { color: var(--bad); }
.stat.warn .n { color: var(--warn); }
.stat.good .n { color: var(--good); }

.results { margin-top: 10px; }
.results h2 { font-size: 20px; margin-top: 28px; }
.results h3 { margin-top: 28px; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; background: var(--card); }
th, td { text-align: left; padding: 9px 13px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); background: var(--chip-bg); }
tr:last-child td { border-bottom: 0; }
td.url, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13.5px; overflow-wrap: anywhere; }
.badge { display: inline-block; font-size: 12px; font-weight: 750; padding: 2px 9px; border-radius: 999px; border: 1px solid currentColor; }
.badge.bad { color: var(--bad); } .badge.warn { color: var(--warn); } .badge.good { color: var(--good); }
.verdict { border: 1.5px solid var(--line-strong); border-radius: 10px; padding: 16px 20px; font-weight: 650; margin: 20px 0; background: var(--chip-bg); }
.verdict.good { border-color: var(--good); }
.verdict.bad { border-color: var(--bad); }
output.plain { display: block; padding: 18px; background: var(--out-bg); border-radius: 10px; white-space: pre-wrap; margin-top: 20px; font-weight: 600; }
.note { font-size: 14px; color: var(--muted); }

details { padding: 15px 0; border-bottom: 1px solid var(--line); }
summary { font-weight: 700; cursor: pointer; }
details p { margin-bottom: 2px; }

/* checklist */
fieldset { border: 0; padding: 0; margin: 0 0 26px; }
legend { font-weight: 750; font-size: 19px; margin-bottom: 6px; padding: 0; }
fieldset .legend-help { color: var(--muted); font-size: 14.5px; margin: 0 0 10px; }
.check-item { display: flex; align-items: flex-start; gap: 13px; padding: 13px 2px; border-bottom: 1px solid var(--line); cursor: pointer; font-weight: 600; }
.check-item input { width: 24px; height: 24px; flex: 0 0 24px; margin: 2px 0 0; accent-color: var(--brand-solid); }
.check-item small { display: block; font-weight: 400; font-size: 14px; color: var(--muted); margin-top: 3px; }
.check-item .req { color: var(--bad); font-size: 12px; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase; }
.progress { height: 10px; background: var(--chip-bg); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin: 14px 0 6px; }
.progress > div { height: 100%; background: var(--brand-solid); width: 0; transition: width 200ms ease; }

.cta-box { border: 1.5px dashed var(--line-strong); border-radius: var(--radius); padding: 22px 26px; margin: 34px 0; background: var(--chip-bg); }
.cta-box h2, .cta-box h3 { margin-top: 0; }

.print-note { display: none; }

/* ---------- motion + print ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .card:hover { transform: none; }
}

@media print {
  .site-head, .site-foot, .skip, .actions, .no-print { display: none !important; }
  body { background: white; color: black; }
  main .wrap { padding: 0; }
  .prose, .tool { max-width: none; }
  .tool { break-inside: avoid; box-shadow: none; }
  .print-note { display: block; }
  h1 { font-size: 28px !important; }
}

/* ---------- small screens ---------- */

@media (max-width: 720px) {
  .site-head .wrap, .site-foot .wrap, main .wrap { padding-inline: 20px; }
  .site-head .wrap { align-items: flex-start; flex-direction: column; gap: 8px; }
  .hero { padding-top: 36px; }
  .cards, .cards.three { grid-template-columns: 1fr; }
  .tool { padding: 20px; }
  .main-nav { gap: 16px; }
  h1 { letter-spacing: -0.6px; }
}
