/*
 * This is a manifest file that'll be compiled into application.css.
 */

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

/* ── Animations ─────────────────────────────────────────────── */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.char {
  display: inline-block;
  opacity: 0;
  animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--i) * 0.06s);
}

.anim {
  opacity: 0;
  animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--step) * 0.12s);
}

/* ── Layout ─────────────────────────────────────────────────── */

.onboarding-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5rem 2rem 4rem;
  gap: 3.5rem;
  background: #0a0a0a;
  font-family: system-ui, -apple-system, sans-serif;
}

/* ── Header ─────────────────────────────────────────────────── */

.onboarding-header {
  text-align: center;
}

.onboarding-title {
  margin: 0 0 0.6rem;
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #f8fafc;
}

.onboarding-sub {
  margin: 0;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: #64748b;
  font-weight: 400;
}

/* ── Steps ──────────────────────────────────────────────────── */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
  max-width: 600px;
}

.step {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.step-number {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #1e293b;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-top: 0.15rem;
}

.step-body {
  flex: 1;
  min-width: 0;
}

.step-title {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #f1f5f9;
  letter-spacing: -0.01em;
}

.step-desc {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: #64748b;
  line-height: 1.6;
}

.step-code {
  margin: 0;
  padding: 0.6rem 0.9rem;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 6px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.85rem;
  color: #7dd3fc;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ── Statistics Explorer ─────────────────────────────────────── */

:root {
  --bg: #0a0a0a;
  --surface: #111827;
  --surface2: #1e293b;
  --border: #1e293b;
  --text: #f1f5f9;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --radius: 10px;
  --font: system-ui, -apple-system, sans-serif;
}

/* Home page */
.stats-home {
  min-height: 100vh;
  background: var(--bg);
  font-family: var(--font);
  padding: 4rem 2rem 6rem;
}

.stats-hero {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 3.5rem;
}

.stats-hero-title {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.stats-hero-sub {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.dist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
}

.dist-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.2s, transform 0.15s;
}

.dist-card:hover {
  border-color: #334155;
  transform: translateY(-2px);
}

.dist-card-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 0.8rem;
  font-weight: 600;
  width: fit-content;
  margin-bottom: 0.25rem;
}

.dist-card-name {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.dist-card-tagline {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.dist-card-cta {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
}

/* Distribution show page */
.dist-page {
  min-height: 100vh;
  background: var(--bg);
  font-family: var(--font);
  color: var(--text);
}

.dist-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-wrap: wrap;
}

.dist-nav-back {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.875rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.dist-nav-back:hover { color: var(--text); }

.dist-nav-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.dist-nav-pill {
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  transition: border-color 0.15s, color 0.15s;
}

.dist-nav-pill:hover { color: var(--text); border-color: #334155; }
.dist-nav-pill.active { font-weight: 600; }

.dist-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: calc(100vh - 57px);
}

.dist-sidebar {
  border-right: 1px solid var(--border);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  overflow-y: auto;
}

.dist-header { display: flex; flex-direction: column; gap: 0.4rem; }

.dist-symbol {
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 0.85rem;
  font-weight: 600;
}

.dist-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.dist-tagline {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.dist-section { display: flex; flex-direction: column; gap: 0.75rem; }

.dist-section-title {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.param-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.param-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.param-label { font-size: 0.875rem; color: var(--text-dim); }

.param-value {
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 0.875rem;
  color: var(--text);
  font-weight: 600;
}

.param-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--surface2);
  outline: none;
  cursor: pointer;
}

.param-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #f1f5f9;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.param-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #f1f5f9;
  border: none;
  cursor: pointer;
}

.param-desc { margin: 0; font-size: 0.8rem; color: #475569; line-height: 1.4; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.stat-box {
  background: var(--surface2);
  border-radius: 8px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.stat-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-size: 1.1rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-formula { font-size: 0.7rem; font-family: ui-monospace, "SF Mono", monospace; color: #475569; }

.formula-box {
  background: var(--surface2);
  border-radius: 8px;
  padding: 0.875rem 1rem;
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 0.825rem;
  color: #7dd3fc;
  line-height: 1.5;
  word-break: break-all;
}

/* Main content area */
.dist-main {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.dist-canvas { width: 100% !important; max-height: 380px; }

.dist-description {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dist-description p {
  margin: 0;
  font-size: 0.975rem;
  color: var(--text-muted);
  line-height: 1.75;
}

.dist-key-fact {
  background: var(--surface2);
  border-radius: 8px;
  padding: 0.875rem 1rem;
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.6;
}

.key-fact-label {
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 0.25rem;
}

.dist-examples { display: flex; flex-direction: column; gap: 0.75rem; }

.example-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.example-tag {
  background: var(--surface2);
  border-radius: 20px;
  padding: 0.3rem 0.75rem;
  font-size: 0.82rem;
  color: var(--text-dim);
}

/* Responsive */
@media (max-width: 900px) {
  .dist-layout {
    grid-template-columns: 1fr;
  }

  .dist-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

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

/* ── Footer ─────────────────────────────────────────────────── */

.onboarding-footer {
  max-width: 600px;
  text-align: center;
  border-top: 1px solid #1e293b;
  padding-top: 2rem;
  width: 100%;
}

.onboarding-footer p {
  margin: 0;
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.6;
}

.footer-link {
  color: #94a3b8;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-color: rgba(148, 163, 184, 0.35);
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.footer-link:hover {
  color: #f1f5f9;
  text-decoration-color: rgba(241, 245, 249, 0.5);
}
