@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Orbitron:wght@400;700;900&display=swap');

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

:root {
  --cyan:   #00f5ff;
  --green:  #00ff88;
  --purple: #bf00ff;
  --dark:   #030712;
  --panel:  rgba(0, 245, 255, 0.04);
  --border: rgba(0, 245, 255, 0.18);
}

body {
  background: var(--dark);
  color: var(--cyan);
  font-family: 'Share Tech Mono', monospace;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/* ── Animated grid background ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
  animation: gridPulse 8s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes gridPulse {
  0%, 100% { opacity: .4; }
  50%       { opacity: .9; }
}

/* ── Scanline overlay ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,.08) 2px,
    rgba(0,0,0,.08) 4px
  );
  pointer-events: none;
  z-index: 1;
}

/* ── Canvas for particles ── */
#particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── Main wrapper ── */
.wrapper {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem 1rem;
  width: 100%;
  max-width: 900px;
}

/* ── Header ── */
.header {
  margin-bottom: 3rem;
}

.sys-label {
  font-size: .7rem;
  letter-spacing: .35em;
  color: var(--green);
  opacity: .7;
  margin-bottom: .5rem;
  text-transform: uppercase;
}

.title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(1.6rem, 5vw, 3rem);
  text-transform: uppercase;
  letter-spacing: .1em;
  background: linear-gradient(90deg, var(--cyan), var(--purple), var(--cyan));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s linear infinite;
  text-shadow: none;
  line-height: 1.15;
}

@keyframes shimmer {
  to { background-position: 200% center; }
}

.subtitle {
  margin-top: .8rem;
  font-size: .75rem;
  letter-spacing: .2em;
  color: rgba(0, 245, 255, .45);
}

/* ── Countdown grid ── */
.countdown {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.unit {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.6rem 2rem;
  min-width: 140px;
  position: relative;
  overflow: hidden;
  flex: 1 1 120px;
  max-width: 180px;
  transition: border-color .3s;
}

.unit:hover {
  border-color: var(--cyan);
}

/* corner accents */
.unit::before, .unit::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--cyan);
  border-style: solid;
  opacity: .6;
}
.unit::before { top: 5px; left: 5px;  border-width: 1px 0 0 1px; }
.unit::after  { bottom: 5px; right: 5px; border-width: 0 1px 1px 0; }

/* glow sweep */
.unit-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,245,255,.07) 0%, transparent 60%);
  pointer-events: none;
}

.number {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: clamp(2.5rem, 7vw, 4rem);
  line-height: 1;
  color: #fff;
  text-shadow:
    0 0 10px var(--cyan),
    0 0 30px rgba(0,245,255,.4),
    0 0 60px rgba(0,245,255,.15);
  letter-spacing: .05em;
  transition: transform .15s ease, color .15s ease;
  display: block;
}

.number.tick {
  animation: numTick .2s ease;
}

@keyframes numTick {
  0%   { transform: translateY(-6px); opacity: 0; }
  100% { transform: translateY(0);    opacity: 1; }
}

.label {
  margin-top: .7rem;
  font-size: .62rem;
  letter-spacing: .3em;
  color: var(--cyan);
  opacity: .55;
  text-transform: uppercase;
}

/* progress bar under each unit */
.bar-track {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: rgba(0,245,255,.1);
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  transition: width .9s linear;
  box-shadow: 0 0 8px var(--cyan);
}

/* ── Target date line ── */
.target {
  font-size: .72rem;
  letter-spacing: .18em;
  color: rgba(0, 245, 255, .35);
  margin-bottom: 2.5rem;
}
.target span { color: var(--green); opacity: .8; }

/* ── Status bar ── */
.statusbar {
  display: flex;
  justify-content: center;
  gap: 2rem;
  font-size: .62rem;
  letter-spacing: .12em;
  color: rgba(0, 245, 255, .3);
  flex-wrap: wrap;
}

.statusbar .dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: blink 1.2s step-start infinite;
  vertical-align: middle;
  margin-right: .4rem;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── Glitch effect on load ── */
.glitch {
  animation: glitch .08s steps(1) 3;
}

@keyframes glitch {
  0%  { clip-path: inset(0 0 80% 0); transform: translate(-4px); }
  25% { clip-path: inset(30% 0 50% 0); transform: translate(4px); }
  50% { clip-path: inset(60% 0 20% 0); transform: translate(-2px); }
  75% { clip-path: inset(80% 0 0 0);  transform: translate(2px); }
  100%{ clip-path: none; transform: none; }
}

@media (max-width: 480px) {
  .unit { padding: 1.2rem 1rem; min-width: 90px; }
  .countdown { gap: .8rem; }
}
