:root {
  color-scheme: dark;
  --bg: #071321;
  --bg-2: #0b1f35;
  --panel: #0f2944;
  --panel-2: #10385f;
  --ink: #f8fafc;
  --muted: #d7e4f7;
  --soft: #92a8c2;
  --line: #37577b;
  --line-strong: #42658d;
  --ocean: #48a8ff;
  --cyan: #2fd2c6;
  --gold: #f4c95d;
  --ember: #f1774d;
  --pine: #12b981;
  --plum: #b58cff;
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 12px 28px rgba(0, 0, 0, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 12%, rgba(91, 192, 235, 0.16), transparent 26rem),
    radial-gradient(circle at 84% 10%, rgba(244, 201, 93, 0.12), transparent 24rem),
    linear-gradient(135deg, #08111f 0%, #10213a 48%, #07101d 100%);
  color: var(--ink);
  font-family: "IBM Plex Sans", "Avenir Next", "Segoe UI", Inter, ui-sans-serif, system-ui, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(66, 101, 141, 0.72);
  background: rgba(7, 19, 33, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(72, 168, 255, 0.58);
  border-radius: 3px;
  background: linear-gradient(135deg, #1477c8, #0f2944);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  letter-spacing: 0;
}

.brand small,
.nav-links a,
.section-label,
.soft-tag {
  color: var(--soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 8px 10px;
  text-transform: uppercase;
}

.nav-links a:hover {
  border-color: var(--line-strong);
  background: #10385f;
  color: var(--ink);
}

main {
  width: min(1360px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(520px, 1.1fr);
  gap: 18px;
  align-items: center;
  min-height: 248px;
  padding: 28px 0 18px;
}

.hero h1 {
  max-width: 700px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(34px, 4vw, 58px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: 0;
}

.hero p {
  max-width: 620px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.button.primary {
  border-color: #4aa8ff;
  background: #1477c8;
  color: #fff;
  box-shadow: 0 14px 34px rgba(20, 119, 200, 0.25);
}

.button.secondary {
  background: #10385f;
  color: var(--muted);
}

.hero-panel,
.panel,
.control-rail {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg-2);
  box-shadow: var(--shadow-soft);
}

.hero-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  background: #0b1f35;
}

.stat {
  min-height: 108px;
  padding: 16px;
  border-top: 4px solid var(--ocean);
  border-right: 1px solid var(--line);
  background: #0b1f35;
}

.stat:nth-child(2) {
  border-top-color: var(--cyan);
}

.stat:nth-child(3) {
  border-top-color: var(--pine);
}

.stat:nth-child(4) {
  border-top-color: var(--gold);
  border-right: 0;
}

.stat span,
.metric-row span {
  display: block;
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 11px;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.12;
}

.dashboard-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 0;
  margin: 0 0 20px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background:
    radial-gradient(circle at 22% 44%, rgba(23, 146, 161, 0.35), transparent 28rem),
    linear-gradient(135deg, #05345a 0%, #07556a 48%, #08203b 100%);
  box-shadow: var(--shadow);
}

.control-rail {
  align-self: stretch;
  padding: 16px;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(7, 19, 33, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.control-rail h2,
.rail-insight h2,
.panel h2,
.methodology h2 {
  margin: 4px 0 0;
  font-size: 20px;
  line-height: 1.18;
}

.control-rail p,
.rail-insight p,
.panel p,
.methodology p {
  color: var(--muted);
  line-height: 1.5;
}

.control-rail p {
  margin: 8px 0 18px;
  font-size: 13px;
}

.control-group {
  margin-top: 14px;
}

.control-label {
  display: block;
  margin-bottom: 7px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.segmented,
.model-buttons,
.scenario-buttons {
  display: grid;
  gap: 6px;
}

.segmented {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #081a2d;
  padding: 4px;
}

.segmented button,
.model-buttons button,
.scenario-buttons button {
  width: 100%;
  min-height: 34px;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #10385f;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  padding: 0 12px;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.segmented button {
  min-height: 30px;
  border-color: transparent;
  background: transparent;
}

.model-buttons button,
.scenario-buttons button {
  text-align: left;
}

.segmented button.active,
.model-buttons button.active,
.scenario-buttons button.active {
  border-color: #4aa8ff;
  background: #1477c8;
  color: #fff;
}

.model-buttons button:hover,
.scenario-buttons button:hover,
.segmented button:hover {
  border-color: #7bbdff;
  color: #fff;
}

.rail-insight {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--gold);
  border-radius: 3px;
  background: #0b1f35;
  padding: 14px;
}

.rail-insight .section-label {
  color: var(--gold);
  font-size: 10px;
  text-transform: uppercase;
}

.rail-insight h2 {
  font-size: 18px;
}

.rail-insight p {
  margin: 12px 0 0;
  font-size: 13px;
}

.rail-insight ul {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.rail-insight li {
  margin: 8px 0;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(260px, 0.82fr);
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(55, 87, 123, 0.72);
  border-left: 0;
  border-radius: 0 3px 3px 0;
  background: rgba(7, 19, 33, 0.82);
}

.panel {
  min-width: 0;
  padding: 15px;
}

.summary-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
  gap: 14px;
  align-items: center;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.metric-row div {
  min-width: 0;
  border: 1px solid var(--line);
  border-top: 4px solid var(--ocean);
  border-radius: 3px;
  background: #071321;
  padding: 12px;
}

.metric-row div:nth-child(2) {
  border-top-color: var(--gold);
}

.metric-row div:nth-child(3) {
  border-top-color: var(--pine);
}

.metric-row strong {
  display: block;
  margin-top: 4px;
  font-size: 28px;
}

.metric-row small {
  display: block;
  margin-top: 6px;
  color: var(--soft);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.kpi-strip {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.kpi-card {
  min-height: 90px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--ocean);
  border-radius: 3px;
  padding: 13px 14px;
  background: #0b1f35;
}

.kpi-card.green {
  border-top-color: var(--pine);
}

.kpi-card.blue {
  border-top-color: var(--ocean);
}

.kpi-card.amber {
  border-top-color: var(--gold);
}

.kpi-card.slate {
  border-top-color: var(--plum);
}

.kpi-card span,
.kpi-card small {
  display: block;
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
}

.kpi-card span {
  color: var(--gold);
  font-size: 10px;
  text-transform: uppercase;
}

.kpi-card strong {
  display: block;
  margin: 8px 0 4px;
  color: #fff;
  font-size: 25px;
  line-height: 1;
}

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.soft-tag {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #071321;
  color: var(--gold);
  padding: 6px 10px;
}

.chart {
  min-height: 236px;
  margin-top: 10px;
}

.horizon-panel {
  grid-column: span 2;
}

.horizon-panel .chart {
  min-height: 330px;
}

.bar-row {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr) 54px;
  gap: 9px;
  align-items: center;
  width: 100%;
  margin: 7px 0;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 8px;
  background: rgba(7, 19, 33, 0.58);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.bar-label,
.bar-value {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.bar-label {
  color: var(--ink);
}

.bar-track {
  overflow: hidden;
  height: 21px;
  border-radius: 2px;
  background: #173454;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 220ms ease, background 160ms ease;
}

.bar-row:hover,
.bar-row.selected {
  border-color: var(--line-strong);
  background: #10385f;
}

.bar-row.selected {
  border-color: rgba(72, 168, 255, 0.72);
}

.line-svg {
  width: 100%;
  height: 310px;
  overflow: visible;
}

.axis-text {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.chart-note {
  margin: 10px 0 0;
  color: var(--soft);
  font-size: 12px;
  font-weight: 700;
}

.line-point,
.legend-item {
  cursor: pointer;
}

.line-series.dimmed {
  opacity: 0.22;
}

.chart-tooltip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #071321;
  padding: 8px 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  box-shadow: var(--shadow-soft);
}

.methodology {
  padding: 38px 0 70px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.steps div {
  min-height: 150px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--gold);
  border-radius: 3px;
  background: var(--bg-2);
  padding: 20px;
}

.steps div:nth-child(2) {
  border-top-color: var(--cyan);
}

.steps div:nth-child(3) {
  border-top-color: var(--ocean);
}

.steps div:nth-child(4) {
  border-top-color: var(--pine);
}

.steps strong {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: #071321;
  color: var(--gold);
}

.steps span {
  display: block;
  margin-top: 18px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}

@media (max-width: 1040px) {
  .hero,
  .dashboard-shell,
  .summary-panel,
  .steps {
    grid-template-columns: 1fr;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    border-left: 1px solid rgba(55, 87, 123, 0.72);
    border-radius: 0 0 3px 3px;
  }

  .horizon-panel {
    grid-column: auto;
  }

  .hero-panel,
  .kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  main {
    width: min(100% - 24px, 1200px);
  }

  .topbar,
  .nav-links {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero {
    min-height: auto;
    padding-top: 34px;
  }

  .hero h1 {
    font-size: 36px;
  }

  .hero-panel,
  .metric-row,
  .kpi-strip {
    grid-template-columns: 1fr;
  }

  .stat {
    border-right: 0;
  }

  .bar-row {
    grid-template-columns: 1fr;
  }
}
