:root {
  --night: #05061a;
  --ink: #f6f2ff;
  --lav: #cfc7f5;
  --lav-dim: rgba(207, 199, 245, 0.62);
  --gold: #ffd27e;
  --gold-2: #f2a548;
  --gold-ink: #1c1235;
  --glass: rgba(16, 13, 48, 0.58);
  --edge: rgba(208, 196, 255, 0.24);
  --err: #ffb8ab;
  --gutter: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}
body { overflow-x: hidden; }

/* ---------- Hero ---------- */
.hero {
  position: fixed;
  inset: 0 0 auto 0;
  height: 100vh;
  height: 100lvh;
  overflow: hidden;
  z-index: 0;
  /* Shown before the scene draws, and if scripts are off */
  background:
    radial-gradient(60% 30% at 58% 52%, rgba(255, 196, 120, 0.22), transparent 70%),
    radial-gradient(90% 40% at 50% 50%, rgba(120, 80, 220, 0.25), transparent 70%),
    linear-gradient(#03041a 0%, #0b0d33 40%, #241a5a 50%, #0c0b2a 62%, #06061a 100%);
}
.hero-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: var(--focus, 50% 50%);
}
/* Darken the top and bottom just enough for the words and the form */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(3, 4, 22, 0.55) 0%, rgba(3, 4, 22, 0) 24%),
    linear-gradient(to top, rgba(4, 4, 20, 0.92) 0%, rgba(4, 4, 20, 0.6) 22%, rgba(4, 4, 20, 0) 44%);
}

/* ---------- Layout ---------- */
.stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding:
    calc(env(safe-area-inset-top, 0px) + max(28px, 6.5vh)) var(--gutter)
    calc(env(safe-area-inset-bottom, 0px) + max(22px, 4.5vh));
}

.brand { text-align: center; }
.wordmark {
  margin: 0;
  font-weight: 700;
  font-size: clamp(30px, 9.6vw, 68px);
  line-height: 1;
  letter-spacing: 0.26em;
  margin-right: -0.26em; /* balance the tracking after the last letter */
  background: linear-gradient(180deg, #fffaf0 25%, #ffd893 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 22px rgba(255, 196, 110, 0.35));
}
.line {
  margin: 14px 0 0;
  font-size: clamp(17px, 4.6vw, 21px);
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--lav);
}

/* ---------- Form ---------- */
.join { width: 100%; max-width: 440px; }
.field { display: flex; flex-direction: column; gap: 10px; }

.field input,
.field button {
  height: 54px;
  border-radius: 14px;
  font: inherit;
  font-size: 17px;
}
.field input {
  width: 100%;
  padding: 0 18px;
  color: var(--ink);
  background: var(--glass);
  border: 1px solid var(--edge);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input::placeholder { color: rgba(207, 199, 245, 0.55); }
.field input:focus {
  border-color: rgba(255, 210, 126, 0.8);
  box-shadow: 0 0 0 3px rgba(255, 210, 126, 0.22);
}
.field input[aria-invalid="true"] {
  border-color: rgba(255, 184, 171, 0.85);
  box-shadow: 0 0 0 3px rgba(255, 140, 120, 0.18);
}
.field button {
  border: 0;
  padding: 0 22px;
  cursor: pointer;
  font-weight: 650;
  color: var(--gold-ink);
  background: linear-gradient(180deg, #ffe2a2 0%, var(--gold) 45%, var(--gold-2) 100%);
  box-shadow: 0 10px 34px rgba(255, 176, 84, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.field button:hover { box-shadow: 0 12px 40px rgba(255, 176, 84, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.55); }
.field button:active { transform: scale(0.98); }
.field button:focus-visible { outline: 2px solid #fff3d6; outline-offset: 3px; }
.field button[aria-busy="true"] { opacity: 0.75; cursor: progress; }

.status {
  min-height: 1.3em;
  margin: 10px 0 0;
  font-size: 14px;
  text-align: center;
  color: var(--err);
}
.status:empty { margin-top: 6px; min-height: 0; }
.fine {
  margin: 8px 0 0;
  font-size: 12.5px;
  text-align: center;
  color: var(--lav-dim);
}

.thanks { text-align: center; outline: none; padding: 8px 0 14px; }
.thanks-big {
  margin: 0;
  font-size: 30px;
  font-weight: 650;
  background: linear-gradient(180deg, #fffaf0 20%, #ffd38a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.thanks-small { margin: 8px 0 0; font-size: 16px; color: var(--lav); }
.thanks:not([hidden]) { animation: rise 0.6s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.fine a, .note a, .back a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(207, 199, 245, 0.4);
  text-underline-offset: 2px;
}
.fine a:hover, .note a:hover, .back a:hover { color: var(--ink); text-decoration-color: currentColor; }
.fine a:focus-visible, .note a:focus-visible, .back a:focus-visible { outline: 2px solid #fff3d6; outline-offset: 2px; border-radius: 2px; }

/* Cloudflare's check, only when the server has Turnstile on */
.check { margin-top: 10px; }

/* Honeypot: invisible to people, tempting to bots */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Plain pages: privacy, and the form's answer when it's sent without main.js ---------- */
.stage.plain { justify-content: center; }
.back { margin: 22px 0 0; font-size: 15px; color: var(--lav-dim); }
.note {
  width: 100%;
  max-width: 34rem;
  font-size: 17px;
  line-height: 1.55;
  color: var(--lav);
}
.note h1 { margin: 0 0 14px; font-size: 26px; font-weight: 650; color: var(--ink); }
.note p { margin: 0 0 12px; }
.note .note-brand { margin: 0 0 30px; font-size: 13px; font-weight: 700; letter-spacing: 0.26em; }
.note .note-brand a { color: var(--gold); text-decoration: none; }

/* ---------- Intro video slot (off until data-src is set) ---------- */
.intro {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  padding: 8vh var(--gutter) calc(env(safe-area-inset-bottom, 0px) + 10vh);
  background: linear-gradient(to bottom, rgba(5, 6, 26, 0), var(--night) 18%);
}
.intro video {
  width: min(100%, 380px);
  aspect-ratio: 9 / 16;
  border-radius: 22px;
  background: #0b0a26;
  box-shadow: 0 0 0 1px rgba(255, 210, 126, 0.25), 0 20px 80px rgba(255, 176, 84, 0.18), 0 0 120px rgba(140, 100, 255, 0.2);
}

/* ---------- Wider screens ---------- */
@media (min-width: 560px) {
  .field {
    flex-direction: row;
    gap: 0;
    padding: 5px;
    border-radius: 18px;
    background: var(--glass);
    border: 1px solid var(--edge);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    transition: border-color 0.2s, box-shadow 0.2s;
  }
  .field:focus-within { border-color: rgba(255, 210, 126, 0.7); box-shadow: 0 0 0 3px rgba(255, 210, 126, 0.18); }
  .field input, .field input:focus, .field input[aria-invalid="true"] {
    background: transparent; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .field:has(input[aria-invalid="true"]) { border-color: rgba(255, 184, 171, 0.85); }
  .field input, .field button { height: 50px; }
  .field button { flex: none; }
  .join { max-width: 480px; }
}

/* Large screens: the same centred layout as the phone, a little larger */
@media (min-width: 900px) {
  .stage { padding-top: calc(env(safe-area-inset-top, 0px) + max(36px, 7vh)); padding-bottom: max(32px, 6vh); }
  .wordmark { font-size: clamp(52px, 4.6vw, 74px); }
  .line { font-size: 22px; margin-top: 18px; }
}

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