:root {
  --bg: #1a1612;
  --bg-surface: #241f19;
  --bg-elevated: #2e261e;
  --text: #e8e0d4;
  --text-muted: #a89b8c;
  --text-faint: #7a6e60;
  --accent: #d4943a;
  --accent-light: #e8b05e;
  --accent-dim: #8a5e20;
  --pass: #5aab6a;
  --pass-bg: rgba(90, 171, 106, 0.12);
  --fail: #d4645a;
  --fail-bg: rgba(212, 100, 90, 0.12);
  --skip: #7a8a9a;
  --skip-bg: rgba(122, 138, 154, 0.12);
  --border: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.14);
  --radius: 8px;
  --radius-lg: 12px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  --max-width: 900px;
  --header-height: 56px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 16px); }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(26, 22, 18, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.logo:hover, .logo:focus-visible { text-decoration: none; color: var(--accent-light); }

.logo svg { color: var(--accent); flex-shrink: 0; }

.site-nav { display: flex; gap: 24px; }
.site-nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s;
}

.site-nav a:hover, .site-nav a:focus-visible {
  color: var(--accent-light);
  text-decoration: none;
  border-bottom-color: var(--accent-dim);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-menu {
  display: none;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
}

.nav-menu a {
  display: block;
  padding: 10px 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  border-bottom: 1px solid var(--border);
}

.nav-menu a:last-child { border-bottom: none; }

.nav-menu.open { display: block; }

/* Hero */
.hero {
  padding: 64px 0 48px;
  background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg) 100%);
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 12px;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 28px;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
  font-family: var(--font);
  line-height: 1.3;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.btn-primary:hover, .btn-primary:focus-visible {
  background: var(--accent-light);
  border-color: var(--accent-light);
  color: var(--bg);
  text-decoration: none;
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: var(--border-light);
}

.btn-secondary:hover, .btn-secondary:focus-visible {
  border-color: var(--accent-dim);
  color: var(--accent-light);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-light);
}

.btn-ghost:hover, .btn-ghost:focus-visible {
  color: var(--text);
  border-color: var(--text-faint);
  text-decoration: none;
}

/* Sections */
section { padding: 56px 0; }

.section-head { margin-bottom: 32px; }
.section-head h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.section-head p { color: var(--text-muted); max-width: 560px; }

/* Tier picker */
.tier-picker {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 28px;
}

.tier-label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.06em; }

.tier-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

.tier-btn {
  padding: 8px 18px;
  border-radius: 20px;
  border: 2px solid var(--border-light);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.tier-btn:hover { border-color: var(--accent-dim); color: var(--text); }

.tier-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent-light);
}

.tier-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Checklist */
.checklist-categories { margin-bottom: 32px; }

.cat {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  overflow: hidden;
}

.cat summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  list-style: none;
  user-select: none;
  transition: background 0.15s;
}

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

.cat summary::after {
  content: '+';
  margin-left: auto;
  font-size: 1.3rem;
  color: var(--text-faint);
  font-weight: 400;
}

.cat[open] summary::after { content: '−'; }

.cat summary:hover { background: var(--bg-elevated); }

.cat-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent-light);
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.cat-items { padding: 0 20px 16px; }

.chk-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

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

.chk-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.chk-label { font-weight: 500; font-size: 0.95rem; }

.chk-options {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.chk-options label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 16px;
  border: 1px solid var(--border);
  transition: all 0.15s;
}

.chk-options label:has(input:checked) {
  border-color: var(--accent-dim);
  color: var(--accent-light);
  background: rgba(212, 148, 58, 0.08);
}

.chk-options label:has(input[value="pass"]:checked) {
  border-color: var(--pass);
  color: var(--pass);
  background: var(--pass-bg);
}

.chk-options label:has(input[value="fail"]:checked) {
  border-color: var(--fail);
  color: var(--fail);
  background: var(--fail-bg);
}

.chk-options label:has(input[value="skip"]:checked) {
  border-color: var(--skip);
  color: var(--skip);
  background: var(--skip-bg);
}

.chk-options input { accent-color: var(--accent); }

.chk-hint {
  font-size: 0.83rem;
  color: var(--text-faint);
  margin-top: 8px;
  line-height: 1.5;
  padding-left: 0;
}

/* Results panel */
.results-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.results-panel h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; }

.results-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }

.progress {
  flex: 1;
  height: 8px;
  background: var(--bg-elevated);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text { font-size: 0.85rem; color: var(--text-muted); white-space: nowrap; }

.results-breakdown { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge.pass { background: var(--pass-bg); color: var(--pass); }
.badge.fail { background: var(--fail-bg); color: var(--fail); }
.badge.skip { background: var(--skip-bg); color: var(--skip); }

.result-verdict {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border-left: 3px solid var(--accent-dim);
}

.results-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Signal chain */
.signal-chain-section { background: var(--bg-surface); }

.chain-diagram {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.chain-step {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
}

.chain-icon { color: var(--accent); margin-bottom: 12px; }

.chain-step h4 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }

.chain-step p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 10px; }

.chain-check-ref {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  background: rgba(212, 148, 58, 0.1);
  padding: 3px 10px;
  border-radius: 10px;
}

.chain-arrow {
  display: flex;
  justify-content: center;
  color: var(--text-faint);
  padding: 4px 0;
}

.chain-arrow svg { transform: rotate(90deg); }

/* Formats */
.formats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.format-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.format-card h4 { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }

.format-tag {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 10px;
}

.format-card p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.5; }

/* Storage calc */
.storage-calc {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.storage-calc h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 16px; }

.calc-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.calc-row label {
  font-size: 0.9rem;
  color: var(--text-muted);
  min-width: 180px;
  flex-shrink: 0;
}

.calc-row input, .calc-row select {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  padding: 8px 12px;
  border-radius: var(--radius);
  width: 160px;
}

.calc-row input:focus, .calc-row select:focus {
  outline: 2px solid var(--accent-dim);
  outline-offset: 1px;
}

.calc-output {
  margin-top: 16px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.calc-output strong { color: var(--accent-light); }

/* About */
.about-section { background: var(--bg-surface); }

.about-content p, .about-content li {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 14px;
}

.about-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 28px;
  margin-bottom: 12px;
  color: var(--text);
}

.about-content ul {
  padding-left: 20px;
  margin-bottom: 14px;
}

.about-content li { margin-bottom: 8px; }

.last-updated {
  margin-top: 24px;
  font-size: 0.8rem;
  color: var(--text-faint);
  font-style: italic;
}

/* Footer */
.site-footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-faint);
}

.footer-links a:hover { color: var(--accent-light); }

.footer-note {
  font-size: 0.8rem;
  color: var(--text-faint);
}

/* Responsive */
@media (min-width: 640px) {
  .chain-diagram {
    grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr auto 1fr;
    align-items: start;
    gap: 0;
  }

  .chain-step { text-align: center; }

  .chain-arrow { padding: 0; align-items: center; }
  .chain-arrow svg { transform: none; }
}

@media (max-width: 768px) {
  .site-nav { display: none; }
  .nav-toggle { display: flex; }
  .hero { padding: 48px 0 36px; }
  section { padding: 40px 0; }
  .chk-main { flex-direction: column; align-items: flex-start; gap: 8px; }
  .calc-row label { min-width: unset; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero h1 { font-size: 1.5rem; }
  .tier-buttons { flex-direction: column; }
  .tier-btn { text-align: center; }
  .results-actions { flex-direction: column; }
  .results-actions .btn { width: 100%; }
}

/* Print */
@media print {
  .site-header, .site-footer, .tier-picker, .hero-actions, .results-actions, .storage-calc, .nav-toggle, .nav-menu { display: none !important; }
  body { background: #fff; color: #222; }
  .cat { break-inside: avoid; }
  .results-panel { border: 2px solid #ccc; }
}

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

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
