:root {
  --countdown-font: "Playfair Display", Georgia, serif;
  --text: #fff;
  --shadow: rgba(0, 22, 42, 0.55);
  --line: rgba(255, 255, 255, 0.36);
  --gold: rgba(255, 203, 122, 0.82);
  --countdown-background: url("../images/montana-4k.png");
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background-color: #0b4d64;
  color: var(--text);
  font-family: var(--countdown-font);
  min-height: 100svh;
  overflow-x: hidden;
}

body::before {
  animation: none;
  content: "";
  position: fixed;
  inset: -2px;
  background-image:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.06), rgba(0, 38, 57, 0.18) 72%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.24)),
    var(--countdown-background, none);
  background-position: center, center, center;
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-size: cover, cover, cover;
  pointer-events: none;
  transform: none;
  transition: none;
  z-index: 0;
}

body::after {
  background:
    linear-gradient(90deg, transparent, rgba(255, 236, 196, 0.16), transparent);
  content: "";
  height: 100%;
  left: -55%;
  pointer-events: none;
  position: fixed;
  top: 0;
  transform: skewX(-18deg);
  width: 26%;
  z-index: 0;
  animation: morning-glow 12s ease-in-out infinite;
}

.countdown-shell {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100svh;
  padding: clamp(28px, 7vw, 84px);
  place-items: center;
}

.countdown-panel {
  width: min(1120px, 100%);
  padding: clamp(20px, 4vw, 44px) 0;
  text-align: center;
  text-shadow: 0 4px 20px var(--shadow);
}

.countdown-kicker {
  color: rgba(255, 242, 219, 0.88);
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(0.72rem, 1.2vw, 0.92rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.2;
  margin: 0 0 clamp(12px, 2vw, 20px);
  text-transform: uppercase;
}

.countdown-title {
  margin: 0 0 clamp(16px, 3vw, 28px);
  color: #fff;
  font-size: clamp(2.25rem, 6vw, 5.4rem);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
}

.cursor-spark {
  background: rgba(255, 236, 196, 0.95);
  border-radius: 999px;
  box-shadow: 0 0 14px rgba(255, 217, 156, 0.75);
  height: var(--spark-size);
  left: var(--spark-x);
  pointer-events: none;
  position: fixed;
  top: var(--spark-y);
  transform: translate(-50%, -50%);
  width: var(--spark-size);
  z-index: 4;
  animation: cursor-sparkle 780ms ease-out forwards;
}

.countdown-note {
  color: rgba(255, 245, 229, 0.9);
  display: block;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(0.82rem, 1.4vw, 1.05rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
  margin: 0 0 clamp(24px, 4vw, 42px);
  text-transform: lowercase;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 auto;
  width: min(100%, 980px);
}

.countdown-unit {
  display: grid;
  min-width: 0;
  padding: 0 clamp(10px, 2.5vw, 34px);
  position: relative;
}

.countdown-unit + .countdown-unit::before {
  background: linear-gradient(180deg, transparent, var(--line), transparent);
  content: "";
  height: 76%;
  left: 0;
  position: absolute;
  top: 12%;
  width: 1px;
}

.countdown-unit + .countdown-unit::after {
  background: linear-gradient(180deg, transparent, var(--gold), transparent);
  content: "";
  height: 18%;
  left: 0;
  opacity: 0;
  position: absolute;
  top: 10%;
  width: 1px;
  animation: divider-glint 7s ease-in-out infinite;
}

.countdown-unit:nth-child(3)::after {
  animation-delay: 1.2s;
}

.countdown-unit:nth-child(4)::after {
  animation-delay: 2.4s;
}

.countdown-value {
  display: block;
  font-size: clamp(3rem, 10vw, 8.75rem);
  font-weight: 800;
  line-height: 0.9;
  min-height: 0.9em;
  text-align: center;
  white-space: nowrap;
  position: relative;
  text-shadow: 0 4px 20px var(--shadow);
}

.countdown-label {
  display: block;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(0.78rem, 1.7vw, 1.25rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.1;
  margin-top: clamp(8px, 1.3vw, 14px);
  text-transform: lowercase;
}

.target-label,
.finished-message {
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  display: inline-block;
  font-size: clamp(1.25rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
  margin: clamp(28px, 5vw, 56px) 0 0;
  padding: clamp(18px, 3vw, 30px) clamp(16px, 5vw, 72px) 0;
}

.finished-message {
  font-size: clamp(2rem, 5vw, 4.8rem);
}

body.is-final-week::before {
  background-image:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.08), rgba(0, 38, 57, 0.16) 72%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.18)),
    var(--countdown-background, none);
}

body.is-final-week .countdown-note {
  color: #ffe1a8;
  font-family: var(--countdown-font);
  font-size: clamp(1.35rem, 3vw, 2.4rem);
  text-transform: none;
}

[hidden] {
  display: none !important;
}

@keyframes morning-glow {
  0%,
  68% {
    left: -55%;
    opacity: 0;
  }

  78% {
    opacity: 0.5;
  }

  100% {
    left: 130%;
    opacity: 0;
  }
}

@keyframes divider-glint {
  0%,
  60% {
    opacity: 0;
    top: 10%;
  }

  72% {
    opacity: 0.9;
  }

  100% {
    opacity: 0;
    top: 72%;
  }
}

@keyframes cursor-sparkle {
  0% {
    opacity: 0.85;
    transform: translate(-50%, -50%) scale(0.7);
  }

  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--spark-dx)), calc(-50% + var(--spark-dy))) scale(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }

  .cursor-spark {
    display: none;
  }
}

@media (max-width: 680px) {
  .countdown-shell {
    padding: 28px 18px;
  }

  .countdown-grid {
    gap: 18px 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .countdown-unit:nth-child(3)::before {
    display: none;
  }

  .countdown-value {
    font-size: clamp(3.7rem, 20vw, 6.5rem);
  }
}

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

  .countdown-unit + .countdown-unit::before {
    display: none;
  }
}
