:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  
  --bg: #0b0f19;
  --surface: #121826;
  --surface-hover: #182235;
  --surface-raised: #1e293b;
  --border: #233044;
  --border-focus: #3b82f6;
  
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --accent: #38bdf8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --danger-border: rgba(239, 68, 68, 0.3);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --max-width: 1140px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-hover: #f1f5f9;
    --surface-raised: #e2e8f0;
    --border: #e2e8f0;
    --border-focus: #2563eb;
    
    --text: #0f172a;
    --text-muted: #475569;
    --text-dim: #94a3b8;
    
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --accent: #0284c7;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;
  }
}

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

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

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

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Site Header */
header.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}
.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}
.brand-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent);
}
nav.site-nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}
.nav-link {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}
.nav-link:hover {
  color: var(--text);
  text-decoration: none;
}

/* Hero Section */
.hero {
  padding: 4rem 0 3rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.hero-eyebrow {
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.hero h1 {
  font-size: 2.75rem;
  line-height: 1.2;
  font-weight: 800;
  max-width: 800px;
  margin: 0 auto 1.25rem;
}
.hero-lead {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 2rem;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.stat-num {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Category Filter Pills */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  margin: 2.5rem 0 1.5rem;
  flex-wrap: wrap;
}
.filter-pill {
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.filter-pill:hover, .filter-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  text-decoration: none;
}

/* Grid & Cards */
.playbook-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
  margin-bottom: 4rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease;
  position: relative;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.card-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--text-muted);
}
.badge-category {
  background: rgba(37, 99, 235, 0.15);
  color: #60a5fa;
}
.card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.75rem;
}
.card h2 a {
  color: var(--text);
  text-decoration: none;
}
.card h2 a:hover {
  color: var(--accent);
}
.card-error {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: var(--surface-raised);
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  color: #f87171;
  border-left: 3px solid var(--danger);
  margin-bottom: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-excerpt {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}
.card-footer {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Playbook Detail Page */
.page-article {
  padding: 2.5rem 0 4rem;
  max-width: 820px;
  margin: 0 auto;
}
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}
.breadcrumbs a {
  color: var(--text-muted);
}
.article-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2rem;
}
.article-header h1 {
  font-size: 2.2rem;
  line-height: 1.25;
  font-weight: 800;
  margin: 0.75rem 0 1rem;
}
.error-box {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-left: 4px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin: 1.5rem 0;
  font-family: var(--font-mono);
}
.error-box-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--danger);
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
.error-box-string {
  font-size: 0.95rem;
  color: var(--text);
  word-break: break-all;
}

.article-section {
  margin-bottom: 2.5rem;
}
.article-section h2 {
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.article-section p {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}
.steps-list {
  padding-left: 1.5rem;
  margin: 1rem 0;
}
.steps-list li {
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.65;
  margin-bottom: 0.85rem;
}
.steps-list li strong {
  color: var(--text);
}

.verification-callout {
  background: rgba(16, 185, 129, 0.08);
  border-left: 4px solid var(--success);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.sources-list {
  padding-left: 1.5rem;
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.sources-list li {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.sources-list li a {
  color: var(--primary);
  text-decoration: underline;
  word-break: break-all;
}
.sources-list li a:hover {
  color: var(--accent);
}

/* Waitlist Form Section */
.waitlist-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin: 3.5rem 0;
}
.waitlist-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 2rem;
}
.waitlist-header h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}
.waitlist-header p {
  color: var(--text-muted);
  font-size: 1rem;
}
.waitlist-form {
  max-width: 580px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.form-input, .form-select {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}
.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--border-focus);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}
.btn-submit {
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
  margin-top: 0.5rem;
}
.btn-submit:hover {
  background: var(--primary-hover);
}
.form-status {
  text-align: center;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}
.form-status.success {
  color: var(--success);
}
.form-status.error {
  color: var(--danger);
}
.form-privacy {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 0.5rem;
}

/* Footer */
footer.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 3rem 0;
  margin-top: 4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.footer-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.footer-disclaimer {
  color: var(--text-dim);
  line-height: 1.6;
}
.footer-nav {
  display: flex;
  gap: 1.5rem;
}
