/* The NabiGlow waitlist in Midnight: the hero with the floating phone and
   the sign-up form, the reward page (welcome.html) and the leave page (unsubscribe.html).
   Colours come from site.css. Motion uses transform, opacity and clip-path
   only, and every animation has a calm version for Reduce Motion. */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ───────────── Hero ───────────── */

.hero-wl .hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(24px, 4vw, 72px);
  min-height: min(820px, calc(100svh - var(--header-h) - 24px));
  padding: clamp(32px, 5vh, 72px) clamp(20px, 6vw, 120px);
}

.hero-wl .hero-copy {
  justify-items: start;
  gap: 20px;
  max-width: 620px;
  margin: 0;
  text-align: left;
}

.hero-wl .display {
  font-size: clamp(42px, 5.6vw, 84px);
}

.hero-wl .hero-copy .lead {
  max-width: 480px;
}

.hero-wl .hero-note {
  max-width: 440px;
}

.launch-pill b {
  font-weight: 600;
}

/* ───────────── The sign-up form ───────────── */

.wl {
  --wl-r: 999px;
  display: grid;
  gap: 14px;
  width: min(520px, 100%);
  margin-top: 6px;
  scroll-margin-top: calc(var(--header-h) + 40px);
}

.wl-field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--glass-line);
  border-radius: var(--wl-r);
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: var(--shadow-soft), inset 0 0 0 1px var(--line);
  transition: box-shadow 0.3s var(--ease);
}

.wl-field:focus-within {
  box-shadow: var(--shadow-soft), inset 0 0 0 2px var(--accent);
}

.wl-input {
  flex: 1;
  min-width: 0;
  height: 52px;
  padding: 0 8px 0 20px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  outline: none;
  transition: opacity 0.3s ease;
}

.wl-input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.wl-btn {
  flex: none;
  overflow: hidden;
}

.wl-btn-label {
  transition: opacity 0.25s ease, transform 0.35s var(--ease);
}

.wl-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(2, 42, 29, 0.3);
  border-top-color: var(--on-accent);
  border-radius: 50%;
  opacity: 0;
  animation: wl-spin 0.8s linear infinite paused;
  transition: opacity 0.25s ease;
}

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

.wl.is-sending .wl-btn-label {
  opacity: 0;
  transform: scale(0.9);
}

.wl.is-sending .wl-spinner {
  opacity: 1;
  animation-play-state: running;
}

.wl.is-sending .wl-input {
  opacity: 0.6;
}

/* The morph: a green layer the exact shape of the button opens out over the
   whole field (clip-path set from the button's place by waitlist.js). */
.wl-done {
  position: absolute;
  z-index: 2;
  inset: -1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: var(--wl-r);
  background: var(--gradient);
  color: var(--on-accent);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  visibility: hidden;
  clip-path: inset(var(--ct, 0px) var(--cr, 0px) var(--cb, 0px) var(--cl, 60%) round var(--wl-r));
  transition: clip-path 0.75s var(--ease), visibility 0s linear 0.75s;
}

.wl.is-done .wl-done {
  visibility: visible;
  clip-path: inset(0 0 0 0 round var(--wl-r));
  transition: clip-path 0.75s var(--ease), visibility 0s;
}

.wl-done-text {
  opacity: 0;
  transform: translateY(8px);
}

.wl.is-done .wl-done-text {
  animation: rise-in 0.6s var(--ease) 0.4s forwards;
}

.env {
  flex: none;
  opacity: 0;
  overflow: visible;
}

.wl.is-done .env {
  animation: env-in 0.8s var(--ease) 0.3s forwards;
}

.env-flap {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
}

.wl.is-done .env-flap {
  animation: env-flap 0.5s ease-out 0.85s forwards;
}

.env-dot {
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0);
}

.wl.is-done .env-dot {
  animation: env-dot 0.5s var(--ease) 1.25s forwards;
}

@keyframes env-in {
  from {
    opacity: 0;
    transform: translate3d(-34px, 6px, 0) rotate(-16deg);
  }
  60% {
    opacity: 1;
    transform: translate3d(3px, -2px, 0) rotate(4deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes env-flap {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes env-dot {
  from {
    transform: scale(0);
  }
  60% {
    transform: scale(1.35);
  }
  to {
    transform: scale(1);
  }
}

.wl.is-shaking .wl-field {
  animation: wl-shake 0.45s ease;
}

@keyframes wl-shake {
  20% {
    transform: translateX(-7px);
  }
  40% {
    transform: translateX(6px);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(2px);
  }
}

/* A soft ring when a "Join the waitlist" button brings you here. */
.wl.is-called .wl-field {
  animation: wl-call 1.1s var(--ease);
}

@keyframes wl-call {
  30% {
    box-shadow: var(--shadow-soft), 0 0 0 6px rgba(47, 217, 154, 0.28);
  }
}

.wl-consent {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 4px 6px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
  transition: opacity 0.4s ease;
}

.wl-consent input {
  position: absolute;
  top: 4px;
  left: 6px;
  width: 24px;
  height: 24px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.wl-box {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  background: var(--glass);
  color: var(--on-accent);
  transition: border-color 0.25s ease, background-color 0.25s ease, transform 0.35s var(--ease);
}

.wl-box svg {
  transform: scale(0);
  transition: transform 0.4s var(--ease);
}

.wl-consent input:checked + .wl-box {
  border-color: transparent;
  background: var(--accent);
}

.wl-consent input:checked + .wl-box svg {
  transform: scale(1);
}

.wl-consent input:focus-visible + .wl-box {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wl-consent.is-missing .wl-box {
  border-color: var(--danger);
  transform: scale(1.12);
}

.wl-consent a {
  color: var(--ink);
  text-underline-offset: 3px;
}

.wl-msg {
  min-height: 21px;
  padding: 0 6px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}

.wl-msg:empty {
  min-height: 0;
  margin-top: -14px;
}

.wl-msg.is-error {
  color: var(--danger);
}

.wl-msg button,
.wl-back {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.wl.is-done .wl-consent {
  opacity: 0;
  pointer-events: none;
}

/* ───────────── After sign-up ───────────── */

/* The green layer is a button: once the envelope has landed, "Check your
   inbox" lifts away and "Open Gmail" (or the right app) rises in. */
.wl-done {
  margin: 0;
  padding: 0 20px;
  border: 0;
  font-family: inherit;
  text-align: center;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}

.wl-done-words {
  display: grid;
  min-width: 0;
}

.wl-done-words > span {
  grid-area: 1 / 1;
}

.wl-open-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transform: translate3d(0, 12px, 0);
  pointer-events: none;
}

.wl.is-done.is-openable .wl-done {
  cursor: pointer;
  box-shadow: 0 8px 34px rgba(var(--glow), 0.5);
  transition: clip-path 0.75s var(--ease), visibility 0s, transform 0.45s var(--spring), box-shadow 0.3s ease;
}

.wl.is-done.is-openable .wl-done-text {
  animation: words-out 0.4s var(--ease) forwards;
}

.wl.is-done.is-openable .wl-open-text {
  animation: words-in 0.6s var(--spring) 0.12s forwards;
}

.wl.is-done.is-openable .wl-done:hover {
  box-shadow: 0 10px 44px rgba(var(--glow), 0.65);
}

.wl.is-done.is-openable .wl-done:active {
  transform: scale(0.97);
}

.wl.is-done.is-openable .wl-done:focus-visible {
  outline: 2px solid #b8f5dc;
  outline-offset: 3px;
}

@keyframes words-out {
  from {
    opacity: 1;
    transform: none;
  }
  to {
    opacity: 0;
    transform: translate3d(0, -12px, 0);
  }
}

@keyframes words-in {
  from {
    opacity: 0;
    transform: translate3d(0, 12px, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* The consent line and the after-sign-up actions share one place, so the
   form never jumps: one fades out as the other rises in. */
.wl-swap {
  display: grid;
}

.wl-swap > * {
  grid-area: 1 / 1;
}

.wl-after {
  display: grid;
  gap: 10px;
  justify-items: start;
  padding: 0 6px;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, 10px, 0);
  transition: opacity 0.35s ease, transform 0.5s var(--ease), visibility 0s linear 0.5s;
}

.wl.is-done .wl-after {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.5s ease 0.9s, transform 0.7s var(--ease) 0.9s, visibility 0s;
}

.wl-after-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}

.wl-resend,
.wl-change {
  min-height: 44px;
  margin: 0;
  font: inherit;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.45s var(--spring), border-color 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}

.wl-resend {
  padding: 0 18px;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.wl-resend:hover:not([disabled]) {
  border-color: var(--line-strong);
}

.wl-resend[disabled] {
  color: var(--muted);
  cursor: default;
}

.wl-resend.is-sent {
  animation: resend-pop 0.6s var(--spring);
}

@keyframes resend-pop {
  40% {
    transform: scale(1.06);
  }
}

.wl-change {
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--text);
}

.wl-change-link {
  color: var(--ink);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgba(63, 224, 166, 0.6);
  text-underline-offset: 4px;
}

.wl-resend:active:not([disabled]),
.wl-change:active {
  transform: scale(0.95);
}

.wl-spam {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .wl-after {
    justify-items: center;
    text-align: center;
  }

  .wl-after-row {
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wl-after,
  .wl.is-done .wl-after {
    transform: none;
  }

  .wl.is-done.is-openable .wl-done-text {
    animation: fade-out 0.3s ease forwards;
  }

  .wl.is-done.is-openable .wl-open-text {
    animation: fade-only 0.3s ease 0.1s forwards;
    transform: none;
  }

  .wl-resend.is-sent,
  .wl.is-done.is-openable .wl-done:active,
  .wl-resend:active:not([disabled]),
  .wl-change:active {
    animation: none;
    transform: none;
  }
}

.wl-turnstile:empty {
  display: none;
}

.wl-return {
  justify-self: start;
  margin-left: 6px;
  font-size: 14px;
}

/* ───────────── The floating phone ───────────── */

.device-stage {
  --px: 0;
  --py: 0;
  --sp: 0;
  position: relative;
  display: grid;
  place-items: center;
  perspective: 1400px;
}

.device-float {
  position: relative;
  width: min(330px, 78%, calc((100svh - var(--header-h) - 150px) / 2.05));
  min-width: 230px;
  animation: device-bob 7s ease-in-out infinite alternate;
  transform-style: preserve-3d;
}

@keyframes device-bob {
  from {
    transform: translate3d(0, -8px, 0);
  }
  to {
    transform: translate3d(0, 10px, 0);
  }
}

.device {
  position: relative;
  padding: 9px;
  border-radius: 54px;
  background: linear-gradient(145deg, #2a302d, #0b0e0d 40%, #1c211f);
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.16),
    0 2px 3px rgba(11, 30, 24, 0.3),
    0 40px 80px -20px rgba(0, 0, 0, 0.7),
    0 0 140px rgba(47, 217, 154, 0.22);
  transform: rotateY(calc(-13deg + var(--px) * 7deg)) rotateX(calc(7deg - var(--py) * 6deg - var(--sp) * 10deg)) rotateZ(2.5deg)
    translate3d(0, calc(var(--sp) * -30px), 0);
  transform-style: preserve-3d;
  will-change: transform;
}

.device-screen {
  width: 100%;
  aspect-ratio: 600 / 1218;
  border-radius: 46px;
  background: #e9efe9;
  object-fit: cover;
  object-position: 50% 0;
}

.device-island {
  position: absolute;
  top: 20px;
  left: 50%;
  z-index: 1;
  width: 28%;
  height: 22px;
  margin-left: -14%;
  border-radius: 999px;
  background: #050706;
}

.device-shine {
  position: absolute;
  inset: 9px;
  border-radius: 46px;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0) 32%);
  opacity: calc(0.55 + var(--px) * 0.3);
  pointer-events: none;
}

.float-chip {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: inset 0 1px 0 var(--glass-top), 0 12px 30px rgba(0, 0, 0, 0.4);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  will-change: transform;
}

.float-chip svg {
  color: var(--accent);
}

.float-chip-a {
  top: 16%;
  left: -18%;
  transform: translate3d(calc(var(--px) * -18px), calc(var(--py) * -12px - var(--sp) * 46px), 90px);
}

.float-chip-b {
  right: -16%;
  bottom: 20%;
  transform: translate3d(calc(var(--px) * 22px), calc(var(--py) * 14px - var(--sp) * 80px), 120px);
}

/* ───────────── Reward page (welcome.html) and leave page ───────────── */

.wl-page {
  position: relative;
  min-height: calc(100svh - var(--header-h));
  overflow: hidden;
  isolation: isolate;
}

.reward {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(24px, 4vw, 64px);
  width: min(1120px, 100%);
  margin-inline: auto;
  padding: clamp(24px, 5vw, 72px) 24px clamp(56px, 8vw, 110px);
}

.reward-lead {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 28px;
  text-align: center;
}

.reward-cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.gcard {
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid var(--glass-line);
  border-radius: var(--r-card);
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  backdrop-filter: blur(22px) saturate(1.3);
  box-shadow: var(--shadow-soft), inset 0 0 0 1px var(--line);
}

.gcard h2 {
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.gcard > p {
  margin-top: 8px;
  color: var(--text);
  font-size: 16px;
  font-weight: 300;
}

.kicker,
.gcard h2.kicker {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Rank: the number counts up inside a soft burst of light. */
.rank {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: clamp(28px, 5vw, 56px) 0 8px;
}

.rank h1 {
  display: grid;
  justify-items: center;
  font-weight: 300;
}

.rank-kicker {
  color: var(--text);
  font-size: clamp(20px, 2.4vw, 28px);
  letter-spacing: -0.02em;
}

/* "#38 of 412". The gradient sits on each glyph's own inline box: iPhone
   Safari draws nothing when a gradient is clipped to text inside flex items
   or under a filter, which hid the number before. The glow is a blurred twin
   of the number behind it. */
.rank-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  column-gap: 0.4em;
  margin-top: 2px;
}

.rank-num {
  position: relative;
  z-index: 0;
  display: inline-block;
  color: #9ff2cf;
  /* Long places shrink so "#1234 of 5678" still fits a small phone. */
  font-size: min(clamp(96px, 17vw, 200px), calc((min(100vw, 560px) - 120px) / (0.52 * var(--len, 2) + 0.42)));
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.06em;
  white-space: nowrap;
  padding-right: 0.06em;
}

.rank-num::before {
  content: attr(data-text);
  position: absolute;
  z-index: -1;
  inset: 0;
  color: rgba(47, 217, 154, 0.55);
  filter: blur(26px);
  pointer-events: none;
}

.rank-ink {
  display: inline;
  color: #9ff2cf;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .rank-ink {
    background: linear-gradient(170deg, #d6fbea 8%, #9ff2cf 38%, #2fd99a 78%, #12b07e);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}

.rank-hash {
  margin-right: 0.04em;
  font-size: 0.56em;
  letter-spacing: 0;
}

.rank-of {
  color: var(--text);
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 400;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.rank-of[hidden] {
  display: none;
}

/* "↑ 5 places" since the last visit: pops in once. */
.rank-up {
  min-height: 0;
  margin: 2px 0 0;
  padding: 6px 14px;
  border: 1px solid rgba(63, 224, 166, 0.35);
  border-radius: 999px;
  background: rgba(47, 217, 154, 0.14);
  color: #b8f5dc;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translate3d(0, 10px, 0) scale(0.6);
}

.rank-up:empty {
  display: none;
}

.rank-up.is-on {
  animation: rank-up 0.9s var(--spring) 0.35s forwards;
}

@keyframes rank-up {
  0% {
    opacity: 0;
    transform: translate3d(0, 10px, 0) scale(0.6);
  }
  55% {
    opacity: 1;
    transform: translate3d(0, -3px, 0) scale(1.08);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

/* A climb replays the burst behind the number. */
.is-revealed.is-climbing .rank-burst {
  animation: burst-again 1.6s var(--ease) 0.2s;
}

@keyframes burst-again {
  0% {
    opacity: 0;
    transform: scale(0.25) rotate(0deg);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.35) rotate(50deg);
  }
}

.rank-sub {
  color: var(--text);
  font-size: clamp(17px, 1.8vw, 21px);
  font-weight: 300;
}

.rank .pill {
  margin: 14px 0 0;
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 600;
}

.rank-burst,
.rank-glow {
  position: absolute;
  z-index: -1;
  top: 44%;
  left: 50%;
  border-radius: 50%;
  pointer-events: none;
}

.rank-glow {
  width: min(520px, 110vw);
  height: min(520px, 110vw);
  margin: max(-260px, -55vw) 0 0 max(-260px, -55vw);
  background: radial-gradient(circle, rgba(47, 217, 154, 0.3), rgba(47, 217, 154, 0.08) 45%, transparent 68%);
  opacity: 0;
}

.rank-burst {
  width: min(620px, 130vw);
  height: min(620px, 130vw);
  margin: max(-310px, -65vw) 0 0 max(-310px, -65vw);
  background:
    repeating-conic-gradient(from 0deg, rgba(47, 217, 154, 0.2) 0deg 5deg, transparent 5deg 20deg),
    radial-gradient(circle, rgba(190, 255, 220, 0.75), rgba(47, 217, 154, 0.2) 40%, transparent 66%);
  -webkit-mask-image: radial-gradient(circle, #000 12%, transparent 66%);
  mask-image: radial-gradient(circle, #000 12%, transparent 66%);
  opacity: 0;
}

.is-revealed .rank-glow {
  animation: glow-in 1.4s var(--ease) 1.25s forwards, glow-breathe 5s ease-in-out 2.65s infinite alternate;
}

.is-revealed .rank-burst {
  animation: burst 1.9s var(--ease) 1.25s forwards;
}

@keyframes glow-in {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes glow-breathe {
  to {
    opacity: 0.7;
    transform: scale(1.08);
  }
}

@keyframes burst {
  0% {
    opacity: 0;
    transform: scale(0.25) rotate(0deg);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.35) rotate(50deg);
  }
}

/* Countdown: every digit sits in a fixed-width slot. A change drops the old
   digit out downward while the new one falls in from above and settles with
   a spring (welcome.js adds the classes). Seconds bounce lightly; minutes
   and hours bounce more and pulse the card; days add a sparkle. */
.countdown {
  position: relative;
  width: 100%;
  text-align: center;
}

.countdown::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(63, 224, 166, 0.55), 0 0 36px rgba(47, 217, 154, 0.35);
  opacity: 0;
  pointer-events: none;
}

.countdown.is-pulse::after {
  animation: count-pulse 1.1s var(--ease);
}

@keyframes count-pulse {
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.count {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.count-unit {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.count-digits {
  position: relative;
  display: flex;
  justify-content: center;
  color: var(--ink);
  font-size: clamp(36px, 9vw, 52px);
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

/* One slot per digit: always the width of a digit, so nothing shifts. */
.digit {
  position: relative;
  display: block;
  width: 1ch;
  height: 1.1em;
  margin: 0 0.01em;
}

.glyph {
  position: absolute;
  inset: 0;
  text-align: center;
  will-change: transform, opacity;
}

.glyph.out {
  animation: digit-out 0.42s cubic-bezier(0.5, 0, 0.75, 0) forwards;
}

.glyph.in-s {
  animation: digit-in-s 0.55s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.glyph.in-m,
.glyph.in-d {
  animation: digit-in-m 0.85s linear both;
}

@keyframes digit-out {
  to {
    opacity: 0;
    transform: translate3d(0, 55%, 0) scale(0.92);
  }
}

@keyframes digit-in-s {
  0% {
    opacity: 0;
    transform: translate3d(0, -60%, 0);
  }
  55% {
    opacity: 1;
    transform: translate3d(0, 7%, 0);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

/* A bigger spring: overshoot, a small rebound, settle. */
@keyframes digit-in-m {
  0% {
    opacity: 0;
    transform: translate3d(0, -110%, 0) scale(1.04);
    animation-timing-function: cubic-bezier(0.3, 0, 0.6, 1);
  }
  45% {
    opacity: 1;
    transform: translate3d(0, 16%, 0) scale(0.98, 1.02);
    animation-timing-function: cubic-bezier(0.3, 0, 0.5, 1);
  }
  70% {
    transform: translate3d(0, -6%, 0);
    animation-timing-function: cubic-bezier(0.3, 0, 0.5, 1);
  }
  86% {
    transform: translate3d(0, 2%, 0);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

/* Days: a few small stars burst from the number. */
.spark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  background: #b8f5dc;
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  opacity: 0;
  pointer-events: none;
  animation: spark 0.9s ease-out var(--d, 0ms) forwards;
}

@keyframes spark {
  0% {
    opacity: 0;
    transform: rotate(var(--a)) translate3d(0, 0, 0) scale(0.4);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(var(--a)) translate3d(var(--r, 40px), 0, 0) scale(1.1);
  }
}

.count-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.count-date {
  margin-top: 16px;
  color: var(--text);
  font-size: 16px;
}

/* Perks */
.perk-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.perk-badge {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 16px;
  background: var(--gradient);
  color: var(--on-accent);
  box-shadow: var(--shadow-green);
}

/* Climb: the goal, its bar, the invites and the link, right under the place. */
.climb {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  text-align: left;
}

.goal-text {
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.goal-bar {
  position: relative;
  height: 10px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.goal-bar i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--gradient);
  box-shadow: 0 0 14px rgba(47, 217, 154, 0.5);
  transform: scaleX(0.001);
  transform-origin: left center;
  transition: transform 1.4s var(--ease) 0.35s;
}

.goal-bar.is-filled i {
  transform: scaleX(var(--p, 0.05));
}

.goal-meta {
  margin-top: 10px;
  color: var(--text);
  font-size: 16px;
}

.climb-note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.invite-link {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  padding: 6px 6px 6px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--glass);
}

.invite-url {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-btn {
  position: relative;
  min-width: 96px;
  min-height: 44px;
  padding: 0 20px;
  font-size: 15px;
}

.copy-btn span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.25s ease, transform 0.4s var(--ease);
}

.copy-btn .copy-done {
  position: absolute;
  inset: 0;
  justify-content: center;
  opacity: 0;
  transform: translateY(10px);
}

.copy-btn.is-copied .copy-idle {
  opacity: 0;
  transform: translateY(-10px);
}

.copy-btn.is-copied .copy-done {
  opacity: 1;
  transform: none;
}

.share-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--glass);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.35s var(--ease), border-color 0.25s ease;
}

.share-btn:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}

.share-btn:active {
  transform: scale(0.97);
}

/* Story */
.story-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: clamp(18px, 3vw, 28px);
}

.story-frame {
  position: relative;
  width: clamp(104px, 26vw, 148px);
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 20px;
  background: #050a18;
  box-shadow: 0 0 0 1px var(--glass-line), 0 16px 36px rgba(0, 0, 0, 0.5), 0 0 40px rgba(47, 217, 154, 0.16);
  transform: rotate(-3deg);
}

.story-frame canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.story-frame.is-ready canvas {
  opacity: 1;
}

.story-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.story-actions .btn {
  min-height: 48px;
  padding: 0 22px;
}

.insta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.reward-foot {
  padding: 4px 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.reward-foot a {
  color: inherit;
}

/* Cards and the rank rise in, one after the other, once the page has its data. */
.js .reward [data-rise] {
  opacity: 0;
  transform: translateY(24px);
}

.js .is-revealed [data-rise] {
  animation: rise-in 0.9s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 90ms + 200ms);
}

/* States: loading, expired link, trouble. */
.state-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  width: min(480px, calc(100% - 32px));
  margin: clamp(48px, 12vh, 140px) auto;
  text-align: center;
}

.state-card h1 {
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.state-card p {
  color: var(--text);
  font-weight: 300;
}

.state-card .btn {
  margin-top: 8px;
}

.state-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.loader {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 217, 154, 0.55), transparent 68%);
  animation: loader 1.4s ease-in-out infinite alternate;
}

@keyframes loader {
  from {
    opacity: 0.4;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1.25);
  }
}

[data-view] {
  display: none;
}

[data-state="loading"] [data-view="loading"],
[data-state="confirmed"] [data-view="confirmed"],
[data-state="gone"] [data-view="gone"],
[data-state="error"] [data-view="error"],
[data-state="ask"] [data-view="ask"],
[data-state="left"] [data-view="left"],
[data-state="deleted"] [data-view="deleted"] {
  display: grid;
}

[data-view].state-card {
  animation: rise-in 0.7s var(--ease) both;
}

.js [data-view].state-card {
  opacity: 0;
  transform: translateY(16px);
}

.btn-quiet {
  border-color: var(--line-strong);
  background: var(--glass);
  color: var(--ink);
}

.btn-quiet:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}

.btn[disabled] {
  opacity: 0.6;
  pointer-events: none;
}

.toast {
  position: fixed;
  z-index: 60;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: 50%;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 15px;
  font-weight: 500;
  opacity: 0;
  transform: translate3d(-50%, 20px, 0);
  transition: opacity 0.3s ease, transform 0.5s var(--ease);
  pointer-events: none;
}

.toast.is-on {
  opacity: 1;
  transform: translate3d(-50%, 0, 0);
}

/* ───────────── Responsive ───────────── */

@media (max-width: 900px) {
  .hero-wl .hero-panel {
    grid-template-columns: 1fr;
    gap: 0;
    min-height: 0;
    padding: clamp(40px, 9vw, 72px) 18px 0;
  }

  .hero-wl .hero-copy {
    justify-items: center;
    max-width: 560px;
    margin-inline: auto;
    text-align: center;
  }

  .wl-return {
    justify-self: center;
    margin-left: 0;
  }

  /* The phone peeks out of the panel's lower edge. */
  .device-stage {
    height: clamp(330px, 92vw, 520px);
    margin-top: 36px;
    place-items: start center;
  }

  .device-float {
    width: min(270px, 68%);
  }

  .float-chip-a {
    left: -22%;
  }

  .float-chip-b {
    right: -22%;
    bottom: auto;
    top: 46%;
  }

  .reward {
    grid-template-columns: minmax(0, 1fr);
    padding-inline: 16px;
  }

  .reward-lead {
    position: static;
  }
}

@media (max-width: 520px) {
  .wl {
    --wl-r: 30px;
  }

  .hero-wl .hero-panel {
    padding-top: 30px;
  }

  .hero-wl .hero-copy {
    gap: 16px;
  }

  .wl-field {
    flex-direction: column;
    align-items: stretch;
  }

  .wl-input {
    flex: none;
    width: 100%;
    padding: 0 18px;
    text-align: center;
  }

  .wl-btn {
    width: 100%;
    min-height: 54px;
  }

  .wl-done {
    flex-direction: column;
    gap: 6px;
  }

  .float-chip {
    padding: 8px 12px;
    font-size: 12px;
  }

  .float-chip-a {
    left: -14%;
  }

  .float-chip-b {
    right: -14%;
  }

  .story-card {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .story-actions {
    justify-content: center;
  }

  .insta {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
}

/* ───────────── Reduced motion: fades only, no travel ───────────── */

@media (prefers-reduced-motion: reduce) {
  .device-float,
  .loader {
    animation: none;
  }

  .device {
    transform: rotateY(-10deg) rotateX(5deg) rotateZ(2deg);
  }

  .float-chip-a,
  .float-chip-b {
    transform: translateZ(100px);
  }

  .wl-done {
    clip-path: none;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
  }

  .wl.is-done .wl-done {
    clip-path: none;
    opacity: 1;
    transition: opacity 0.3s ease, visibility 0s;
  }

  .wl.is-done .wl-done-text,
  .wl.is-done .env,
  .wl.is-done .env-dot {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .wl.is-done .env-flap {
    animation: none;
    stroke-dashoffset: 0;
  }

  .wl.is-shaking .wl-field,
  .wl.is-called .wl-field {
    animation: none;
  }

  .wl-spinner {
    animation-duration: 1.2s !important;
    animation-iteration-count: infinite !important;
  }

  .js .reward [data-rise],
  .js [data-view].state-card {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .is-revealed .rank-glow {
    animation: none;
    opacity: 0.85;
  }

  .is-revealed .rank-burst {
    animation: none;
    opacity: 0;
  }

  .goal-bar i,
  .copy-btn span,
  .share-btn,
  .toast,
  .wl-box,
  .wl-box svg {
    transition: none;
  }

  .toast {
    transform: translate3d(-50%, 0, 0);
  }
}

/* A heading focused by the page itself (after an action) needs no ring. */
.state-card h1:focus {
  outline: none;
}

/* ═════════════ Midnight ═════════════ */


.hero-wl .hero-panel {
  overflow: visible;
}

/* The phone floats in with a slight tilt, after the words. */
.js .device-stage {
  opacity: 0;
  animation: device-in 1.5s var(--ease) 0.7s forwards;
}

@keyframes device-in {
  from {
    opacity: 0;
    transform: translate3d(0, 70px, 0) rotateX(14deg) scale(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.device {
  background: linear-gradient(145deg, #2a3144, #070a12 40%, #1a2032);
}

/* Glass: the field, the reward cards. */
.wl-field,
.gcard {
  border: 1px solid var(--glass-line);
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: inset 0 1px 0 var(--glass-top), var(--shadow-soft);
}

.wl-field:focus-within {
  box-shadow: inset 0 0 0 2px var(--accent), 0 0 30px rgba(var(--glow), 0.22);
}

.invite-link,
.share-btn,
.wl-box {
  border-color: var(--glass-line);
  background: var(--soft);
}

.share-btn {
  transition: transform 0.45s var(--spring), border-color 0.25s ease;
}

.share-btn:hover {
  border-color: var(--line-strong);
}

.share-btn:active,
.wl-msg button:active,
.wl-consent:active .wl-box,
.reward-foot a:active {
  transform: scale(0.94);
}

.wl-msg button,
.reward-foot a {
  display: inline-block;
  transition: transform 0.45s var(--spring);
}

.wl-consent input:checked + .wl-box {
  background: var(--accent-bright);
  box-shadow: 0 0 16px rgba(var(--glow), 0.45);
}

.wl-box {
  transition: border-color 0.25s ease, background-color 0.25s ease, transform 0.45s var(--spring);
}

.env-dot {
  fill: var(--on-accent);
}

/* The sign-up lands: an emerald pulse spreads from the field and a few
   stars drift up (waitlist.js adds them). */
.wl-pulse {
  position: absolute;
  z-index: 1;
  inset: -1px;
  border-radius: var(--wl-r);
  box-shadow: 0 0 0 2px rgba(var(--glow), 0.7), 0 0 44px 8px rgba(var(--glow), 0.5);
  opacity: 0;
  pointer-events: none;
}

.wl.is-done .wl-pulse {
  animation: wl-pulse 1.3s var(--ease) 0.45s;
}

@keyframes wl-pulse {
  0% {
    opacity: 0;
    transform: scale(0.98);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.09, 1.5);
  }
}

.wl.is-done .wl-done {
  box-shadow: 0 6px 30px rgba(var(--glow), 0.4);
}

.wl-star {
  position: absolute;
  z-index: 3;
  bottom: 50%;
  left: var(--x, 50%);
  width: var(--s, 10px);
  height: var(--s, 10px);
  background: var(--c, #fff);
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  opacity: 0;
  pointer-events: none;
  animation: wl-star var(--t, 1.6s) ease-out var(--d, 0s) forwards;
}

@keyframes wl-star {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(0.3) rotate(0deg);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--dx, 0px), var(--dy, -90px), 0) scale(1) rotate(120deg);
  }
}

/* The constellation round the place: seven stars, joined line by line
   (lib/levelShow.ts CONSTELLATION: 130 ms a line, a flare as it arrives). */
.constellation {
  position: absolute;
  z-index: -1;
  top: 46%;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
}

.c-line {
  position: absolute;
  top: 0;
  left: 0;
  height: 1px;
  transform-origin: 0 50%;
}

.c-line i {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(207, 221, 255, 0.5), rgba(63, 224, 166, 0.6));
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.c-star {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--s, 9px);
  height: var(--s, 9px);
  margin: calc(var(--s, 9px) / -2) 0 0 calc(var(--s, 9px) / -2);
}

.c-star i {
  display: block;
  width: 100%;
  height: 100%;
  background: #fff;
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  filter: drop-shadow(0 0 6px rgba(159, 242, 207, 0.9));
  opacity: 0;
}

.is-revealed .c-line i {
  animation: c-line 130ms linear forwards;
  animation-delay: calc(var(--n) * 130ms + 350ms);
}

.is-revealed .c-star i {
  animation: c-star 520ms ease-out forwards;
  animation-delay: calc(var(--n) * 130ms + 350ms);
}

@keyframes c-line {
  to {
    transform: scaleX(1);
  }
}

@keyframes c-star {
  0% {
    opacity: 0;
    transform: scale(0.2);
  }
  30% {
    opacity: 1;
    transform: scale(1.6);
  }
  100% {
    opacity: 0.9;
    transform: scale(1);
  }
}

.rank .pill {
  border: 1px solid rgba(63, 224, 166, 0.3);
}

.story-frame {
  transition: transform 0.6s var(--spring);
}

@media (hover: hover) {
  .story-frame:hover {
    transform: rotate(0deg) scale(1.03);
  }
}

.toast {
  background: var(--raised);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--glass-line), 0 12px 30px rgba(0, 0, 0, 0.5);
}

.state-card .loader {
  background: radial-gradient(circle, rgba(47, 217, 154, 0.6), transparent 68%);
}

@media (prefers-reduced-motion: reduce) {
  .js .device-stage {
    animation: fade-only 0.4s ease forwards;
  }

  .wl.is-done .wl-pulse,
  .wl-star {
    animation: none;
    opacity: 0;
  }

  .is-revealed .c-line i {
    animation: none;
    transform: none;
  }

  .is-revealed .c-star i {
    animation: none;
    opacity: 0.9;
  }

  .story-frame,
  .share-btn,
  .wl-msg button,
  .reward-foot a {
    transition: none;
  }

  .share-btn:active,
  .wl-msg button:active,
  .wl-consent:active .wl-box,
  .reward-foot a:active,
  .story-frame:hover {
    transform: none;
  }
}

/* The place and its card stay in view on tall screens while the right column scrolls. */
@media (min-width: 901px) and (min-height: 940px) {
  .reward-lead {
    position: sticky;
    top: calc(var(--header-h) + 24px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .glyph.out {
    animation: fade-out 0.3s ease forwards;
  }

  .glyph.in-s,
  .glyph.in-m,
  .glyph.in-d {
    animation: fade-only 0.3s ease both;
  }

  .countdown.is-pulse::after,
  .spark {
    animation: none;
    opacity: 0;
  }

  .rank-up.is-on {
    animation: fade-only 0.4s ease forwards;
    transform: none;
  }
}

@keyframes fade-out {
  to {
    opacity: 0;
  }
}

@keyframes fade-only {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* On phones and tablets the phone mockup peeks out and fades into the night. */
@media (max-width: 900px) {
  .device-stage {
    padding-top: 44px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 72%, transparent 100%), linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 72%, transparent 100%), linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
  }
}

/* Readability on phones: the form's words and the reward page's small print. */
@media (max-width: 600px) {
  .wl-consent,
  .wl-return,
  .invite-url {
    font-size: 16px;
  }

  .reward-foot {
    font-size: 15px;
  }
}

/* A new message under the form rises in softly. */
.wl-msg.is-new {
  animation: msg-in 0.45s var(--ease);
}

@keyframes msg-in {
  from {
    opacity: 0;
    transform: translate3d(0, 6px, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wl-msg.is-new {
    animation: fade-only 0.3s ease;
  }
}

/* ───────────── Back on the home page after joining ─────────────
   The head script marks <html data-wl="place|pending"> before the first
   paint, so the form never flashes for someone who already joined. */

.place-card {
  position: relative;
  display: none;
  grid-template-columns: minmax(0, 1fr);
  width: min(520px, 100%);
  min-width: 0;
  min-height: 220px;
  margin-top: 6px;
  padding: clamp(22px, 3vw, 30px);
  text-align: left;
}

html[data-wl="place"] .place-card {
  display: grid;
}

html[data-wl="place"] [data-waitlist],
html[data-wl="place"] .hero-wl .hero-note {
  display: none;
}

/* A kept sign-up: the form waits, invisible, until it is in "Check your inbox". */
html[data-wl="pending"] [data-waitlist]:not(.is-done) {
  opacity: 0;
}

.place-loader {
  position: absolute;
  inset: 0;
  display: none;
  margin: auto;
}

.place-card.is-loading .place-loader {
  display: block;
}

.place-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  min-width: 0;
}

.place-card.is-loading .place-body {
  visibility: hidden;
}

/* When the place arrives, its parts rise in one after the other. */
.place-body > * {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
}

.place-card.is-shown .place-body > * {
  animation: rise-in 0.7s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 80ms);
}

.place-card.is-trouble .place-body > :not(.place-error):not(.place-open):not(.wl-notyou) {
  display: none;
}

.place-card.is-leaving {
  animation: place-out 0.32s var(--ease) forwards;
}

@keyframes place-out {
  to {
    opacity: 0;
    transform: translate3d(0, 10px, 0) scale(0.98);
  }
}

.place-head {
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
}

.place-title {
  display: grid;
  justify-items: center;
  font-weight: 300;
}

.place-kicker {
  color: var(--text);
  font-size: 18px;
  letter-spacing: -0.01em;
}

.place-card .rank-num {
  font-size: min(clamp(68px, 15vw, 104px), calc((min(100vw, 520px) - 140px) / (0.52 * var(--len, 2) + 0.42)));
}

.place-card .rank-num::before {
  filter: blur(20px);
}

.place-card .rank-of {
  font-size: clamp(18px, 2vw, 22px);
}

/* The countdown sits in a soft inner panel. */
.place-count {
  padding: 14px 10px 16px;
  border: 1px solid var(--glass-line);
  border-radius: 22px;
  background: var(--soft);
}

.place-count .count {
  margin-top: 8px;
}

.place-count .count-digits {
  font-size: clamp(30px, 8vw, 44px);
}

.place-climb .goal-bar {
  margin-top: 12px;
}

.place-share .invite-link {
  margin-top: 0;
}

.place-share .share-row {
  margin-top: 12px;
}

.place-open {
  width: 100%;
  justify-content: center;
}

.wl-notyou {
  justify-self: center;
  min-height: 44px;
  margin: -6px 0 0;
  padding: 0 6px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.45s var(--spring);
}

.wl-notyou:active {
  transform: scale(0.95);
}

.place-error {
  color: var(--text);
  font-size: 16px;
  text-align: center;
}

.place-error button {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}

/* The form (and its note) rising in again after "Not you?". */
.js .wl.is-entering,
.js .hero-wl .hero-note.is-entering {
  animation: hero-enter 0.6s var(--ease) both;
  animation-delay: 0s;
}

@keyframes hero-enter {
  from {
    opacity: 0;
    transform: translate3d(0, 14px, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* A kept "Check your inbox" comes back as it was, without replaying the morph. */
.wl.is-instant .wl-done,
.wl.is-instant .wl-done *,
.wl.is-instant .wl-after,
.wl.is-instant .wl-consent,
.wl.is-instant .wl-pulse {
  animation-duration: 0s !important;
  animation-delay: 0s !important;
  transition: none !important;
}

.wl.is-instant .wl-pulse,
.wl.is-instant .wl-star {
  display: none;
}

/* ───────────── "Already on the list?" ───────────── */

.wl-label-recover,
.wl-switch-back {
  display: none;
}

.wl.is-recover .wl-label-join,
.wl.is-recover .wl-switch-join {
  display: none;
}

.wl.is-recover .wl-label-recover,
.wl.is-recover .wl-switch-back {
  display: inline;
}

.wl-btn.is-relabel .wl-btn-label {
  animation: hero-enter 0.4s var(--ease);
}

.wl-recover-note {
  padding: 4px 6px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, 6px, 0);
  transition: opacity 0.3s ease, transform 0.45s var(--ease), visibility 0s linear 0.3s;
}

.wl.is-recover:not(.is-done) .wl-recover-note {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.35s ease 0.1s, transform 0.5s var(--ease) 0.1s, visibility 0s;
}

.wl.is-recover .wl-consent {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.wl.is-recover .wl-resend {
  display: none;
}

.wl-switch {
  justify-self: start;
  min-height: 44px;
  margin: -6px 0 0;
  padding: 0 6px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.45s var(--spring), opacity 0.3s ease;
}

.wl-switch-join {
  color: var(--ink);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgba(63, 224, 166, 0.6);
  text-underline-offset: 4px;
}

.wl-switch:active {
  transform: scale(0.95);
}

.wl.is-done .wl-switch {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 900px) {
  .wl-switch {
    justify-self: center;
  }

  .wl-recover-note {
    text-align: center;
  }
}

@media (max-width: 600px) {
  .wl-switch,
  .wl-notyou,
  .wl-recover-note {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .place-body > *,
  .place-card.is-shown .place-body > * {
    transform: none;
  }

  .place-card.is-shown .place-body > * {
    animation: fade-only 0.35s ease forwards;
  }

  .place-card.is-leaving,
  .js .wl.is-entering,
  .js .hero-wl .hero-note.is-entering,
  .wl-btn.is-relabel .wl-btn-label {
    animation: fade-only 0.3s ease both;
  }

  .wl-recover-note,
  .wl.is-recover:not(.is-done) .wl-recover-note {
    transform: none;
  }

  .wl-switch:active,
  .wl-notyou:active {
    transform: none;
  }
}

/* One state at a time, even if a rule above changes: what the page marks
   [hidden] stays hidden (the status card is shown by the place state only). */
.wl [hidden],
.place-card[hidden]:not(html[data-wl="place"] .place-card) {
  display: none !important;
}

/* The place arrives large and bright, and settles while it counts (place.js
   adds .is-arriving on the first show). */
.rank-num.is-arriving {
  animation: rank-arrive 1.5s var(--ease) both;
}

.rank-num.is-arriving::before {
  animation: rank-flash 1.7s ease-out both;
}

@keyframes rank-arrive {
  0% {
    opacity: 0;
    transform: scale(1.8);
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes rank-flash {
  0% {
    opacity: 0;
  }
  30% {
    opacity: 1;
    transform: scale(1.7);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rank-num.is-arriving,
  .rank-num.is-arriving::before {
    animation: none;
  }
}
