:root {
  --bg: #07111f;
  --bg-soft: rgba(10, 20, 38, 0.72);
  --panel: rgba(8, 17, 33, 0.7);
  --panel-strong: rgba(10, 18, 34, 0.88);
  --text: #f4f0e8;
  --muted: #afbdd2;
  --line: rgba(198, 218, 255, 0.12);
  --accent: #ff8e3c;
  --accent-2: #ffd166;
  --accent-3: #5ce1e6;
  --shadow: 0 32px 80px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Bricolage Grotesque", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(255, 163, 92, 0.14), transparent 25%),
    linear-gradient(180deg, #08111f 0%, #091420 38%, #0a0d18 100%);
  overflow-x: hidden;
}

button {
  font: inherit;
}

.starfield,
.aurora {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.starfield {
  z-index: 0;
}

.aurora {
  filter: blur(22px);
  opacity: 0.62;
  z-index: 0;
  mix-blend-mode: screen;
}

.aurora-one {
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 153, 85, 0.28), transparent 30%),
    radial-gradient(circle at 68% 18%, rgba(92, 225, 230, 0.16), transparent 30%);
  animation: drift 16s ease-in-out infinite alternate;
}

.aurora-two {
  background:
    radial-gradient(circle at 78% 68%, rgba(255, 209, 102, 0.16), transparent 22%),
    radial-gradient(circle at 34% 74%, rgba(82, 125, 255, 0.16), transparent 26%);
  animation: drift 20s ease-in-out infinite alternate-reverse;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 80px;
}

.panel {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(12, 20, 36, 0.82), rgba(10, 16, 28, 0.74));
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.06), transparent 35%);
  opacity: 0.5;
  pointer-events: none;
}

.hero {
  padding: 28px;
  min-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow,
.kicker,
.signal-card-top,
.theme-chip,
.metric-card span,
.footer-copy code {
  font-family: "IBM Plex Mono", monospace;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 26px;
}

.eyebrow-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  box-shadow: 0 0 18px rgba(255, 170, 110, 0.95);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.8fr);
  gap: 24px;
  align-items: center;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(4rem, 12vw, 8.4rem);
  line-height: 0.92;
  letter-spacing: -0.06em;
  max-width: 7ch;
}

.kicker {
  margin: 0 0 10px;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.82rem;
}

.lede {
  max-width: 38rem;
  margin: 22px 0 0;
  font-size: clamp(1.05rem, 2.6vw, 1.35rem);
  line-height: 1.6;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.primary,
.ghost,
.theme-chip {
  border: 0;
  border-radius: 999px;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease,
    color 180ms ease;
  cursor: pointer;
}

.primary,
.ghost {
  padding: 14px 18px;
}

.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1a1110;
  box-shadow: 0 16px 34px rgba(255, 142, 60, 0.24);
}

.ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.primary:hover,
.ghost:hover,
.theme-chip:hover {
  transform: translateY(-2px);
}

.signal-card {
  padding: 22px;
  background: linear-gradient(180deg, rgba(14, 27, 49, 0.92), rgba(10, 18, 33, 0.84));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  min-height: 360px;
}

.signal-card-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 0.86rem;
}

.meter {
  margin-top: 20px;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.meter-bar {
  width: 84%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  transition: width 260ms ease;
}

.signal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 22px;
}

.signal-stats strong {
  display: block;
  font-size: clamp(1.4rem, 4vw, 2rem);
}

.signal-stats span {
  color: var(--muted);
}

.theme-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.theme-chip {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.theme-chip.active {
  background: rgba(255, 209, 102, 0.14);
  color: var(--accent-2);
  box-shadow: 0 0 0 1px rgba(255, 209, 102, 0.14) inset;
}

.narrative,
.metrics,
.footer-panel {
  margin-top: 22px;
  padding: 28px;
}

.section-heading h2 {
  margin: 6px 0 0;
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1;
  letter-spacing: -0.05em;
  max-width: 12ch;
}

.constellation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.86fr);
  gap: 26px;
  margin-top: 28px;
}

.constellation-stage {
  position: relative;
  min-height: 420px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 20% 24%, rgba(255, 170, 120, 0.18), transparent 22%),
    radial-gradient(circle at 72% 28%, rgba(92, 225, 230, 0.16), transparent 24%),
    linear-gradient(180deg, rgba(8, 13, 25, 0.94), rgba(12, 17, 31, 0.86));
}

.node {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.08em;
  font-size: 0.86rem;
  color: #fff6e8;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22);
  animation: float 8s ease-in-out infinite;
}

.node span {
  mix-blend-mode: screen;
}

.node-a {
  width: 118px;
  height: 118px;
  top: 14%;
  left: 14%;
}

.node-b {
  width: 146px;
  height: 146px;
  top: 32%;
  left: 42%;
  animation-delay: -2s;
}

.node-c {
  width: 136px;
  height: 136px;
  top: 58%;
  left: 68%;
  animation-delay: -3.4s;
}

.node-d {
  width: 112px;
  height: 112px;
  top: 10%;
  left: 70%;
  animation-delay: -5.2s;
}

.node-links {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.node-links path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 1;
  stroke-dasharray: 3 5;
}

.insight-stack {
  display: grid;
  gap: 16px;
}

.insight-stack article,
.metric-card {
  padding: 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.insight-stack article span,
.metric-card span {
  color: var(--accent-2);
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.insight-stack article h3 {
  margin: 10px 0 10px;
  font-size: 1.3rem;
}

.insight-stack article p,
.metric-card p,
.footer-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.metric-card strong {
  display: block;
  margin-top: 12px;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  letter-spacing: -0.05em;
}

.footer-panel {
  text-align: center;
}

.footer-copy code {
  color: var(--accent-2);
}

body[data-theme="tide"] {
  --bg: #071321;
  --panel: rgba(6, 18, 39, 0.76);
  --panel-strong: rgba(4, 16, 36, 0.9);
  --text: #edf8ff;
  --muted: #acc6df;
  --accent: #6ee7ff;
  --accent-2: #8ef7c8;
  --accent-3: #8ea8ff;
}

body[data-theme="ember"] {
  --bg: #170d0c;
  --panel: rgba(28, 13, 11, 0.78);
  --panel-strong: rgba(33, 14, 12, 0.88);
  --text: #fff1e6;
  --muted: #e1b7aa;
  --accent: #ff7148;
  --accent-2: #ffd166;
  --accent-3: #ff4f7d;
}

body[data-pulse="true"] .panel,
body[data-pulse="true"] .signal-card,
body[data-pulse="true"] .metric-card,
body[data-pulse="true"] .insight-stack article {
  box-shadow:
    var(--shadow),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 0 48px rgba(255, 170, 120, 0.14);
}

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

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

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }

  to {
    transform: translate3d(2%, -2%, 0) scale(1.08);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-12px);
  }
}

@media (max-width: 980px) {
  .hero {
    min-height: auto;
    padding-top: 84px;
  }

  .hero-grid,
  .constellation-layout,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 18px, 1180px);
    padding-top: 12px;
  }

  .panel,
  .signal-card,
  .constellation-stage,
  .metric-card,
  .insight-stack article {
    border-radius: 22px;
  }

  .hero,
  .narrative,
  .metrics,
  .footer-panel {
    padding: 20px;
  }

  .hero-copy h1 {
    font-size: clamp(3.2rem, 22vw, 5.2rem);
  }

  .signal-stats {
    grid-template-columns: 1fr;
  }

  .constellation-stage {
    min-height: 360px;
  }
}
