/* ============================================================
   kryptosbot.com — Design System v2
   Modernized: 2026-02-23
   Aesthetic: research-grade data platform (Linear / Vercel / Stripe)
   Principles: clarity > decoration, structure > novelty, data > chrome
   ============================================================ */

/* --- Design Tokens --- */
:root {
  /* Type Scale (modular, 1.25 ratio) */
  --text-xs: 0.75rem;     /* 12px — metadata, timestamps */
  --text-sm: 0.875rem;    /* 14px — labels, captions */
  --text-base: 1rem;      /* 16px — body text */
  --text-lg: 1.125rem;    /* 18px — card titles */
  --text-xl: 1.5rem;      /* 24px — section headers */
  --text-2xl: 2rem;       /* 32px — page titles */
  --text-3xl: 2.5rem;     /* 40px — hero stat numbers */
  --text-4xl: 3.5rem;     /* 56px — large display numbers */

  /* Font Stacks */
  --font-display: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Fira Code", "Cascadia Code", monospace;

  /* Spacing (8px grid) */
  --sp-1: 0.25rem;   /* 4px */
  --sp-2: 0.5rem;    /* 8px */
  --sp-3: 0.75rem;   /* 12px */
  --sp-4: 1rem;      /* 16px */
  --sp-5: 1.25rem;   /* 20px */
  --sp-6: 1.5rem;    /* 24px */
  --sp-8: 2rem;      /* 32px */
  --sp-10: 2.5rem;   /* 40px */
  --sp-12: 3rem;     /* 48px */
  --sp-16: 4rem;     /* 64px */
  --sp-20: 5rem;     /* 80px */

  /* Layout */
  --max-width: 1080px;
  --content-width: 720px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition: 180ms ease;
}

/* --- Dark Theme (default) --- */
[data-theme="dark"] {
  --bg-root: #0a0f14;
  --bg-surface: #111820;
  --bg-elevated: #19222d;
  --bg-hover: #1f2a38;
  --bg-active: #253241;

  --text-primary: #e8edf3;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --text-quaternary: #475569;

  --border-default: #1e293b;
  --border-subtle: #172032;
  --border-strong: #334155;
  --border-focus: #38bdf8;

  --accent: #38bdf8;
  --accent-hover: #60ccfc;
  --accent-muted: #0c4a6e;
  --accent-faint: rgba(56, 189, 248, 0.08);

  --green: #34d399;
  --green-bg: rgba(52, 211, 153, 0.1);
  --green-border: rgba(52, 211, 153, 0.25);
  --amber: #fbbf24;
  --amber-bg: rgba(251, 191, 36, 0.1);
  --amber-border: rgba(251, 191, 36, 0.25);
  --red: #f87171;
  --red-bg: rgba(248, 113, 113, 0.1);
  --red-border: rgba(248, 113, 113, 0.25);

  /* Warm accent (copper — tools, interactive, exploration) */
  --accent-warm: #d4956a;
  --accent-warm-hover: #e0a87e;
  --accent-warm-muted: #3d2a1c;
  --accent-warm-faint: rgba(212, 149, 106, 0.06);

  /* Patina green (oxidized copper nod) */
  --patina: #5b8a72;
  --patina-faint: rgba(91, 138, 114, 0.08);

  /* Exploration mode surface */
  --bg-workshop: #12181f;

  --code-bg: #0d1117;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.5);
}

/* --- Light Theme --- */
[data-theme="light"] {
  --bg-root: #ffffff;
  --bg-surface: #f8fafc;
  --bg-elevated: #ffffff;
  --bg-hover: #f1f5f9;
  --bg-active: #e2e8f0;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --text-quaternary: #cbd5e1;

  --border-default: #e2e8f0;
  --border-subtle: #f1f5f9;
  --border-strong: #cbd5e1;
  --border-focus: #0284c7;

  --accent: #0284c7;
  --accent-hover: #0369a1;
  --accent-muted: #e0f2fe;
  --accent-faint: rgba(2, 132, 199, 0.05);

  --green: #16a34a;
  --green-bg: rgba(22, 163, 74, 0.08);
  --green-border: rgba(22, 163, 74, 0.2);
  --amber: #d97706;
  --amber-bg: rgba(217, 119, 6, 0.08);
  --amber-border: rgba(217, 119, 6, 0.2);
  --red: #dc2626;
  --red-bg: rgba(220, 38, 38, 0.08);
  --red-border: rgba(220, 38, 38, 0.2);

  --accent-warm: #b87a4e;
  --accent-warm-hover: #a06838;
  --accent-warm-muted: #f5ebe3;
  --accent-warm-faint: rgba(184, 122, 78, 0.06);

  --patina: #3d7a5a;
  --patina-faint: rgba(61, 122, 90, 0.06);

  --bg-workshop: #f9f7f5;

  --code-bg: #f1f5f9;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.1);
}


/* ============================================================
   RESET & GLOBAL
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-root);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

::selection {
  background: var(--accent-muted);
  color: var(--text-primary);
}

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


/* ============================================================
   LAYOUT
   ============================================================ */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}


/* ============================================================
   TYPOGRAPHY
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-top: var(--sp-12);
  margin-bottom: var(--sp-4);
}

h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  margin-top: var(--sp-12);
  margin-bottom: var(--sp-4);
}

h3 {
  font-size: var(--text-lg);
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-3);
}

h4 {
  font-size: var(--text-base);
  font-weight: 600;
  margin-top: var(--sp-6);
  margin-bottom: var(--sp-2);
}

h1:first-child, h2:first-child, h3:first-child {
  margin-top: 0;
}

p {
  margin-bottom: var(--sp-4);
  max-width: var(--content-width);
  color: var(--text-secondary);
  line-height: 1.7;
}

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

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

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

p a, li a, dd a, td a {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-underline-offset: 2px;
}

p a:hover, li a:hover, dd a:hover, td a:hover {
  text-decoration-color: var(--accent);
}

strong {
  font-weight: 600;
  color: var(--text-primary);
}

small {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

hr {
  border: none;
  border-top: 1px solid var(--border-default);
  margin: var(--sp-10) 0;
}

blockquote {
  border-left: 3px solid var(--border-strong);
  padding: var(--sp-3) var(--sp-4);
  margin: var(--sp-4) 0;
  color: var(--text-tertiary);
  background: var(--bg-surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Code */
code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

code {
  background: var(--code-bg);
  padding: 0.125em 0.375em;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

pre {
  background: var(--code-bg);
  padding: var(--sp-4);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: var(--sp-4) 0;
  border: 1px solid var(--border-default);
}

pre code {
  background: none;
  padding: 0;
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--text-secondary);
}

kbd {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 0.125em 0.375em;
  font-size: var(--text-xs);
}

mark {
  background: var(--amber-bg);
  color: var(--amber);
  padding: 0.125em 0.25em;
  border-radius: 2px;
}


/* ============================================================
   NAVIGATION
   ============================================================ */

nav {
  background: color-mix(in srgb, var(--bg-surface) 85%, transparent);
  border-bottom: 1px solid var(--border-default);
  padding: 0 var(--sp-6);
  height: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

nav ul {
  list-style: none;
  display: flex;
  gap: var(--sp-1);
  align-items: center;
}

nav a {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-tertiary);
  white-space: nowrap;
  transition: color var(--transition), background var(--transition);
}

nav a:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

nav a:visited {
  color: var(--text-tertiary);
}

nav a:visited:hover {
  color: var(--text-primary);
}

nav strong a,
nav strong a.nav-brand {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.nav-logo {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

nav strong a:visited {
  color: var(--text-primary);
}

/* Hamburger toggle — hidden on desktop */
.nav-toggle {
  display: none;
}

.nav-toggle-label {
  display: none;
  cursor: pointer;
  padding: var(--sp-2);
  position: absolute;
  right: var(--sp-4);
  top: 14px;
}

.nav-toggle-label span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  margin: 5px 0;
  border-radius: 1px;
  transition: transform var(--transition), opacity var(--transition);
}

@media (max-width: 768px) {
  .nav-toggle-label {
    display: block;
  }

  nav .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    padding-bottom: var(--sp-3);
  }

  .nav-toggle:checked ~ .nav-links {
    display: flex;
  }

  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}


/* ============================================================
   LISTS
   ============================================================ */

ul, ol {
  margin: var(--sp-2) 0 var(--sp-4) var(--sp-6);
  color: var(--text-secondary);
}

li {
  margin-bottom: var(--sp-2);
  line-height: 1.6;
}

li::marker {
  color: var(--text-quaternary);
}

dl { margin: var(--sp-4) 0; }

dt {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-primary);
  margin-top: var(--sp-4);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

dd {
  margin-left: 0;
  margin-top: var(--sp-1);
  color: var(--text-secondary);
  line-height: 1.6;
}


/* ============================================================
   TABLES
   ============================================================ */

table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--sp-4) 0;
  font-size: var(--text-sm);
}

thead {
  border-bottom: 1px solid var(--border-strong);
}

th {
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  color: var(--text-tertiary);
  font-weight: 500;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

tbody tr {
  transition: background var(--transition);
}

tbody tr:hover {
  background: var(--accent-faint);
}

.table-wrap {
  overflow-x: auto;
  margin: var(--sp-4) 0;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}

.table-wrap table {
  margin: 0;
}

.table-wrap td:first-child,
.table-wrap th:first-child {
  padding-left: var(--sp-5);
}


/* ============================================================
   FORMS
   ============================================================ */

label {
  display: block;
  margin-bottom: var(--sp-2);
  font-weight: 500;
  font-size: var(--text-sm);
  color: var(--text-primary);
}

input[type="text"],
input[type="email"],
input[type="search"],
input[type="url"],
input[type="number"],
select,
textarea {
  display: block;
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-root);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), box-shadow var(--transition);
  margin-bottom: var(--sp-4);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 140px;
}

input[type="search"] {
  -webkit-appearance: none;
}

input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}


/* ============================================================
   BUTTONS
   ============================================================ */

button,
input[type="submit"],
.btn,
a.btn,
a.btn:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.5;
  color: var(--bg-root);
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

button:hover,
input[type="submit"]:hover,
.btn:hover {
  background: var(--accent-hover);
  box-shadow: var(--shadow-sm);
}

button:active,
.btn:active {
  transform: translateY(1px);
}

button:disabled,
input[type="submit"]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary,
a.btn-secondary,
a.btn-secondary:visited {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}

.btn-secondary:hover,
a.btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}


/* ============================================================
   CARDS
   ============================================================ */

article, .card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  margin-bottom: var(--sp-4);
}

article header {
  margin-bottom: var(--sp-4);
}

article footer {
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}


/* ============================================================
   DETAILS / SUMMARY (FAQ)
   ============================================================ */

details {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--sp-4) var(--sp-5);
  margin: var(--sp-3) 0;
  transition: background var(--transition);
  max-width: var(--content-width);
}

details p {
  max-width: none;
}

details:hover {
  background: var(--accent-faint);
}

details[open] {
  background: var(--bg-elevated);
}

summary {
  cursor: pointer;
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--text-primary);
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

summary::before {
  content: "›";
  font-size: var(--text-lg);
  color: var(--text-tertiary);
  transition: transform var(--transition);
  flex-shrink: 0;
  width: 1em;
  text-align: center;
}

details[open] summary::before {
  transform: rotate(90deg);
}

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

details[open] summary {
  margin-bottom: var(--sp-4);
}


/* ============================================================
   FOOTER
   ============================================================ */

footer {
  padding: var(--sp-8) var(--sp-6);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

footer p {
  max-width: none;
  color: var(--text-tertiary);
}


/* ============================================================
   IMAGES
   ============================================================ */

img {
  max-width: 100%;
  height: auto;
}

figure {
  margin: var(--sp-8) 0;
  text-align: center;
}

figcaption {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-top: var(--sp-3);
}


/* ============================================================
   CUSTOM COMPONENTS — kryptosbot-specific
   ============================================================ */

/* --- Verdict Badges --- */
.verdict {
  display: inline-flex;
  align-items: center;
  padding: var(--sp-1) var(--sp-3);
  border-radius: 100px;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
}

.verdict-eliminated {
  color: var(--red);
  background: var(--red-bg);
  border: 1px solid var(--red-border);
}

.verdict-survived {
  color: var(--green);
  background: var(--green-bg);
  border: 1px solid var(--green-border);
}

.verdict-inconclusive {
  color: var(--amber);
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
}

.verdict-noise {
  color: var(--text-tertiary);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
}


/* --- Tier Badges --- */
.tier-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--sp-1) var(--sp-3);
  border-radius: 100px;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1;
  white-space: nowrap;
}

.tier-1 {
  color: var(--green);
  background: var(--green-bg);
  border: 1px solid var(--green-border);
}

.tier-2 {
  color: var(--accent);
  background: var(--accent-faint);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.tier-3 {
  color: var(--amber);
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
}

.tier-4 {
  color: var(--red);
  background: var(--red-bg);
  border: 1px solid var(--red-border);
}


/* --- "Billions Served" Disproven Banner --- */
.disproven-banner {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  padding: var(--sp-2) var(--sp-6);
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: var(--sp-3);
}

.disproven-count {
  font-size: var(--text-lg);
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent);
  letter-spacing: -0.01em;
}

.disproven-label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}


/* --- Hero Section (Home Page) --- */
.hero {
  padding: var(--sp-16) 0 var(--sp-12);
  border-bottom: 1px solid var(--border-default);
  margin-bottom: var(--sp-12);
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: var(--sp-12);
}

.hero-text {
  flex: 1;
  min-width: 0;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: var(--sp-4);
  color: var(--text-primary);
  line-height: 1.2;
}

.hero p {
  font-size: var(--text-lg);
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 640px;
}

.hero-tagline {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: var(--sp-3);
}

.hero-logo {
  flex-shrink: 0;
}

.hero-logo-img {
  width: 160px;
  height: 160px;
  border-radius: var(--radius-lg);
  filter: drop-shadow(0 4px 24px rgba(56, 189, 248, 0.15));
  transition: transform var(--transition), filter var(--transition);
}

.hero-logo-img:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 6px 32px rgba(56, 189, 248, 0.25));
}


/* --- Stats Grid (Home Page) --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border-default);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: var(--sp-10) 0;
}

.stat-card {
  background: var(--bg-elevated);
  padding: var(--sp-8) var(--sp-6);
  text-align: center;
}

.stat-value {
  font-size: var(--text-4xl);
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: var(--sp-2);
}

.stat-accent .stat-value {
  color: var(--accent);
}

.stat-micro {
  font-size: var(--text-xs);
  color: var(--text-quaternary);
  margin-top: var(--sp-1);
  line-height: 1.3;
}


/* --- Entry Point Cards (Home Page) --- */
.entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--sp-4);
  margin: var(--sp-6) 0 var(--sp-12);
}

.entry-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.entry-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-md);
  transform: translateY(-1px);
}

.entry-card h3 {
  margin-top: 0;
  margin-bottom: var(--sp-2);
  font-size: var(--text-base);
  font-weight: 600;
}

.entry-card h3 a {
  color: var(--text-primary);
}

.entry-card h3 a:visited {
  color: var(--text-primary);
}

.entry-card p {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-bottom: 0;
  line-height: 1.5;
}

.entry-card .entry-arrow {
  display: inline-block;
  margin-top: var(--sp-4);
  font-size: var(--text-sm);
  color: var(--accent);
  font-weight: 500;
}


/* --- Plain-English Summary (Elimination Page) --- */
.plain-summary {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: 1.6;
  margin: var(--sp-6) 0;
  padding: var(--sp-4) var(--sp-5);
  border-left: 3px solid var(--accent);
  background: var(--bg-surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.plain-summary strong {
  color: var(--text-primary);
}

.score-explanation {
  display: inline-block;
  margin-left: var(--sp-2);
  font-style: italic;
  color: var(--text-secondary);
}


/* --- Field Guide (Elimination Page) --- */
.field-guide-toggle {
  margin: var(--sp-4) 0;
}

.field-guide-toggle summary {
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.field-guide-toggle summary:hover {
  color: var(--accent);
}

.field-guide {
  list-style: none;
  padding: 0;
  margin: var(--sp-4) 0 var(--sp-8);
}

.field-guide li {
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border-subtle);
  line-height: 1.6;
}

.field-guide li:last-child {
  border-bottom: none;
}


/* --- Verdict Row (Elimination Page) --- */
.verdict-row {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  margin: var(--sp-6) 0;
}


/* --- Score Display --- */
.score-display {
  font-size: var(--text-xl);
  font-weight: 800;
  font-family: var(--font-mono);
}

.score-noise { color: var(--text-tertiary); }
.score-store { color: var(--amber); }
.score-signal { color: var(--accent); }
.score-breakthrough { color: var(--green); }


/* --- Ciphertext Display --- */
.ct-display {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  letter-spacing: 0.12em;
  word-break: break-all;
  line-height: 2;
  background: var(--code-bg);
  padding: var(--sp-5);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  margin: var(--sp-4) 0;
  color: var(--text-tertiary);
}

.ct-display .crib {
  color: var(--green);
  font-weight: 700;
}

.ct-display .position-marker {
  font-size: var(--text-xs);
  color: var(--text-quaternary);
  vertical-align: super;
}


/* --- Detail Grid (Elimination Page) --- */
.detail-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0;
  margin: var(--sp-6) 0;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.detail-grid dt {
  margin: 0;
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-surface);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
}

.detail-grid dd {
  margin: 0;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
}

.detail-grid dt:last-of-type,
.detail-grid dd:last-of-type {
  border-bottom: none;
}


/* --- Search Results --- */
.search-result {
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition);
}

.search-result:last-child {
  border-bottom: none;
}

.search-result h3 {
  font-size: var(--text-base);
  font-weight: 600;
  margin: 0 0 var(--sp-1) 0;
}

.search-result .meta {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.search-result .meta span {
  margin-right: 0;
}

.search-result p {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin: var(--sp-2) 0 0;
  line-height: 1.5;
}


/* --- Submit Form --- */
#submit-form {
  max-width: var(--content-width);
}

.submit-actions {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
}

.char-counter {
  text-align: right;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: calc(-1 * var(--sp-3));
  margin-bottom: var(--sp-4);
  font-family: var(--font-mono);
}

.char-counter.over-limit {
  color: var(--red);
  font-weight: 700;
}

.result-box {
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-md);
  margin-top: var(--sp-4);
  max-width: var(--content-width);
  display: none;
}

.result-matched {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  color: var(--green);
}

.result-novel {
  background: var(--accent-faint);
  border: 1px solid rgba(56, 189, 248, 0.2);
  color: var(--accent);
}

.result-error {
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  color: var(--red);
}

.result-ratelimit {
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  color: var(--amber);
}


/* --- Credit Notice --- */
.credit-notice {
  background: var(--accent-faint);
  border: 1px solid rgba(56, 189, 248, 0.15);
  border-radius: var(--radius-md);
  padding: var(--sp-4) var(--sp-5);
  margin: var(--sp-6) 0;
  max-width: var(--content-width);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.6;
  color: var(--text-secondary);
  text-align: center;
  text-wrap: balance;
}

.credit-notice strong {
  color: var(--accent);
}


/* --- Category Cards (Browse Page) --- */
.category-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--sp-4);
  margin: var(--sp-6) 0 var(--sp-10);
}

.category-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  transition: border-color var(--transition), transform var(--transition);
}

.category-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.category-card h3 {
  margin-top: 0;
  margin-bottom: var(--sp-1);
  font-size: var(--text-base);
}

.category-card .count {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.category-card p {
  margin-top: var(--sp-2);
  margin-bottom: 0;
}

.category-card small {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  line-height: 1.5;
}


/* --- Progress Indicators (RQ Page) --- */
.progress-bar {
  height: 4px;
  background: var(--border-default);
  border-radius: 2px;
  overflow: hidden;
  margin-top: var(--sp-3);
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 400ms ease;
}

.rq-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--sp-5);
  margin-bottom: var(--sp-3);
}

.rq-card h3 {
  margin: 0 0 var(--sp-2) 0;
  font-size: var(--text-base);
}

.rq-card p {
  margin-bottom: var(--sp-2);
}

.rq-meta {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-weight: 500;
}


/* --- Recent Feed --- */
.feed-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-5);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition);
}

.feed-item:first-child {
  padding-top: 0;
}

.feed-item:last-child {
  border-bottom: none;
}

.feed-date {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--text-quaternary);
  white-space: nowrap;
  min-width: 90px;
  padding-top: 2px;
}

.feed-content h3 {
  font-size: var(--text-sm);
  font-weight: 600;
  margin: 0 0 var(--sp-1) 0;
}

.feed-content .meta {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  display: flex;
  gap: var(--sp-3);
  align-items: center;
}


/* --- Noscript --- */
noscript {
  display: block;
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  color: var(--amber);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md);
  margin: var(--sp-4) 0;
  font-size: var(--text-sm);
}


/* --- Methodology Diagram --- */
.crib-diagram {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
  background: var(--code-bg);
  padding: var(--sp-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  margin: var(--sp-4) 0;
}


/* --- Loading Spinner --- */
.spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid var(--border-default);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: var(--sp-2);
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


/* --- Breadcrumb --- */
.breadcrumb {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-bottom: var(--sp-2);
}

.breadcrumb a {
  color: var(--text-tertiary);
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb a:visited {
  color: var(--text-tertiary);
}


/* --- Section divider --- */
.section-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--sp-3);
  margin-top: var(--sp-12);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border-subtle);
}


/* --- Long-form content sections --- */
main section + section {
  margin-top: var(--sp-10);
}


/* --- Legal / Long-form Prose Pages --- */
.legal-page {
  max-width: var(--content-width);
  margin: 0 auto;
  padding-bottom: var(--sp-12);
}

.legal-page h1 {
  margin-top: var(--sp-10);
  margin-bottom: var(--sp-2);
}

.legal-page .legal-effective {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-bottom: var(--sp-8);
  font-weight: 500;
}

.legal-page h2 {
  margin-top: var(--sp-10);
  margin-bottom: var(--sp-3);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--border-subtle);
  font-size: var(--text-lg);
}

.legal-page h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.legal-page h3 {
  font-size: var(--text-base);
  color: var(--accent);
  margin-top: var(--sp-6);
  margin-bottom: var(--sp-2);
}

.legal-page p {
  max-width: none;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: var(--sp-4);
}

.legal-page ul {
  margin: var(--sp-2) 0 var(--sp-5) var(--sp-6);
}

.legal-page li {
  line-height: 1.7;
  margin-bottom: var(--sp-2);
}

.legal-page .legal-caps {
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--text-tertiary);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-4);
}

.legal-page .legal-contact {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--sp-5) var(--sp-6);
  margin-top: var(--sp-4);
}

.legal-page .legal-contact p {
  margin-bottom: var(--sp-1);
}


/* --- Workbench: Elimination Warnings --- */
.wb-warning {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md);
  margin: var(--sp-4) 0;
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.6;
}

.wb-warning-proven {
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  color: var(--red);
}

.wb-warning-exhausted {
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  color: var(--amber);
}

.wb-warning-open {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  color: var(--green);
}

.wb-warning strong {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: var(--text-xs);
}

.elim-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.elim-dot-red { background: var(--red); }
.elim-dot-amber { background: var(--amber); }
.elim-dot-green { background: var(--green); }

/* --- Workbench: W-Marker Highlighting --- */
.ct-display .w-marker {
  color: var(--amber) !important;
  font-weight: 700;
  background: var(--amber-bg);
  border-bottom: 2px solid var(--amber);
  padding: 1px 2px;
  border-radius: 2px;
  font-size: 1.1em;
}

.wb-segments {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin: var(--sp-2) 0 var(--sp-4);
  padding: var(--sp-2) var(--sp-4);
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
}

.wb-segments span {
  color: var(--amber);
  font-weight: 600;
}

/* --- Workbench: Null Position Styling --- */
.ct-display .null-pos,
.ct-display .null-char {
  text-decoration: line-through;
  opacity: 0.25;
}

/* --- Workbench: Preset Cards --- */
.wb-presets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-3);
  margin: var(--sp-4) 0 var(--sp-6);
}

.preset-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.preset-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-sm);
  transform: translateY(-1px);
}

.preset-card h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  margin: 0 0 var(--sp-1) 0;
  color: var(--text-primary);
}

.preset-card p {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin: 0;
  line-height: 1.4;
}

/* --- Workbench: Null Mask Panel --- */
.null-extracted {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: 0.08em;
  word-break: break-all;
  line-height: 1.8;
  background: var(--code-bg);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  margin: var(--sp-2) 0;
}

/* --- Workbench: Keystream Analysis Table --- */
.keystream-table {
  width: 100%;
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  border-collapse: collapse;
  margin: var(--sp-3) 0;
}

.keystream-table th,
.keystream-table td {
  padding: var(--sp-1) var(--sp-3);
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
}

.keystream-table th {
  color: var(--text-tertiary);
  font-weight: 600;
}

.keystream-table .conflict-0 { color: var(--green); }
.keystream-table .conflict-high { color: var(--red); }

/* --- Workbench: Inline controls --- */
.wb-inline-controls {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin: var(--sp-2) 0;
}

.wb-inline-controls label {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: 0;
  cursor: pointer;
  font-weight: 400;
}

.wb-inline-controls input[type="checkbox"] {
  width: auto;
  margin: 0;
}

/* ============================================================
   MODE: EXPLORATION — warmer surfaces for tools & interactives
   ============================================================ */

.mode-explore {
  background: var(--bg-workshop);
}

.mode-explore .entry-card:hover,
.mode-explore .preset-card:hover {
  border-color: var(--accent-warm);
  box-shadow: 0 0 0 1px var(--accent-warm), var(--shadow-md);
}

.mode-explore .btn {
  background: var(--accent-warm);
  color: var(--bg-root);
}

.mode-explore .btn:hover {
  background: var(--accent-warm-hover);
}

.mode-explore h1,
.mode-explore h2 {
  font-family: var(--font-sans);
}


/* ============================================================
   TWO-PATHS SECTION — the homepage fork
   ============================================================ */

.two-paths {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-6);
  margin: var(--sp-10) 0;
}

.path-card {
  padding: var(--sp-8) var(--sp-6);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.path-card:hover {
  box-shadow: var(--shadow-md);
}

.path-card-explore {
  background: var(--bg-workshop);
}

.path-card-explore:hover {
  border-color: var(--accent-warm);
}

.path-card-research:hover {
  border-color: var(--accent);
}

.path-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--sp-3);
}

.path-card-research .path-label { color: var(--accent); }
.path-card-explore .path-label { color: var(--accent-warm); }

.path-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  margin: 0 0 var(--sp-3) 0;
}

.path-card p {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-bottom: var(--sp-5);
}

.path-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.path-links li {
  margin-bottom: var(--sp-2);
}

.path-links a {
  font-size: var(--text-sm);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}

.path-links a::after {
  content: "\2192";
  font-size: var(--text-xs);
  opacity: 0.5;
  transition: opacity var(--transition), transform var(--transition);
}

.path-links a:hover::after {
  opacity: 1;
  transform: translateX(3px);
}


/* ============================================================
   CREDIBILITY BAR — single-line stats
   ============================================================ */

.credibility-bar {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  text-align: center;
  padding: var(--sp-5) 0;
  margin: var(--sp-8) 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  letter-spacing: 0.01em;
  line-height: 1.8;
}

.credibility-bar strong {
  color: var(--text-primary);
  font-weight: 700;
}

.credibility-bar .sep {
  color: var(--text-quaternary);
  margin: 0 var(--sp-3);
}


/* ============================================================
   NOT-A-CLAIM BLOCK — calm authority
   ============================================================ */

.not-a-claim {
  max-width: var(--content-width);
  padding: var(--sp-5) var(--sp-6);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  margin: var(--sp-12) 0;
}

.not-a-claim h3 {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: var(--sp-3);
  font-weight: 600;
}

.not-a-claim p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 0;
}


/* ============================================================
   WHY SECTION — human voice
   ============================================================ */

.why-section {
  max-width: var(--content-width);
  margin: var(--sp-12) 0;
  padding-top: var(--sp-8);
  border-top: 1px solid var(--border-default);
}

.why-section h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--sp-6);
}

.why-section p {
  font-size: var(--text-base);
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: var(--sp-5);
}

.why-section p:last-child {
  color: var(--text-primary);
  font-style: italic;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  margin-bottom: 0;
}


/* ============================================================
   FINDING CALLOUTS — pull-quote style key numbers
   ============================================================ */

.finding-callout {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--sp-6) var(--sp-8);
  margin: var(--sp-6) 0;
  background: var(--accent-faint);
  border: 1px solid rgba(56, 189, 248, 0.12);
  border-radius: var(--radius-md);
  text-align: center;
}

.callout-value {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--accent);
  line-height: 1.1;
}

.callout-label {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-top: var(--sp-2);
  max-width: 40ch;
  line-height: 1.5;
}


/* ============================================================
   CONFIDENCE INDICATOR — visual strength bar
   ============================================================ */

.confidence-indicator {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}

.confidence-bar {
  display: flex;
  gap: 2px;
}

.confidence-bar span {
  width: 24px;
  height: 6px;
  border-radius: 3px;
  background: var(--border-default);
}

.confidence-bar span.filled {
  background: var(--accent);
}

.confidence-bar.confidence-high span.filled { background: var(--green); }
.confidence-bar.confidence-moderate span.filled { background: var(--accent); }
.confidence-bar.confidence-low span.filled { background: var(--amber); }

.confidence-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.confidence-high .confidence-label { color: var(--green); }
.confidence-moderate .confidence-label { color: var(--accent); }
.confidence-low .confidence-label { color: var(--amber); }


/* ============================================================
   FINDINGS SUMMARY CARDS — progressive disclosure from homepage
   ============================================================ */

.findings-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--sp-4);
  margin: var(--sp-6) 0 var(--sp-12);
}

.finding-preview-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  transition: border-color var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}

.finding-preview-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.finding-preview-num {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--accent);
  margin-bottom: var(--sp-2);
}

.finding-preview-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  margin: 0 0 var(--sp-2) 0;
}

.finding-preview-card p {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-bottom: var(--sp-4);
  flex: 1;
}

.finding-preview-card .entry-arrow {
  font-size: var(--text-sm);
  color: var(--accent);
  font-weight: 500;
}


/* ============================================================
   HERO CTA ROW
   ============================================================ */

.hero-cta-row {
  display: flex;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
  flex-wrap: wrap;
}

.hero-emphasis {
  color: var(--accent);
}

.hero-sub {
  font-size: var(--text-lg);
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 560px;
}


/* ============================================================
   TERM TOOLTIPS — glossary on hover
   ============================================================ */

.term {
  border-bottom: 1px dotted var(--text-tertiary);
  cursor: help;
  position: relative;
}

.term:hover::after {
  content: attr(data-def);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: var(--text-xs);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-md);
  white-space: nowrap;
  max-width: 300px;
  z-index: 50;
  pointer-events: none;
  line-height: 1.4;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}


/* ============================================================
   NAV DROPDOWN — for Tools and About grouping
   ============================================================ */

.nav-group {
  position: relative;
}

.nav-group-label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.nav-group-label::after {
  content: "\25BE";
  font-size: 10px;
  color: var(--text-quaternary);
}

.nav-dropdown {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-2) 0;
  z-index: 200;
  list-style: none;
  margin: 0;
  padding-top: calc(var(--sp-2) + 8px);
  transition: opacity 120ms ease, visibility 120ms ease;
  flex-direction: column;
  gap: 0;
}

/* Invisible bridge so the mouse can cross the gap */
.nav-dropdown::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}

.nav-group:hover .nav-dropdown,
.nav-group:focus-within .nav-dropdown {
  visibility: visible;
  opacity: 1;
}

.nav-dropdown li {
  margin: 0;
}

.nav-dropdown a {
  display: block;
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
}

.nav-dropdown a:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}


/* --- Utility --- */
.hidden { display: none !important; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

.text-muted { color: var(--text-tertiary); }
.text-mono { font-family: var(--font-mono); }
.mt-0 { margin-top: 0; }

.bean-pass { color: var(--green); font-weight: 700; }
.bean-fail { color: var(--red); font-weight: 700; }


/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet (iPad portrait ~768-1024px) — held at arm's length, needs bigger text */
@media (max-width: 1024px) and (min-width: 769px) {
  html { font-size: 17px; }
  .container { padding: 0 var(--sp-8); }
  nav .nav-links li a { padding: var(--sp-3) var(--sp-4); }
  .two-paths { grid-template-columns: 1fr; }
  .conclusion-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  html { font-size: 16px; }

  h1 { font-size: var(--text-xl); }
  h2 { font-size: var(--text-lg); }

  nav {
    height: auto;
    min-height: 56px;
    padding: var(--sp-3) var(--sp-4);
    flex-wrap: wrap;
    position: relative;
  }

  .container {
    padding: 0 var(--sp-4);
  }

  .hero {
    padding: var(--sp-10) 0 var(--sp-8);
  }

  .hero-inner {
    flex-direction: column-reverse;
    gap: var(--sp-6);
    text-align: center;
  }

  .hero-logo-img {
    width: 120px;
    height: 120px;
  }

  .hero p {
    max-width: none;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-card {
    padding: var(--sp-5) var(--sp-4);
  }

  .stat-value {
    font-size: var(--text-2xl);
  }

  .entry-grid {
    grid-template-columns: 1fr;
  }

  .two-paths {
    grid-template-columns: 1fr;
  }

  .findings-preview {
    grid-template-columns: 1fr;
  }

  .credibility-bar .sep {
    display: none;
  }

  .credibility-bar {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
  }

  .category-list {
    grid-template-columns: 1fr;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-grid dt {
    border-bottom: none;
    padding-bottom: 0;
    background: transparent;
    padding-top: var(--sp-4);
  }

  .detail-grid dd {
    padding-top: var(--sp-1);
  }

  .detail-grid dt:first-of-type {
    padding-top: var(--sp-3);
  }

  table { font-size: var(--text-xs); }

  th, td {
    padding: var(--sp-2) var(--sp-3);
  }

  .feed-item {
    flex-direction: column;
    gap: var(--sp-1);
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .disproven-banner {
    flex-direction: column;
    gap: var(--sp-1);
    padding: var(--sp-3) var(--sp-4);
  }

  .disproven-count {
    font-size: var(--text-base);
  }
}


/* ============================================================
   PRINT
   ============================================================ */

@media print {
  nav, footer, .btn, button, input, textarea, .disproven-banner {
    display: none;
  }

  body {
    color: #000;
    background: #fff;
  }

  a { color: #000; text-decoration: underline; }

  .verdict, .tier-badge {
    border: 1px solid #000;
    color: #000;
    background: #fff;
  }

  .hero { padding: var(--sp-4) 0; border: none; }
  .stats-grid { border: 1px solid #ccc; }
  .stat-card { background: #fff; }
}

/* ============================================================
   Workbench Page
   ============================================================ */

/* --- Workspace: two-column on wide screens --- */
.wb-workspace { display: flex; flex-direction: column; gap: var(--sp-4); margin-top: var(--sp-4); }
.wb-controls { min-width: 0; }
.wb-results { min-width: 0; }

@media (min-width: 1280px) {
  .wb-workspace { flex-direction: row; align-items: flex-start; gap: var(--sp-6); }
  .wb-controls { flex: 1 1 420px; max-width: 480px; }
  .wb-results { flex: 1 1 500px; position: sticky; top: var(--sp-4); max-height: calc(100vh - var(--sp-8)); overflow-y: auto; }
}

/* --- Compact pipeline --- */
.wb-pipeline-flow { display: flex; flex-direction: column; gap: 0; }
.wb-pipeline-flow .card { margin-bottom: 0; padding: var(--sp-3) var(--sp-4); }
.wb-step-card { position: relative; }
.wb-step-card p { margin-bottom: var(--sp-2); }
.wb-step-card label { margin-bottom: 2px; font-size: var(--text-xs); }
.wb-step-card select,
.wb-step-card input,
.wb-step-card textarea { margin-bottom: var(--sp-2); }
.wb-step-label { font-size: var(--text-xs); font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: var(--sp-1); display: flex; align-items: center; gap: var(--sp-2); }
.wb-step-num { display: inline-flex; align-items: center; justify-content: center; width: 1.4em; height: 1.4em; border-radius: 50%; background: var(--accent-faint); color: var(--accent); font-size: 10px; font-weight: 700; border: 1px solid rgba(56,189,248,0.2); flex-shrink: 0; }
.wb-step-connector { width: 2px; height: 12px; background: var(--border-default); margin: 0 auto; }

/* --- CT display: crib vis --- */
.ct-display .crib-miss { color: var(--red); font-weight: 700; text-decoration: underline wavy; }
.ct-display-compact { font-size: var(--text-sm); padding: var(--sp-3); line-height: 1.6; }
.pt-legend { font-size: var(--text-xs); color: var(--text-tertiary); margin: var(--sp-1) 0 var(--sp-3); display: flex; align-items: center; gap: var(--sp-3); }
.crib-legend-match { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--green); margin-right: 4px; vertical-align: middle; }
.crib-legend-miss { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--red); margin-right: 4px; vertical-align: middle; }

/* --- Score hero --- */
.score-hero { padding: var(--sp-4); border-radius: var(--radius-lg); margin: var(--sp-3) 0; border: 1px solid var(--border-default); background: var(--bg-surface); transition: border-color 0.3s, box-shadow 0.3s; }
.score-hero-main { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.score-hero-num { font-family: var(--font-mono); font-size: var(--text-3xl); font-weight: 700; line-height: 1; color: var(--text-tertiary); }
.score-hero-noise .score-hero-num { color: var(--text-tertiary); }
.score-hero-store .score-hero-num { color: var(--amber); }
.score-hero-signal { border-color: rgba(56,189,248,0.3); box-shadow: 0 0 20px rgba(56,189,248,0.08); }
.score-hero-signal .score-hero-num { color: var(--accent); }
.score-hero-breakthrough { border-color: rgba(34,197,94,0.4); box-shadow: 0 0 30px rgba(34,197,94,0.12); }
.score-hero-breakthrough .score-hero-num { color: var(--green); }
.score-sub-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
.score-sub-item { display: flex; flex-direction: column; gap: 1px; }
.score-sub-label { font-size: 10px; color: var(--text-tertiary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.score-sub-value { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--text-primary); }

/* --- Score badge --- */
.score-badge { display: inline-flex; align-items: center; padding: var(--sp-1) var(--sp-3); border-radius: 100px; font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; line-height: 1; margin-left: var(--sp-2); }
.score-badge-noise { color: var(--text-tertiary); background: var(--bg-surface); border: 1px solid var(--border-default); }
.score-badge-store { color: var(--amber); background: var(--amber-bg); border: 1px solid var(--amber-border); }
.score-badge-signal { color: var(--accent); background: var(--accent-faint); border: 1px solid rgba(56,189,248,0.2); }
.score-badge-breakthrough { color: var(--green); background: var(--green-bg); border: 1px solid var(--green-border); }

/* --- Null mask grid --- */
/* WCAG 2.2 AA: 24×24px min touch targets, 12px+ font, 4.5:1 contrast */
.null-grid-wrap {
  margin: var(--sp-3) 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--sp-2);
}
.null-grid {
  display: grid;
  grid-template-columns: 28px repeat(31, minmax(24px, 1fr));
  gap: 1px;
  font-family: var(--font-mono);
  user-select: none;
  min-width: 780px; /* 28 + 31×24 = 772, ensures scrollable not squished */
}
.null-grid-cell {
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-xs); /* 12px — WCAG AA minimum */
  font-weight: 500;
  line-height: 1;
  min-width: 24px; min-height: 24px; /* WCAG 2.2 AA touch target */
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  cursor: pointer;
  color: var(--text-secondary); /* higher contrast than quaternary */
  background: var(--bg-surface);
  transition: background 0.12s, color 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.null-grid-cell:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  z-index: 1;
  box-shadow: 0 0 0 1px var(--accent);
}
.null-grid-cell:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  z-index: 2;
}
.null-grid-cell.is-crib {
  color: var(--green);
  font-weight: 700;
  background: var(--green-bg);
}
.null-grid-cell.is-null {
  color: var(--red);
  text-decoration: line-through;
  background: var(--red-bg);
  border-color: var(--red-border);
  opacity: 0.7;
}
.null-grid-cell.is-null.is-crib { color: var(--red); background: var(--red-bg); }
.null-grid-cell.is-w { border-bottom: 2px solid var(--amber); }
.null-grid-cell.is-empty {
  border: none; background: transparent;
  cursor: default; min-height: 0;
}
.null-grid-rowlabel {
  font-size: 11px; color: var(--text-tertiary); font-weight: 600;
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 6px; min-width: 28px;
  border: none; cursor: default;
}
.null-grid-collabel {
  font-size: 10px; color: var(--text-tertiary);
  text-align: center; padding-bottom: 3px; cursor: default;
  display: flex; align-items: flex-end; justify-content: center;
  font-weight: 500;
}
.null-grid-legend {
  display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap;
  font-size: var(--text-xs); color: var(--text-tertiary);
  margin-top: var(--sp-2); padding-top: var(--sp-2);
  border-top: 1px solid var(--border-subtle);
}
.null-grid-legend span { display: inline-flex; align-items: center; gap: 4px; }
.null-grid-legend i {
  display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0;
}
.ngl-crib { background: var(--green); }
.ngl-null { background: var(--red); opacity: 0.7; }
.ngl-w { border-bottom: 2px solid var(--amber); background: var(--bg-surface); }
.ngl-count { margin-left: auto; color: var(--text-secondary); font-weight: 600; }

/* --- Workbench utility classes --- */
.wb-details-body { margin-top: var(--sp-3); }
.wb-mb2 { margin-bottom: var(--sp-2); }
.wb-mt3 { margin-top: var(--sp-3); }
.wb-mt6 { margin-top: var(--sp-6); }
.wb-mt8 { margin-top: var(--sp-8); }
.wb-reset-wrap { margin: var(--sp-3) 0; text-align: right; }
.wb-reset-btn { padding: var(--sp-2) var(--sp-4); font-size: var(--text-sm); cursor: pointer; border: 1px solid var(--border-default); border-radius: 6px; background: var(--bg-surface); color: var(--text-secondary); }
.wb-result-heading { margin: var(--sp-2) 0; }
.wb-history-scroll { max-height: 300px; overflow-y: auto; }
.wb-odds-kicker { color: var(--text-quaternary); font-style: italic; }
.wb-verdict-inline { margin-left: var(--sp-1); }
.wb-bean-pass { color: var(--green); }
.wb-bean-fail { color: var(--red); }

#keystream-detail { white-space: pre; font-size: var(--text-sm); line-height: 1.6; overflow-x: auto; }
#history-panel { margin-top: var(--sp-4); }
#history-log table { width: 100%; font-size: var(--text-xs); font-family: var(--font-mono); border-collapse: collapse; }
#history-log th, #history-log td { padding: var(--sp-1) var(--sp-3); text-align: left; border-bottom: 1px solid var(--border-subtle); }
#history-log th { color: var(--text-tertiary); font-weight: 600; }

@media (max-width: 768px) {
  .score-sub-grid { grid-template-columns: repeat(2, 1fr); }
  .score-hero-num { font-size: var(--text-2xl); }
}
