:root {
  --bg: #080b1a;
  --bg-2: #101631;
  --text: #f7f3ff;
  --muted: #bfc7e6;
  --soft: rgba(255, 255, 255, 0.08);
  --soft-2: rgba(255, 255, 255, 0.14);
  --border: rgba(255, 255, 255, 0.16);
  --accent: #91e7ff;
  --accent-2: #d7a1ff;
  --negative: #ff6b8a;
  --neutral: #8ea0ff;
  --positive: #55e7b5;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

body.light {
  --bg: #f7f8ff;
  --bg-2: #edf1ff;
  --text: #121831;
  --muted: #4f5874;
  --soft: rgba(255, 255, 255, 0.72);
  --soft-2: rgba(255, 255, 255, 0.9);
  --border: rgba(32, 41, 88, 0.12);
  --shadow: 0 24px 60px rgba(68, 88, 160, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% 10%, rgba(145, 231, 255, 0.18), transparent 28rem),
    radial-gradient(circle at 80% 5%, rgba(215, 161, 255, 0.20), transparent 30rem),
    linear-gradient(135deg, var(--bg), var(--bg-2));
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
}

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

.cosmic-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}

.orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(6px);
  opacity: 0.42;
  animation: float 12s ease-in-out infinite;
}

.orb-one {
  width: 19rem;
  height: 19rem;
  left: -4rem;
  top: 16rem;
  background: radial-gradient(circle, rgba(85, 231, 181, 0.7), transparent 65%);
}

.orb-two {
  width: 24rem;
  height: 24rem;
  right: -7rem;
  top: 4rem;
  background: radial-gradient(circle, rgba(215, 161, 255, 0.72), transparent 66%);
  animation-delay: -3s;
}

.orb-three {
  width: 18rem;
  height: 18rem;
  right: 18%;
  bottom: -6rem;
  background: radial-gradient(circle, rgba(255, 107, 138, 0.55), transparent 68%);
  animation-delay: -7s;
}

.star {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 22px var(--accent);
  animation: twinkle 3s infinite alternate;
}

.s1 { top: 18%; left: 26%; }
.s2 { top: 24%; right: 30%; animation-delay: .6s; }
.s3 { top: 58%; left: 12%; animation-delay: 1s; }
.s4 { bottom: 20%; right: 18%; animation-delay: 1.5s; }
.s5 { top: 78%; left: 55%; animation-delay: 2s; }

@keyframes float {
  0%, 100% { transform: translateY(0) translateX(0) scale(1); }
  50% { transform: translateY(-24px) translateX(18px) scale(1.05); }
}

@keyframes twinkle {
  from { transform: scale(.7); opacity: .45; }
  to { transform: scale(1.4); opacity: 1; }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  padding: 1rem clamp(1rem, 4vw, 4.5rem);
  backdrop-filter: blur(18px);
  background: rgba(8, 11, 26, 0.58);
  border-bottom: 1px solid var(--border);
}

body.light .site-header {
  background: rgba(247, 248, 255, 0.72);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  letter-spacing: -.02em;
}

.brand-mark {
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border-radius: .9rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0c1022;
  box-shadow: 0 10px 24px rgba(145, 231, 255, .22);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--muted);
  font-size: .92rem;
}

.nav a {
  transition: color .2s ease, transform .2s ease;
}

.nav a:hover {
  color: var(--text);
  transform: translateY(-1px);
}

.theme-toggle,
.mini-btn,
.btn {
  border: 1px solid var(--border);
  background: var(--soft);
  color: var(--text);
  border-radius: 999px;
  padding: .75rem 1rem;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.theme-toggle:hover,
.mini-btn:hover,
.btn:hover {
  transform: translateY(-2px);
  border-color: rgba(145, 231, 255, .65);
  background: var(--soft-2);
}

.section {
  padding: clamp(4rem, 7vw, 7rem) clamp(1rem, 4vw, 4.5rem);
  max-width: 1440px;
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, .88fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
  min-height: calc(100vh - 80px);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 800;
  margin: 0 0 .8rem;
}

h1,
h2,
h3 {
  font-family: "Space Grotesk", sans-serif;
  line-height: 1.08;
  margin: 0;
}

h1 {
  font-size: clamp(4rem, 10vw, 9.5rem);
  letter-spacing: -.09em;
  max-width: 950px;
}

h2 {
  font-size: clamp(2rem, 4vw, 4rem);
  letter-spacing: -.055em;
}

h3 {
  font-size: 1.2rem;
  letter-spacing: -.025em;
}

.subtitle {
  color: var(--muted);
  max-width: 780px;
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  margin: 1.2rem 0 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #080b1a;
  border: none;
}

.btn.secondary {
  color: var(--text);
}

.hero-panel,
.glass-card,
.chart-card,
.table-card,
.control-panel,
.finding-card,
.stat-card {
  background:
    linear-gradient(145deg, rgba(255,255,255,.13), rgba(255,255,255,.045));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-panel {
  border-radius: 2rem;
  padding: 1.2rem;
}

.mission-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  padding: 1.1rem;
  border-radius: 1.45rem;
  background: var(--soft);
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}

.mission-icon {
  width: 3.4rem;
  height: 3.4rem;
  display: grid;
  place-items: center;
  border-radius: 1.1rem;
  background: rgba(145,231,255,.14);
  font-size: 1.6rem;
}

.mission-card p,
.glass-card p,
.finding-card p,
.timeline p,
.footer p,
.tiny-note {
  color: var(--muted);
  margin-bottom: 0;
}

.metric-ribbon {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
  margin-top: 1.1rem;
}

.metric-ribbon div {
  padding: 1rem .8rem;
  border-radius: 1.2rem;
  background: rgba(145,231,255,.10);
  border: 1px solid var(--border);
  text-align: center;
}

.metric-ribbon strong {
  display: block;
  font-size: 1.35rem;
  font-family: "Space Grotesk", sans-serif;
}

.metric-ribbon span {
  display: block;
  color: var(--muted);
  font-size: .78rem;
}

.tiny-note {
  font-size: .78rem;
  margin: 1rem .25rem 0;
}

.overview-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr .8fr;
  gap: 1.2rem;
}

.glass-card,
.finding-card,
.table-card,
.chart-card,
.control-panel {
  border-radius: 1.75rem;
  padding: 1.4rem;
}

.glass-card.wide {
  grid-column: span 1;
}

.glass-card h2 {
  font-size: clamp(1.7rem, 3vw, 3rem);
  margin-bottom: 1rem;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.stat-card {
  padding: 1.2rem;
  border-radius: 1.45rem;
}

.stat-card span,
.stat-card em {
  display: block;
  color: var(--muted);
  font-style: normal;
  font-size: .85rem;
}

.stat-card strong {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1;
  margin: .7rem 0 .35rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  color: transparent;
}

.section-heading {
  max-width: 820px;
  margin-bottom: 2rem;
}

.section-heading p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.02rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 1.2rem;
  align-items: stretch;
}

.control-panel label {
  display: block;
  color: var(--muted);
  font-weight: 700;
  margin: 0 0 .5rem;
}

select,
input[type="search"] {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(8, 11, 26, .38);
  color: var(--text);
  border-radius: 1rem;
  padding: .9rem 1rem;
  margin-bottom: 1.1rem;
  outline: none;
}

body.light select,
body.light input[type="search"] {
  background: rgba(255,255,255,.85);
}

.selected-summary {
  display: grid;
  gap: .75rem;
  margin-top: 1rem;
}

.summary-chip {
  border-radius: 1rem;
  background: var(--soft);
  padding: .95rem;
  border: 1px solid var(--border);
}

.summary-chip span {
  display: block;
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.summary-chip strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.55rem;
}

.chart-toolbar,
.table-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .75rem;
}

.plot {
  min-height: 430px;
}

.plot.tall {
  min-height: 500px;
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  gap: 1.2rem;
}

.table-card {
  margin-top: 1.2rem;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  text-align: left;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--accent);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .12em;
}

td {
  color: var(--muted);
}

.sentiment-pill {
  display: inline-flex;
  padding: .36rem .7rem;
  border-radius: 999px;
  color: #07101f;
  font-weight: 900;
  font-size: .78rem;
}

.sentiment-negative { background: var(--negative); }
.sentiment-neutral { background: var(--neutral); }
.sentiment-positive { background: var(--positive); }

.findings-grid,
.limitations-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
}

.finding-card {
  position: relative;
  overflow: hidden;
}

.finding-card::after {
  content: "";
  position: absolute;
  inset: auto -20% -40% 20%;
  height: 8rem;
  background: radial-gradient(circle, rgba(145,231,255,.16), transparent 70%);
}

.badge {
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border-radius: .9rem;
  background: rgba(145,231,255,.14);
  color: var(--accent);
  font-weight: 900;
  margin-bottom: 1rem;
}

.methodology {
  max-width: 1080px;
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 1.3rem;
  top: 1rem;
  bottom: 1rem;
  width: 1px;
  background: linear-gradient(var(--accent), transparent);
}

.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.timeline li > span {
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #07101f;
  font-weight: 900;
  z-index: 1;
}

.timeline li > div {
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: 1.3rem;
  padding: 1rem 1.2rem;
}

.limitations-grid {
  grid-template-columns: repeat(2, 1fr);
}

.footer {
  padding: 2rem clamp(1rem, 4vw, 4.5rem) 3rem;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s ease, transform .7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1100px) {
  .hero,
  .overview-grid,
  .dashboard-grid,
  .comparison-grid {
    grid-template-columns: 1fr;
  }

  .stats-strip,
  .findings-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav {
    display: none;
  }
}

@media (max-width: 680px) {
  .site-header {
    padding: .85rem 1rem;
  }

  .brand span:last-child {
    display: none;
  }

  .section {
    padding: 3.5rem 1rem;
  }

  .hero {
    min-height: auto;
    padding-top: 4rem;
  }

  .metric-ribbon,
  .stats-strip,
  .findings-grid,
  .limitations-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 3.8rem;
  }

  .chart-toolbar,
  .table-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .plot,
  .plot.tall {
    min-height: 360px;
  }
}
