:root {
  --bg: #07111c;
  --panel: rgba(8, 19, 33, 0.84);
  --line: rgba(153, 204, 255, 0.14);
  --text: #edf7ff;
  --muted: #acc1d6;
  --accent: #86e7ff;
  --accent-strong: #24bfff;
  --energy: #ffd16f;
  --nucleus: #77c7ff;
  --fragment: #8bffba;
  --danger: #ff7f6e;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(36, 191, 255, 0.18), transparent 28%),
    radial-gradient(circle at 85% 15%, rgba(255, 209, 111, 0.14), transparent 22%),
    linear-gradient(170deg, #03080f, #091525 42%, #112742 100%);
}

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

.page {
  width: min(1240px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.site-nav {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.7rem;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(8, 19, 33, 0.68);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-right: auto;
  padding: 0.3rem 0.35rem 0.3rem 0.1rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  display: inline-block;
}

.brand-core,
.brand-orbit {
  position: absolute;
  inset: 0;
}

.brand-core {
  width: 8px;
  height: 8px;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--energy), var(--accent));
  box-shadow: 0 0 18px rgba(134, 231, 255, 0.45);
  animation: core-pulse 2.8s ease-in-out infinite;
}

.brand-orbit {
  border: 2px solid rgba(134, 231, 255, 0.72);
  border-radius: 50%;
}

.orbit-a {
  transform: rotate(28deg) scaleX(1.18) scaleY(0.58);
  animation: orbit-spin-a 7s linear infinite;
}

.orbit-b {
  transform: rotate(-28deg) scaleX(1.18) scaleY(0.58);
  animation: orbit-spin-b 9s linear infinite;
}

.brand-text {
  font-size: 0.95rem;
}

@keyframes orbit-spin-a {
  from {
    transform: rotate(28deg) scaleX(1.18) scaleY(0.58);
  }
  to {
    transform: rotate(388deg) scaleX(1.18) scaleY(0.58);
  }
}

@keyframes orbit-spin-b {
  from {
    transform: rotate(-28deg) scaleX(1.18) scaleY(0.58);
  }
  to {
    transform: rotate(-388deg) scaleX(1.18) scaleY(0.58);
  }
}

@keyframes core-pulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 18px rgba(134, 231, 255, 0.45);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.18);
    box-shadow: 0 0 24px rgba(255, 209, 111, 0.55);
  }
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(153, 204, 255, 0.1);
  transition: transform 180ms ease, color 180ms ease, background-color 180ms ease;
}

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

.nav-link.is-active {
  color: #022234;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: transparent;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
  align-items: stretch;
}

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

.hero-copy,
.summary-card,
.simulation-card,
.info-card {
  border-radius: 26px;
}

.hero-copy {
  padding: 1.8rem;
}

.eyebrow,
.label {
  margin: 0;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--accent);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin: 0.45rem 0 0.9rem;
  font-size: clamp(2.6rem, 5vw, 4.8rem);
  line-height: 0.95;
  max-width: 9ch;
}

.lead {
  margin-bottom: 0;
  max-width: 58ch;
  color: var(--muted);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 1.4rem;
  flex-wrap: wrap;
}

.primary,
.secondary {
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.2rem;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.primary {
  color: #022234;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 12px 30px rgba(36, 191, 255, 0.28);
}

.secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(153, 204, 255, 0.14);
}

.primary:hover,
.secondary:hover {
  transform: translateY(-2px);
}

.summary-card {
  padding: 1rem;
  display: grid;
  gap: 0.8rem;
}

.summary-card article {
  padding: 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(153, 204, 255, 0.08);
}

.value {
  margin: 0.25rem 0 0;
  font-size: 1.25rem;
  font-weight: 800;
}

.simulation-card {
  margin-top: 1rem;
  padding: 1rem;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.8rem;
}

.panel-head h2 {
  margin: 0.35rem 0 0;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
}

.stage-stat {
  margin: 0;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(153, 204, 255, 0.12);
  color: var(--muted);
  white-space: nowrap;
}

.simulation-shell {
  position: relative;
  overflow: hidden;
  min-height: 640px;
  border-radius: 24px;
  border: 1px solid rgba(153, 204, 255, 0.12);
  background:
    radial-gradient(circle at center, rgba(36, 191, 255, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(5, 15, 27, 0.96), rgba(7, 18, 29, 0.96));
}

.reaction-canvas {
  display: block;
  width: 100%;
  height: auto;
}

.legend-card {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  width: min(320px, calc(100% - 2rem));
  padding: 0.75rem;
  border-radius: 18px;
  background: rgba(6, 18, 31, 0.78);
  border: 1px solid rgba(153, 204, 255, 0.12);
  backdrop-filter: blur(14px);
}

.legend-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.legend-item {
  display: flex;
  gap: 0.6rem;
  padding: 0.45rem 0.5rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.swatch {
  width: 12px;
  height: 12px;
  margin-top: 0.25rem;
  flex: 0 0 auto;
  border-radius: 50%;
}

.swatch.nucleus {
  background: var(--nucleus);
  box-shadow: 0 0 14px rgba(119, 199, 255, 0.45);
}

.swatch.neutron {
  background: #d8f5ff;
  box-shadow: 0 0 14px rgba(134, 231, 255, 0.6);
}

.swatch.fragment {
  background: var(--fragment);
  box-shadow: 0 0 14px rgba(139, 255, 186, 0.45);
}

.swatch.energy {
  border-radius: 999px;
  background: linear-gradient(90deg, #ffe7a7, var(--energy));
  box-shadow: 0 0 14px rgba(255, 209, 111, 0.45);
}

.legend-title {
  margin: 0 0 0.12rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.legend-copy {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.2;
  color: var(--muted);
}

.status-grid {
  margin-top: 0.8rem;
  display: grid;
  grid-template-columns: 180px 180px 1fr;
  gap: 0.7rem;
}

.status-card {
  padding: 0.7rem 0.85rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(153, 204, 255, 0.08);
}

.status-card.wide .value,
.stage-text {
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--muted);
}

.stage-text {
  margin: 0.2rem 0 0;
}

.timeline-card {
  margin-top: 0.8rem;
  padding: 0.75rem 0.9rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(153, 204, 255, 0.08);
}

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

.timeline-step-indicator {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.timeline-track {
  height: 6px;
  margin: 0.6rem 0;
  border-radius: 999px;
  background: rgba(134, 231, 255, 0.12);
  overflow: hidden;
}

.timeline-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--energy));
}

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

.timeline-item {
  padding: 0.55rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(153, 204, 255, 0.06);
}

.timeline-item.is-active {
  background: rgba(134, 231, 255, 0.08);
  border-color: rgba(134, 231, 255, 0.28);
}

.timeline-item.is-complete {
  border-color: rgba(255, 209, 111, 0.24);
}

.timeline-title {
  margin: 0 0 0.18rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.timeline-copy {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.22;
  color: var(--muted);
}

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

.info-card {
  padding: 1.2rem;
}

.info-card h3 {
  margin: 0.45rem 0 0.55rem;
  font-size: 1.1rem;
}

.info-card p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
  }

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

  .status-card.wide {
    grid-column: 1 / -1;
  }

  .timeline-grid,
  .info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .page {
    width: min(100vw - 1rem, 100%);
    padding-top: 0.8rem;
  }

  .hero-copy,
  .summary-card,
  .simulation-card,
  .info-card {
    border-radius: 20px;
  }

  .hero-copy,
  .simulation-card,
  .info-card {
    padding: 1rem;
  }

  .simulation-shell {
    min-height: 520px;
  }

  .panel-head,
  .timeline-head,
  .status-grid,
  .timeline-grid,
  .info-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .panel-head {
    gap: 0.5rem;
  }

  .stage-stat {
    white-space: normal;
  }

  .legend-card {
    right: 0.55rem;
    left: 0.55rem;
    bottom: 0.55rem;
    width: auto;
  }

  .secondary,
  .primary,
  .nav-link {
    width: 100%;
    text-align: center;
  }

  .nav-brand {
    width: 100%;
    justify-content: center;
    margin-right: 0;
    padding-bottom: 0.55rem;
  }
}
