/* ============================================================
   survivorsbias.com — Shared Stylesheet
   Dark Cosmic Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,700;1,400&display=swap');

/* ── Variables ─────────────────────────────────────────── */
:root {
  --bg-deep:        #080810;
  --bg-mid:         #0d0d1e;
  --surface:        rgba(18, 18, 48, 0.72);
  --surface-hover:  rgba(30, 30, 80, 0.85);
  --amber:          #f0a500;
  --amber-dim:      rgba(240, 165, 0, 0.15);
  --indigo:         #6060d8;
  --indigo-dim:     rgba(96, 96, 216, 0.12);
  --text:           #dde0ff;
  --text-muted:     #7878a8;
  --border:         rgba(100, 100, 200, 0.18);
  --border-amber:   rgba(240, 165, 0, 0.30);
  --radius:         12px;
  --radius-lg:      20px;
  --transition:     0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background-color: var(--bg-deep);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ── Star-field Canvas ─────────────────────────────────── */
#starfield {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}

/* ── Layout Shell ──────────────────────────────────────── */
.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

/* ── Navigation ─────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 64px;
  background: rgba(8, 8, 16, 0.75);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--amber);
  text-decoration: none;
  letter-spacing: 0.04em;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
  letter-spacing: 0.02em;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: var(--indigo-dim);
}

.nav-links a.active {
  color: var(--amber);
}

/* ── Hero Section ──────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 7rem 2rem 5rem;
  position: relative;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
  border: 1px solid var(--border-amber);
  background: var(--amber-dim);
  padding: 0.35rem 1rem;
  border-radius: 999px;
  margin-bottom: 2rem;
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  font-weight: 700;
  line-height: 1.12;
  max-width: 820px;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #fff 0%, #aabbff 60%, var(--amber) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 3rem;
  line-height: 1.8;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.8rem 1.8rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--amber);
  color: #0a0a0a;
}

.btn-primary:hover {
  background: #ffc030;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(240, 165, 0, 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--indigo-dim);
  border-color: var(--indigo);
  transform: translateY(-2px);
}

/* ── Section Layout ─────────────────────────────────────── */
.section {
  padding: 6rem 2rem;
}

.section-inner {
  max-width: 900px;
  margin: 0 auto;
}

.section-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 1rem;
}

.section h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  color: #fff;
}

.section p {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.85;
  margin-bottom: 1.25rem;
  max-width: 740px;
}

.section p strong {
  color: var(--text);
  font-weight: 600;
}

/* ── Cards ──────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  backdrop-filter: blur(12px);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--indigo-dim), transparent 60%);
  opacity: 0;
  transition: opacity var(--transition);
}

.card:hover {
  border-color: rgba(96, 96, 216, 0.4);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 0, 60, 0.4);
}

.card:hover::before {
  opacity: 1;
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  display: block;
}

.card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.6rem;
  position: relative;
}

.card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 0;
  position: relative;
}

/* ── Blockquote ─────────────────────────────────────────── */
blockquote {
  border-left: 3px solid var(--amber);
  padding: 1.25rem 1.75rem;
  margin: 2.5rem 0;
  background: var(--amber-dim);
  border-radius: 0 var(--radius) var(--radius) 0;
}

blockquote p {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.15rem !important;
  color: #d0d0ff !important;
  margin-bottom: 0 !important;
  line-height: 1.7;
}

/* ── Table ──────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2.5rem 0;
  font-size: 0.9rem;
}

.data-table th {
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 2px solid var(--border-amber);
  color: var(--amber);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: top;
  line-height: 1.6;
}

.data-table td:first-child {
  color: var(--text);
  font-weight: 500;
}

.data-table tr:hover td {
  background: var(--indigo-dim);
}

/* ── Divider ─────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 0 2rem;
}

/* ── Manifesto Text ─────────────────────────────────────── */
.manifesto {
  max-width: 700px;
  margin: 4rem auto 0;
  text-align: left;
}

.manifesto h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: #fff;
  margin: 2.5rem 0 0.75rem;
}

.manifesto p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.85;
  margin-bottom: 0;
}

/* ── Fade-in Animation ──────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: none;
}

/* ── Footer ─────────────────────────────────────────────── */
footer {
  padding: 3rem 2rem;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.8;
}

footer a {
  color: var(--amber);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 640px) {
  .nav-brand { font-size: 0.95rem; }
  .nav-links a { padding: 0.35rem 0.6rem; font-size: 0.8rem; }
  .section { padding: 4rem 1.25rem; }
  .hero { padding: 6rem 1.25rem 4rem; }
  .card-grid { grid-template-columns: 1fr; }
  blockquote { padding: 1rem 1.25rem; }
  .data-table { font-size: 0.82rem; }
  .data-table th, .data-table td { padding: 0.65rem 0.6rem; }
}

/* ── Star-field Script (injected in HTML) ───────────────── */
