html {
  scroll-behavior: smooth;
}

body {
  background:
    linear-gradient(rgba(13, 17, 23, .92), rgba(13, 17, 23, .96)),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, .025) 1px, transparent 1px),
    #0d1117;
  background-size: auto, 44px 44px, 44px 44px, auto;
}

.glass {
  background: linear-gradient(180deg, rgba(18, 24, 38, .94), rgba(16, 22, 35, .86));
  border: 1px solid rgba(148, 163, 184, .18);
  box-shadow: 0 18px 70px rgba(0, 0, 0, .32);
}

.metric-number {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  max-width: 100%;
  min-width: 0;
  line-height: 1.15;
}

#totalDays,
#totalHours,
#totalMinutes,
#totalSeconds {
  max-width: 100%;
  min-width: 0;
  line-height: 1.2;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  contain: layout paint;
}

.tab-active {
  color: #e6fbff;
  background: linear-gradient(180deg, rgba(34, 211, 238, .2), rgba(52, 211, 153, .08));
  border-color: rgba(34, 211, 238, .5);
}

.starfield::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .55;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, .7) 1px, transparent 1px),
    radial-gradient(circle, rgba(34, 211, 238, .45) 1px, transparent 1px);
  background-size: 91px 91px, 143px 143px;
  background-position: 12px 18px, 40px 58px;
  mask-image: linear-gradient(to bottom, black, transparent 86%);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height .28s ease;
}

.accordion-item.open .accordion-content {
  max-height: 320px;
}

.accordion-item.open .chevron {
  transform: rotate(180deg);
}

.odometer-pulse {
  animation: odometerPulse 1s ease-in-out infinite;
}

.tick-flash {
  animation: tickFlash .48s ease;
}

@keyframes odometerPulse {
  0%,
  100% {
    text-shadow: 0 0 0 rgba(34, 211, 238, 0);
  }

  50% {
    text-shadow: 0 0 18px rgba(34, 211, 238, .48);
  }
}

@keyframes tickFlash {
  0% {
    transform: translateY(0);
    color: #67e8f9;
  }

  45% {
    transform: translateY(-1px);
    color: #e0faff;
  }

  100% {
    transform: translateY(0);
    color: #22d3ee;
  }
}

.planetary-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.planetary-card::before,
.planetary-card::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(34, 211, 238, .18);
  border-radius: 999px;
  pointer-events: none;
  z-index: -1;
}

.planetary-card::before {
  width: 118px;
  height: 118px;
  right: -42px;
  top: -34px;
  animation: orbitSweep 9s linear infinite;
}

.planetary-card::after {
  width: 72px;
  height: 72px;
  right: -20px;
  top: -12px;
  border-color: rgba(251, 191, 36, .2);
  animation: orbitSweep 6s linear infinite reverse;
}

@keyframes orbitSweep {
  to {
    transform: rotate(360deg);
  }
}

.bio-stat-card,
#heartbeats,
.heartbeat-pulse {
  position: relative;
}

.heartbeat-pulse,
#heartbeats {
  animation: heartbeatPulse 1.28s ease-in-out infinite;
}

@keyframes heartbeatPulse {
  0%,
  45%,
  100% {
    filter: drop-shadow(0 0 0 rgba(251, 113, 133, 0));
    transform: scale(1);
  }

  18% {
    filter: drop-shadow(0 0 12px rgba(251, 113, 133, .35));
    transform: scale(1.025);
  }
}

.history-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 2rem;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: .375rem;
  background: rgba(15, 23, 42, .75);
  padding: .35rem .6rem;
  color: #cbd5e1;
  font-size: .75rem;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}

.history-chip:hover,
.history-chip:focus-visible {
  border-color: rgba(34, 211, 238, .55);
  background: rgba(8, 47, 73, .42);
  color: #e6fbff;
  outline: none;
}

.toast-region {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 80;
  display: grid;
  gap: .75rem;
  width: min(24rem, calc(100vw - 2rem));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: .75rem;
  border: 1px solid rgba(34, 211, 238, .32);
  border-radius: .5rem;
  background: rgba(13, 17, 23, .96);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .42);
  color: #e2e8f0;
  padding: .85rem 1rem;
  pointer-events: auto;
  transform: translateY(.75rem);
  opacity: 0;
  animation: toastIn .22s ease forwards;
}

.toast.success {
  border-color: rgba(52, 211, 153, .42);
}

.toast.warning {
  border-color: rgba(251, 191, 36, .42);
}

.toast.error {
  border-color: rgba(251, 113, 133, .42);
}

.toast.hide {
  animation: toastOut .18s ease forwards;
}

@keyframes toastIn {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes toastOut {
  to {
    transform: translateY(.75rem);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .accordion-content,
  .history-chip {
    transition: none;
  }

  .odometer-pulse,
  .tick-flash,
  .planetary-card::before,
  .planetary-card::after,
  .heartbeat-pulse,
  #heartbeats {
    animation: none;
  }
}
