:root {
  --black: #000000;
  --red: #d9112f;
  --red-deep: #8f0a1f;
  --purple: #7c3aed;
  --white: #ffffff;
  --muted: rgba(255, 255, 255, 0.62);
  --font: "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
}

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

html,
body {
  width: 100%;
  height: 100%;
  background: var(--black);
  color: var(--white);
  font-family: var(--font);
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  /* Very faint purple floor-light, kept sparing */
  background:
    radial-gradient(ellipse 60% 28% at 50% 108%, rgba(124, 58, 237, 0.16), transparent 70%),
    var(--black);
}

.stage {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(0.4rem, 1.6vh, 1rem);
}

.brand {
  font-size: clamp(1.6rem, 6vw, 3rem);
  font-weight: 800;
  letter-spacing: 0.5em;
  padding-left: 0.5em; /* optically balances trailing letter-spacing */
  color: var(--red);
  text-shadow: 0 0 22px rgba(217, 17, 47, 0.55);
}

.title {
  font-size: clamp(0.72rem, 2.6vw, 1.05rem);
  font-weight: 500;
  letter-spacing: 0.42em;
  padding-left: 0.42em;
  color: var(--muted);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--purple);
  border-image: linear-gradient(90deg, transparent, var(--purple), transparent) 1;
}

/* The day counter is the largest element on screen. */
.counter {
  position: relative;
  max-width: 100%;
  margin-top: clamp(1rem, 5vh, 3rem);
  display: flex;
  justify-content: center;
  align-items: center;
}

.days {
  --chars: 1;
  position: relative;
  z-index: 1;
  display: block;
  max-width: 100%;
  font-size: min(34vw, 40vh, calc(150vw / var(--chars)));
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  color: var(--white);
  white-space: nowrap;
  text-shadow:
    0 0 18px rgba(217, 17, 47, 0.7),
    0 0 60px rgba(217, 17, 47, 0.38);
}

/* One slow breathing glow — the only ambient motion (opacity only, cheap). */
.glow {
  position: absolute;
  inset: -12% -8%;
  z-index: 0;
  background: radial-gradient(ellipse at center, rgba(143, 10, 31, 0.5), transparent 68%);
  opacity: 0.55;
  animation: breathe 7s ease-in-out infinite;
  pointer-events: none;
}

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

.unit {
  margin-top: clamp(0.2rem, 1vh, 0.6rem);
  font-size: clamp(1.1rem, 4.4vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.7em;
  padding-left: 0.7em;
  color: var(--red);
  text-shadow: 0 0 16px rgba(217, 17, 47, 0.5);
}

.journey {
  position: fixed;
  left: 0;
  right: 0;
  bottom: max(0.9rem, env(safe-area-inset-bottom));
  text-align: center;
  font-size: clamp(0.62rem, 2vw, 0.8rem);
  letter-spacing: 0.3em;
  color: rgba(255, 255, 255, 0.34);
  pointer-events: none;
}

/* Landscape phones: tighten vertical rhythm so nothing scrolls. */
@media (orientation: landscape) and (max-height: 520px) {
  .brand {
    font-size: clamp(1.1rem, 4vh, 1.6rem);
  }
  .title {
    font-size: 0.65rem;
    padding-bottom: 0.25rem;
  }
  .counter {
    margin-top: 0.4rem;
  }
  .days {
    font-size: min(30vw, 44vh, calc(150vw / var(--chars)));
  }
  .unit {
    font-size: 1rem;
  }
  .journey {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .glow {
    animation: none;
    opacity: 0.5;
  }
}
