/* ====================================================================
   NOVATRADE — LAUNCH COUNTDOWN · CINEMATIC EDITION
   Target: 20 December 2026 · 00:00 CET

   Narrative: a dawn rising over a dark horizon. The closer the launch,
   the higher the light climbs — from quiet to epic.

     base  (> 30 days) : Quiet. Editorial type, one soft key light.
     30d   (<= 30 days): The horizon glows. Embers begin to rise.
     10d   (<= 10 days): Letterbox frames the scene. Anamorphic streak.
     1d    (<= 24 h)   : Full-bleed READY?, sunrise, cinema framing.
     final (<= 10 s)   : One number at a time, then the reveal.
   ==================================================================== */

/* Lock scroll & hide the site while the countdown is active */
html.countdown-active,
body.countdown-active {
  overflow: hidden !important;
  height: 100vh !important;
}

body.countdown-active > *:not(#countdownOverlay):not(#countdownRevealFlash) {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* ====================================================================
   OVERLAY & TIER VARIABLES
   ==================================================================== */
#countdownOverlay {
  --rise: 3vh;          /* how far the horizon has risen */
  --dawn: 0.22;         /* intensity of the dawn glow */
  --key: 0.55;          /* intensity of the top key light */
  --bar: 0px;           /* letterbox bar height */
  --grain: 0.05;        /* film grain amount */

  --ink: #06090E;
  --gold: #D4AF37;
  --gold-light: #F3E5AB;
  --champagne: #FDF8E2;
  --serif: 'Instrument Serif', 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-cinema: cubic-bezier(0.77, 0, 0.18, 1);

  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: clamp(1rem, 2.8vh, 1.9rem) clamp(1.25rem, 4vw, 3.5rem);
  box-sizing: border-box;
  overflow: hidden;
  background: var(--ink);
  color: #F5F2EA;
  font-family: var(--sans);
  user-select: none;
  -webkit-font-smoothing: antialiased;
  transition:
    opacity 1.4s var(--ease-out),
    transform 1.6s var(--ease-out),
    filter 1.4s var(--ease-out);
}

#countdownOverlay[data-tier="30d"] {
  --rise: 10vh;
  --dawn: 0.5;
  --key: 0.75;
}

#countdownOverlay[data-tier="10d"] {
  --rise: 15vh;
  --dawn: 0.78;
  --key: 0.9;
  --bar: clamp(26px, 4.6vh, 56px);
  --grain: 0.06;
}

#countdownOverlay[data-tier="1d"] {
  --rise: 20vh;
  --dawn: 1;
  --key: 1;
  --bar: clamp(44px, 8.5vh, 104px);
  --grain: 0.07;
}

#countdownOverlay.countdown-finished {
  opacity: 0;
  transform: scale(1.06);
  filter: blur(16px) brightness(1.6);
  pointer-events: none;
}

/* ====================================================================
   ATMOSPHERE
   ==================================================================== */
.cd-atmosphere {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.cd-light {
  position: absolute;
  pointer-events: none;
  transition: opacity 2.4s ease;
}

/* Soft stage light falling from above */
.cd-light-key {
  top: -35vh;
  left: 50%;
  width: 110vw;
  height: 120vh;
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse 38% 55% at 50% 0%,
    rgba(243, 229, 171, 0.13) 0%,
    rgba(212, 175, 55, 0.05) 45%,
    transparent 75%
  );
  opacity: var(--key);
}

.cd-light-key.is-pulse {
  animation: keyPulse 1s ease-out;
}

/* Brand colour, barely there */
.cd-light-cool {
  top: -10%;
  right: -12%;
  width: 60vw;
  height: 60vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.09) 0%, transparent 62%);
  filter: blur(40px);
  animation: driftA 22s ease-in-out infinite alternate;
}

.cd-light-emerald {
  bottom: -18%;
  left: -14%;
  width: 55vw;
  height: 55vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.07) 0%, transparent 62%);
  filter: blur(40px);
  animation: driftB 26s ease-in-out infinite alternate;
}

/* The dawn glow sitting just above the horizon line */
.cd-dawn {
  position: absolute;
  left: 50%;
  top: calc(100% - var(--rise));
  width: 130vw;
  height: 90vh;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(ellipse 30% 22% at 50% 50%, rgba(255, 242, 210, 0.42) 0%, transparent 70%),
    radial-gradient(ellipse 55% 45% at 50% 50%, rgba(232, 200, 96, 0.22) 0%, rgba(212, 175, 55, 0.08) 45%, transparent 72%);
  opacity: var(--dawn);
  transition: top 2.8s var(--ease-cinema), opacity 2.8s ease;
}

/* The planetary horizon — a dark disc with a rim of light */
.cd-horizon {
  position: absolute;
  left: 50%;
  top: calc(100% - var(--rise));
  width: 260vw;
  height: 260vw;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse 50% 50% at 50% 0%, #0B0F18 0%, #05070B 6%, #04060A 30%);
  box-shadow:
    0 -1px 0 rgba(255, 240, 205, calc(0.18 + var(--dawn) * 0.4)),
    0 -14px 50px -12px rgba(243, 229, 171, calc(var(--dawn) * 0.45)),
    0 -60px 160px -40px rgba(212, 175, 55, calc(var(--dawn) * 0.35));
  transition: top 2.8s var(--ease-cinema), box-shadow 2.8s ease;
}

.cd-horizon::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border-top: 1.5px solid rgba(255, 248, 228, 0.95);
  opacity: calc(0.25 + var(--dawn) * 0.75);
  -webkit-mask-image: radial-gradient(ellipse 16% 4% at 50% 0%, #000 0%, transparent 100%);
  mask-image: radial-gradient(ellipse 16% 4% at 50% 0%, #000 0%, transparent 100%);
  transition: opacity 2.8s ease;
}

/* Embers canvas */
.cd-embers {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.cd-vignette {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: radial-gradient(ellipse 75% 70% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.62) 100%);
}

/* Cinema letterbox */
.cd-letterbox {
  position: absolute;
  left: 0;
  right: 0;
  height: var(--bar);
  z-index: 6;
  background: #000;
  pointer-events: none;
  transition: height 2s var(--ease-cinema);
}

.cd-letterbox-top {
  top: 0;
}

.cd-letterbox-bottom {
  bottom: 0;
}

/* Film grain */
.cd-grain {
  position: absolute;
  inset: -60%;
  z-index: 9;
  pointer-events: none;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  animation: grain 1s steps(8) infinite;
  transition: opacity 2s ease;
}

/* ====================================================================
   TOP BAR
   ==================================================================== */
.cd-topbar {
  position: relative;
  z-index: 8;
  width: 100%;
  max-width: 1280px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cd-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #F8FAFC;
}

.cd-brand img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.cd-date {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.55);
  font-variant-numeric: tabular-nums;
}

.cd-date-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.8);
  animation: breathe 2.6s ease-in-out infinite;
}

/* ====================================================================
   STAGE & EDITORIAL TYPE
   ==================================================================== */
.cd-stage {
  position: relative;
  z-index: 7;
  width: 100%;
  max-width: 1200px;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: opacity 0.9s var(--ease-out), transform 1.2s var(--ease-out), filter 0.9s ease;
}

.cd-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1.4rem;
  font-size: clamp(0.64rem, 0.95vw, 0.74rem);
  font-weight: 500;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: rgba(243, 229, 171, 0.8);
  transition: opacity 0.8s ease;
}

.cd-eyebrow::before,
.cd-eyebrow::after {
  content: '';
  width: clamp(24px, 4vw, 48px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.6));
}

.cd-eyebrow::after {
  background: linear-gradient(270deg, transparent, rgba(212, 175, 55, 0.6));
}

.cd-title {
  margin: 0 0 clamp(2rem, 5vh, 3.4rem);
  max-width: 14ch;
  font-family: var(--sans);
  font-size: clamp(2.3rem, 5.8vw, 5rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.048em;
  color: #F4F1EA;
  text-wrap: balance;
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.cd-title em {
  display: inline-block;
  padding: 0 0.06em 0.04em;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.14em;
  line-height: 0.9;
  letter-spacing: -0.01em;
  background: linear-gradient(180deg, #FFF8E4 8%, #EBCB74 58%, #B98F2B 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.cd-tagline {
  display: none;
  margin: 0 0 clamp(1.4rem, 3.4vh, 2.4rem);
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.5rem, 2.8vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--gold-light);
  text-shadow: 0 0 30px rgba(212, 175, 55, 0.35);
}

/* ====================================================================
   THE CLOCK — one slab of liquid glass, glass-filled numerals
   ==================================================================== */
.cd-clock-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  margin-bottom: clamp(1.8rem, 4.4vh, 3rem);
}

/* Anamorphic streak behind the clock (10d & 1d) */
.cd-clock-streak {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150vw;
  height: 2px;
  transform: translate(-50%, -50%) scaleX(0.2);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(212, 175, 55, 0.12) 22%,
    rgba(255, 240, 205, 0.7) 50%,
    rgba(212, 175, 55, 0.12) 78%,
    transparent 100%
  );
  box-shadow: 0 0 24px 2px rgba(212, 175, 55, 0.35), 0 0 70px 10px rgba(212, 175, 55, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 2s ease, transform 2.4s var(--ease-cinema);
}

.cd-clock {
  --mx: 50%;
  --my: 0%;
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-start;
  gap: clamp(0.7rem, 2.4vw, 2.4rem);
  padding: clamp(1rem, 2.2vw, 1.7rem) clamp(1.3rem, 3.4vw, 2.9rem) clamp(1rem, 2vw, 1.55rem);
  border-radius: clamp(20px, 2.4vw, 32px);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075) 0%, rgba(255, 255, 255, 0.015) 42%, rgba(255, 255, 255, 0.035) 100%),
    rgba(8, 12, 20, 0.38);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(255, 255, 255, 0.03),
    0 40px 90px -36px rgba(0, 0, 0, 0.95);
  transition: background 1.6s ease, border-color 1.6s ease, box-shadow 1.6s ease;
}

/* Gradient glass rim */
.cd-clock::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.32) 0%,
    rgba(255, 255, 255, 0.04) 30%,
    rgba(212, 175, 55, 0) 65%,
    rgba(212, 175, 55, 0.22) 100%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* Soft highlight following the cursor */
.cd-clock::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(255, 246, 222, 0.07), transparent 60%);
  pointer-events: none;
}

/* Light passing across the glass (30d onwards) */
.cd-clock-sheen {
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: -40%;
  right: -40%;
  z-index: 2;
  background: linear-gradient(
    105deg,
    transparent 42%,
    rgba(255, 255, 255, 0.07) 47%,
    rgba(255, 246, 220, 0.16) 50%,
    rgba(255, 255, 255, 0.07) 53%,
    transparent 58%
  );
  transform: translateX(-62%);
  opacity: 0;
  mix-blend-mode: screen;
  pointer-events: none;
}

.cd-unit {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cd-num {
  font-family: var(--sans);
  font-size: clamp(3.1rem, 7.6vw, 7rem);
  font-weight: 300;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  filter:
    drop-shadow(0 0 22px rgba(212, 175, 55, 0.16))
    drop-shadow(0 10px 22px rgba(0, 0, 0, 0.5));
  transition: filter 1.6s ease;
}

/* The digits roll like a drum; the mask hides the travel */
.cd-digits {
  display: flex;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 17%, #000 83%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 17%, #000 83%, transparent 100%);
}

.cd-digit {
  position: relative;
  display: block;
  width: 0.6em;
  height: 1.36em;
}

/* Liquid glass inside each numeral: bright crown, a refractive band, gold base */
.cd-glyph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  background: linear-gradient(
    180deg,
    #FFFFFF 24%,
    rgba(255, 255, 255, 0.95) 40%,
    rgba(253, 248, 226, 0.5) 49%,
    #FFFFFF 55%,
    #F2DFA6 67%,
    #C9A13B 80%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.cd-glyph.is-in {
  animation: glyphIn 0.8s var(--ease-out) both;
}

.cd-glyph.is-out {
  animation: glyphOut 0.6s cubic-bezier(0.55, 0, 0.75, 0.2) forwards;
}

.cd-label {
  margin-top: -0.15rem;
  padding-left: 0.34em;
  font-size: clamp(0.56rem, 0.85vw, 0.68rem);
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.42);
  transition: color 1.6s ease;
}

.cd-sep {
  position: relative;
  z-index: 1;
  align-self: stretch;
  width: 1px;
  margin: clamp(1.1rem, 2.4vw, 2.2rem) 0 clamp(1.8rem, 3.4vw, 3rem);
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.13), transparent);
}

/* ====================================================================
   DISCORD
   ==================================================================== */
.cd-discord {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.72rem 1.3rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: rgba(241, 245, 249, 0.82);
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  text-decoration: none;
  transition: all 0.35s var(--ease-out);
}

.cd-discord svg:first-child {
  color: #8C96F5;
}

.cd-discord:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(212, 175, 55, 0.45);
  color: #FFFFFF;
  transform: translateY(-2px);
}

.cd-discord-arrow {
  opacity: 0.6;
  transition: transform 0.35s var(--ease-out), opacity 0.35s ease;
}

.cd-discord:hover .cd-discord-arrow {
  opacity: 1;
  transform: translateX(3px);
}

/* ====================================================================
   FOOTER
   ==================================================================== */
.cd-footer {
  position: relative;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

.cd-signature {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.7);
}

.cd-signature em {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.45em;
  letter-spacing: 0;
  text-transform: none;
  color: var(--gold-light);
}

.cd-legal {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.7rem;
  color: rgba(148, 163, 184, 0.35);
}

.cd-legal a {
  color: rgba(203, 213, 225, 0.5);
  text-decoration: none;
  transition: color 0.2s ease;
}

.cd-legal a:hover {
  color: var(--gold);
}

/* ====================================================================
   READY? — FULL-BLEED, FINAL 24 HOURS
   ==================================================================== */
.cd-ready {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.6s ease, transform 1.4s var(--ease-out), filter 1.4s ease, visibility 0s linear 1.6s;
}

.cd-ready::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100vw;
  height: 70vh;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse 50% 45% at 50% 50%, rgba(212, 175, 55, 0.14), transparent 70%);
  filter: blur(20px);
}

.cd-ready-inner {
  position: relative;
  transition: transform 1.2s var(--ease-out);
}

.cd-ready-word {
  display: inline-flex;
  font-family: var(--sans);
  font-size: 24vw;
  font-weight: 800;
  line-height: 0.8;
  letter-spacing: -0.055em;
  white-space: nowrap;
  animation: readyBreathe 16s ease-in-out infinite alternate;
}

.cd-ready-word span {
  display: inline-block;
  background-image:
    linear-gradient(105deg, transparent 40%, rgba(255, 251, 238, 0.9) 50%, transparent 60%),
    linear-gradient(180deg, rgba(255, 249, 232, 0.62) 6%, rgba(243, 229, 171, 0.36) 40%, rgba(212, 175, 55, 0.16) 70%, rgba(212, 175, 55, 0.05) 100%);
  background-size: 320% 100%, 100% 100%;
  background-position: 170% 0, 0 0;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 238, 196, 0.3);
  opacity: 0;
}

/* ====================================================================
   FINAL 10 SECONDS
   ==================================================================== */
.cd-final {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease, visibility 0s linear 0.8s;
}

.cd-final-num {
  display: block;
  font-family: var(--sans);
  font-size: min(70vh, 58vw);
  font-weight: 200;
  line-height: 1;
  letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(
    180deg,
    #FFFFFF 16%,
    rgba(255, 255, 255, 0.95) 38%,
    rgba(253, 248, 226, 0.48) 49%,
    #FFFFFF 56%,
    #EED593 72%,
    #C9A13B 88%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.cd-final-num.is-tick {
  animation: finalTick 1s var(--ease-out) both;
}

/* ====================================================================
   TIER: <= 30 DAYS
   ==================================================================== */
#countdownOverlay[data-tier="30d"] .cd-clock-sheen {
  opacity: 1;
  animation: sheen 9s var(--ease-out) infinite;
}

#countdownOverlay[data-tier="30d"] .cd-clock {
  border-color: rgba(243, 229, 171, 0.1);
}

#countdownOverlay[data-tier="30d"] .cd-num {
  filter:
    drop-shadow(0 0 26px rgba(212, 175, 55, 0.24))
    drop-shadow(0 10px 22px rgba(0, 0, 0, 0.5));
}

/* ====================================================================
   TIER: <= 10 DAYS
   ==================================================================== */
#countdownOverlay[data-tier="10d"] .cd-clock-sheen {
  opacity: 1;
  animation: sheen 6.5s var(--ease-out) infinite;
}

#countdownOverlay[data-tier="10d"] .cd-clock-streak {
  opacity: 0.55;
  transform: translate(-50%, -50%) scaleX(1);
}

#countdownOverlay[data-tier="10d"] .cd-clock {
  border-color: rgba(243, 229, 171, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(243, 229, 171, 0.06),
    0 40px 90px -36px rgba(0, 0, 0, 0.95),
    0 0 60px -20px rgba(212, 175, 55, 0.25);
}

#countdownOverlay[data-tier="10d"] .cd-num {
  filter:
    drop-shadow(0 0 30px rgba(212, 175, 55, 0.32))
    drop-shadow(0 10px 22px rgba(0, 0, 0, 0.5));
}

#countdownOverlay[data-tier="10d"] .cd-label {
  color: rgba(243, 229, 171, 0.55);
}

/* ====================================================================
   TIER: FINAL 24 HOURS
   ==================================================================== */
#countdownOverlay[data-tier="1d"] .cd-ready {
  opacity: 1;
  visibility: visible;
  transition: opacity 1.6s ease, transform 1.4s var(--ease-out), filter 1.4s ease, visibility 0s;
}

#countdownOverlay[data-tier="1d"] .cd-ready-word span {
  animation:
    readyIn 2.4s var(--ease-out) both,
    readyShine 9s ease-in-out infinite;
  animation-delay:
    calc(0.2s + var(--i) * 0.12s),
    calc(3s + var(--i) * 0.14s);
}

#countdownOverlay[data-tier="1d"] .cd-eyebrow,
#countdownOverlay[data-tier="1d"] .cd-title {
  display: none;
}

#countdownOverlay[data-tier="1d"] .cd-tagline {
  display: block;
  animation: riseIn 1.6s var(--ease-out) 1.2s both;
}

#countdownOverlay[data-tier="1d"] .cd-unit[data-unit="days"],
#countdownOverlay[data-tier="1d"] .cd-sep-days {
  display: none;
}

#countdownOverlay[data-tier="1d"] .cd-clock-wrap {
  animation: riseIn 1.6s var(--ease-out) 0.9s both;
}

#countdownOverlay[data-tier="1d"] .cd-clock-streak {
  opacity: 0.95;
  transform: translate(-50%, -50%) scaleX(1);
}

#countdownOverlay[data-tier="1d"] .cd-clock {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.02) 42%, rgba(255, 255, 255, 0.04) 100%),
    rgba(6, 9, 14, 0.5);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  backdrop-filter: blur(28px) saturate(160%);
  border-color: rgba(243, 229, 171, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(243, 229, 171, 0.08),
    0 50px 110px -40px rgba(0, 0, 0, 1),
    0 0 80px -24px rgba(212, 175, 55, 0.35);
}

#countdownOverlay[data-tier="1d"] .cd-clock-sheen {
  opacity: 1;
  animation: sheen 5s var(--ease-out) infinite;
}

#countdownOverlay[data-tier="1d"] .cd-num {
  font-size: clamp(3.6rem, 9vw, 8.4rem);
  filter:
    drop-shadow(0 0 34px rgba(212, 175, 55, 0.4))
    drop-shadow(0 12px 26px rgba(0, 0, 0, 0.6));
}

#countdownOverlay[data-tier="1d"] .cd-label {
  color: rgba(243, 229, 171, 0.62);
}

#countdownOverlay[data-tier="1d"] .cd-discord {
  animation: riseIn 1.6s var(--ease-out) 1.5s both;
}

/* ====================================================================
   FINAL 10 SECONDS STATE
   ==================================================================== */
#countdownOverlay[data-final="true"] .cd-stage {
  opacity: 0;
  transform: scale(0.94);
  filter: blur(8px);
  pointer-events: none;
}

#countdownOverlay[data-final="true"] .cd-ready {
  opacity: 0.12;
  transform: scale(1.14);
  filter: blur(6px);
}

#countdownOverlay[data-final="true"] .cd-final {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.8s ease, visibility 0s;
}

/* ====================================================================
   REVEAL FLASH
   ==================================================================== */
.countdown-reveal-flash {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 55%, #FFFFFF 0%, #F3E5AB 30%, rgba(212, 175, 55, 0.5) 55%, rgba(6, 9, 14, 0) 85%);
  transition: opacity 0.7s ease-out;
}

.countdown-reveal-flash.flash-active {
  opacity: 0.92;
  transition: opacity 0.18s ease-in;
}

/* ====================================================================
   PREVIEW SWITCHER (local only, or Shift+P)
   ==================================================================== */
.countdown-phase-switcher {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1000001;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.3rem;
  border-radius: 9999px;
  background: rgba(10, 14, 22, 0.85);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  font-family: 'JetBrains Mono', monospace;
}

.phase-switcher-label {
  padding: 0 0.5rem 0 0.6rem;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748B;
}

.phase-switcher-btn {
  padding: 0.32rem 0.65rem;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: #CBD5E1;
  font-family: inherit;
  font-size: 0.64rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.phase-switcher-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #FFFFFF;
}

.phase-switcher-btn.active {
  background: linear-gradient(135deg, #F3E5AB, #D4AF37);
  color: #06090E;
}

/* ====================================================================
   KEYFRAMES
   ==================================================================== */
@keyframes glyphIn {
  from {
    opacity: 0;
    transform: translateY(40%);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes glyphOut {
  to {
    opacity: 0;
    transform: translateY(-40%);
    filter: blur(6px);
  }
}

@keyframes sheen {
  0% {
    transform: translateX(-62%);
  }
  38%,
  100% {
    transform: translateX(62%);
  }
}

@keyframes readyIn {
  from {
    opacity: 0;
    transform: translateY(12%) scale(1.06);
    filter: blur(26px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes readyShine {
  0% {
    background-position: 170% 0, 0 0;
  }
  42%,
  100% {
    background-position: -70% 0, 0 0;
  }
}

@keyframes readyBreathe {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.03);
  }
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(18px);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes finalTick {
  0% {
    opacity: 0;
    transform: scale(1.22);
    filter: blur(22px) drop-shadow(0 0 60px rgba(212, 175, 55, 0.5));
  }
  20% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0) drop-shadow(0 0 60px rgba(212, 175, 55, 0.5));
  }
  100% {
    opacity: 0.35;
    transform: scale(0.93);
    filter: blur(2px) drop-shadow(0 0 30px rgba(212, 175, 55, 0.25));
  }
}

@keyframes keyPulse {
  0% {
    opacity: calc(var(--key) * 1.35);
  }
  100% {
    opacity: var(--key);
  }
}

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

@keyframes driftA {
  to {
    transform: translate(-6vw, 5vh);
  }
}

@keyframes driftB {
  to {
    transform: translate(5vw, -4vh);
  }
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  12% { transform: translate(-3%, 2%); }
  25% { transform: translate(2%, -4%); }
  37% { transform: translate(-4%, -1%); }
  50% { transform: translate(3%, 3%); }
  62% { transform: translate(-1%, 4%); }
  75% { transform: translate(4%, -2%); }
  87% { transform: translate(-2%, -3%); }
  100% { transform: translate(0, 0); }
}

/* ====================================================================
   RESPONSIVE
   ==================================================================== */
@media (max-width: 760px) {
  #countdownOverlay {
    padding: 1rem 1rem 1.1rem;
  }

  .cd-date {
    font-size: 0.6rem;
    letter-spacing: 0.14em;
  }

  .cd-title {
    font-size: clamp(2rem, 9vw, 2.8rem);
  }

  .cd-clock {
    gap: 0.55rem;
    padding: 0.85rem 1rem 0.9rem;
    border-radius: 20px;
  }

  .cd-num,
  #countdownOverlay[data-tier="1d"] .cd-num {
    font-size: clamp(2.3rem, 11vw, 3.4rem);
  }

  #countdownOverlay[data-tier="1d"] .cd-num {
    font-size: clamp(2.8rem, 14vw, 4.2rem);
  }

  .cd-label {
    font-size: 0.52rem;
    letter-spacing: 0.2em;
  }

  .cd-sep {
    margin: 0.9rem 0 1.5rem;
  }

  .cd-legal {
    flex-wrap: wrap;
    justify-content: center;
  }

  .countdown-phase-switcher {
    right: 50%;
    transform: translateX(50%);
    white-space: nowrap;
  }

  .phase-switcher-label {
    display: none;
  }
}

@media (max-height: 640px) {
  .cd-eyebrow {
    margin-bottom: 0.8rem;
  }

  .cd-title {
    margin-bottom: 1.2rem;
    font-size: clamp(1.8rem, 4.4vw, 2.6rem);
  }

  .cd-clock-wrap {
    margin-bottom: 1rem;
  }
}

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