/*
 * SpecCheck design system — shared by every page and report.
 * Swiss / audit-tool aesthetic: white, ink, hairlines, one emerald accent.
 * Same-origin only (CSP: font-src 'self', style-src 'self').
 */

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-wght.woff2") format("woff2-variations"),
       url("/fonts/inter-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-latin-wght.woff2") format("woff2-variations"),
       url("/fonts/jetbrains-mono-latin-wght.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  --sc-bg: #FFFFFF;
  --sc-bg-subtle: #FAFAFA;
  --sc-highlight: #F4F4F5;
  --sc-ink: #09090B;
  --sc-ink-2: #52525B;
  --sc-ink-3: #71717A;
  --sc-line: #E4E4E7;
  --sc-line-strong: #D4D4D8;

  --sc-accent: #059669;
  --sc-accent-tint: rgba(5, 150, 105, 0.10);

  --sc-built: #059669;
  --sc-built-tint: rgba(5, 150, 105, 0.10);
  --sc-missing: #E11D48;
  --sc-missing-tint: rgba(225, 29, 72, 0.08);
  --sc-undoc: #D97706;
  --sc-undoc-tint: rgba(217, 119, 6, 0.10);
  --sc-review: #64748B;
  --sc-review-tint: rgba(100, 116, 139, 0.10);

  --sc-r-sm: 6px;
  --sc-r-md: 8px;
  --sc-r-lg: 12px;
  --sc-shadow-xs: 0 1px 2px rgba(9, 9, 11, 0.04);

  --sc-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --sc-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --sc-max: 1120px;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.sc {
  margin: 0;
  background: var(--sc-bg);
  color: var(--sc-ink);
  font: 400 16px/1.6 var(--sc-font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
:where(.sc) :is(h1, h2, h3, h4) { color: var(--sc-ink); font-weight: 600; margin: 0; }
:where(.sc) h1 { letter-spacing: -0.03em; line-height: 1.02; }
:where(.sc) h2 { letter-spacing: -0.025em; line-height: 1.12; }
:where(.sc) h3 { letter-spacing: -0.015em; line-height: 1.3; }
:where(.sc) a { color: inherit; }
.sc code, .sc kbd, .sc pre, .mono { font-family: var(--sc-mono); font-feature-settings: normal; }
.sc ::selection { background: rgba(5, 150, 105, 0.18); }
.sc :focus-visible { outline: 2px solid var(--sc-accent); outline-offset: 2px; }

.sc-wrap { width: min(var(--sc-max), 100% - 40px); margin-inline: auto; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--sc-line);
}
.site-header-inner {
  width: min(var(--sc-max), 100% - 40px);
  margin-inline: auto;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -0.015em;
  color: var(--sc-ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand-mark {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--sc-ink);
  position: relative;
  flex: none;
}
.brand-mark::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--sc-accent);
}
.site-nav { display: flex; align-items: center; gap: 2px; }
.site-nav a {
  padding: 7px 11px;
  border-radius: var(--sc-r-sm);
  color: var(--sc-ink-2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.site-nav a:hover { color: var(--sc-ink); background: var(--sc-highlight); }
.site-nav a[aria-current="page"] { color: var(--sc-ink); }
.site-header-actions { display: flex; align-items: center; gap: 8px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: var(--sc-r-sm);
  border: 1px solid transparent;
  font: 500 14.5px/1 var(--sc-font);
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn-primary { background: var(--sc-ink); color: #fff; border-color: var(--sc-ink); }
.btn-primary:hover { background: #27272A; border-color: #27272A; }
.btn-secondary { background: #fff; color: var(--sc-ink); border-color: var(--sc-line); }
.btn-secondary:hover { border-color: var(--sc-line-strong); background: var(--sc-bg-subtle); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn .arrow { font-family: var(--sc-mono); transition: transform .15s ease; }
.btn:hover .arrow { transform: translateX(2px); }

/* ---------- badges / tags ---------- */
.badge, .tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 26px;
  padding: 0 9px;
  border-radius: var(--sc-r-sm);
  border: 1px solid var(--sc-line);
  background: #fff;
  color: var(--sc-ink-2);
  font: 500 12px/1 var(--sc-mono);
  letter-spacing: 0;
  white-space: nowrap;
}
.badge .dot, .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--sc-accent);
  flex: none;
}
.eyebrow {
  font: 500 11.5px/1.2 var(--sc-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sc-ink-3);
}

.status-built { --st: var(--sc-built); --st-tint: var(--sc-built-tint); }
.status-missing { --st: var(--sc-missing); --st-tint: var(--sc-missing-tint); }
.status-undoc { --st: var(--sc-undoc); --st-tint: var(--sc-undoc-tint); }
.status-review { --st: var(--sc-review); --st-tint: var(--sc-review-tint); }
.status-built .status-dot, .status-missing .status-dot, .status-undoc .status-dot, .status-review .status-dot { background: var(--st); }

/* ---------- cards ---------- */
.card {
  background: #fff;
  border: 1px solid var(--sc-line);
  border-radius: var(--sc-r-lg);
  box-shadow: var(--sc-shadow-xs);
}
.card-subtle { background: var(--sc-bg-subtle); }

.rows { display: grid; }
.rows > * { border-top: 1px solid var(--sc-line); }
.rows > *:first-child { border-top: 0; }

/* ---------- prose pages (about / privacy / legal) ---------- */
.prose-page { padding: clamp(40px, 7vw, 88px) 0 clamp(56px, 8vw, 104px); }
.prose-head { margin-bottom: 40px; display: grid; gap: 14px; }
.prose-head h1 { font-size: clamp(34px, 5vw, 52px); }
.prose-head .lead { color: var(--sc-ink-2); font-size: 18px; max-width: 640px; margin: 0; }
.prose { max-width: 720px; color: var(--sc-ink-2); }
.prose h2 { font-size: 22px; margin: 40px 0 12px; padding-top: 32px; border-top: 1px solid var(--sc-line); }
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h3 { font-size: 16px; margin: 24px 0 8px; }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 20px; }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--sc-ink-3); }
.prose a { color: var(--sc-ink); text-decoration: underline; text-decoration-color: var(--sc-line-strong); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--sc-ink); }
.prose strong { color: var(--sc-ink); font-weight: 600; }
.prose code { font-size: 13.5px; background: var(--sc-highlight); border: 1px solid var(--sc-line); border-radius: 4px; padding: 1px 5px; }
.callout {
  border: 1px solid var(--sc-line);
  border-left: 3px solid var(--sc-ink);
  border-radius: var(--sc-r-sm);
  background: var(--sc-bg-subtle);
  padding: 14px 16px;
  margin: 18px 0;
  color: var(--sc-ink-2);
}
.callout.ok { border-left-color: var(--sc-built); }
.callout.warn { border-left-color: var(--sc-undoc); }
.callout.danger { border-left-color: var(--sc-missing); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--sc-line); background: #fff; }
.site-footer-inner {
  width: min(var(--sc-max), 100% - 40px);
  margin-inline: auto;
  padding: 24px 0 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.site-footer nav a { color: var(--sc-ink-2); text-decoration: none; font-size: 14px; }
.site-footer nav a:hover { color: var(--sc-ink); }
.site-footer small { color: var(--sc-ink-3); font: 12px/1.4 var(--sc-mono); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); align-items: start; gap: 28px; padding: 40px 0 28px; }
.footer-brand p { margin: 12px 0 0; color: var(--sc-ink-2); font-size: 14px; max-width: 320px; }
.site-footer .footer-col { display: grid; gap: 8px; align-content: start; margin: 0; padding: 0; }
.footer-col .eyebrow { margin: 0 0 4px; }
.footer-col a { color: var(--sc-ink-2); text-decoration: none; font-size: 14px; }
.footer-col a:hover { color: var(--sc-ink); }
.site-footer-base { border-top: 1px solid var(--sc-line); width: min(var(--sc-max), 100% - 40px); margin-inline: auto; padding: 16px 0 28px; }
.site-footer-base a { color: inherit; }

/* "soon" marker for products that are not live yet */
.soon {
  display: inline-flex; align-items: center; height: 18px; padding: 0 6px; margin-left: 4px;
  border: 1px solid var(--sc-line); border-radius: 4px; background: var(--sc-bg-subtle);
  color: var(--sc-ink-3); font: 500 10.5px/1 var(--sc-mono); letter-spacing: .02em; vertical-align: 1px;
}
.eyebrow .soon { margin-left: 0; height: 22px; padding: 0 8px; font-size: 11.5px; }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  /* Same menu on phones: a second, scrollable row under the brand. */
  .site-header-inner { height: auto; flex-wrap: wrap; row-gap: 0; padding-top: 10px; }
  .site-nav {
    order: 3; width: 100%; margin: 6px -11px 0; padding-bottom: 6px;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { white-space: nowrap; padding: 7px 11px; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand, .footer-col:last-child { grid-column: 1 / -1; }
}

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

@media print {
  .site-header, .site-footer { position: static; }
}
