:root {
  --bg: #09111d;
  --bg-deep: #02060b;
  --panel: rgba(248, 244, 236, 0.1);
  --panel-line: rgba(255, 255, 255, 0.08);
  --ink: #17212d;
  --text: #eff6ff;
  --muted: rgba(239, 246, 255, 0.72);
  --accent: #ff9a3c;
  --accent-strong: #e05c1f;
  --accent-cool: #4cc9f0;
  --shadow: rgba(0, 0, 0, 0.32);
  --series-one: #f59e0b;
  --series-two: #14b8a6;
  --series-three: #818cf8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(255, 154, 60, 0.28), transparent 28%),
    radial-gradient(circle at left center, rgba(76, 201, 240, 0.18), transparent 30%),
    linear-gradient(145deg, var(--bg), var(--bg-deep));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 28px 28px;
}

.app-shell {
  width: min(1320px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
  display: grid;
  gap: 1.4rem;
}

.panel,
.hero,
.summary-card {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  box-shadow: 0 24px 44px var(--shadow);
  backdrop-filter: blur(14px);
}

.hero {
  border-radius: 30px;
  padding: 1.8rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  animation: rise-in 420ms ease-out both;
}

.eyebrow,
.label,
.field span,
.legend__value small {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.72rem;
  color: #8be3ff;
}

.hero h1,
.panel h2 {
  margin: 0.35rem 0 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  line-height: 0.94;
  color: #fff8f2;
}

.hero h1 {
  font-size: clamp(2.4rem, 4vw, 4.8rem);
}

.hero__lede,
.insight,
.timeline-row,
.field input,
.field span,
.assumption-card,
.pill {
  color: var(--text);
}

.hero__lede {
  max-width: 58ch;
  margin-top: 1rem;
  color: var(--muted);
  line-height: 1.58;
}

.hero__actions {
  display: flex;
  justify-content: flex-end;
}

.lang-toggle,
.mode-toggle__button {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 0.78rem 1rem;
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.lang-toggle:hover,
.mode-toggle__button:hover {
  transform: translateY(-1px);
}

.controls-panel,
.chart-panel,
.insights-panel {
  border-radius: 28px;
  padding: 1.35rem;
  animation: rise-in 520ms ease-out both;
}

.panel__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.mode-toggle {
  display: inline-flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.mode-toggle__button.is-active {
  background: linear-gradient(180deg, rgba(255, 154, 60, 0.92), rgba(224, 92, 31, 0.92));
  color: #fff9f3;
}

.controls-grid {
  margin-top: 1.1rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.field,
.assumption-card {
  display: grid;
  gap: 0.45rem;
  padding: 0.95rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.field input {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 0.86rem 0.95rem;
  background: rgba(255, 255, 255, 0.07);
  font: inherit;
  font-weight: 700;
}

.assumption-card strong {
  font-size: 1.2rem;
}

.assumption-card b {
  font-size: 2rem;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.summary-card {
  position: relative;
  border-radius: 26px;
  padding: 1.2rem;
  overflow: hidden;
  transform: translateY(0);
  transition: transform 220ms ease, border-color 220ms ease;
}

.summary-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background: radial-gradient(circle at top right, currentColor, transparent 45%);
}

.summary-card:hover {
  transform: translateY(-4px);
}

.summary-card__kicker {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.78);
}

.summary-card__value {
  position: relative;
  z-index: 1;
  margin-top: 0.6rem;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(2rem, 3vw, 3rem);
}

.summary-card__meta {
  position: relative;
  z-index: 1;
  margin-top: 0.35rem;
  color: rgba(255, 255, 255, 0.8);
}

.summary-card--fixed48 {
  color: var(--series-one);
}

.summary-card--hybrid60 {
  color: var(--series-two);
}

.summary-card--indexed39 {
  color: var(--series-three);
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  gap: 1rem;
}

.chart-panel__meta {
  display: flex;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.88rem;
  font-weight: 700;
}

.chart-shell {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
    linear-gradient(145deg, rgba(14, 23, 38, 0.84), rgba(23, 37, 56, 0.74));
}

.chart {
  width: 100%;
  height: auto;
  display: block;
}

.chart-grid line,
.chart-axes line {
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 1;
}

.chart-label {
  fill: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 700;
}

.chart-series__path {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.18));
}

.chart-series__area {
  opacity: 0.14;
}

.legend {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.legend__item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
}

.legend__swatch {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  flex: none;
}

.legend__value {
  display: grid;
  gap: 0.15rem;
}

.legend__value strong {
  font-size: 1rem;
}

.insights-list {
  margin-top: 1rem;
  display: grid;
  gap: 0.8rem;
}

.insight,
.timeline-row {
  padding: 0.9rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
}

.timeline-table {
  margin-top: 1rem;
  display: grid;
  gap: 0.55rem;
}

.timeline-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
  align-items: center;
}

.timeline-row strong {
  display: block;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .controls-grid,
  .summary-grid,
  .legend,
  .timeline-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .layout-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 1rem, 760px);
    padding-top: 1rem;
  }

  .hero,
  .controls-panel,
  .chart-panel,
  .insights-panel,
  .summary-card {
    border-radius: 22px;
  }

  .hero,
  .panel__header {
    flex-direction: column;
  }

  .controls-grid,
  .summary-grid,
  .legend,
  .timeline-row {
    grid-template-columns: 1fr;
  }

  .mode-toggle {
    width: 100%;
  }

  .mode-toggle__button,
  .lang-toggle {
    width: 100%;
  }
}
