*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --purple: #6c3ce1;
  --violet: #9b59f5;
  --violet-dim: rgba(155,89,245,0.18);
  --dark: #07040d;
}

html, body {
  height: 100%;
  background: var(--dark);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  overflow: hidden;
}

/* ── CANVAS BACKGROUND ── */
.scene {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(108,60,225,0.28) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 90% 110%, rgba(59,91,219,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at -10% 80%, rgba(155,89,245,0.14) 0%, transparent 60%),
    var(--dark);
}

/* Grid */
.grid {
  position: fixed; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(155,89,245,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(155,89,245,0.06) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(ellipse 90% 90% at 50% 50%, black 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 90% 90% at 50% 50%, black 20%, transparent 80%);
  animation: scrollGrid 20s linear infinite;
}
@keyframes scrollGrid {
  to { transform: translateY(50px); }
}

/* Orbs */
.orb {
  position: fixed; border-radius: 50%;
  filter: blur(80px); z-index: 0;
  pointer-events: none;
  animation: drift 14s ease-in-out infinite alternate;
}
.orb1 { width: 600px; height: 600px; background: rgba(108,60,225,.14); top: -20%; left: -10%; }
.orb2 { width: 500px; height: 500px; background: rgba(59,91,219,.10); bottom: -15%; right: -10%; animation-delay: -5s; }
.orb3 { width: 350px; height: 350px; background: rgba(155,89,245,.08); top: 40%; left: 50%; transform: translateX(-50%); animation-delay: -10s; }
@keyframes drift {
  from { transform: translate(0,0); }
  to   { transform: translate(30px, 40px); }
}

/* Noise grain */
.grain {
  position: fixed; inset: 0; z-index: 1;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  pointer-events: none;
}

/* ── LAYOUT ── */
.wrap {
  position: relative; z-index: 2;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: clamp(1.2rem, 4vw, 2.5rem) clamp(1rem, 5vw, 3rem);
}

/* ── TOP: LOGO ── */
.header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  animation: riseIn 1s cubic-bezier(.16,1,.3,1) both;
}

.logo-wrap img {
  width: min(340px, 72vw);
  filter: drop-shadow(0 0 24px rgba(108,60,225,.55));
}

/* ── MIDDLE: COUNTDOWN ── */
.center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1.2rem, 3.5vh, 2rem);
}

/* Decorative horizontal rule */
.rule {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: min(440px, 90vw);
}
.rule::before, .rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(155,89,245,.4), transparent);
}
.rule-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--violet);
  box-shadow: 0 0 10px var(--violet);
  animation: blink 2s ease-in-out infinite;
}
@keyframes blink {
  0%,100% { opacity:.4; transform: scale(1); }
  50%      { opacity:1;  transform: scale(1.4); box-shadow: 0 0 18px var(--violet); }
}

/* Label above */
.label-top {
  font-family: 'Space Mono', monospace;
  font-size: clamp(.6rem, 1.8vw, .75rem);
  letter-spacing: .35em;
  text-transform: uppercase;
  color: rgba(155,89,245,.7);
  animation: riseIn 1s .3s cubic-bezier(.16,1,.3,1) both;
}

/* The countdown itself */
.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(.4rem, 2vw, 1.5rem);
  width: min(520px, 96vw);
  animation: riseIn 1s .45s cubic-bezier(.16,1,.3,1) both;
}

.block {
  position: relative;
  background: linear-gradient(135deg, rgba(255,255,255,.055) 0%, rgba(255,255,255,.015) 100%);
  border: 1px solid rgba(155,89,245,.2);
  border-radius: 16px;
  padding: clamp(.9rem, 3vw, 1.6rem) clamp(.4rem, 1.5vw, 1rem) clamp(.7rem, 2vw, 1.2rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  backdrop-filter: blur(16px);
  box-shadow:
    0 20px 40px rgba(0,0,0,.5),
    inset 0 1px 0 rgba(255,255,255,.08),
    0 0 0 0 rgba(155,89,245,0);
  transition: box-shadow .3s ease, transform .3s ease;
  overflow: hidden;
}

/* Subtle corner accent */
.block::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 30px; height: 30px;
  background: linear-gradient(135deg, rgba(155,89,245,.3), transparent);
  border-radius: 16px 0 0 0;
}

/* Scanline per block */
.block::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(155,89,245,.12) 50%, transparent 100%);
  animation: scan 3s linear infinite;
  pointer-events: none;
}
.block:nth-child(2)::after { animation-delay: -.75s; }
.block:nth-child(3)::after { animation-delay: -1.5s; }
.block:nth-child(4)::after { animation-delay: -2.25s; }

@keyframes scan {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(200%); }
}

.num {
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(2.4rem, 8.5vw, 5.2rem);
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(170deg, #ffffff 20%, #c4a8ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -.02em;
  min-width: 2ch;
  text-align: center;
  filter: drop-shadow(0 0 12px rgba(108,60,225,.3));
  animation: breathe 3.5s ease-in-out infinite alternate;
}
.block:nth-child(1) .num { animation-delay: 0s; }
.block:nth-child(2) .num { animation-delay: -.9s; }
.block:nth-child(3) .num { animation-delay: -1.8s; }
.block:nth-child(4) .num { animation-delay: -2.7s; }

@keyframes breathe {
  0%   { filter: drop-shadow(0 0 8px rgba(108,60,225,.2)); }
  100% { filter: drop-shadow(0 0 22px rgba(155,89,245,.7)); }
}

.lbl {
  font-family: 'Space Mono', monospace;
  font-size: clamp(.5rem, 1.5vw, .65rem);
  letter-spacing: .3em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
}

/* Progress bar at bottom of each block */
.prog {
  position: absolute;
  bottom: 0; left: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--violet), transparent);
  border-radius: 0 0 16px 16px;
  width: 0%;
  transition: width 1s linear;
}

/* ── BOTTOM SECTION ── */
.bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(.8rem, 2.5vh, 1.4rem);
  animation: riseIn 1s .6s cubic-bezier(.16,1,.3,1) both;
}

footer {
  font-family: 'Space Mono', monospace;
  font-size: clamp(.55rem, 1.5vw, .65rem);
  letter-spacing: .25em;
  color: rgba(255,255,255,.18);
  text-transform: uppercase;
  text-align: center;
}

/* ── ANIMATION ── */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
  .wrap {
    padding: 1.2rem 0.75rem;
  }

  .logo-wrap img {
    width: min(260px, 80vw);
  }

  .countdown {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
    width: 100%;
  }

  .block {
    border-radius: 10px;
    padding: 0.75rem 0.2rem 0.6rem;
    gap: 0.2rem;
  }

  .num {
    font-size: clamp(1.8rem, 7.5vw, 2.6rem);
  }

  .lbl {
    font-size: 0.5rem;
    letter-spacing: .1em;
  }

  .label-top {
    font-size: 0.6rem;
    letter-spacing: .25em;
  }

  .rule {
    width: 90vw;
  }
}

@media (max-width: 360px) {
  .num {
    font-size: 1.6rem;
  }

  .lbl {
    font-size: 0.45rem;
    letter-spacing: .08em;
  }

  .block {
    padding: 0.6rem 0.15rem 0.5rem;
  }
}

@media (min-width: 1024px) {
  .countdown { width: min(600px, 80vw); }
}