/* Preflight
   One accent for the brand, three for status, nothing decorative that carries
   meaning on its own. Type has four jobs: eyebrow, heading, subheading, copy. */

:root {
  --ink: #0f1115;
  --ink-2: #2b3040;
  --ink-3: #626a7d;
  --paper: #fbfaf7;
  --paper-2: #f2f0ea;
  --card: #ffffff;
  --line: #dedbd2;
  --line-2: #eceae3;

  --brand: #4b4ded;
  --brand-soft: #eeeeff;
  --fail: #c4362b;
  --fail-soft: #fdeeec;
  --warn: #9a6b04;
  --warn-soft: #fdf3df;
  --pass: #1f7350;
  --pass-soft: #e8f5ee;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --shell: min(1180px, 100% - 3rem);
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f2f2f0;
    --ink-2: #c8ccd6;
    --ink-3: #8b93a4;
    --paper: #0d0f14;
    --paper-2: #14171e;
    --card: #171a22;
    --line: #2a2f3a;
    --line-2: #222630;
    --brand: #8b8cff;
    --brand-soft: #1d1f3d;
    --fail: #ff8071;
    --fail-soft: #331c1a;
    --warn: #e0aa4a;
    --warn-soft: #2e2515;
    --pass: #5cc494;
    --pass-soft: #16281f;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.1; letter-spacing: -0.025em; font-weight: 650; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, textarea, input { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--brand); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 20; padding: .6rem 1rem; background: var(--ink); color: var(--paper); }

/* ---------- type roles ---------- */
.eyebrow {
  display: flex; align-items: center; gap: .5rem;
  margin: 0 0 .75rem;
  font-family: var(--mono); font-size: .68rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3);
}
.sub { max-width: 60ch; margin-top: .85rem; color: var(--ink-2); font-size: 1.02rem; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--pass); box-shadow: 0 0 0 4px color-mix(in srgb, var(--pass) 18%, transparent); }

/* ---------- masthead ---------- */
.masthead {
  position: sticky; top: 0; z-index: 10;
  width: 100%; padding: 0 max(1.5rem, calc((100vw - 1180px) / 2));
  height: 66px; display: flex; align-items: center; justify-content: space-between;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-2);
}
.wordmark { display: inline-flex; align-items: center; gap: .55rem; font-weight: 680; letter-spacing: -.03em; font-size: 1.06rem; }
.wordmark-glyph svg rect { fill: var(--ink); }
.wordmark-glyph svg path { stroke: var(--brand); }
.masthead nav { display: flex; align-items: center; gap: 1.6rem; font-size: .85rem; }
.masthead nav a:not(.masthead-cta) { color: var(--ink-2); }
.masthead nav a:not(.masthead-cta):hover { color: var(--ink); }
.masthead-cta { padding: .5rem .9rem; border-radius: 7px; background: var(--ink); color: var(--paper); font-weight: 600; }

/* ---------- buttons ---------- */
.button {
  appearance: none; border: 1px solid transparent; border-radius: 8px;
  padding: .72rem 1.1rem; font-size: .92rem; font-weight: 620;
  cursor: pointer; transition: background .14s ease, border-color .14s ease, transform .14s ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: .4; cursor: not-allowed; }
.primary { background: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .primary { color: #0d0f14; } }
.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--brand) 86%, black); }
.ghost { background: transparent; border-color: var(--line); }
.ghost:hover:not(:disabled) { border-color: var(--ink-3); }
.quiet { background: none; border: none; color: var(--ink-3); text-decoration: underline; text-underline-offset: 4px; padding: .72rem .4rem; }

/* ---------- hero ---------- */
.hero { width: var(--shell); margin: 0 auto; padding: 5rem 0 3.5rem; }
.hero h1 { font-size: clamp(2.5rem, 6vw, 4.2rem); max-width: 18ch; }
.hero h1 em { font-style: normal; color: var(--brand); }
.lede { max-width: 62ch; margin-top: 1.5rem; font-size: 1.12rem; color: var(--ink-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.promises { display: flex; flex-wrap: wrap; gap: .5rem 1.6rem; margin: 1.9rem 0 0; padding: 0; list-style: none; font-size: .82rem; color: var(--ink-3); }
.promises li::before { content: "✓"; margin-right: .45rem; color: var(--pass); font-weight: 700; }

/* ---------- sections ---------- */
section { width: var(--shell); margin: 0 auto; }
.section-head { max-width: 70ch; margin-bottom: 2rem; }
.section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }

.workbench { padding: 3.5rem 0 1rem; border-top: 1px solid var(--line-2); }

.niche-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .5rem; margin-bottom: 1.4rem; }
.niche {
  appearance: none; text-align: left; cursor: pointer;
  padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 8px; background: var(--card);
}
.niche b { display: block; font-size: .85rem; font-weight: 620; }
.niche span { display: block; margin-top: .15rem; font-size: .7rem; color: var(--ink-3); }
.niche[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.niche[aria-checked="true"] span { color: color-mix(in srgb, var(--paper) 62%, transparent); }

.panes { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.pane-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.pane-head label { display: inline-flex; align-items: center; gap: .55rem; font-size: .92rem; font-weight: 620; }
.step { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: .68rem; font-weight: 700; }
.counter { font-family: var(--mono); font-size: .7rem; color: var(--ink-3); }
textarea {
  width: 100%; resize: vertical; padding: .95rem 1rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
  font-size: .93rem; line-height: 1.62;
}
textarea:focus { border-color: var(--brand); }
.hint { margin-top: .45rem; font-size: .76rem; color: var(--ink-3); }

.run-row { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin: 1.3rem 0 0; }
.privacy { flex: 1 1 260px; text-align: right; font-size: .76rem; color: var(--ink-3); }

/* ---------- results ---------- */
.results { padding: 2.5rem 0 3rem; }
.verdict-card {
  display: grid; grid-template-columns: 116px minmax(0, 1fr) auto; align-items: center; gap: 1.6rem;
  padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
}
.dial { position: relative; width: 108px; height: 108px; }
.dial svg { transform: rotate(-90deg); }
.dial-track { stroke: var(--line-2); }
.dial-value { stroke: var(--pass); transition: stroke-dasharray .5s ease; }
.band-close .dial-value { stroke: var(--warn); }
.band-rework .dial-value, .band-stop .dial-value { stroke: var(--fail); }
.dial-number { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.dial-number b { display: block; font-size: 1.9rem; font-weight: 680; letter-spacing: -.04em; line-height: 1; }
.dial-number span { font-family: var(--mono); font-size: .6rem; color: var(--ink-3); }
.verdict-copy h3 { font-size: 1.42rem; }
.verdict-copy p { margin-top: .35rem; color: var(--ink-2); font-size: .95rem; }
.verdict-actions { display: flex; flex-direction: column; gap: .5rem; }
.blocked-banner {
  display: flex; gap: .8rem; align-items: flex-start;
  margin-bottom: 1rem; padding: .95rem 1.1rem;
  border: 1px solid var(--fail); border-left-width: 4px; border-radius: var(--radius); background: var(--fail-soft);
}
.blocked-banner strong { color: var(--fail); }

.spec-strip { margin-top: 1.1rem; padding: 1rem 1.2rem; border: 1px dashed var(--line); border-radius: var(--radius); }
.spec-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.chip { padding: .28rem .6rem; border: 1px solid var(--line); border-radius: 99px; background: var(--paper-2); font-family: var(--mono); font-size: .72rem; }
.spec-note { margin-top: .7rem; font-size: .76rem; color: var(--ink-3); }

.result-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 1.2rem; margin-top: 1.2rem; align-items: start; }

.filter-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.filter-row p { font-family: var(--mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.filter-row .button { padding: .3rem .2rem; font-size: .78rem; }

.group { margin-bottom: 1.4rem; }
.group > h4 { margin-bottom: .55rem; font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.finding {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .8rem;
  width: 100%; text-align: left; cursor: pointer;
  padding: .85rem .95rem; margin-bottom: .4rem;
  border: 1px solid var(--line); border-left-width: 3px; border-radius: 8px; background: var(--card);
  transition: border-color .14s ease, background .14s ease;
}
.finding:hover { border-color: var(--ink-3); }
.finding.active { border-color: var(--brand); background: var(--brand-soft); }
.finding.fail { border-left-color: var(--fail); }
.finding.warn { border-left-color: var(--warn); }
.finding.pass { border-left-color: var(--pass); }
.finding.info { border-left-color: var(--line); }
.badge {
  align-self: start; padding: .18rem .45rem; border-radius: 4px;
  font-family: var(--mono); font-size: .6rem; font-weight: 700; letter-spacing: .06em;
}
.fail .badge { background: var(--fail-soft); color: var(--fail); }
.warn .badge { background: var(--warn-soft); color: var(--warn); }
.pass .badge { background: var(--pass-soft); color: var(--pass); }
.info .badge { background: var(--paper-2); color: var(--ink-3); }
.finding b { font-size: .93rem; font-weight: 620; }
.finding .detail { margin-top: .2rem; font-size: .85rem; color: var(--ink-2); }
.finding .fix { margin-top: .4rem; font-size: .82rem; color: var(--ink); }
.finding .fix::before { content: "Do this  "; font-family: var(--mono); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.finding .cost { margin-top: .4rem; font-family: var(--mono); font-size: .66rem; color: var(--ink-3); }

.evidence { position: sticky; top: 82px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.evidence-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem .9rem; border-bottom: 1px solid var(--line-2); }
.evidence-head p { font-family: var(--mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.evidence-doc { max-height: 300px; overflow: auto; padding: .9rem; font-size: .84rem; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.evidence-doc + .evidence-head { border-top: 1px solid var(--line-2); }
mark { background: color-mix(in srgb, var(--warn) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
mark.on { background: color-mix(in srgb, var(--brand) 34%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 34%, transparent); }
.evidence-empty { padding: 1.4rem .9rem; font-size: .84rem; color: var(--ink-3); }

.repair { margin-top: 1.6rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.repair-head { padding: 1.1rem 1.2rem .9rem; border-bottom: 1px solid var(--line-2); }
.repair-head h3 { font-size: 1.2rem; }
.repair-head p { margin-top: .35rem; font-size: .85rem; color: var(--ink-2); max-width: 68ch; }
.dialect-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-bottom: 1px solid var(--line-2); }
.dialect { appearance: none; border: none; border-right: 1px solid var(--line-2); padding: .7rem .5rem; background: transparent; cursor: pointer; font-size: .8rem; font-weight: 600; color: var(--ink-3); }
.dialect:last-child { border-right: none; }
.dialect[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.dialect-note { padding: .8rem 1.2rem; font-size: .82rem; color: var(--ink-2); border-bottom: 1px solid var(--line-2); }
.dialect-note a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.code { margin: 0; max-height: 340px; overflow: auto; padding: 1.1rem 1.2rem; background: var(--paper-2); font-family: var(--mono); font-size: .74rem; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.gate { padding: .8rem 1.2rem; border-top: 1px solid var(--line-2); }
.gate-title { font-family: var(--mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--pass); font-weight: 700; }
.gate.blocked .gate-title { color: var(--fail); }
.gate ul { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin: .5rem 0 0; padding: 0; list-style: none; font-size: .74rem; color: var(--ink-3); }
.repair-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; padding: .9rem 1.2rem; border-top: 1px solid var(--line-2); }
.repair-foot p { font-size: .76rem; color: var(--ink-3); max-width: 52ch; }

/* ---------- explainer ---------- */
.explainer { padding: 4rem 0; border-top: 1px solid var(--line-2); }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.compare-card { padding: 1.3rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.compare-card.bad { border-left: 3px solid var(--fail); }
.compare-card.good { border-left: 3px solid var(--pass); }
.compare-brief { font-family: var(--mono); font-size: .74rem; color: var(--ink-3); word-break: break-all; }
.compare-out { margin-top: .9rem; padding: .7rem .8rem; border-radius: 7px; background: var(--paper-2); font-family: var(--mono); font-size: .76rem; }
.bad .compare-out { background: var(--fail-soft); color: var(--fail); }
.good .compare-out { background: var(--pass-soft); color: var(--pass); }
.compare-note { margin-top: .8rem; font-size: .85rem; color: var(--ink-2); }
.rulebook { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: .8rem; margin-top: 1.1rem; }
.rule-card { padding: 1rem; border: 1px solid var(--line); border-radius: 9px; background: var(--card); }
.rule-card h4 { font-size: .93rem; }
.rule-card p { margin-top: .3rem; font-size: .82rem; color: var(--ink-2); }
.rule-card .weightbar { display: block; margin-top: .7rem; line-height: 0; }
.rule-card .weightbar svg { display: block; overflow: visible; }
.rule-card .weightbar rect { fill: var(--brand); opacity: .75; }

/* ---------- limits ---------- */
.limits { padding: 4rem 0; border-top: 1px solid var(--line-2); }
.limit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.1rem; }
.limit-grid article { padding: 1.2rem; border-top: 2px solid var(--ink); }
.limit-grid h3 { font-size: 1rem; }
.limit-grid p { margin-top: .45rem; font-size: .88rem; color: var(--ink-2); }

/* ---------- ide ---------- */
.ide { padding: 4rem 0 4.5rem; border-top: 1px solid var(--line-2); }
.ide-box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.ide-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; padding: .9rem 1.2rem; border-top: 1px solid var(--line-2); }
.ide-foot code { font-family: var(--mono); font-size: .72rem; color: var(--ink-2); word-break: break-all; }

/* ---------- footer ---------- */
footer { width: var(--shell); margin: 0 auto; padding: 2.2rem 0 3rem; border-top: 1px solid var(--line-2); display: grid; grid-template-columns: repeat(3, 1fr); align-items: center; gap: 1rem; }
.foot-mark { font-weight: 680; letter-spacing: -.03em; }
footer p:nth-child(2) { text-align: center; font-size: .88rem; color: var(--ink-2); }
.foot-meta { text-align: right; font-size: .74rem; color: var(--ink-3); }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .niche-row { grid-template-columns: repeat(3, 1fr); }
  .panes, .result-grid, .compare { grid-template-columns: 1fr; }
  .evidence { position: static; }
  .verdict-card { grid-template-columns: 92px minmax(0, 1fr); }
  .verdict-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 680px) {
  :root { --shell: calc(100% - 2rem); }
  .masthead nav a:not(.masthead-cta) { display: none; }
  .niche-row { grid-template-columns: repeat(2, 1fr); }
  .dialect-row { grid-template-columns: repeat(3, 1fr); }
  .privacy { text-align: left; }
  footer { grid-template-columns: 1fr; text-align: left; }
  footer p:nth-child(2), .foot-meta { text-align: left; }
  .hero { padding-top: 3rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
@media print {
  .masthead, .hero, .explainer, .limits, .ide, .run-row, .repair, footer { display: none; }
  .results { padding: 0; }
}
