:root {
  --bg-base:        #06080F;
  --primary:        #635BFF;
  --accent1:        #00F5FF;
  --accent2-deco:   #AAFF4D;
  --text-primary:   #EEF2FF;
  --text-secondary: #7080AA;
  --text-muted:     #2E3D60;
}

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

html, body {
  height: 100%;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Instrument Sans', system-ui, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.bg {
  position: absolute;
  inset: 0;
  background: var(--bg-base);
  z-index: 0;
}

/* Layer 2 — Glows + rings */
.ambience { position: absolute; inset: 0; z-index: 1; pointer-events: none; }

.glow {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: blur(20px);
}
.glow--outer {
  width: 650px;
  height: 650px;
  background: radial-gradient(
    circle,
    rgba(99,91,255,0.18) 0%,
    rgba(0,245,255,0.08) 35%,
    rgba(99,91,255,0.04) 60%,
    transparent 75%
  );
  /* Slow clockwise orbit around viewport center (90 x 60 px ellipse). */
  animation: drift-outer 14s ease-in-out infinite;
}
.glow--inner {
  width: 350px;
  height: 350px;
  background: radial-gradient(
    circle,
    rgba(99,91,255,0.12) 0%,
    rgba(99,91,255,0.05) 50%,
    transparent 75%
  );
  /* Counter-clockwise orbit (50 x 35 px) at a different period — the glows
     appear loosely tethered: usually on opposite sides of center, but the
     14:11 ratio means they never repeat the exact same configuration. */
  animation: drift-inner 11s ease-in-out infinite 1.5s;
}

.ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.ring--1 {
  width: 900px;
  height: 900px;
  border: 1px solid rgba(99,91,255,0.06);
  animation: ring-pulse 16s ease-in-out infinite;
}
.ring--2 {
  width: 500px;
  height: 500px;
  border: 1px solid rgba(0,245,255,0.05);
  animation: ring-pulse 16s ease-in-out infinite 6s;
}

/* Fog canvases */
.fog {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.fog--back  { z-index: 2; }
.fog--front { z-index: 5; }

/* Layer 4 — Counter watermark, sits clearly below the logo, slightly offset right */
.watermark {
  position: absolute;
  top: 66%;
  left: 54%;
  transform: translate(-50%, -50%);
  z-index: 3;
  text-align: center;
  pointer-events: none;
  font-family: 'JetBrains Mono', monospace;
  opacity: 0;
  animation: fade-up 2s ease-out 0.3s forwards;
  white-space: nowrap;
}
.wm-days {
  font-size: 120px;
  font-weight: 400;
  line-height: 0.95;
  color: rgba(99,91,255,0.08);
  letter-spacing: -0.02em;
}
.wm-time {
  margin-top: 12px;
  font-size: 38px;
  color: rgba(99,91,255,0.06);
  letter-spacing: 0.02em;
}
.wm-time .wm-colon {
  font-size: 28px;
  color: rgba(99,91,255,0.04);
  margin: 0 6px;
  vertical-align: 2px;
}
.wm-seconds {
  color: rgba(0,245,255,0.07);
}
.wm-labels {
  margin-top: 18px;
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 9px;
  letter-spacing: 0.28em;
  color: rgba(99,91,255,0.10);
  text-transform: uppercase;
  display: flex;
  justify-content: center;
  gap: 32px;
}
.wm-label-time { display: inline-flex; gap: 24px; }
.wm-label-gap { width: 0; }

/* Layer 5 — Logo */
.logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  animation: fade-up 2s ease-out 1s forwards;
}
.logo-svg {
  height: 58px;
  width: auto;
  display: block;
}
.logo-mark {
  filter:
    drop-shadow(0 0 16px rgba(99,91,255,0.5))
    drop-shadow(0 0 40px rgba(99,91,255,0.2));
}
.logo-word path {
  fill: var(--text-primary);
}

/* Layer 7 — Footer */
.footer {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0;
  animation: fade-up 2s ease-out 2s forwards;
}
.footer-line {
  width: 1px;
  height: 32px;
  background: linear-gradient(to bottom, rgba(99,91,255,0.35), transparent);
}
.footer-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 400;
  color: rgba(112,128,170,0.35);
  letter-spacing: 0.14em;
}

/* Animations */
@keyframes fade-up {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 18px)); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}
.footer { animation-name: fade-up-footer; }
@keyframes fade-up-footer {
  from { opacity: 0; transform: translate(-50%, 18px); }
  to   { opacity: 1; transform: translateX(-50%); }
}

@keyframes breathe {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1;   transform: translate(-50%, -50%) scale(1.3); }
}

/* Drift = orbit + breathe. Translate offsets trace an ellipse around
   center; scale/opacity oscillate independently of the orbit so the
   glow doesn't pulse exactly at the cardinal points. */
@keyframes drift-outer {
  0%   { transform: translate(calc(-50% + 90px), calc(-50% +   0px)) scale(1.00); opacity: 0.55; }
  25%  { transform: translate(calc(-50% +  0px), calc(-50% +  60px)) scale(1.18); opacity: 0.85; }
  50%  { transform: translate(calc(-50% - 90px), calc(-50% +   0px)) scale(1.30); opacity: 1.00; }
  75%  { transform: translate(calc(-50% +  0px), calc(-50% -  60px)) scale(1.18); opacity: 0.85; }
  100% { transform: translate(calc(-50% + 90px), calc(-50% +   0px)) scale(1.00); opacity: 0.55; }
}

@keyframes drift-inner {
  0%   { transform: translate(calc(-50% - 50px), calc(-50% +   0px)) scale(1.00); opacity: 0.55; }
  25%  { transform: translate(calc(-50% +  0px), calc(-50% -  35px)) scale(1.18); opacity: 0.85; }
  50%  { transform: translate(calc(-50% + 50px), calc(-50% +   0px)) scale(1.30); opacity: 1.00; }
  75%  { transform: translate(calc(-50% +  0px), calc(-50% +  35px)) scale(1.18); opacity: 0.85; }
  100% { transform: translate(calc(-50% - 50px), calc(-50% +   0px)) scale(1.00); opacity: 0.55; }
}

@keyframes ring-pulse {
  0%, 100% { opacity: 0.15; transform: translate(-50%, -50%) scale(0.8); }
  50%      { opacity: 0.6;  transform: translate(-50%, -50%) scale(1.2); }
}

/* Responsive */
@media (max-width: 768px) {
  .wm-days { font-size: 80px; }
  .wm-time { font-size: 28px; }
  .wm-time .wm-colon { font-size: 20px; }
  .wm-labels { font-size: 8px; gap: 20px; letter-spacing: 0.22em; }
  .wm-label-time { gap: 16px; }
  .logo-svg { height: 44px; }
  .glow--outer { width: 420px; height: 420px; }
  .glow--inner { width: 240px; height: 240px; }
  .ring--1 { width: 600px; height: 600px; }
  .ring--2 { width: 340px; height: 340px; }
}

@media (max-width: 400px) {
  .wm-days { font-size: 60px; }
  .wm-time { font-size: 22px; }
  .wm-time .wm-colon { font-size: 16px; }
  .wm-labels { font-size: 7px; gap: 14px; }
  .wm-label-time { gap: 10px; }
  .logo-svg { height: 36px; }
  .glow--outer { width: 320px; height: 320px; }
  .ring--1 { width: 460px; height: 460px; }
  .ring--2 { width: 260px; height: 260px; }
}

@media (prefers-reduced-motion: reduce) {
  .glow, .ring, .watermark, .logo, .footer { animation: none !important; opacity: 1 !important; }
  .logo, .watermark { transform: translate(-50%, -50%); }
  .footer { transform: translateX(-50%); }
}
