/* ============================================================
   "Alive" layer: daily inspiration, living constellation, confetti.
   Mobile-first (most members use phones); wider screens get two columns.
   All motion is off for people who prefer reduced motion.
   ============================================================ */

.alive-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin: 0 0 18px;
}

.landing-alive {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 16px 0;
}

/* ------------------------------------------------ inspiration card */
.inspire {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 10px;
  padding: 18px 16px 14px;
  min-width: 0;
  background:
    radial-gradient(120% 90% at 100% 0%, var(--gold-soft) 0%, transparent 55%),
    linear-gradient(160deg, var(--surface) 0%, var(--paper-2) 100%);
  isolation: isolate;
}

.inspire__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.inspire__date {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.inspire__stage {
  position: relative;
  z-index: 1;
  perspective: 900px;
  min-height: 112px;
  display: flex;
  align-items: center;
}

.inspire__quote {
  margin: 0;
  width: 100%;
  transform-origin: 50% 50%;
  backface-visibility: hidden;
}

.inspire__mark {
  display: block;
  height: 26px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 3.2rem;
  line-height: 1;
  color: var(--gold);
}

.inspire__text {
  margin: 4px 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.12rem, 4.6vw, 1.45rem);
  line-height: 1.35;
  color: var(--ink);
  overflow-wrap: anywhere;
  /* leave room for the floating objects in the corner */
  padding-right: 26%;
}

.inspire__source {
  font-size: 0.84rem;
  color: var(--ink-2);
}

.inspire__actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* thumb-friendly tap targets */
.inspire__actions .btn {
  min-height: 44px;
  min-width: 44px;
}

.inspire__actions [data-inspire-next] {
  flex: 1 1 auto;
}

/* 3D flip between phrases */
@keyframes inspire-out-fwd {
  to { transform: rotateX(-85deg) translateY(-8px); opacity: 0; }
}
@keyframes inspire-out-back {
  to { transform: rotateX(85deg) translateY(8px); opacity: 0; }
}
@keyframes inspire-in {
  from { transform: rotateX(70deg) translateY(10px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@keyframes inspire-in-back {
  from { transform: rotateX(-70deg) translateY(-10px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.inspire__stage.is-out.is-fwd .inspire__quote { animation: inspire-out-fwd 0.26s ease-in forwards; }
.inspire__stage.is-out.is-back .inspire__quote { animation: inspire-out-back 0.26s ease-in forwards; }
.inspire__stage.is-in.is-fwd .inspire__quote { animation: inspire-in 0.5s cubic-bezier(0.2, 0.9, 0.25, 1.15) both; }
.inspire__stage.is-in.is-back .inspire__quote { animation: inspire-in-back 0.5s cubic-bezier(0.2, 0.9, 0.25, 1.15) both; }

/* floating 3D objects */
.inspire__objects {
  --px: 0;
  --py: 0;
  position: absolute;
  top: 38px;
  right: 6px;
  width: 104px;
  height: 104px;
  perspective: 500px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.9;
  transform: translate(calc(var(--px) * -14px), calc(var(--py) * -10px));
  transition: transform 0.4s ease-out;
}

.obj {
  position: absolute;
  transform-style: preserve-3d;
}

.obj--cube {
  --s: 26px;
  width: var(--s);
  height: var(--s);
  top: 46px;
  left: 12px;
  transform: rotateX(-24deg) rotateY(36deg);
}
.obj--cube i {
  position: absolute;
  inset: 0;
  border: 1.5px solid color-mix(in srgb, var(--gold) 80%, transparent);
  background: color-mix(in srgb, var(--gold-soft) 55%, transparent);
  border-radius: 4px;
}
.obj--cube i:nth-child(1) { transform: translateZ(calc(var(--s) / 2)); }
.obj--cube i:nth-child(2) { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.obj--cube i:nth-child(3) { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.obj--cube i:nth-child(4) { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.obj--cube i:nth-child(5) { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.obj--cube i:nth-child(6) { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }

.obj--ring {
  width: 64px;
  height: 64px;
  top: 6px;
  right: 4px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--brand) 55%, transparent);
  box-shadow: inset 0 0 0 5px color-mix(in srgb, var(--brand-soft) 70%, transparent);
  transform: rotateX(68deg) rotateZ(0deg);
}

.obj--orb {
  width: 18px;
  height: 18px;
  bottom: 6px;
  right: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #fff 0%, var(--clay-soft) 30%, var(--clay) 100%);
  box-shadow: 0 6px 12px rgba(16, 20, 19, 0.15);
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes cube-spin {
    from { transform: rotateX(-24deg) rotateY(0deg); }
    to { transform: rotateX(-24deg) rotateY(360deg); }
  }
  @keyframes ring-spin {
    from { transform: rotateX(68deg) rotateZ(0deg); }
    to { transform: rotateX(68deg) rotateZ(360deg); }
  }
  @keyframes orb-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-9px); }
  }
  .obj--cube { animation: cube-spin 14s linear infinite; }
  .obj--ring { animation: ring-spin 9s linear infinite; }
  .obj--orb { animation: orb-float 4.2s ease-in-out infinite; }
}

/* ------------------------------------------------ living constellation */
.alive-sky {
  position: relative;
  overflow: hidden;
  min-height: 300px;
  min-width: 0;
  padding: 0;
  background:
    radial-gradient(70% 70% at 50% 45%, var(--brand-tint, #eef3ef) 0%, transparent 70%),
    var(--surface);
}

.alive-sky__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  /* phones: vertical swipes still scroll the page, sideways swipes spin the sky */
  touch-action: pan-y;
}
.alive-sky__canvas.is-dragging {
  cursor: grabbing;
}

.alive-sky__overlay {
  position: absolute;
  inset: 12px 14px;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
}
.alive-sky__stats {
  display: grid;
  gap: 2px;
}

.alive-sky__live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ok);
}
.alive-sky__live span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
}
@media (prefers-reduced-motion: no-preference) {
  @keyframes sky-live {
    0%, 100% { box-shadow: 0 0 0 3px rgba(47, 107, 79, 0.18); }
    50% { box-shadow: 0 0 0 7px rgba(47, 107, 79, 0); }
  }
  .alive-sky__live span { animation: sky-live 2.2s ease-in-out infinite; }
}

.alive-sky__count {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink);
}
.alive-sky__count strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
}
.alive-sky__hint {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  font-size: 0.76rem;
  color: var(--muted);
}

/* ------------------------------------------------ confetti */
.confetti-layer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

/* ------------------------------------------------ wider screens */
@media (min-width: 760px) {
  .alive-band {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 16px;
    margin-bottom: 22px;
  }
  .inspire {
    padding: 22px 22px 18px;
  }
  .inspire__objects {
    width: 128px;
    height: 128px;
  }
  .inspire__text {
    padding-right: 120px;
  }
  .alive-sky {
    min-height: 300px;
  }
  .landing-alive {
    padding: 32px 32px 0;
  }
}
