:root {
  --bg: #eef2f8;
  --panel: rgba(255, 255, 255, 0.92);
  --ink: #192435;
  --muted: #5f6d80;
  --blue: #3d5a80;
  --green: #4caf50;
  --orange: #ff9800;
  --rose: #ee6c4d;
  --teal: #2a9d8f;
  --line: rgba(61, 90, 128, 0.12);
  --shadow: 0 24px 60px rgba(61, 90, 128, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, rgba(152, 193, 217, 0.35) 0, transparent 28%),
    linear-gradient(180deg, #f8fbff 0, var(--bg) 100%);
  color: var(--ink);
}

a {
  color: inherit;
}

code {
  padding: 0.16rem 0.45rem;
  border-radius: 999px;
  background: rgba(61, 90, 128, 0.1);
  color: var(--blue);
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
  font-size: 0.92rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 251, 255, 0.88);
  backdrop-filter: blur(16px);
}

.topbar-inner,
main {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: clamp(1rem, 3vw, 1.5rem);
  padding-right: clamp(1rem, 3vw, 1.5rem);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
}

.brand {
  min-width: 0;
}

.brand strong,
.section-head h2,
.hero h1 {
  color: var(--blue);
}

.brand small,
.section-copy,
.hero p,
.placeholder p,
.empty-state p {
  color: var(--muted);
}

.brand strong {
  display: block;
  font-size: 0.98rem;
  letter-spacing: 0.02em;
}

.brand small {
  display: block;
  margin-top: 0.12rem;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.topnav a {
  padding: 0.48rem 0.82rem;
  border-radius: 999px;
  border: 1px solid rgba(61, 90, 128, 0.14);
  background: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.92rem;
  transition: 160ms ease;
}

.topnav a:hover {
  transform: translateY(-1px);
  border-color: rgba(61, 90, 128, 0.3);
  background: #ffffff;
}

main {
  padding-top: 1.1rem;
  padding-bottom: 3rem;
}

.hero,
.story-section {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero {
  padding: clamp(1.35rem, 3vw, 2rem);
}

.eyebrow {
  margin: 0 0 0.7rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: var(--blue);
}

.hero h1,
.section-head h2 {
  margin: 0;
  line-height: 1.04;
}

.hero h1 {
  font-size: clamp(2.1rem, 4vw, 3.4rem);
  max-width: 15ch;
}

.hero p {
  margin: 0.95rem 0 0;
  max-width: 54rem;
  line-height: 1.65;
}

.hero-stats,
.section-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.2rem;
}

.hero-stats span,
.section-meta span {
  padding: 0.46rem 0.78rem;
  border-radius: 999px;
  font-size: 0.92rem;
}

.hero-stats span {
  background: rgba(61, 90, 128, 0.1);
  color: var(--blue);
}

.story-section {
  --accent: var(--blue);
  margin-top: 1.2rem;
  padding: clamp(1.2rem, 2.5vw, 1.6rem);
  scroll-margin-top: 5.5rem;
}

.story-section::before {
  content: "";
  display: block;
  width: 72px;
  height: 4px;
  margin-bottom: 1rem;
  border-radius: 999px;
  background: var(--accent);
}

.theme-panorama { --accent: var(--blue); }
.theme-monetization { --accent: var(--orange); }
.theme-engagement { --accent: var(--rose); }
.theme-maintenance { --accent: var(--teal); }

.story-section .eyebrow {
  color: var(--accent);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.section-copy {
  margin-top: 0.8rem;
  max-width: 54rem;
  line-height: 1.65;
}

.section-meta span {
  background: color-mix(in srgb, var(--accent) 12%, white);
  color: var(--accent);
}

.plot-wrap {
  margin-top: 1rem;
}

.plot-wrap .js-plotly-plot,
.plot-wrap .plot-container {
  width: 100% !important;
}

.placeholder,
.empty-state {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 18px;
}

.placeholder {
  border: 1px dashed rgba(61, 90, 128, 0.2);
  background: rgba(255, 255, 255, 0.6);
}

.empty-state {
  border: 1px solid rgba(238, 108, 77, 0.2);
  background: linear-gradient(135deg, #fff3ef 0, #ffffff 100%);
}

.placeholder strong,
.empty-state strong {
  display: block;
}

.placeholder p,
.empty-state p {
  margin: 0.55rem 0 0;
  line-height: 1.55;
}

.footnote {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 820px) {
  .topbar-inner,
  .section-head {
    align-items: start;
    flex-direction: column;
  }

  .topnav {
    justify-content: start;
  }
}
