/* ═══════════════════════════════════════════════════════════════
   ricche.info — Design System
   Clean, modern, responsive with light/dark themes
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  --text-xs: 0.75rem; --text-sm: 0.875rem; --text-base: 1rem;
  --text-lg: 1.125rem; --text-xl: 1.25rem; --text-2xl: 1.5rem; --text-3xl: 2rem;
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem; --space-12: 3rem;
  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 16px; --radius-full: 9999px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms; --duration-base: 250ms;
  --max-width: 1100px; --header-height: 60px;
}

/* ── Light Theme ───────────────────────────────────────────── */
:root, [data-theme="light"] {
  --bg: #ffffff; --bg-soft: #f8f9fb; --bg-muted: #f0f2f5; --bg-card: #ffffff;
  --bg-overlay: rgba(255,255,255,0.85);
  --border: #e2e5ea; --border-soft: #eceef2; --border-accent: #c7d2fe;
  --text: #0f172a; --text-secondary: #475569; --text-muted: #94a3b8; --text-inverse: #fff;
  --accent: #4f46e5; --accent-hover: #6366f1; --accent-bg: #eef2ff;
  --green: #059669; --green-bg: #ecfdf5;
  --yellow: #d97706; --yellow-bg: #fffbeb;
  --red: #dc2626; --red-bg: #fef2f2;
  --blue: #0284c7; --blue-bg: #f0f9ff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06); --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  color-scheme: light;
}

/* ── Dark Theme ────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg: #0b0f1a; --bg-soft: #111827; --bg-muted: #1e293b; --bg-card: #151c2c;
  --bg-overlay: rgba(11,15,26,0.9);
  --border: #1e293b; --border-soft: #1a2236; --border-accent: #312e81;
  --text: #f1f5f9; --text-secondary: #94a3b8; --text-muted: #64748b; --text-inverse: #0f172a;
  --accent: #818cf8; --accent-hover: #6366f1; --accent-bg: rgba(99,102,241,0.12);
  --green: #34d399; --green-bg: rgba(5,150,105,0.12);
  --yellow: #fbbf24; --yellow-bg: rgba(217,119,6,0.12);
  --red: #f87171; --red-bg: rgba(220,38,38,0.12);
  --blue: #38bdf8; --blue-bg: rgba(2,132,199,0.12);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.25); --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  color-scheme: dark;
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-family: var(--font-sans); line-height: 1.6; scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1.5rem); -webkit-font-smoothing: antialiased; }
body { background: var(--bg); color: var(--text); min-height: 100dvh;
  transition: background var(--duration-base) var(--ease-out), color var(--duration-base) var(--ease-out); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ── Layout ────────────────────────────────────────────────── */
.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space-6); }
.page { padding-top: calc(var(--header-height) + var(--space-8)); padding-bottom: var(--space-12); min-height: 100dvh; }

/* ── Header ────────────────────────────────────────────────── */
.header { position: fixed; top: 0; left: 0; right: 0; height: var(--header-height);
  background: var(--bg-overlay); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-soft); z-index: 100; }
.header-inner { display: flex; align-items: center; justify-content: space-between;
  height: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space-6); }
.logo { display: inline; font-weight: 600;
  font-size: var(--text-lg); color: var(--text); text-decoration: none; letter-spacing: -0.02em; }
.logo:hover { color: var(--accent); }
.logo-mark { width: 28px; height: 28px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: var(--text-sm); font-weight: 700; font-family: var(--font-mono); }

.nav { display: flex; align-items: center; gap: var(--space-1); }
.nav a { padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: var(--text-sm); font-weight: 500;
  transition: all var(--duration-fast) var(--ease-out); }
.nav a:hover, .nav a.active { color: var(--text); background: var(--bg-muted); }

.header-actions { display: flex; align-items: center; gap: var(--space-2); }

/* Theme toggle */
.theme-btn { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-soft);
  color: var(--text-secondary); cursor: pointer; transition: all var(--duration-fast) var(--ease-out); }
.theme-btn:hover { color: var(--accent); border-color: var(--accent); }
.theme-btn svg { width: 18px; height: 18px; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun, :root .icon-sun { display: none; }
[data-theme="light"] .icon-moon, :root .icon-moon { display: block; }

/* Mobile nav */
.menu-btn { display: none; align-items: center; justify-content: center; width: 36px; height: 36px;
  border: none; background: transparent; color: var(--text); cursor: pointer; }
.menu-btn svg { width: 22px; height: 22px; }

/* ── Hero / Page Title ─────────────────────────────────────── */
.hero { padding-top: calc(var(--header-height) + var(--space-8)); padding-bottom: var(--space-4); }
.hero h1 { font-size: var(--text-3xl); font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
.hero-sub { font-size: var(--text-lg); color: var(--text-secondary); margin-top: var(--space-2); }
.hero-greeting { font-size: var(--text-sm); color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: var(--space-2); }
.hero-meta { font-size: var(--text-sm); color: var(--text-muted); margin-top: var(--space-3); }

/* ── Page Header (subpages) ───────────────────────────────── */
.page-header { padding-top: calc(var(--header-height) + var(--space-8)); padding-bottom: var(--space-4);
  background: var(--bg-soft); border-bottom: 1px solid var(--border-soft); }
.page-header h1 { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-2xl);
  font-weight: 700; letter-spacing: -0.02em; }
.page-header h1 svg { color: var(--accent); flex-shrink: 0; }
.page-header p { color: var(--text-secondary); margin-top: var(--space-2); }

/* ── Cards ─────────────────────────────────────────────────── */
.card { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
  overflow: hidden; transition: all var(--duration-base) var(--ease-out); }
.card:hover { border-color: var(--border); box-shadow: var(--shadow-md); }
.card-header, .card-head { display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border-soft); }
.card-header h2, .card-head h2 { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-lg); font-weight: 600; }
.card-header h2 svg, .card-head h2 svg { color: var(--accent); flex-shrink: 0; }
.card-link { font-size: var(--text-sm); font-weight: 500; color: var(--accent); white-space: nowrap; }
.card-body { padding: var(--space-5); }
.card-foot { display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-3) var(--space-5); border-top: 1px solid var(--border-soft);
  background: var(--bg-soft); font-size: var(--text-sm); font-weight: 500; color: var(--accent); }
.card-foot:hover { background: var(--accent-bg); }
.card-foot svg { width: 14px; height: 14px; }

.summary-card { background: linear-gradient(135deg, var(--accent-bg) 0%, var(--bg-card) 50%);
  border-color: var(--border-accent); margin-bottom: var(--space-6); }
.summary-card .card-body { padding: var(--space-6); }
.summary-card p { font-size: var(--text-lg); line-height: 1.7; }
.summary-card strong { color: var(--accent); }

.main-grid, .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6);
  padding-top: var(--space-4); padding-bottom: var(--space-8); }

/* ── Stats Row ─────────────────────────────────────────────── */
.stats { padding: var(--space-4) 0; }
.stats-inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-3); max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space-6); }
.stat { text-align: center; padding: var(--space-4); background: var(--bg-soft);
  border-radius: var(--radius-md); border: 1px solid var(--border-soft); }
.stat-value, .stat-val { display: block; font-size: var(--text-2xl); font-weight: 700; font-family: var(--font-mono);
  letter-spacing: -0.02em; line-height: 1.2; }
.stat-label { display: block; font-size: var(--text-xs); color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.06em; margin-top: 4px; }

/* ── Data List ─────────────────────────────────────────────── */
.data-list .item { display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) 0; border-bottom: 1px solid var(--border-soft);
  text-decoration: none; color: inherit; transition: background var(--duration-fast) var(--ease-out); }
.data-list .item:last-child { border-bottom: none; }
a.item:hover { background: var(--accent-bg); border-radius: var(--radius-sm);
  margin: 0 calc(-1 * var(--space-2)); padding-left: var(--space-2); padding-right: var(--space-2); }

.item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.item-title { font-weight: 500; font-size: var(--text-base); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.item-detail { font-size: var(--text-sm); color: var(--text-secondary); }
.item-time { flex-shrink: 0; font-size: var(--text-xs); color: var(--text-muted); font-family: var(--font-mono); }

/* ── Badges ────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 42px;
  padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-weight: 700; font-size: var(--text-sm); flex-shrink: 0; }
.mag-low { background: var(--green-bg); color: var(--green); }
.mag-mid { background: var(--yellow-bg); color: var(--yellow); }
.mag-high { background: var(--red-bg); color: var(--red); }
.badge-status { padding: 2px var(--space-2); border-radius: var(--radius-full);
  font-size: var(--text-xs); font-weight: 600; font-family: var(--font-sans); }
.status-go { background: var(--green-bg); color: var(--green); }
.status-tbd { background: var(--blue-bg); color: var(--blue); }
.status-hold { background: var(--yellow-bg); color: var(--yellow); }

/* ── Filters ───────────────────────────────────────────────── */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3);
  padding: var(--space-4) var(--space-5); background: var(--bg-soft);
  border-radius: var(--radius-lg); margin-bottom: var(--space-6); border: 1px solid var(--border-soft); }
.filter-group { display: flex; align-items: center; gap: var(--space-2); }
.filter-label { font-size: var(--text-sm); color: var(--text-secondary); font-weight: 500; }
.filter-btn { padding: var(--space-1) var(--space-3); border: 1px solid var(--border);
  border-radius: var(--radius-full); background: var(--bg-card); color: var(--text-secondary);
  font-size: var(--text-sm); font-family: var(--font-sans); cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out); }
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.on { background: var(--accent); border-color: var(--accent); color: var(--text-inverse); }
.filter-btns { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.results-count { font-size: var(--text-sm); color: var(--text-secondary); font-weight: 500; margin-bottom: var(--space-3); }

/* ── Launch highlight ──────────────────────────────────────── */
.launch-hero { margin-bottom: var(--space-6); }
.launch-hero .card-body h2 { font-size: var(--text-xl); font-weight: 700; margin-bottom: var(--space-4); }
.launch-img { height: 200px; display: flex; align-items: center; justify-content: center;
  background: var(--bg-muted); color: var(--text-muted); overflow: hidden; }
.launch-img img { width: 100%; height: 100%; object-fit: cover; }
.launch-meta { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-bottom: var(--space-4); }
.launch-meta dt { font-size: var(--text-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.launch-meta dd { font-size: var(--text-sm); font-weight: 500; }

/* ── Map placeholder ───────────────────────────────────────── */
.map-box { height: 300px; border-radius: var(--radius-md); background: var(--bg-muted);
  border: 1px solid var(--border-soft); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: var(--space-3); color: var(--text-muted);
  margin-bottom: var(--space-6); }
.map-box svg { width: 40px; height: 40px; opacity: 0.4; }

/* ── About Page ────────────────────────────────────────────── */
.about-content { padding-top: var(--space-8); padding-bottom: var(--space-12); }
.about-section { margin-bottom: var(--space-8); }
.about-section h2 { font-size: var(--text-xl); font-weight: 600; margin-bottom: var(--space-3);
  letter-spacing: -0.01em; }
.about-section p { color: var(--text-secondary); line-height: 1.8; margin-bottom: var(--space-3); }
.about-section p:last-child { margin-bottom: 0; }
.about-section a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.about-section a:hover { color: var(--accent-hover); }
.about-grid { display: grid; grid-template-columns: 200px 1fr; gap: var(--space-8); align-items: start; margin-bottom: var(--space-8); }
.about-photo { width: 200px; height: auto; object-fit: cover; border-radius: var(--radius-lg); border: 3px solid var(--border-soft); background: var(--bg-muted); }
.about-text h2 { font-size: var(--text-2xl); font-weight: 700; letter-spacing: -0.02em; margin-bottom: var(--space-4); }
.about-text p { color: var(--text-secondary); line-height: 1.8; margin-bottom: var(--space-4); }
.about-links { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }
.about-links a { padding: var(--space-2) var(--space-4); border: 1px solid var(--border);
  border-radius: var(--radius-full); font-size: var(--text-sm); font-weight: 500;
  color: var(--text-secondary); transition: all var(--duration-fast) var(--ease-out); }
.about-links a:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.note-box { padding: var(--space-6); background: var(--accent-bg); border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg); }
.note-box h3 { font-size: var(--text-lg); font-weight: 600; color: var(--accent); margin-bottom: var(--space-3); }
.note-box p { font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.7; margin-bottom: var(--space-3); }
.note-box p:last-child { margin-bottom: 0; }
.note-box strong { color: var(--accent); }

/* ── Footer ────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--border-soft); padding: var(--space-8) 0;
  color: var(--text-muted); font-size: var(--text-sm); }
.footer-inner { display: flex; align-items: center; justify-content: space-between;
  max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space-6); }
.footer-links { display: flex; gap: var(--space-4); }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--text); }

/* ── Empty / Loading States ────────────────────────────────── */
.empty { text-align: center; padding: var(--space-10); color: var(--text-muted); }
.empty svg { margin: 0 auto var(--space-4); opacity: 0.4; }
.loading { display: flex; align-items: center; justify-content: center; gap: var(--space-3);
  padding: var(--space-8); color: var(--text-muted); }
.spinner { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) { .main-grid, .two-col { grid-template-columns: 1fr; } }
@media (max-width: 680px) {
  .nav { display: none; }
  .nav.open { display: flex; flex-direction: column; position: fixed; top: var(--header-height);
    left: 0; right: 0; background: var(--bg-overlay); backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-soft); padding: var(--space-4) var(--space-6); z-index: 99; }
  .menu-btn { display: flex; }
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { max-width: 160px; }
  .filters { flex-direction: column; align-items: stretch; }
  .footer-inner { flex-direction: column; gap: var(--space-4); text-align: center; }
}

/* ── Utility ───────────────────────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.mono { font-family: var(--font-mono); }
