/*
 * Shared launch-page engine — Leo District 306 D2 / Project Web Weavers.
 *
 * Every club page sets its own --bg / --bg2 / --ink / --on-ink / --accent /
 * --accent2 custom properties inline (see any club's index.html) and then
 * links this one stylesheet. Nothing club-specific lives in here.
 */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--on-ink);
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  overflow: hidden;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  position: relative;
}

/* Ambient background: a soft radial wash of the club's accent colour plus a
   faint moving grid, so the stage doesn't read as a flat rectangle. */
.stage-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 20%, color-mix(in srgb, var(--accent) 22%, transparent), transparent),
    radial-gradient(ellipse 50% 40% at 85% 85%, color-mix(in srgb, var(--accent2) 16%, transparent), transparent),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
}

.stage-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(color-mix(in srgb, var(--on-ink) 6%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--on-ink) 6%, transparent) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 40%, transparent 85%);
}

canvas#burst {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.stage {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 34rem;
  padding: 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.eyebrow {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--on-ink) 65%, transparent);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--on-ink) 18%, transparent);
  background: color-mix(in srgb, var(--bg2) 60%, transparent);
  backdrop-filter: blur(6px);
}

.eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 8px 1px var(--accent);
}

.crest {
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: color-mix(in srgb, var(--bg2) 80%, transparent);
  border: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 10%, transparent), 0 18px 40px rgba(0,0,0,0.35);
  transition: transform 700ms cubic-bezier(.2,1,.3,1), box-shadow 700ms ease;
}

.crest img { width: 100%; height: 100%; object-fit: cover; }

.crest .initial {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 2.6rem;
  color: var(--accent);
}

.stage.launched .crest {
  transform: scale(1.08);
  box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 16%, transparent), 0 24px 60px rgba(0,0,0,0.4);
}

h1.club-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(1.5rem, 5vw, 2.4rem);
  line-height: 1.12;
  margin: 0;
  letter-spacing: -0.01em;
}

p.theme-line {
  margin: 0;
  max-width: 30ch;
  font-size: 0.95rem;
  color: color-mix(in srgb, var(--on-ink) 72%, transparent);
  line-height: 1.5;
}

.status {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  min-height: 1.4em;
}
.status .pre { color: color-mix(in srgb, var(--on-ink) 55%, transparent); }
.status .live {
  color: var(--accent);
  display: none;
  align-items: center;
  gap: 0.5rem;
}
.status .live .dot {
  width: 7px; height: 7px; border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 10px 2px var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
}
.stage.launched .status .pre { display: none; }
.stage.launched .status .live { display: inline-flex; }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(1.3); }
}

/* Launch button */
.launch-btn {
  margin-top: 0.5rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: var(--bg);
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  border-radius: 999px;
  padding: 1rem 2.4rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent);
  animation: glow 2.2s ease-in-out infinite;
  transition: transform 180ms ease;
}
.launch-btn:hover { transform: translateY(-2px); }
.launch-btn:active { transform: translateY(0) scale(0.98); }
.launch-btn svg { width: 18px; height: 18px; }

@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 35%, transparent); }
  50% { box-shadow: 0 0 0 14px color-mix(in srgb, var(--accent) 0%, transparent); }
}

.stage.launched .launch-btn { display: none; }
/* Launch sequence: split layout — club details left, countdown right */
body.sequence { gap: clamp(2rem, 6vw, 6rem); }
body.sequence .stage { width: auto; flex: 0 1 30rem; }
body.sequence .launch-btn,
body.sequence .status { display: none; }

.mission { display: none; }
body.sequence .mission {
  display: grid;
  width: 100%;
  max-width: 22rem;
  margin: 0.25rem 0 0;
  border: 1px solid color-mix(in srgb, var(--on-ink) 14%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg2) 55%, transparent);
  backdrop-filter: blur(8px);
  overflow: hidden;
  animation: rise 600ms 150ms cubic-bezier(.2,1,.3,1) both;
}
.mission > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 1rem;
  font-size: 0.8rem;
}
.mission > div + div { border-top: 1px solid color-mix(in srgb, var(--on-ink) 9%, transparent); }
.mission dt {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.66rem;
  color: color-mix(in srgb, var(--on-ink) 55%, transparent);
  align-self: center;
}
.mission dd { margin: 0; text-align: right; font-weight: 500; }
.mission > div:last-child dd { color: var(--accent); font-family: 'Space Grotesk', sans-serif; font-weight: 700; }

.launch-panel {
  position: relative;
  z-index: 10;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  padding: 2rem 2.25rem;
  border-radius: 28px;
  border: 1px solid color-mix(in srgb, var(--on-ink) 14%, transparent);
  background: color-mix(in srgb, var(--bg2) 55%, transparent);
  backdrop-filter: blur(10px);
  box-shadow: 0 30px 80px rgba(0,0,0,0.35);
}
body.sequence .launch-panel { display: flex; animation: panelIn 750ms cubic-bezier(.2,1,.3,1) both; }
body.sequence .launch-panel.leaving { animation: panelOut 450ms ease forwards; }

@keyframes panelIn {
  from { opacity: 0; transform: translateX(60px) scale(0.92); }
  to { opacity: 1; transform: none; }
}
@keyframes panelOut {
  to { opacity: 0; transform: scale(0.9); filter: blur(6px); }
}

.lp-label {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--on-ink) 65%, transparent);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.lp-label .dot {
  width: 7px; height: 7px; border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 10px 2px var(--accent);
  animation: pulse 1s ease-in-out infinite;
}

.lp-ring {
  position: relative;
  width: clamp(11rem, 24vw, 15rem);
  aspect-ratio: 1;
}
.lp-fx {
  position: absolute;
  inset: -22%;
  width: 144%;
  height: 144%;
  pointer-events: none;
}

.lp-warp {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.lp-num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(4.5rem, 10vw, 7rem);
  line-height: 1;
  background: linear-gradient(180deg, #ffffff 0%, #f3f6fa 44%, #b4bfcc 52%, #eef2f7 62%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.55);
  filter:
    drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35))
    drop-shadow(0 0 14px color-mix(in srgb, var(--accent) 80%, transparent))
    drop-shadow(0 0 34px color-mix(in srgb, var(--accent) 55%, transparent));
}
.lp-num.tick { animation: slam 1s cubic-bezier(.2,1,.3,1) both; }
@keyframes slam {
  0% { transform: scale(2.3); opacity: 0; }
  22% { transform: scale(0.9); opacity: 1; }
  40% { transform: scale(1.05); }
  58%, 100% { transform: scale(1); opacity: 1; }
}

/* Per-style number entrances, chosen by the style's `intro` in launch.js */
.launch-panel[data-intro="flip"] .lp-num.tick { animation-name: introFlip; }
.launch-panel[data-intro="spin"] .lp-num.tick { animation-name: introSpin; }
.launch-panel[data-intro="zoom"] .lp-num.tick { animation-name: introZoom; }
.launch-panel[data-intro="drop"] .lp-num.tick { animation-name: introDrop; }
.launch-panel[data-intro="rise"] .lp-num.tick { animation-name: introRise; }
.launch-panel[data-intro="slide"] .lp-num.tick { animation-name: introSlide; }
.launch-panel[data-intro="flicker"] .lp-num.tick { animation-name: introFlicker; animation-timing-function: linear; }
.launch-panel[data-intro="pulse"] .lp-num.tick { animation-name: introPulse; }
.launch-panel[data-intro="bounce"] .lp-num.tick { animation-name: introBounce; }
.launch-panel[data-intro="glitch"] .lp-num.tick { animation-name: introGlitch; animation-timing-function: linear; }

@keyframes introFlip {
  0% { transform: perspective(400px) rotateX(-95deg); opacity: 0; }
  35% { transform: perspective(400px) rotateX(12deg); opacity: 1; }
  55%, 100% { transform: perspective(400px) rotateX(0); opacity: 1; }
}
@keyframes introSpin {
  0% { transform: rotate(-200deg) scale(0.2); opacity: 0; }
  45% { transform: rotate(10deg) scale(1.08); opacity: 1; }
  65%, 100% { transform: rotate(0) scale(1); opacity: 1; }
}
@keyframes introZoom {
  0% { transform: scale(0); opacity: 0; }
  35% { transform: scale(1.18); opacity: 1; }
  55%, 100% { transform: scale(1); opacity: 1; }
}
@keyframes introDrop {
  0% { transform: translateY(-70px); opacity: 0; }
  30% { transform: translateY(6px); opacity: 1; }
  45% { transform: translateY(-8px); }
  60%, 100% { transform: translateY(0); opacity: 1; }
}
@keyframes introRise {
  0% { transform: translateY(40px) scale(0.9); opacity: 0; }
  40%, 100% { transform: none; opacity: 1; }
}
@keyframes introSlide {
  0% { transform: translateX(60px) skewX(-15deg); opacity: 0; }
  30% { transform: translateX(-6px) skewX(4deg); opacity: 1; }
  50%, 100% { transform: none; opacity: 1; }
}
@keyframes introFlicker {
  0%, 8%, 16% { opacity: 0; }
  4%, 12%, 20%, 100% { opacity: 1; }
}
@keyframes introPulse {
  0% { transform: scale(0.6); opacity: 0; }
  15% { transform: scale(1.15); opacity: 1; }
  28% { transform: scale(0.95); }
  40% { transform: scale(1.08); }
  55%, 100% { transform: scale(1); opacity: 1; }
}
@keyframes introBounce {
  0% { transform: scale(0.3); opacity: 0; }
  30% { transform: scale(1.2); opacity: 1; }
  45% { transform: scale(0.9); }
  60% { transform: scale(1.05); }
  75%, 100% { transform: scale(1); opacity: 1; }
}
@keyframes introGlitch {
  0% { transform: translateX(-12px); clip-path: inset(0 0 60% 0); opacity: 0.4; }
  8% { transform: translateX(10px); clip-path: inset(40% 0 20% 0); opacity: 1; }
  16% { transform: translateX(-6px); clip-path: inset(70% 0 0 0); }
  24% { transform: translateX(4px); clip-path: inset(10% 0 50% 0); }
  32%, 100% { transform: none; clip-path: inset(0 0 0 0); opacity: 1; }
}

body.sequence .launch-panel.jolt { animation: jolt 260ms cubic-bezier(.36,.07,.19,.97); }
@keyframes jolt {
  20% { transform: translate(-3px, 2px); }
  45% { transform: translate(3px, -2px); }
  70% { transform: translate(-1px, 1px); }
}

.lp-step {
  margin: 0;
  min-height: 1.4em;
  font-size: 0.9rem;
  color: color-mix(in srgb, var(--on-ink) 75%, transparent);
}

.lp-bars { display: flex; gap: 6px; }
.lp-bars span {
  width: 28px;
  height: 4px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--on-ink) 15%, transparent);
  transition: background 250ms ease, box-shadow 250ms ease;
}
.lp-bars span.on { background: var(--accent); box-shadow: 0 0 10px var(--accent); }

.launch-panel.liftoff .lp-num {
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  letter-spacing: 0.08em;
}
.launch-panel.liftoff .lp-bars span { background: var(--accent2); box-shadow: 0 0 10px var(--accent2); }

body.shake { animation: shake 500ms cubic-bezier(.36,.07,.19,.97); }
@keyframes shake {
  10%, 90% { transform: translate(-1px, 1px); }
  20%, 80% { transform: translate(3px, -2px); }
  30%, 50%, 70% { transform: translate(-5px, 2px); }
  40%, 60% { transform: translate(5px, -2px); }
}

@media (max-width: 820px) {
  body.sequence { flex-direction: column; gap: 1rem; }
  body.sequence .stage { flex: none; width: 100%; padding: 1rem 1.25rem 0; gap: 0.75rem; }
  body.sequence .theme-line,
  body.sequence .eyebrow { display: none; }
  body.sequence .crest { width: 4.5rem; height: 4.5rem; }
  body.sequence .mission > div { padding: 0.45rem 0.85rem; }
  .launch-panel { padding: 1.25rem 1.5rem; gap: 0.75rem; }
  .lp-ring { width: 9.5rem; }
  .lp-num { font-size: 3.6rem; }
}

/* Post-launch CTA */
.cta {
  display: none;
  margin-top: 0.25rem;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}
.stage.launched .cta { display: flex; animation: rise 600ms cubic-bezier(.2,1,.3,1) both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.cta a.visit {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--bg);
  background: var(--on-ink);
  text-decoration: none;
  padding: 0.85rem 1.8rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: opacity 150ms ease;
}
.cta a.visit:hover { opacity: 0.85; }

.cta .soon {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--on-ink) 60%, transparent);
  border: 1px dashed color-mix(in srgb, var(--on-ink) 30%, transparent);
  border-radius: 999px;
  padding: 0.7rem 1.4rem;
}

.sound-toggle {
  position: fixed;
  top: 1.1rem;
  right: 1.1rem;
  z-index: 20;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--on-ink) 20%, transparent);
  background: color-mix(in srgb, var(--bg2) 70%, transparent);
  color: var(--on-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.sound-toggle svg { width: 16px; height: 16px; }

.hub-link {
  position: fixed;
  bottom: 1.1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  font-size: 0.72rem;
  color: color-mix(in srgb, var(--on-ink) 50%, transparent);
  text-decoration: none;
  letter-spacing: 0.04em;
}
.hub-link:hover { color: var(--on-ink); }

@media (max-width: 420px) {
  .stage { padding: 1.25rem; gap: 1rem; }
  .crest { width: 6rem; height: 6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .launch-btn, .status .live .dot, .lp-label .dot, .lp-num.tick,
  body.sequence .launch-panel, body.sequence .launch-panel.leaving, body.sequence .launch-panel.jolt,
  body.sequence .mission, body.shake { animation: none; }
  .launch-panel .lp-num.tick { animation: none !important; }
  .crest, .cta { transition: none; }
}
