/* ============================================================
   PORTFOLIO KIT — base.css
   Design language: "bench instrument" — the calm precision of
   test equipment. Instrument-gray paper, charcoal ink, carbon
   blue interaction color, and a monospace readout strip as the
   house signature. Functional pass/fail colors are reserved for
   actual pass/fail states, never decoration.
   ============================================================ */

:root {
  /* Color tokens */
  --paper: #f4f5f2;        /* instrument housing */
  --panel: #ffffff;        /* tool face */
  --ink: #1b1e23;          /* primary text */
  --ink-soft: #4b5058;     /* secondary text */
  --line: #d7dad3;         /* hairline borders */
  --line-strong: #b9bdb4;
  --accent: #0043ce;       /* carbon blue — interactive */
  --accent-soft: #e3ecfd;
  --focus: #0f62fe;
  --pass: #197a3d;
  --pass-soft: #e2f2e7;
  --fail: #c0231b;
  --fail-soft: #fbe9e7;
  --warn: #9a5b00;
  --readout-bg: #16181d;   /* instrument display */
  --readout-ink: #e8eaed;
  --readout-dim: #8b919b;

  /* Type tokens */
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "Segoe UI Mono",
          Menlo, Consolas, monospace;

  /* Scale */
  --radius: 3px;
  --maxw: 62rem;
  --toolw: 62rem;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.site-header .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.brand {
  font-weight: 750;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
  font-size: 1.05rem;
}

.brand .brand-mark {
  color: var(--accent);
}

.site-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
}

.site-nav a:hover { color: var(--ink); border-bottom-color: var(--line-strong); }
.site-nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Layout ---------- */

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1rem;
}

main.wrap { padding-top: 1.5rem; padding-bottom: 3rem; }

/* Eyebrow: spec-label style — mono, uppercase, tracked */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  margin: 0 0 0.35rem;
}

h1 {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  font-weight: 780;
  margin: 0 0 0.5rem;
}

.lede {
  color: var(--ink-soft);
  max-width: 46rem;
  margin: 0 0 1.5rem;
}

h2 {
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  margin: 2.25rem 0 0.6rem;
}

h3 { font-size: 1.02rem; margin: 1.4rem 0 0.4rem; }

p { margin: 0.6rem 0; }

a { color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- Tool panel ---------- */

.tool-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 0 0 1.25rem;
}

/* ---------- Readout strip (house signature) ----------
   A dark mono "instrument display" carried by every tool. */

.readout {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.4rem;
  align-items: baseline;
  background: var(--readout-bg);
  color: var(--readout-ink);
  font-family: var(--mono);
  font-size: 0.85rem;
  border-radius: var(--radius);
  padding: 0.6rem 0.85rem;
  margin: 0 0 1rem;
  min-height: 2.4rem;
}

.readout .r-item { white-space: nowrap; }
.readout .r-label {
  color: var(--readout-dim);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-right: 0.45rem;
}
.readout .r-value { font-weight: 600; }
.readout .r-value.pass { color: #5fd68a; }
.readout .r-value.fail { color: #ff8d85; }

/* ---------- Buttons & controls ---------- */

.btn {
  appearance: none;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--panel);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  cursor: pointer;
}

.btn:hover { filter: brightness(1.08); }

.btn.secondary {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn.secondary:hover { border-color: var(--ink-soft); filter: none; }

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin: 0.75rem 0;
}

select, input[type="text"] {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  max-width: 100%;
}

label.inline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ---------- Status notes ---------- */

.note {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 0.75rem 0;
}

.note.error { border-left-color: var(--fail); background: var(--fail-soft); color: var(--ink); }
.note.warn  { border-left-color: var(--warn); }

/* ---------- Tool index cards (homepage) ---------- */

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
  gap: 0.9rem;
  margin: 1.25rem 0;
  padding: 0;
  list-style: none;
}

.tool-card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 0.9rem 1rem 1rem;
}

.tool-card a.title {
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--ink);
  text-decoration: none;
}

.tool-card a.title:hover { color: var(--accent); }

.tool-card p {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin: 0.4rem 0 0;
}

.tool-card .eyebrow { margin-bottom: 0.5rem; }

/* ---------- Prose sections (methodology, FAQ) ---------- */

.prose { max-width: 46rem; }
.prose code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--accent-soft);
  padding: 0.08em 0.3em;
  border-radius: 2px;
}

/* FAQ accordion */
.faq details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  margin: 0.5rem 0;
  max-width: 46rem;
}

.faq summary {
  cursor: pointer;
  font-weight: 620;
  padding: 0.65rem 0.9rem;
  list-style: none;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::before {
  content: "+";
  font-family: var(--mono);
  color: var(--accent);
  margin-right: 0.6rem;
}

.faq details[open] summary::before { content: "–"; }

.faq details > div { padding: 0 0.9rem 0.8rem; color: var(--ink-soft); font-size: 0.94rem; }

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

.related {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  list-style: none;
}

.related li a {
  display: inline-block;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
  color: var(--ink);
  text-decoration: none;
  background: var(--panel);
}

.related li a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Ad slots ----------
   Reserved-dimension containers. Empty and collapsed at launch;
   when ads are enabled, add class "active" and the space is
   reserved to prevent CLS. Never place within 150px of a
   clickable tool control. */

.ad-slot { display: none; }
.ad-slot.active {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  margin: 1.25rem auto;
}
.ad-slot.leaderboard { min-height: 90px; max-width: 728px; }
.ad-slot.rectangle { min-height: 250px; max-width: 336px; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 2rem;
  background: var(--panel);
}

.site-footer .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.1rem 1rem 1.4rem;
  font-size: 0.83rem;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  align-items: baseline;
}

.site-footer a { color: var(--ink-soft); }
.site-footer a:hover { color: var(--ink); }
.site-footer .promise { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; }

/* ---------- Motion & accessibility ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
