/* ---------- Base ---------- */
:root {
  --cream: #F2EBDD;
  --ink:   #1A1612;
  --ink-soft: #3B2F1F;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--cream);
  color: var(--ink);
  font-family: 'EB Garamond', Georgia, serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Layout ---------- */
.stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto auto auto;
  align-items: center;
  justify-items: center;
  padding: clamp(28px, 4vw, 48px) 24px;
  gap: clamp(16px, 3vh, 40px);
  text-align: center;
}

/* ---------- Top & bottom labels ---------- */
.topline,
.progress-labels {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.tagline {
  font-style: italic;
  font-size: clamp(16px, 2vw, 20px);
  color: var(--ink-soft);
}

/* ---------- Ball + shadow ---------- */
.ball-wrap {
  position: relative;
  width: 260px;
  height: 260px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.bounce {
  position: absolute;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  animation: bounce 1.2s cubic-bezier(.5, 0, .5, 1) infinite;
  transform-origin: 50% 100%;
}

.spin {
  animation: spin 2.4s linear infinite;
  transform-origin: 50% 50%;
  width: 200px;
  height: 200px;
}

.spin svg { display: block; width: 100%; height: 100%; }

.shadow {
  position: absolute;
  left: 50%;
  bottom: 20px;
  width: 140px;
  height: 18px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse,
              rgba(26, 22, 18, 0.35),
              rgba(26, 22, 18, 0) 70%);
  animation: shadow 1.2s cubic-bezier(.5, 0, .5, 1) infinite;
  transform-origin: 50% 50%;
}

@keyframes bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, -40px); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shadow {
  0%, 100% { transform: translateX(-50%) scaleX(1);   opacity: 0.9; }
  50%      { transform: translateX(-50%) scaleX(0.6); opacity: 0.5; }
}

/* ---------- Headline ---------- */
.headline {
  margin: 0;
  font-family: 'EB Garamond', Georgia, serif;
  font-weight: 500;
  font-size: clamp(64px, 12vw, 140px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.headline em { font-style: italic; }

.dots { animation: dots 1.6s ease-in-out infinite; }

@keyframes dots {
  0%, 20% { opacity: 0.2; }
  50%     { opacity: 1;   }
  100%    { opacity: 0.2; }
}

/* ---------- Progress ---------- */
.progress {
  width: min(560px, 88vw);
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 11px;
  letter-spacing: 0.24em;
}

.progress-track {
  height: 2px;
  background: rgba(26, 22, 18, 0.18);
  position: relative;
  overflow: hidden;
}

.progress-bar {
  position: absolute;
  top: 0; bottom: 0;
  width: 40%;
  background: var(--ink);
  animation: bar 3.5s cubic-bezier(.65, .05, .35, 1) infinite;
}

@keyframes bar {
  0%   { transform: translateX(-100%); }
  60%  { transform: translateX(60%); }
  100% { transform: translateX(260%); }
}

/* ---------- Motion safety ---------- */
@media (prefers-reduced-motion: reduce) {
  .bounce, .spin, .shadow, .dots, .progress-bar {
    animation-duration: 0s;
    animation-iteration-count: 1;
  }
  .spin { animation: spin 8s linear infinite; }
}
