/* Landing page (pages#home) */

.landing {
  --mx: 0; --my: 0; /* pointer position, -0.5 to 0.5, set by landing_controller.js */
  position: relative;
  display: flex; flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
}

/* Soft aura glow behind the content. It drifts on its own and leans toward the pointer. */
.landing .glow {
  position: absolute; z-index: 0;
  top: -18vmax; left: 50%;
  width: 80vmax; height: 60vmax;
  margin-left: -40vmax;
  translate: calc(var(--mx) * 14vmax) calc(var(--my) * 10vmax);
  transition: translate 1.2s cubic-bezier(.2, .8, .2, 1);
  background: var(--aura);
  filter: blur(90px);
  border-radius: 50%;
  opacity: var(--glow-opacity);
  pointer-events: none;
  animation: glow-in 1.6s ease-out both, drift 18s ease-in-out infinite alternate;
}

.landing header,
.landing main,
.landing footer { position: relative; z-index: 1; }

.landing header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 28px 32px;
  animation: fade-in .8s ease-out both;
}

/* Light / dark switch: shows a moon in light mode and a sun in dark mode */
.landing .theme-toggle {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  color: var(--ink-700);
  background: var(--canvas);
  border: 1px solid var(--border);
  box-shadow: 0 4px 14px rgba(26, 26, 26, .08);
  cursor: pointer;
  transition: color .2s, border-color .2s, transform .3s cubic-bezier(.34, 1.56, .64, 1);
}
.landing .theme-toggle:hover { color: var(--primary); border-color: var(--border-strong); transform: rotate(-12deg); }
.landing .theme-toggle:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.landing .theme-toggle svg { width: 20px; height: 20px; }
.landing .theme-toggle .sun { display: none; }
[data-theme="dark"] .landing .theme-toggle .sun { display: block; }
[data-theme="dark"] .landing .theme-toggle .moon { display: none; }

.landing .wordmark {
  font-size: 26px; font-weight: 800; letter-spacing: -.045em;
  background: var(--aura);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

.landing main {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 24px 24px 64px;
}

/* A little "group" of people, overlapping avatars */
.landing .circle {
  position: relative;
  display: flex;
  margin-bottom: 36px;
  translate: calc(var(--mx) * -18px) calc(var(--my) * -12px);
  transition: translate .6s cubic-bezier(.2, .8, .2, 1);
}

.landing .circle > span:not(.welcome),
.landing .circle > button {
  --toward: 0px;
  position: relative;
  width: 52px; height: 52px; border-radius: 50%;
  border: 3px solid var(--surface);
  margin: 0 0 0 -12px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  font: inherit; font-size: 15px; font-weight: 800; letter-spacing: -.02em; color: #fff;
  box-shadow: 0 4px 14px rgba(26, 26, 26, .08);
  transition: transform .45s cubic-bezier(.34, 1.56, .64, 1), box-shadow .3s;
  animation:
    pop-in .6s cubic-bezier(.34, 1.56, .64, 1) both,
    bob 4s ease-in-out infinite;
  animation-delay: var(--delay), calc(var(--delay) + .6s);
}
.landing .circle > :first-child { margin-left: 0; }

.landing .circle .a { background: #FF8A80; --delay: .05s; --toward: 14px; }
.landing .circle .b { background: #FF5C93; --delay: .12s; --toward: 7px; }
.landing .circle .c { background: var(--aura); --delay: .19s; width: 60px; height: 60px; margin-top: -4px; font-size: 17px; z-index: 2; cursor: pointer; }
.landing .circle .d { background: #9A7BF3; --delay: .26s; --toward: -7px; }
.landing .circle .e { background: var(--primary); --delay: .33s; --toward: -14px; }

/* Each avatar bobs slightly out of step with the others */
.landing .circle .b { animation-duration: .6s, 4.6s; }
.landing .circle .c { animation-duration: .6s, 3.6s; }
.landing .circle .d { animation-duration: .6s, 4.3s; }

.landing .circle > span:hover { transform: translateY(-6px) rotate(-4deg); z-index: 3; }

/* Name tag on hover */
.landing .circle > [data-name]::after {
  content: attr(data-name);
  position: absolute; top: calc(100% + 10px); left: 50%;
  translate: -50% 4px;
  padding: 4px 9px;
  border-radius: var(--r-pill);
  background: #1A1A1A; color: #fff;
  font-size: 12px; font-weight: 600; letter-spacing: 0; white-space: nowrap;
  opacity: 0;
  transition: opacity .2s, translate .2s;
  pointer-events: none;
}
.landing .circle > [data-name]:hover::after { opacity: 1; translate: -50% 0; }

/* "you" invites a click with a soft pulsing ring */
.landing .circle .c::before {
  content: "";
  position: absolute; inset: -3px;
  border-radius: 50%;
  border: 2px solid #FF5C93;
  animation: ring 2.4s ease-out 1.2s infinite;
  pointer-events: none;
}
.landing .circle .c:hover { transform: scale(1.08); box-shadow: 0 8px 24px rgba(255, 92, 147, .35); }
.landing .circle .c:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }

/* Clicking "you": the group huddles in around you */
.landing .circle.joined > span:not(.welcome) { transform: translateX(var(--toward)) translateY(-4px); }
.landing .circle.joined .c { transform: scale(1.14); box-shadow: 0 10px 30px rgba(255, 92, 147, .45); }
.landing .circle.joined .c::before { animation: none; opacity: 0; }

.landing .welcome {
  position: absolute; bottom: calc(100% + 14px); left: 50%;
  translate: -50% 6px; scale: .85;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: var(--canvas);
  box-shadow: 0 8px 24px rgba(26, 26, 26, .12);
  font-size: 14px; font-weight: 700; white-space: nowrap; color: var(--ink-900);
  opacity: 0;
  transition: opacity .25s, translate .35s cubic-bezier(.34, 1.56, .64, 1), scale .35s cubic-bezier(.34, 1.56, .64, 1);
  pointer-events: none;
}
.landing .circle.joined .welcome { opacity: 1; translate: -50% 0; scale: 1; }

.landing .spark {
  position: absolute; top: 50%; left: 50%;
  width: 8px; height: 8px; margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: #FF5C93;
  pointer-events: none;
  animation: spark .8s cubic-bezier(.2, .8, .3, 1) forwards;
}
.landing .spark:nth-child(3n)   { background: #FF8A80; }
.landing .spark:nth-child(3n+1) { background: var(--primary); width: 6px; height: 6px; }

.landing .badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase;
  color: var(--primary-hover);
  background: var(--primary-soft);
  border-radius: var(--r-pill);
  padding: 7px 14px;
  margin-bottom: 22px;
  animation: rise .7s cubic-bezier(.2, .8, .2, 1) .35s both;
}

/* "Live" dot: we're building it right now */
.landing .badge .dot {
  position: relative;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary);
}
.landing .badge .dot::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  background: var(--primary);
  animation: ping 1.8s cubic-bezier(0, 0, .2, 1) infinite;
}

.landing h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(40px, 7vw, 76px);
  font-weight: 800; letter-spacing: -.045em; line-height: 1.02;
  animation: rise .8s cubic-bezier(.2, .8, .2, 1) .45s both;
}

/* The gradient slowly sweeps across "you belong." */
.landing h1 em {
  font-style: normal;
  background: linear-gradient(90deg, #FF8A80, #FF5C93, #6D5EF5, #FF5C93, #FF8A80);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: shimmer 6s ease-in-out infinite alternate;
}

.landing .lede {
  max-width: 540px;
  margin: 22px 0 0;
  font-size: clamp(17px, 2vw, 20px); line-height: 1.55;
  color: var(--ink-700);
  animation: rise .8s cubic-bezier(.2, .8, .2, 1) .6s both;
}

/* The way in: the public TestFlight beta */
.landing .beta {
  margin-top: 32px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  animation: rise .8s cubic-bezier(.2, .8, .2, 1) .7s both;
}
.landing .beta-button {
  display: inline-block;
  padding: 14px 28px;
  border-radius: var(--r-pill);
  background: var(--aura); color: #fff;
  font-size: 17px; font-weight: 700; text-decoration: none;
  box-shadow: 0 8px 24px rgba(255, 92, 147, .3);
  transition: transform .2s cubic-bezier(.34, 1.56, .64, 1), box-shadow .2s;
}
.landing .beta-button:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(255, 92, 147, .4); }
.landing .beta-button:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.landing .beta-note { max-width: 380px; margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-500); }

.landing footer {
  padding: 24px 32px 32px;
  text-align: center;
  font-size: 13px; color: var(--ink-500);
  animation: fade-in .8s ease-out .8s both;
}
.landing footer a { color: inherit; text-underline-offset: 2px; }
.landing footer a:hover { color: var(--ink-700, inherit); }

@keyframes fade-in { from { opacity: 0; } }
@keyframes rise    { from { opacity: 0; translate: 0 18px; } }
@keyframes pop-in  { from { opacity: 0; scale: .4; } }
@keyframes glow-in { from { opacity: 0; scale: .8; } }
@keyframes bob     { 50% { translate: 0 -5px; } }
@keyframes drift   { to { transform: rotate(18deg) scale(1.15); } }
@keyframes shimmer { to { background-position: 100% 0; } }
@keyframes ring    { from { opacity: .7; scale: 1; } 70%, to { opacity: 0; scale: 1.5; } }
@keyframes ping    { 75%, to { opacity: 0; scale: 2.4; } }
@keyframes spark   { to { opacity: 0; translate: var(--dx) var(--dy); scale: .3; } }

/* Keep it still for people who ask for less motion */
@media (prefers-reduced-motion: reduce) {
  .landing *, .landing *::before, .landing *::after {
    animation: none !important;
    transition: none !important;
  }
}
