:root {
  color-scheme: light dark;
  --screen: #f9f9fb;
  --surface: rgba(255, 255, 255, 0.84);
  --text: #17171a;
  --secondary: #696970;
  --hairline: rgba(60, 60, 67, 0.18);
  --action: #087cf0;
  --action-pressed: #0068cf;
  --aura: rgba(52, 199, 89, 0.16);
  --shadow: rgba(24, 24, 27, 0.07);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100svh;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 15%, var(--aura), transparent 34rem),
    var(--screen);
}

.shell {
  width: min(100% - 2rem, 46rem);
  min-height: 100svh;
  margin: 0 auto;
  padding: clamp(2rem, 8vh, 6rem) 0 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2.5rem;
}

.brand {
  font-family: ui-serif, Georgia, serif;
  font-size: clamp(2.25rem, 7vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  text-align: center;
}

.invite-card {
  padding: 0 clamp(1rem, 7vw, 4rem);
  text-align: center;
}

.mark {
  width: 5rem;
  height: 5rem;
  margin: 0 auto 1.5rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(52, 199, 89, 0.28);
  border-radius: 50%;
  background: var(--aura);
  font-size: 2.5rem;
  animation: mark-in 480ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.eyebrow {
  margin: 0 0 0.85rem;
  color: var(--secondary);
  font-family: ui-serif, Georgia, serif;
  font-size: 0.75rem;
  font-variant: small-caps;
  letter-spacing: 0.12em;
}

h1 {
  margin: 0;
  font-family: ui-serif, Georgia, serif;
  font-size: clamp(1.85rem, 7vw, 3.15rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

h1 em { color: var(--action); font-style: normal; }

.supporting {
  max-width: 28rem;
  margin: 1.25rem auto 0;
  color: var(--secondary);
  font-size: 1.05rem;
  line-height: 1.5;
}

.avatars {
  min-height: 3.25rem;
  margin: 1.5rem auto 1.75rem;
  display: flex;
  justify-content: center;
  padding-left: 0.7rem;
}

.avatar {
  width: 3.25rem;
  height: 3.25rem;
  margin-left: -0.7rem;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 3px solid var(--screen);
  border-radius: 50%;
  background: #e8e8ed;
  color: #65656b;
  font-weight: 600;
  animation: avatar-in 360ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.avatar:nth-child(2) { animation-delay: 70ms; }
.avatar:nth-child(3) { animation-delay: 140ms; }
.avatar:nth-child(4) { animation-delay: 210ms; }

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

.primary-button, .secondary-button {
  min-height: 3.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 120ms ease, background-color 120ms ease;
}

.primary-button { width: 100%; margin-top: 1.5rem; color: white; background: var(--action); }
.primary-button:hover { background: var(--action-pressed); }
.primary-button:active, .secondary-button:active { transform: scale(0.98); }
.primary-button[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.secondary-button { margin-top: 1.5rem; color: var(--action); border: 1px solid var(--hairline); }

.instruction { margin: 1rem auto 0; color: var(--secondary); font-size: 0.875rem; line-height: 1.45; }
.android-note { margin: 1.4rem 0 0; color: var(--secondary); font-size: 0.8rem; }

.skeleton { width: 8rem; height: 2.5rem; margin: 1.8rem auto 0; display: flex; justify-content: center; }
.skeleton i { width: 2.5rem; height: 2.5rem; margin-left: -0.4rem; border-radius: 50%; background: #e8e8ed; animation: pulse 1.2s ease-in-out infinite alternate; }
.skeleton i:nth-child(2) { animation-delay: 180ms; }
.skeleton i:nth-child(3) { animation-delay: 360ms; }

footer { color: var(--secondary); text-align: center; font-family: ui-serif, Georgia, serif; font-size: 0.75rem; }

@keyframes pulse { to { opacity: 0.35; } }
@keyframes mark-in { from { opacity: 0; transform: translateY(0.8rem) scale(0.86); } }
@keyframes avatar-in { from { opacity: 0; transform: translateY(0.55rem); } }

#invite-state:not([hidden]), #error-state:not([hidden]) {
  animation: content-in 300ms ease-out both;
}
@keyframes content-in { from { opacity: 0; transform: translateY(0.4rem); } }

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

@media (prefers-color-scheme: dark) {
  :root {
    --screen: #08080a;
    --surface: rgba(28, 28, 30, 0.84);
    --text: #f4f4f5;
    --secondary: #a1a1a8;
    --hairline: rgba(235, 235, 245, 0.18);
    --aura: rgba(48, 209, 88, 0.13);
    --shadow: rgba(0, 0, 0, 0.35);
  }
  .avatar, .skeleton i { background: #2c2c2e; color: #c7c7cc; }
}

@media (max-width: 420px) {
  .shell { width: 100%; padding: 2rem 0 1rem; justify-content: center; }
  .invite-card { padding-inline: 1.5rem; }
  footer { display: none; }
}
