:root {
  color-scheme: dark;
  --ink: #f8f4ea;
  --muted: #c9bd9c;
  --panel: rgba(20, 22, 24, 0.82);
  --panel-strong: rgba(12, 13, 15, 0.94);
  --line: rgba(255, 255, 255, 0.16);
  --yellow: #ffd34f;
  --pink: #ff4d8d;
  --cyan: #41d9ff;
  --green: #80ff72;
  --black: #07080a;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #101112;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, rgba(65, 217, 255, 0.2), transparent 28rem),
    radial-gradient(circle at 88% 4%, rgba(255, 211, 79, 0.18), transparent 24rem),
    linear-gradient(145deg, #131313 0%, #1f1914 38%, #0b1012 100%);
  overflow-x: hidden;
}

button {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.counter-stage {
  position: relative;
  display: grid;
  min-height: calc(100vh - 56px);
  align-items: center;
  isolation: isolate;
}

.counter-stage::before {
  position: absolute;
  inset: 34px 0 auto;
  height: 62%;
  content: "";
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent);
  z-index: -3;
}

.motion-proof {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 18px;
  object-fit: cover;
  opacity: 0.16;
  pointer-events: none;
  z-index: 0;
  filter: saturate(1.2) contrast(1.1);
}

.counter-panel {
  position: relative;
  overflow: hidden;
  width: min(720px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 5vw, 52px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02)),
    var(--panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  text-align: center;
  backdrop-filter: blur(18px);
  animation: panel-in 700ms ease both;
}

.counter-panel > :not(.motion-proof) {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--yellow);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  max-width: 12ch;
  margin: 0 auto;
  font-family: "Archivo Black", Impact, sans-serif;
  font-size: clamp(3.1rem, 11vw, 8.5rem);
  line-height: 0.86;
  letter-spacing: 0;
  text-wrap: balance;
  text-transform: uppercase;
  text-shadow:
    0.04em 0.04em 0 var(--pink),
    -0.035em -0.02em 0 var(--cyan),
    0 0 38px rgba(255, 211, 79, 0.22);
}

.quote-mark {
  width: 58px;
  height: 58px;
  margin: 24px auto 0;
  border: 2px solid var(--yellow);
  border-radius: 50%;
  color: var(--yellow);
  font-family: Georgia, serif;
  font-size: 4rem;
  line-height: 78px;
  transform: rotate(-8deg);
  animation: wobble 2.6s ease-in-out infinite;
}

.count-readout {
  display: grid;
  gap: 0;
  justify-items: center;
  margin: 24px auto 26px;
}

.count-number {
  font-size: clamp(5rem, 18vw, 11rem);
  font-weight: 900;
  line-height: 0.9;
  color: var(--green);
  text-shadow: 0 0 34px rgba(128, 255, 114, 0.34);
  font-variant-numeric: tabular-nums;
}

.count-number.bump {
  animation: count-bump 360ms cubic-bezier(0.2, 1.8, 0.25, 1) both;
}

.count-label {
  color: var(--muted);
  font-size: clamp(0.95rem, 2.6vw, 1.2rem);
  font-weight: 900;
  text-transform: uppercase;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.primary-button,
.ghost-button {
  position: relative;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 900;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.primary-button {
  min-width: min(100%, 220px);
  color: #111;
  background: var(--yellow);
  box-shadow: 0 12px 0 #9b6f00;
}

.primary-button:hover {
  transform: translateY(-3px) rotate(-1deg);
  box-shadow: 0 15px 0 #9b6f00;
}

.primary-button:active {
  transform: translateY(8px);
  box-shadow: 0 4px 0 #9b6f00;
}

.ghost-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--line);
}

.ghost-button:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.14);
}

.photo-cloud {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

.cloud-photo {
  position: absolute;
  width: clamp(92px, 17vw, 190px);
  aspect-ratio: 1;
  border: 4px solid rgba(255, 255, 255, 0.84);
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.36);
  filter: saturate(1.15) contrast(1.06);
  animation: float-photo 5.8s ease-in-out infinite;
}

.cloud-photo-a {
  top: 7%;
  left: 4%;
  transform: rotate(-12deg);
}

.cloud-photo-b {
  top: 8%;
  right: 7%;
  transform: rotate(10deg);
  animation-delay: -1.2s;
}

.cloud-photo-c {
  right: 0;
  bottom: 17%;
  transform: rotate(-7deg);
  animation-delay: -2.1s;
}

.cloud-photo-d {
  bottom: 10%;
  left: 2%;
  transform: rotate(8deg);
  animation-delay: -3s;
}

.cloud-photo-e {
  top: 42%;
  left: 0;
  width: clamp(56px, 9vw, 92px);
  transform: rotate(-18deg);
  animation-delay: -4s;
}

.burst-layer {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  overflow: hidden;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 18px;
  border-radius: 2px;
  animation: confetti-fall 900ms ease-out forwards;
}

.flying-photo {
  position: absolute;
  width: 72px;
  height: 72px;
  border: 3px solid white;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  animation: photo-pop 850ms ease-out forwards;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
}

@keyframes wobble {
  0%,
  100% {
    transform: rotate(-8deg) translateY(0);
  }
  50% {
    transform: rotate(7deg) translateY(-6px);
  }
}

@keyframes count-bump {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.18) rotate(-2deg);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes float-photo {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -14px;
  }
}

@keyframes confetti-fall {
  to {
    opacity: 0;
    transform: translate(var(--x), var(--y)) rotate(var(--r));
  }
}

@keyframes photo-pop {
  to {
    opacity: 0;
    transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(0.72);
  }
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 20px, 680px);
    padding-top: 18px;
  }

  .counter-stage {
    min-height: calc(100vh - 36px);
  }

  .counter-panel {
    margin-top: 56px;
  }

  .cloud-photo {
    opacity: 0.7;
  }
}

@media (max-width: 520px) {
  .counter-stage {
    min-height: calc(100vh - 36px);
  }

  .counter-panel {
    padding: 22px 14px;
  }

  .button-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .primary-button {
    width: 100%;
  }

  .ghost-button {
    width: 100%;
  }

  .cloud-photo-a,
  .cloud-photo-b {
    top: 0;
  }

  .cloud-photo-c,
  .cloud-photo-d {
    bottom: 2%;
  }
}

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