/* Tokens and type follow speciefy.com (src/styles.css in the website repo). */
:root {
  --background: #050805;
  --foreground: #f3f2ee;
  --primary: #5fc655;
  --muted-foreground: #88867e;
  --input: rgba(255, 255, 255, 0.12);
  --background: oklch(0.13 0.012 145);
  --foreground: oklch(0.96 0.005 90);
  --primary: oklch(0.74 0.18 142);
  --muted-foreground: oklch(0.62 0.012 95);
  --font-serif: "Instrument Serif", serif;
  --font-sans: "Inter", sans-serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--background);
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

/* Photographic hero: a top band on phones, the full background on desktop. */
.hero {
  position: relative;
  height: 44vh;
  min-height: 300px;
  max-height: 460px;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      to bottom,
      rgba(5, 8, 5, 0.85) 0%,
      rgba(5, 8, 5, 0.3) 22%,
      transparent 40%,
      transparent 55%,
      rgba(5, 8, 5, 0.7) 80%,
      var(--background) 100%
    );
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% center;
  animation: ken-burns 24s ease-in-out infinite alternate;
}

.fireflies {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.firefly {
  position: absolute;
  border-radius: 50%;
  background: rgba(250, 222, 110, 0.8);
  box-shadow: 0 0 12px 2px rgba(250, 210, 90, 0.6);
  filter: blur(0.5px);
  opacity: 0;
  animation: firefly ease-in-out infinite;
}

@keyframes ken-burns {
  0% {
    transform: scale(1.05) translate3d(0, 0, 0);
  }
  100% {
    transform: scale(1.15) translate3d(-1.5%, -1%, 0);
  }
}

@keyframes firefly {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.8);
  }
  20% {
    opacity: 0.9;
  }
  50% {
    opacity: 0.4;
    transform: translate(20px, -30px) scale(1.1);
  }
  80% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
    transform: translate(-15px, -60px) scale(0.7);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(20px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

.brand {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  padding: 20px 24px;
}

.brand a {
  display: block;
}

.brand img {
  display: block;
  height: 26px;
  width: auto;
}

.page {
  position: relative;
  z-index: 2;
  max-width: 480px;
  margin: -64px auto 0;
  padding: 0 24px 40px;
}

h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 46px;
  line-height: 0.98;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  animation: rise 1.4s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

h1 em {
  color: var(--primary);
}

.lead {
  margin: 18px 0 0;
  max-width: 32rem;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(243, 242, 238, 0.8);
  animation: rise 1.4s cubic-bezier(0.22, 1, 0.36, 1) 0.6s both;
}

.eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--primary);
}

.invite {
  margin-top: 36px;
}

.code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
}

.code {
  margin: 0;
  font-size: 30px;
  font-weight: 400;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  user-select: all;
  -webkit-user-select: all;
}

.feedback {
  margin: 6px 0 0;
  min-height: 18px;
  font-size: 13px;
  color: var(--primary);
}

.invalid {
  margin-top: 32px;
}

.invalid h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.invalid p {
  margin: 8px 0 0;
  line-height: 1.6;
  color: rgba(243, 242, 238, 0.8);
}

.actions {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 32px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.3s,
    box-shadow 0.3s,
    border-color 0.3s;
}

.pill.primary {
  background: var(--primary);
  color: var(--background);
}

.pill.primary:hover {
  box-shadow: 0 0 40px -8px rgba(95, 198, 85, 0.45);
}

.pill.outline,
.pill.small {
  border-color: var(--input);
}

.pill.outline:hover,
.pill.small:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.04);
}

.pill.small {
  min-height: 40px;
  padding: 0 20px;
  font-size: 14px;
}

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.stores a {
  display: block;
  transition: opacity 0.3s;
}

.stores a:hover {
  opacity: 0.9;
}

.stores img {
  display: block;
  height: 48px;
  width: auto;
}

.help {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted-foreground);
  text-align: center;
}

.qr-block {
  display: grid;
  gap: 12px;
  justify-items: start;
}

.qr {
  width: 152px;
  height: 152px;
  padding: 10px;
  border-radius: 12px;
  background: #ffffff;
}

.qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

footer {
  display: grid;
  gap: 10px;
  justify-items: start;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.privacy {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted-foreground);
}

.read-more {
  font-size: 13px;
  color: rgba(243, 242, 238, 0.7);
  text-underline-offset: 3px;
}

@media (min-width: 900px) {
  .hero {
    position: fixed;
    inset: 0;
    height: auto;
    max-height: none;
  }

  .hero::after {
    background:
      radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%),
      linear-gradient(to bottom, rgba(5, 8, 5, 0.9) 0%, rgba(5, 8, 5, 0.4) 10%, transparent 20%),
      linear-gradient(to right, var(--background) 0%, rgba(5, 8, 5, 0.75) 32%, transparent 58%),
      linear-gradient(to top, var(--background) 0%, transparent 18%);
  }

  /* Keeps the butterfly clear of the invite code. */
  .hero-image {
    object-position: 30% center;
  }

  .brand {
    padding: 28px 64px;
  }

  .brand img {
    height: 28px;
  }

  .page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
    padding: 112px 64px 40px;
  }

  .page > * {
    max-width: 640px;
  }

  .page > h1 {
    max-width: 860px;
    font-size: clamp(64px, 6.6vw, 88px);
    line-height: 0.94;
  }

  .lead {
    margin-top: 24px;
    font-size: 20px;
  }

  .invite {
    display: flex;
    align-items: flex-start;
    gap: 56px;
    margin-top: 44px;
  }

  .code-row {
    justify-content: flex-start;
  }

  .qr-block {
    order: -1;
  }

  .actions {
    margin-top: 28px;
  }

  .pill.primary,
  .pill.outline,
  .help {
    display: none !important;
  }

  .page > footer {
    max-width: 540px;
    margin-top: 56px;
    border-top: 0;
    padding-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-image,
  h1,
  .lead {
    animation: none;
  }

  .fireflies {
    display: none;
  }
}
