:root {
  --panel: rgba(8, 20, 38, 0.8);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f3f6fb;
  --muted: rgba(243, 246, 251, 0.72);
  --gold: #e0b847;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  font-family: "Space Grotesk", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(30, 92, 179, 0.3), transparent 32%),
    radial-gradient(circle at 82% 14%, rgba(12, 166, 120, 0.2), transparent 22%),
    radial-gradient(circle at 50% 100%, rgba(224, 184, 71, 0.18), transparent 34%),
    linear-gradient(160deg, #040915 0%, #09162a 48%, #07111f 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  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: 84px 84px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.82), transparent 86%);
}

body::after {
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.08) 0, transparent 60%),
    radial-gradient(circle at center, rgba(224, 184, 71, 0.12) 0, transparent 40%);
  opacity: 0.16;
}

.ambient {
  position: fixed;
  width: 36rem;
  height: 36rem;
  border-radius: 50%;
  filter: blur(36px);
  pointer-events: none;
  opacity: 0.28;
}

.ambient--left {
  top: -10rem;
  left: -12rem;
  background: radial-gradient(circle, rgba(30, 92, 179, 0.9), transparent 68%);
}

.ambient--right {
  right: -10rem;
  bottom: -14rem;
  background: radial-gradient(circle, rgba(12, 166, 120, 0.78), transparent 68%);
}

.page {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: 1.25rem 0;
  position: relative;
}

.container {
  width: min(100% - 2rem, 1180px);
  margin-inline: auto;
}

.hero {
  position: relative;
  min-height: min(92vh, 56rem);
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid var(--line);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(13, 31, 58, 0.95), rgba(7, 17, 31, 0.9)),
    radial-gradient(circle at top right, rgba(112, 200, 255, 0.12), transparent 28%);
  box-shadow: var(--shadow);
  isolation: isolate;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.hero::before {
  inset: auto auto -10rem -7rem;
  width: 22rem;
  height: 22rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(224, 184, 71, 0.18), transparent 70%);
}

.hero::after {
  inset: 0;
  background:
    linear-gradient(125deg, rgba(255, 255, 255, 0.05), transparent 32%),
    radial-gradient(circle at 82% 22%, rgba(30, 92, 179, 0.2), transparent 16%);
  mix-blend-mode: screen;
}

.hero__background,
.hero__copy,
.celebration-burst {
  opacity: 0;
  animation: rise-in 0.9s cubic-bezier(0.2, 0.65, 0.2, 1) forwards;
}

.hero__background {
  position: absolute;
  inset: 0;
  z-index: 1;
  animation-delay: 0.08s;
}

.hero__glow,
.hero__asset {
  position: absolute;
  pointer-events: none;
}

.hero__glow {
  border-radius: 50%;
  filter: blur(32px);
  opacity: 0.3;
  z-index: 0;
}

.hero__glow--blue {
  top: -8rem;
  right: 8%;
  width: 18rem;
  height: 18rem;
  background: radial-gradient(circle, rgba(30, 92, 179, 0.9), transparent 70%);
}

.hero__glow--green {
  left: -6rem;
  bottom: -8rem;
  width: 20rem;
  height: 20rem;
  background: radial-gradient(circle, rgba(12, 166, 120, 0.84), transparent 72%);
}

.hero__glow--gold {
  top: 34%;
  right: 24%;
  width: 14rem;
  height: 14rem;
  background: radial-gradient(circle, rgba(224, 184, 71, 0.7), transparent 74%);
}

.hero__asset {
  opacity: 0.13;
  mix-blend-mode: screen;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.28));
  z-index: 2;
}

.hero__asset--hsv {
  top: -2rem;
  right: 2%;
  width: min(28vw, 20rem);
  transform: rotate(12deg);
  animation: drift-hsv 15s ease-in-out infinite;
}

.hero__asset--tc {
  left: -3%;
  bottom: -3rem;
  width: min(26vw, 18rem);
  transform: rotate(-12deg);
  animation: drift-tc 17s ease-in-out infinite;
}

.hero__asset--lol {
  top: 50%;
  right: 14%;
  width: min(38vw, 26rem);
  transform: translateY(-50%) rotate(-8deg);
  animation: drift-lol 18s ease-in-out infinite;
}

.hero__copy {
  position: relative;
  z-index: 2;
  max-width: 44rem;
  animation-delay: 0.16s;
}

.hero__copy > * {
  opacity: 0;
  animation: rise-in 0.9s cubic-bezier(0.2, 0.65, 0.2, 1) forwards;
}

.hero__copy > :nth-child(1) {
  animation-delay: 0.1s;
}

.hero__copy > :nth-child(2) {
  animation-delay: 0.18s;
}

.hero__copy > :nth-child(3) {
  animation-delay: 0.26s;
}

.hero__copy > :nth-child(4) {
  animation-delay: 0.34s;
}

.hero__copy > :nth-child(5) {
  animation-delay: 0.42s;
}

.eyebrow,
.time-label {
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.78rem;
}

.eyebrow::before {
  content: "";
  width: 2.5rem;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

h1,
.time-value {
  font-family: "Bricolage Grotesque", Arial, sans-serif;
}

h1 {
  margin: 0.6rem 0 0;
  max-width: 100%;
  font-size: clamp(2.3rem, 11vw, 4.2rem);
  line-height: 0.94;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

h1 span {
  display: inline-block;
  color: transparent;
  background: linear-gradient(135deg, #ffffff 0%, #ffe08b 48%, #70c8ff 100%);
  background-clip: text;
}

.countdown-shell {
  position: relative;
  margin-top: 1.2rem;
  padding: 1.1rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  transition:
    transform 0.28s ease,
    border-color 0.28s ease,
    box-shadow 0.28s ease,
    background 0.28s ease;
}

.countdown-shell::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.45), transparent 60%);
}

.countdown-shell:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.18);
}

.countdown-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.timer-label,
.countdown-status {
  margin: 0;
}

.timer-label {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.92rem;
}

.countdown-status {
  color: var(--gold);
  font-size: 0.92rem;
  font-weight: 700;
}

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

.time-card {
  position: relative;
  padding: 1rem;
  min-height: 9.75rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(6, 14, 28, 0.9);
}

.time-card__memory {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.08);
  transition:
    opacity 0.7s ease,
    transform 5.8s ease;
  z-index: 0;
}

.time-card__memory::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 14, 28, 0.14), rgba(6, 14, 28, 0.6)),
    linear-gradient(130deg, rgba(255, 255, 255, 0.08), transparent 44%);
}

.time-card__memory img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: saturate(1.04) contrast(1.08);
  transition:
    opacity 0.7s ease,
    transform 5.8s ease;
  transform: scale(1.08);
}

.time-card__memory.is-visible {
  opacity: 0.24;
  transform: scale(1);
}

.time-card__memory.is-visible img {
  opacity: 1;
  transform: scale(1);
}

.time-card__content {
  position: relative;
  z-index: 2;
}

.time-card::after {
  content: attr(data-unit);
  position: absolute;
  right: 0.85rem;
  bottom: 0.85rem;
  z-index: 2;
  color: rgba(255, 255, 255, 0.07);
  font-size: 0.72rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.time-value {
  display: block;
  font-size: clamp(2.4rem, 8vw, 4.8rem);
  line-height: 0.95;
}

.time-value.is-tick {
  animation: digit-pop 0.42s cubic-bezier(0.2, 0.65, 0.2, 1);
}

.time-label {
  display: inline-block;
  margin-top: 0.8rem;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.72rem;
}

.celebration-burst {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  animation-delay: 0.28s;
}

.celebration-burst__piece {
  position: absolute;
  top: -12%;
  left: var(--left);
  width: var(--size);
  height: calc(var(--size) * 1.8);
  border-radius: 999px;
  background: var(--color);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.16);
  opacity: 0;
  transform: translate3d(0, -120%, 0) rotate(0deg);
  animation:
    confetti-fall var(--duration) linear infinite var(--delay),
    confetti-flicker 1.4s ease-in-out infinite var(--delay);
  animation-play-state: paused;
}

body[data-state="final-hours"] .countdown-shell {
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.45),
    0 0 42px rgba(224, 184, 71, 0.12);
}

body[data-state="final-hours"] .time-card[data-unit="seconds"] {
  animation: warning-pulse 1.1s ease-in-out infinite;
}

body[data-state="final-hours"] .hero__asset {
  opacity: 0.16;
}

body[data-state="final-hours"] .time-card__memory.is-visible {
  opacity: 0.3;
}

body[data-state="celebration"] {
  background:
    radial-gradient(circle at top left, rgba(30, 92, 179, 0.34), transparent 34%),
    radial-gradient(circle at 88% 16%, rgba(12, 166, 120, 0.3), transparent 22%),
    radial-gradient(circle at 50% 100%, rgba(224, 184, 71, 0.3), transparent 36%),
    linear-gradient(160deg, #071020 0%, #112341 42%, #081521 100%);
}

body[data-state="celebration"] .hero {
  background:
    linear-gradient(135deg, rgba(16, 38, 70, 0.96), rgba(9, 20, 36, 0.92)),
    radial-gradient(circle at top right, rgba(224, 184, 71, 0.2), transparent 28%);
}

body[data-state="celebration"] .hero__asset {
  opacity: 0.2;
  filter:
    drop-shadow(0 18px 40px rgba(0, 0, 0, 0.28))
    drop-shadow(0 0 24px rgba(255, 255, 255, 0.08));
}

body[data-state="celebration"] .time-card__memory.is-visible {
  opacity: 0.38;
}

body[data-state="celebration"] .countdown-status {
  color: #ffe08b;
}

body[data-state="celebration"] .time-card {
  animation: celebration-card 1.4s ease-in-out infinite alternate;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 0 28px rgba(224, 184, 71, 0.14);
}

body[data-state="celebration"] .celebration-burst {
  opacity: 1;
}

body[data-state="celebration"] .celebration-burst__piece {
  opacity: 0.92;
  animation-play-state: running;
}

@media (min-width: 780px) {
  h1 {
    max-width: 10ch;
    font-size: clamp(4.2rem, 8vw, 6rem);
  }

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

  .hero__asset--lol {
    right: 8%;
  }
}

@media (max-width: 779px) {
  body {
    overflow-y: auto;
  }

  .page {
    align-items: stretch;
  }

  .hero {
    min-height: auto;
    padding-block: 5rem;
  }

  .hero__asset--hsv {
    width: 11rem;
    right: -1rem;
  }

  .hero__asset--tc {
    width: 10rem;
    left: -1rem;
    bottom: -1rem;
  }

  .hero__asset--lol {
    width: 13rem;
    right: -2rem;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(28px);
  }

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

@keyframes digit-pop {
  0% {
    transform: translateY(10px) scale(0.94);
    opacity: 0.2;
  }

  55% {
    transform: translateY(-2px) scale(1.02);
    opacity: 1;
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes warning-pulse {
  0%,
  100% {
    transform: translateY(0);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  }

  50% {
    transform: translateY(-4px);
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.12),
      0 0 26px rgba(224, 184, 71, 0.2);
  }
}

@keyframes celebration-card {
  from {
    transform: translateY(0) scale(1);
  }

  to {
    transform: translateY(-4px) scale(1.015);
  }
}

@keyframes drift-hsv {
  0%,
  100% {
    transform: rotate(12deg) translate3d(0, 0, 0);
  }

  50% {
    transform: rotate(18deg) translate3d(-10px, 12px, 0);
  }
}

@keyframes drift-tc {
  0%,
  100% {
    transform: rotate(-12deg) translate3d(0, 0, 0);
  }

  50% {
    transform: rotate(-6deg) translate3d(12px, -10px, 0);
  }
}

@keyframes drift-lol {
  0%,
  100% {
    transform: translateY(-50%) rotate(-8deg) translate3d(0, 0, 0);
  }

  50% {
    transform: translateY(-50%) rotate(-4deg) translate3d(10px, -10px, 0);
  }
}

@keyframes confetti-fall {
  0% {
    transform: translate3d(0, -120%, 0) rotate(var(--rotation));
  }

  100% {
    transform: translate3d(var(--drift), 120vh, 0) rotate(calc(var(--rotation) + 540deg));
  }
}

@keyframes confetti-flicker {
  0%,
  100% {
    opacity: 0.95;
  }

  50% {
    opacity: 0.42;
  }
}
