:root {
  --bg: #0b1021;
  --panel: #0f1629;
  --muted: #94a3b8;
  --accent: #7c3aed;
  --accent-glow: rgba(124, 58, 237, 0.35);
  --accent-2: #38bdf8;
  --card: rgba(17, 24, 39, 0.7);
  --border: rgba(255, 255, 255, 0.1);
  --frost: rgba(255, 255, 255, 0.03);
  --ink: #e2e8f0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: radial-gradient(circle at 15% 15%, rgba(124, 58, 237, 0.15), transparent 25%),
              radial-gradient(circle at 85% 15%, rgba(56, 189, 248, 0.12), transparent 25%),
              linear-gradient(180deg, #0c1326 0%, #0b1021 100%);
  color: #e5e7eb;
  min-height: 100vh;
}

.page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* --- Hero --- */
.hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 40px;
}

.hero h1 {
  font-size: 3rem;
  margin: 12px 0;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--muted);
  max-width: 800px;
  margin: 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 99px;
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.2);
  color: #d8b4fe;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  width: fit-content;
}

/* --- Controls --- */
.controls-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  user-select: none;
}

.toggle-pill:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}

.toggle-pill input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

/* --- Layouts --- */
.story-section, .macro-section {
  margin-bottom: 60px;
}

.section-header {
  margin-bottom: 24px;
}

.section-header h2 {
  font-size: 1.8rem;
  margin: 0 0 8px 0;
  font-weight: 700;
}

.story-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
  align-items: stretch;
}

.macro-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1024px) {
  .story-grid, .macro-layout {
    grid-template-columns: 1fr;
  }
}

/* --- Cards --- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* --- Story Components --- */
.story-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
}

.story-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.story-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.story-btn:hover {
  border-color: #fff;
  color: #fff;
}

.story-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 15px var(--accent-glow);
}

.info-box {
  background: linear-gradient(145deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  flex-grow: 1;
}

.info-headline {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
}

.info-body {
  color: #cbd5e1;
  line-height: 1.7;
  margin-bottom: 20px;
  font-size: 1rem;
}

.info-box ul {
  margin: 0;
  padding-left: 20px;
  color: #cbd5e1;
}

.info-box li {
  margin-bottom: 8px;
  line-height: 1.6;
}

/* --- Macro Controls --- */
.macro-controls h3 {
  margin-top: 0;
  font-size: 1.1rem;
  color: #fff;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Inputs */
select, input[type="number"] {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  color: #fff;
  padding: 10px;
  border-radius: 8px;
  width: 100%;
  cursor: pointer;
}

select:focus, input:focus {
  outline: none;
  border-color: var(--accent);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  background: transparent;
}

/* --- Charts --- */
.chart-container {
  position: relative;
  width: 100%;
  height: 400px;
}

.chart-subtitle {
  font-size: 0.95rem;
  color: var(--muted);
  margin-top: 16px;
  text-align: center;
  font-style: italic;
  line-height: 1.5;
}

.badges {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}