/* Scanplyance design system. Dark mode default; light via [data-theme="light"]. */

:root {
  --bg-page: #111110;
  --bg-card: #1c1c1a;
  --bg-surface: #242422;
  --text-primary: #e8e8e4;
  --text-secondary: #888;
  --border: #333330;
  --accent: #2db88a;
  --accent-ink: #06281e;
  --crit: #e24b4a;
  --warn: #ef9f27;
  --info: #185fa5;
  --ok: #0f6e56;
  --ok-bright: #2db88a;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  --maxw: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="light"] {
  --bg-page: #f5f5f0;
  --bg-card: #ffffff;
  --bg-surface: #f8f8f5;
  --text-primary: #1a1a1a;
  --text-secondary: #6a6a6a;
  --border: #e5e5e0;
  --accent: #0f6e56;
  --accent-ink: #ffffff;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg-page);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; margin: 0 0 0.5em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }

/* Skip link — we practice what we sell. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 16px;
  z-index: 1000;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Header / nav */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-page);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 64px;
}
.brand {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand:hover { text-decoration: none; }
.brand .dot { width: 12px; height: 12px; border-radius: 3px; background: var(--accent); display: inline-block; }
.nav-spacer { flex: 1; }
.nav a.navlink {
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}
.nav a.navlink:hover { color: var(--text-primary); text-decoration: none; background: var(--bg-surface); }
.nav a.navlink.active { color: var(--text-primary); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.12s ease;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn-danger { background: var(--crit); color: #fff; border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 20px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* KPI stat */
.stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.stat .label { color: var(--text-secondary); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.stat .value { font-size: 1.8rem; font-weight: 800; margin-top: 4px; }

/* Hero */
.hero { padding: 72px 0 48px; }
.hero h1 { font-size: 2.6rem; letter-spacing: -0.02em; max-width: 14ch; }
.hero p.lede { font-size: 1.2rem; color: var(--text-secondary); max-width: 52ch; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
@media (max-width: 640px) { .hero h1 { font-size: 2rem; } }

/* Badges / pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.pill.crit { background: rgba(226,75,74,0.15); color: var(--crit); border-color: transparent; }
.pill.serious { background: rgba(239,159,39,0.15); color: var(--warn); border-color: transparent; }
.pill.moderate { background: rgba(24,95,165,0.18); color: #5aa0e0; border-color: transparent; }
.pill.minor { background: rgba(136,136,136,0.18); color: var(--text-secondary); border-color: transparent; }
.pill.ok { background: rgba(15,110,86,0.2); color: var(--ok-bright); border-color: transparent; }
.pill.wosb { background: rgba(45,184,138,0.14); color: var(--accent); border-color: transparent; }

/* Grade ring */
.ring-wrap { display: flex; align-items: center; gap: 20px; }
.ring { position: relative; width: 132px; height: 132px; flex: none; }
.ring .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .grade { font-size: 2.4rem; font-weight: 800; line-height: 1; }
.ring .pct { font-size: 0.85rem; color: var(--text-secondary); }

/* Tables */
table.data { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.data th, table.data td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data th { color: var(--text-secondary); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; }
table.data tr:hover td { background: var(--bg-surface); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }

/* Forms */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 6px; }
input[type="text"], input[type="url"], input[type="email"], input[type="password"], select, textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(45,184,138,0.25); }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid transparent; }
.alert-error { background: rgba(226,75,74,0.12); color: var(--crit); border-color: rgba(226,75,74,0.3); }
.alert-ok { background: rgba(15,110,86,0.15); color: var(--ok-bright); border-color: rgba(15,110,86,0.3); }
.alert-info { background: rgba(24,95,165,0.12); color: #5aa0e0; border-color: rgba(24,95,165,0.3); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; flex-wrap: wrap; }
.tabs a, .tabs button {
  background: none; border: none; font-family: inherit; font-size: 0.95rem; cursor: pointer;
  color: var(--text-secondary); padding: 10px 14px; border-bottom: 2px solid transparent; text-decoration: none;
}
.tabs a.active, .tabs button.active { color: var(--text-primary); border-bottom-color: var(--accent); }

/* Pricing */
.price-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 720px) { .price-cards { grid-template-columns: 1fr; } }
.price { font-size: 2.4rem; font-weight: 800; }
.price small { font-size: 1rem; color: var(--text-secondary); font-weight: 500; }
.feature-list { list-style: none; padding: 0; margin: 16px 0; }
.feature-list li { padding: 6px 0 6px 26px; position: relative; }
.feature-list li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 800; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 64px; padding: 32px 0; color: var(--text-secondary); font-size: 0.9rem; }
.site-footer a { color: var(--text-secondary); }

.muted { color: var(--text-secondary); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.85em; }
.code-box { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.82rem; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.flex { display: flex; }
.between { justify-content: space-between; }
.items-center { align-items: center; }
.gap { gap: 12px; }
.wrap { flex-wrap: wrap; }
.mt { margin-top: 16px; }
.mt-lg { margin-top: 32px; }
.text-right { text-align: right; }
.theme-toggle { background: none; border: 1px solid var(--border); color: var(--text-secondary); width: 38px; height: 38px; border-radius: var(--radius-sm); cursor: pointer; font-size: 1rem; }
