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

:root {
  --bg: #0a0a0a;
  --bg-card: linear-gradient(135deg, rgba(30, 24, 18, 0.8), rgba(22, 18, 14, 0.6));
  --bg-card-solid: #161210;
  --text: #ffffff;
  --text-muted: #a0a0a0;
  --accent: #e08a3a;
  --accent-10: rgba(224, 138, 58, 0.1);
  --accent-15: rgba(224, 138, 58, 0.15);
  --accent-08: rgba(224, 138, 58, 0.08);
  --accent-25: rgba(224, 138, 58, 0.25);
  --danger: #f85149;
  --danger-bg: rgba(248, 81, 73, 0.08);
  --success: #3fb950;
  --border: rgba(224, 138, 58, 0.08);
  --border-hover: rgba(224, 138, 58, 0.25);
  --card-shadow: none;
  --card-hover-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  --input-bg: rgba(255, 255, 255, 0.05);
  --nav-bg: transparent;
  --nav-blur: none;
  --nav-border: none;
  --nav-position: relative;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: -200px;
  left: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(224, 138, 58, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(224, 138, 58, 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ─── Nav ────────────────────────────────────────────────────────── */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 48px;
  position: var(--nav-position);
  background: var(--nav-bg);
  backdrop-filter: var(--nav-blur);
  -webkit-backdrop-filter: var(--nav-blur);
  border-bottom: var(--nav-border);
  z-index: 10;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-logo {
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
}

.nav-logo span { color: var(--accent); }

.nav-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-btn {
  background: none;
  border: 1px solid var(--accent-15);
  color: var(--text-muted);
  min-width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s;
  padding: 0 8px;
}

.nav-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.back-home {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 18px;
  transition: color 0.2s;
}

.back-home:hover { color: var(--accent); }

/* ─── Container ──────────────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 48px 60px;
  flex: 1;
  position: relative;
  z-index: 1;
  width: 100%;
}

/* ─── Hero ────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  margin-bottom: 48px;
}

.hero-badge {
  display: inline-block;
  padding: 6px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-10);
  border: 1px solid var(--accent-15);
  border-radius: 50px;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.hero h1 span {
  color: var(--accent);
}

.hero p {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
  font-weight: 300;
}

/* ─── Section Titles ─────────────────────────────────────────────── */
.section-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

/* ─── Live Price Strip ───────────────────────────────────────────── */
.price-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 40px;
}

.strip-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
}

.strip-card .label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.strip-card .value {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
}

/* ─── Scenario Pills ────────────────────────────────────────────── */
.scenario-pills {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.scenario-pill {
  padding: 10px 20px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.scenario-pill:hover {
  border-color: var(--accent-25);
  color: var(--text);
}

.scenario-pill.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-10);
}

.scenario-pill.custom-pill {
  border-style: dashed;
  font-style: italic;
}

/* ─── Discount Rate ─────────────────────────────────────────────── */
.discount-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 32px;
}

.discount-panel label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  display: block;
  margin-bottom: 10px;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--input-bg);
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg);
  box-shadow: 0 2px 8px rgba(224, 138, 58, 0.3);
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg);
  box-shadow: 0 2px 8px rgba(224, 138, 58, 0.3);
}

.slider-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
  min-width: 50px;
  text-align: right;
}

/* ─── Asset Cards (Accordion) ───────────────────────────────────── */
.asset-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 40px;
}

.asset-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.asset-card:hover {
  border-color: var(--border-hover);
}

.asset-card.open {
  border-color: var(--accent-25);
  border-left-color: var(--accent);
}

.asset-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
}

.asset-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.asset-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.asset-name {
  font-size: 15px;
  font-weight: 600;
}

.asset-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.asset-contribution {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.asset-chevron {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.asset-card.open .asset-chevron {
  transform: rotate(180deg);
}

.asset-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 20px;
}

.asset-card.open .asset-body {
  padding: 0 20px 20px;
}

.asset-field {
  margin-top: 16px;
}

.asset-field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  display: block;
  margin-bottom: 6px;
}

.asset-input {
  background: var(--input-bg);
  border: 1px solid var(--accent-15);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  font-weight: 500;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.asset-input:focus {
  border-color: var(--accent);
}

/* ─── Results Grid ───────────────────────────────────────────────── */
.results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 40px;
}

.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  transition: border-color 0.3s, transform 0.2s;
}

.result-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.result-card .label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.result-card .value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

.result-card.highlight {
  border-color: rgba(224, 138, 58, 0.3);
  background: linear-gradient(135deg, rgba(224, 138, 58, 0.08), rgba(224, 138, 58, 0.02));
}

.result-card.highlight .value {
  color: var(--accent);
  font-size: 32px;
}

/* ─── Charts ─────────────────────────────────────────────────────── */
.chart-section {
  margin-bottom: 40px;
}

.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  overflow: hidden;
}

.chart-container canvas {
  display: block;
  width: 100%;
}

.area-chart-wrap {
  height: 350px;
  position: relative;
}

/* ─── Implied Probability Table ──────────────────────────────────── */
.implied-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 40px;
}

.implied-table {
  width: 100%;
  border-collapse: collapse;
}

.implied-table th {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.implied-table td {
  font-size: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.implied-table tr:last-child td {
  border-bottom: none;
}

.implied-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}

/* ─── Methodology ────────────────────────────────────────────────── */
.methodology {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 40px;
}

.methodology h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--accent);
}

.methodology p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.methodology p:last-child {
  margin-bottom: 0;
}

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

.methodology code {
  background: var(--input-bg);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--accent);
}

/* ─── Footer ─────────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 28px;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

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

footer a:hover { color: var(--accent); }

/* ─── Light Mode (manual override) ───────────────────────────────── */
html[data-theme="light"] {
  --bg: #f6f9fb;
  --bg-card: #ffffff;
  --bg-card-solid: #ffffff;
  --text: #1a2b3c;
  --text-muted: #7a8a98;
  --border: rgba(224, 138, 58, 0.08);
  --card-shadow: 0 1px 3px rgba(0, 40, 60, 0.04);
  --card-hover-shadow: 0 12px 32px rgba(0, 40, 60, 0.08);
  --input-bg: rgba(0, 0, 0, 0.04);
  --nav-bg: rgba(246, 249, 251, 0.85);
  --nav-blur: blur(16px);
  --nav-border: 1px solid rgba(224, 138, 58, 0.08);
  --nav-position: sticky;
}

html[data-theme="light"] body::before,
html[data-theme="light"] body::after { display: none; }

html[data-theme="light"] nav { top: 0; }

html[data-theme="light"] .strip-card,
html[data-theme="light"] .result-card,
html[data-theme="light"] .asset-card,
html[data-theme="light"] .discount-panel,
html[data-theme="light"] .chart-container,
html[data-theme="light"] .implied-table-wrap,
html[data-theme="light"] .methodology {
  box-shadow: var(--card-shadow);
}

html[data-theme="light"] .result-card:hover {
  box-shadow: var(--card-hover-shadow);
}

/* ─── Dark Mode (manual override) ────────────────────────────────── */
html[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-card: linear-gradient(135deg, rgba(30, 24, 18, 0.8), rgba(22, 18, 14, 0.6));
  --bg-card-solid: #161210;
  --text: #ffffff;
  --text-muted: #a0a0a0;
  --border: rgba(224, 138, 58, 0.08);
  --card-shadow: none;
  --card-hover-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  --input-bg: rgba(255, 255, 255, 0.05);
  --nav-bg: transparent;
  --nav-blur: none;
  --nav-border: none;
  --nav-position: relative;
}

html[data-theme="dark"] body::before,
html[data-theme="dark"] body::after { display: block; }

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  nav { padding: 20px 24px; }
  .container { padding: 16px 24px 48px; }
  .hero h1 { font-size: 28px; }
  .hero p { font-size: 14px; }

  .price-strip { grid-template-columns: 1fr; }
  .results-grid { grid-template-columns: 1fr; }
  .scenario-pills { justify-content: center; }

  .result-card .value { font-size: 22px; }
  .result-card.highlight .value { font-size: 26px; }

  .area-chart-wrap { height: 280px; }

  .implied-table th,
  .implied-table td { padding: 12px 14px; font-size: 12px; }
}

@media (max-width: 480px) {
  nav { padding: 16px 20px; }
  .container { padding: 12px 16px 32px; }
  .hero h1 { font-size: 24px; }

  .scenario-pill { padding: 8px 14px; font-size: 13px; }
  .asset-header { padding: 14px 16px; }
  .asset-name { font-size: 14px; }
  .chart-container { padding: 16px; }
  .methodology { padding: 24px; }
}
