*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #0a0a0a;
  --ink: #f5f5f5;
  --muted: #9a9a9a;
  --line: #262626;
  color-scheme: dark;
}

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

.page {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.75rem, 5vw, 3rem);
  padding:
    max(2rem, env(safe-area-inset-top))
    max(1rem, env(safe-area-inset-right))
    max(1.5rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
}

/* Logo */
.brand {
  width: 100%;
  display: flex;
  justify-content: center;
  padding-top: clamp(0.5rem, 3vw, 2rem);
}

.logo {
  position: relative; /* paint above .brand::before glow */
  display: block;
  width: min(78vw, 420px);
  height: auto;
  /* Source logo is black on white: invert to white on black, then screen drops the black. */
  filter: invert(1);
  mix-blend-mode: screen;
  animation:
    logo-in 1.1s cubic-bezier(.2, .8, .2, 1) both,
    logo-float 5s ease-in-out 1.1s infinite;
}

@keyframes logo-in {
  from { opacity: 0; transform: translateY(14px) scale(.96); filter: invert(1) blur(6px); }
  to   { opacity: 1; transform: none; filter: invert(1); }
}

/* Short flash after an invite request. The logo image is opaque, so the light sits
   behind it and shows through the screen-blended black. */
.brand { position: relative; }

.brand::before {
  content: "";
  position: absolute;
  inset: -30% 0;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .45), transparent);
  opacity: 0;
  pointer-events: none;
}

.brand.glow::before { animation: brand-flash 1.4s ease-out both; }

.brand.glow .logo {
  animation:
    logo-pop 1.4s ease-out both,
    logo-float 5s ease-in-out 1.4s infinite;
}

@keyframes brand-flash {
  0%   { opacity: 0; }
  20%  { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes logo-pop {
  0%, 100% { transform: scale(1); }
  20%      { transform: scale(1.05); }
}

@keyframes logo-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-6px) scale(1.015); }
}

/* Video */
.stage {
  width: 100%;
  max-width: 900px;
  animation: fade-up 1s .25s cubic-bezier(.2, .8, .2, 1) both;
}

.video-frame {
  position: relative;
  border-radius: clamp(14px, 3vw, 22px);
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 0 1px var(--line), 0 20px 50px -20px rgba(0, 0, 0, .8);
}

.video-frame video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 72svh;
  object-fit: contain;
  background: #000;
}

.sound {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 44px;
  padding: .55rem 1rem .55rem .8rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: #0a0a0a;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .2);
  animation: pulse 2s ease-in-out infinite;
}

.sound[hidden] { display: none; }
.sound svg { width: 20px; height: 20px; }

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

/* Invite */
.invite {
  width: 100%;
  max-width: 460px;
  text-align: center;
  animation: fade-up 1s .35s cubic-bezier(.2, .8, .2, 1) both;
}

.invite-kicker {
  margin: 0 0 .6rem;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .32em;
  text-transform: uppercase;
}

.invite-title {
  margin: 0 0 1.25rem;
  font-size: clamp(1.35rem, 5vw, 1.7rem);
  font-weight: 300;
  letter-spacing: .04em;
}

.invite-form {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.invite-form[hidden] { display: none; }

.invite-form input,
.invite-form button {
  width: 100%;
  min-height: 52px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 1rem;
}

.invite-form input {
  padding: 0 1.25rem;
  border: 1px solid #333;
  background: #111;
  color: var(--ink);
  text-align: center;
  letter-spacing: .02em;
  transition: border-color .2s, box-shadow .2s;
}

.invite-form input::placeholder { color: #666; }

.invite-form input:focus {
  outline: none;
  border-color: #8a8a8a;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .06);
}

.invite-form button {
  border: 0;
  background: linear-gradient(180deg, #ffffff, #d9d9d9);
  color: #0a0a0a;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 24px -10px rgba(255, 255, 255, .35);
  transition: transform .15s, box-shadow .2s;
}

.invite-form button:hover { box-shadow: 0 10px 30px -8px rgba(255, 255, 255, .5); }
.invite-form button:active { transform: scale(.98); }

.invite-error {
  margin: .75rem 0 0;
  color: #e08a8a;
  font-size: .85rem;
}

.invite-done {
  margin: 0;
  padding: 1rem 0;
  font-size: 1.05rem;
  font-weight: 300;
  letter-spacing: .04em;
  animation: fade-up .6s cubic-bezier(.2, .8, .2, 1) both;
}

.invite-error[hidden],
.invite-done[hidden] { display: none; }

/* Disclaimer */
.disclaimer {
  margin-top: auto;
  width: 100%;
  max-width: 640px;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: clamp(.8rem, 2.6vw, .9rem);
  line-height: 1.6;
  animation: fade-up 1s .45s cubic-bezier(.2, .8, .2, 1) both;
}

.disclaimer p { margin: 0; }

.disclaimer-title {
  margin-bottom: .35rem !important;
  color: var(--ink);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
}
