/* DNA Signpost design tokens */
:root {
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --bg-panel: #ffffff;
  --border: #e2e5ea;
  --text: #16181d;
  --text-dim: #5a6472;
  --accent: #1258c9;
  --accent-dark: #0d3f96;
  --accent-soft: #eaf1fd;
  --amber: #b5750f;
  --amber-soft: #fbf3e3;
  --red: #a3312a;
  --red-soft: #fbecec;
  --green: #157a4a;
  --green-soft: #eaf6f0;
  --radius: 10px;
  --max-width: 1120px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* Long-form reading (articles). System fonts only: nothing fetched from a third party. */
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  /* Chart series colours (blue = --accent) */
  --chart-2: #d08a1b;
  --chart-muted: #8a94a3;
  --chart-ghost: #cfd9e8;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* Keyboard focus: visible ring for links/buttons without fighting mouse clicks */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button:focus-visible,
.menu-btn:focus-visible,
.btn:focus-visible,
.copy-link:focus-visible,
.consent-actions button:focus-visible,
.cookie-settings:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  font-size: 1.2rem;
  font-weight: 750;
  letter-spacing: -0.015em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 9px;
}
.logo img { display: block; }
.logo-dna { color: var(--accent); }
nav.main-nav { display: flex; gap: 26px; }
nav.main-nav a {
  font-size: 0.92rem;
  color: var(--text-dim);
  font-weight: 600;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
nav.main-nav a:hover, nav.main-nav a.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.menu-btn {
  display: none;
  background: none; border: 1px solid var(--border); border-radius: 6px;
  width: 38px; height: 38px; color: var(--text); cursor: pointer;
  align-items: center; justify-content: center;
}
.mobile-nav {
  display: none; flex-direction: column;
  border-top: 1px solid var(--border);
  padding: 6px 0 14px;
}
.mobile-nav a {
  padding: 12px 0; font-size: 1rem; font-weight: 600;
  color: var(--text-dim); border-bottom: 1px solid var(--border);
}
.mobile-nav a:last-child { border-bottom: none; }
body.nav-open .mobile-nav { display: flex; }
@media (max-width: 720px) {
  nav.main-nav { display: none; }
  .menu-btn { display: flex; }
}

/* Buttons */
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 8px;
  font-size: 0.94rem; font-weight: 700;
  border: 1.5px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: #fff; border-color: var(--border); color: var(--text); }
.btn-secondary:hover { border-color: var(--text-dim); }

/* Card grid (tools index / landing categories) */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 0 0 56px; }
@media (max-width: 860px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }

.card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.card:hover {
  border-color: var(--c, var(--accent));
  box-shadow: 0 6px 18px -12px rgba(20,30,50,.25);
  transform: translateY(-1px);
}
.card .icon {
  width: 38px; height: 38px; border-radius: 9px;
  background: color-mix(in srgb, var(--c, var(--accent)) 12%, white);
  color: var(--c, var(--accent));
  display: flex; align-items: center; justify-content: center;
}
.card .icon svg { width: 19px; height: 19px; }
.card h3 { margin: 0; font-size: 1.02rem; font-weight: 700; }
.card .status {
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-dim);
}
.card .status.live { color: var(--green); }

.card p { margin: 0; color: var(--text-dim); font-size: .9rem; line-height: 1.5; }

/* Footer */
footer.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 36px 0 28px;
  color: var(--text-dim);
  font-size: .86rem;
  margin-top: 24px;
}
.footer-top { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; padding-bottom: 24px; }
.footer-brand { max-width: 320px; }
.footer-brand .logo { font-size: 1.05rem; }
.footer-brand p { margin: 10px 0 0; line-height: 1.5; }
.footer-cols { display: flex; gap: 56px; }
.footer-cols h4 {
  margin: 0 0 10px; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text);
}
.footer-cols a, .footer-cols .cookie-settings { display: block; padding: 4px 0; }
.footer-cols a:hover, .footer-cols .cookie-settings:hover { color: var(--text); }
.cookie-settings { background: none; border: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }

/* Cookie consent message (Google Analytics only; see main.js) */
.consent {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 100;
  max-width: 560px; margin: 0 auto; padding: 16px 18px;
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 32px -12px rgba(20, 30, 50, .35);
  font-size: .92rem; line-height: 1.5;
}
.consent p { margin: 0 0 12px; }
.consent a { color: var(--accent); text-decoration: underline; }
.consent-actions { display: flex; gap: 10px; }
.consent-actions button {
  flex: 1; padding: 10px 14px; border-radius: 8px; cursor: pointer;
  font: inherit; font-weight: 700; color: var(--text);
  background: var(--bg-panel); border: 1.5px solid var(--border);
}
.consent-actions button:hover { border-color: var(--text-dim); }
.footer-legal { border-top: 1px solid var(--border); padding-top: 18px; font-size: .8rem; line-height: 1.5; }
.footer-legal p { margin: 0 0 6px; }

/* Landing page: article cards, with tools, guides and about in separate boxes */
.home-intro { color: var(--text-dim); font-size: 1.06rem; margin: 0; padding: 28px 0 0; }
.page-head .home-intro { padding-top: 0; margin: 0 0 8px; max-width: 620px; }
.home-cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; padding: 22px 0 56px; }
.box-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 12px; }
.box-head h2 { font-size: 1.15rem; letter-spacing: -0.01em; margin: 0; }
.box-head a { font-size: .88rem; font-weight: 700; color: var(--accent); white-space: nowrap; }
.box-head a:hover { color: var(--accent-dark); }

.side-box { border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; background: var(--bg-alt); }
.side-box + .side-box { margin-top: 18px; }
.tools-box { background: color-mix(in srgb, var(--accent) 5%, #fff); border-color: color-mix(in srgb, var(--accent) 20%, #fff); }
.guides-box { background: color-mix(in srgb, var(--green) 5%, #fff); border-color: color-mix(in srgb, var(--green) 20%, #fff); }
.side-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid rgba(20, 30, 50, .08); }
.box-head + .side-item { border-top: none; padding-top: 2px; }
.side-item strong { display: block; font-size: .96rem; margin-bottom: 2px; }
.side-item span span { display: block; color: var(--text-dim); font-size: .86rem; line-height: 1.45; }
.side-item:hover strong { color: var(--accent-dark); }
.side-icon {
  flex: none; width: 34px; height: 34px; border-radius: 9px; background: #fff; color: var(--c, var(--accent));
  border: 1px solid color-mix(in srgb, var(--c, var(--accent)) 25%, #fff);
  display: flex; align-items: center; justify-content: center;
}
.side-icon svg { width: 18px; height: 18px; }
.about-box h2 { font-size: 1.15rem; margin: 0 0 8px; }
.about-box p { margin: 0; color: var(--text-dim); font-size: .92rem; line-height: 1.55; }

@media (max-width: 860px) {
  .home-cols { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 560px) {
  .footer-cols { gap: 40px; }
  .home-intro { padding-top: 20px; }
  .side-box { padding: 14px 16px; }
}

/* Article cards (articles index + landing page) */
.post-cards { display: grid; gap: 14px; }
.post-card {
  display: block; background: var(--bg-panel); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.post-card:hover { border-color: var(--accent); box-shadow: 0 6px 18px -12px rgba(20,30,50,.25); }
.post-card .kicker, .article-head .kicker {
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--accent);
}
.post-card h3 { font-family: var(--serif); font-size: 1.32rem; line-height: 1.25; font-weight: 700; margin: 6px 0; }
.post-card:hover h3 { color: var(--accent-dark); }
.post-card .dek { margin: 0 0 10px; color: var(--text-dim); font-size: .96rem; line-height: 1.5; }
.post-meta { font-size: .8rem; color: var(--text-dim); }
@media (max-width: 560px) {
  .post-card { padding: 16px; }
  .post-card h3 { font-size: 1.2rem; }
}

/* Article page: Substack-style reading column */
.article { max-width: 700px; margin: 0 auto; padding-top: 40px; padding-bottom: 56px; }
.article-head h1 {
  font-size: clamp(1.9rem, 4.6vw, 2.6rem); line-height: 1.15; letter-spacing: -0.02em;
  font-weight: 800; margin: 10px 0 12px;
}
.article-head .dek { font-family: var(--serif); font-size: 1.22rem; line-height: 1.5; color: var(--text-dim); margin: 0 0 22px; }
.byline {
  display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center;
  font-size: .86rem; color: var(--text-dim);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 12px 0; margin-bottom: 32px;
}
.byline strong { color: var(--text); }
.byline .copy-link {
  margin-left: auto; font: inherit; font-weight: 700; color: var(--accent);
  background: none; border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; cursor: pointer;
}
.byline .copy-link:hover { border-color: var(--accent); }

.article-body { font-family: var(--serif); font-size: 1.16rem; line-height: 1.72; }
.article-body p, .article-body ul, .article-body ol { margin: 0 0 1.15em; }
.article-body li { margin-bottom: .4em; }
.article-body h2 { font-family: var(--sans); font-size: 1.4rem; letter-spacing: -0.01em; line-height: 1.3; margin: 1.9em 0 .55em; }
.article-body h3 { font-family: var(--sans); font-size: 1.1rem; margin: 1.6em 0 .5em; }
.article-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.article-body blockquote {
  margin: 1.5em 0; padding: 2px 0 2px 20px; border-left: 3px solid var(--border); color: var(--text-dim); font-style: italic;
}
.article-body figure { margin: 2em 0; }
.article-body figure img, .article-body figure svg { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: 10px; }
.article-body figcaption { font-family: var(--sans); font-size: .84rem; color: var(--text-dim); margin-top: 8px; line-height: 1.5; }
.callout {
  font-family: var(--sans); font-size: 1rem; line-height: 1.6;
  background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: 8px;
  padding: 16px 18px; margin: 1.6em 0;
}
.callout strong:first-child { display: block; margin-bottom: 4px; }
.callout.amber { background: var(--amber-soft); border-left-color: var(--amber); }
.table-wrap { overflow-x: auto; margin: 1.6em 0; }
.article-body table { font-family: var(--sans); font-size: .9rem; border-collapse: collapse; width: 100%; }
.article-body th, .article-body td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.article-body td.mut { background: var(--amber-soft); font-weight: 700; }
.article-body th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim); border-bottom-width: 2px; }
.article-sources { font-family: var(--sans); font-size: .9rem; line-height: 1.6; border-top: 1px solid var(--border); margin-top: 2.4em; padding-top: 1em; }
.article-sources h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); margin: 0 0 8px; }
.article-sources ol { padding-left: 1.2em; color: var(--text-dim); }
.article-sources a { color: var(--accent); word-break: break-word; }
.related-tool {
  display: flex; gap: 14px; align-items: center; margin-top: 28px;
  border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px;
}
.related-tool:hover { border-color: var(--accent); }
.related-tool .lbl { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); }
.related-tool .name { font-weight: 700; }
/* Article charts: plain HTML bars so labels stay readable at any width.
   Set each bar's length with style="--w:NN%" (and a marker with --x). */
.chart {
  font-family: var(--sans); margin: 2em 0; padding: 18px 20px 14px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--bg-panel);
}
.chart-title { font-weight: 700; font-size: 1.02rem; line-height: 1.35; margin: 0 0 3px; }
.chart-sub { font-size: .84rem; color: var(--text-dim); line-height: 1.45; margin: 0 0 14px; }
.bar-row {
  display: grid; grid-template-columns: minmax(0, 12em) minmax(0, 1fr) 7.6em;
  gap: 4px 12px; align-items: center; margin: 10px 0; font-size: .88rem;
}
.bar-label { line-height: 1.3; }
.bar-row.hl .bar-label, .bar-row.hl .bar-value { color: var(--chart-2); }
.bar-track { position: relative; display: block; height: 20px; background: var(--bg-alt); border-radius: 4px; }
.bar-track.thin { height: 11px; }
.bar { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); background: var(--accent); border-radius: 4px; }
.bar.amber { background: var(--chart-2); }
.bar.grey { background: var(--chart-muted); }
.bar.ghost { background: var(--chart-ghost); }
.bar-marker { position: absolute; left: var(--x); top: -5px; bottom: -5px; border-left: 2px dashed var(--text); opacity: .55; }
.bar-pair { display: grid; gap: 3px; }
.bar-value { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; min-width: 3.2em; }
.bar-value.pair { display: grid; gap: 3px; font-size: .78rem; line-height: 11px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .8rem; color: var(--text-dim); margin-top: 12px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 11px; height: 11px; border-radius: 2px; background: var(--accent); }
.chart-legend i.amber { background: var(--chart-2); }
.chart-legend i.ghost { background: var(--chart-ghost); }
.chart-legend i.marker { width: 0; height: 13px; border-radius: 0; background: none; border-left: 2px dashed var(--text); opacity: .55; }
.chart .chart-note { font-size: .8rem; color: var(--text-dim); margin: 10px 0 0; line-height: 1.45; }
.dot-grid { display: grid; grid-template-columns: repeat(17, 1fr); gap: 5px; max-width: 440px; margin: 6px 0 4px; }
.dot-grid i { aspect-ratio: 1; border-radius: 50%; background: var(--accent); }
.dot-grid i.off { background: var(--chart-2); }
.dot-grid i.grey { background: var(--chart-ghost); }
.chart-legend i.grey { background: var(--chart-ghost); }

/* Three-level guide (strong / possible / background) */
.tiers { font-family: var(--sans); display: grid; gap: 10px; margin: 1.6em 0; }
.tier { --t: var(--chart-muted); border: 1px solid var(--border); border-left: 6px solid var(--t); border-radius: 10px; padding: 14px 16px; background: var(--bg-panel); }
.tier.strong { --t: var(--accent); }
.tier.possible { --t: var(--chart-2); }
.tier-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tier-name { font-weight: 800; font-size: 1.05rem; color: var(--t); }
.tier.background .tier-name { color: var(--text-dim); }
.tier-share { font-size: .82rem; font-weight: 700; color: var(--text-dim); }
.tier-rule { font-weight: 700; font-size: .95rem; margin: 4px 0 6px; }
.tier p { margin: 0; font-size: .95rem; line-height: 1.55; }
.tier p + p { margin-top: 6px; }
@media (max-width: 560px) {
  .chart { padding: 16px 14px 12px; }
  .bar-row { grid-template-columns: minmax(0, 1fr) 7.6em; margin: 12px 0; }
  .bar-row .bar-label { grid-column: 1 / -1; }
}

.article-note { font-size: .82rem; color: var(--text-dim); margin-top: 22px; line-height: 1.5; }
.article-note a { color: var(--accent); text-decoration: underline; }
@media (max-width: 560px) {
  .article { padding-top: 28px; }
  .article-body { font-size: 1.08rem; }
  .article-head .dek { font-size: 1.1rem; }
}

/* Breadcrumb + page heading (tool/guide pages) */
.breadcrumb { font-size: .82rem; color: var(--text-dim); margin-bottom: 14px; }
.breadcrumb a:hover { color: var(--text); }
.page-head { padding: 36px 0 0; }
.page-head h1 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; margin: 0 0 8px; }
.page-head .lede { color: var(--text-dim); max-width: 620px; margin: 0 0 28px; font-size: .98rem; }

/* Tool shell: deliberately spare */
.tool-panel {
  max-width: 620px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px;
  margin: 0 0 28px;
}
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { display: none; }
.dropzone .filename { font-weight: 700; margin-top: 6px; }
.dropzone p { margin: 6px 0 0; color: var(--text-dim); font-size: .86rem; }
.supported-row {
  font-size: .78rem; color: var(--text-dim); text-align: center; margin-top: 12px;
}
#analyzeBtn { width: 100%; margin-top: 16px; justify-content: center; }
#analyzeBtn:disabled { opacity: .45; cursor: not-allowed; }
.status-line { text-align: center; color: var(--text-dim); font-size: .86rem; margin-top: 12px; min-height: 1.2em; }

.result { max-width: 620px; margin: 0; display: none; }
.result.show { display: block; }
.result-card {
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 24px; box-shadow: 0 1px 2px rgba(20,30,50,.04);
  margin-bottom: 16px; border-left: 5px solid var(--conf-color, var(--accent));
}
.result-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 6px; }
.result-hap { font-weight: 800; font-size: 1.7rem; }
.conf-badge {
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 5px 11px; border-radius: 999px; color: #fff; background: var(--conf-color, var(--accent));
}
.result-sub { color: var(--text-dim); font-size: .9rem; margin-bottom: 16px; }
.path-trail { display: flex; flex-wrap: wrap; gap: 6px; font-size: .8rem; color: var(--text-dim); border-top: 1px solid var(--border); padding-top: 14px; }
.path-trail span:not(:last-child)::after { content: "›"; margin-left: 6px; color: var(--border); }
.metrics-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin: 16px 0; }
.metric { text-align: center; padding: 12px 8px; background: var(--bg-alt); border-radius: 9px; }
.metric .num { font-weight: 800; font-size: 1.3rem; display: block; }
.metric .lbl { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); }
.alt-list { font-size: .86rem; }
.alt-list h4 { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); margin: 0 0 8px; }
.alt-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--border); }
.alt-row:last-child { border-bottom: none; }
.alt-row .name { font-weight: 600; }
.alt-row .score { color: var(--text-dim); }

/* Caveat / trust note: one line, links to full explanation elsewhere */
.caveat-line {
  font-size: .82rem; color: var(--text-dim);
  border-top: 1px solid var(--border);
  padding-top: 12px; margin-top: 4px;
}
.caveat-line a { color: var(--accent); text-decoration: underline; }

/* Error box */
.error-box {
  background: var(--red-soft); border: 1px solid #eecfcd; border-radius: 10px;
  padding: 16px 18px; font-size: .88rem; color: #6b1f1a; margin-top: 14px;
}
.error-box strong { display: block; margin-bottom: 4px; }
.error-box .actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.error-box button, .error-box a.btn-mini {
  font-size: .8rem; font-weight: 700; padding: 6px 12px; border-radius: 7px;
  border: 1px solid #d9a5a1; background: #fff; color: #6b1f1a; cursor: pointer;
}

/* Plain content pages (guides) */
.prose { max-width: 680px; padding-bottom: 60px; line-height: 1.65; }
.prose h2 { font-size: 1.25rem; margin-top: 36px; }
.prose p { color: var(--text); }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--accent); text-decoration: underline; }
.prose .updated { color: var(--text-dim); font-size: .88rem; margin-top: -4px; }
.summary-box {
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: 12px; padding: 4px 22px; margin: 20px 0 8px;
}
.summary-box ul { padding-left: 1.1em; }
.placeholder { padding: 60px 0 100px; text-align: center; color: var(--text-dim); }
