/*
  Background scene (bg-1600/900.avif/webp): original procedural illustration,
  generated in this project from an inline SVG (assets/bg-source.svg) and
  rasterized/encoded locally. Not a third-party photo; no external licence
  applies. "Still water at dusk" motif: dark sky, a soft moon, and faint
  rings on a calm surface.
*/

@font-face {
  font-family: "Alegreya";
  src: url("/assets/fonts/Alegreya-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya";
  src: url("/assets/fonts/Alegreya-500Italic.woff2") format("woff2");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya Sans";
  src: url("/assets/fonts/AlegreyaSans-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya Sans";
  src: url("/assets/fonts/AlegreyaSans-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0a1420;
  --ink-2: #0f2434;
  --teal: #2dd4bf;
  --teal-soft: #5eead4;
  --violet: #8b5cf6;
  --violet-soft: #a78bfa;
  --foam: #f4fbfa;
  --mist: #b9c9d6;
  --glass: rgba(244, 251, 250, 0.06);
  --glass-border: rgba(244, 251, 250, 0.14);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--foam);
  font-family: "Alegreya Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
  position: relative;
}

/* Background scene: faint, blurred, tinted through blend mode.
   Photo scenes (forest/lake/coast/beach/rain) are from Unsplash, free to use
   under the Unsplash License; sources and photographers are listed in
   brand/CREDITS.md. Default "dusk" scene is an original procedural
   illustration (assets/bg-source.svg), not a photo. */
.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.16;
  mix-blend-mode: soft-light;
  filter: blur(2px) saturate(1.2);
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: cover;
  background-image: image-set(
    url("/assets/bg-900.avif") 1x type("image/avif"),
    url("/assets/bg-900.webp") 1x type("image/webp")
  );
  animation: scene-drift 90s ease-in-out infinite alternate;
}

@media (min-width: 900px) {
  .scene {
    background-image: image-set(
      url("/assets/bg-1600.avif") 1x type("image/avif"),
      url("/assets/bg-1600.webp") 1x type("image/webp")
    );
  }
}

html[data-scene="forest"] .scene {
  opacity: 0.18;
  background-image: image-set(url("/assets/bg-forest-960.avif") 1x type("image/avif"), url("/assets/bg-forest-960.webp") 1x type("image/webp"));
}
html[data-scene="lake"] .scene {
  opacity: 0.16;
  background-image: image-set(url("/assets/bg-lake-960.avif") 1x type("image/avif"), url("/assets/bg-lake-960.webp") 1x type("image/webp"));
}
html[data-scene="coast"] .scene {
  opacity: 0.2;
  background-image: image-set(url("/assets/bg-coast-960.avif") 1x type("image/avif"), url("/assets/bg-coast-960.webp") 1x type("image/webp"));
}
html[data-scene="beach"] .scene {
  opacity: 0.14;
  background-image: image-set(url("/assets/bg-beach-960.avif") 1x type("image/avif"), url("/assets/bg-beach-960.webp") 1x type("image/webp"));
}
html[data-scene="rain"] .scene {
  opacity: 0.2;
  background-image: image-set(url("/assets/bg-rain-960.avif") 1x type("image/avif"), url("/assets/bg-rain-960.webp") 1x type("image/webp"));
}

@media (min-width: 900px) {
  html[data-scene="forest"] .scene {
    background-image: image-set(url("/assets/bg-forest-1920.avif") 1x type("image/avif"), url("/assets/bg-forest-1920.webp") 1x type("image/webp"));
  }
  html[data-scene="lake"] .scene {
    background-image: image-set(url("/assets/bg-lake-1920.avif") 1x type("image/avif"), url("/assets/bg-lake-1920.webp") 1x type("image/webp"));
  }
  html[data-scene="coast"] .scene {
    background-image: image-set(url("/assets/bg-coast-1920.avif") 1x type("image/avif"), url("/assets/bg-coast-1920.webp") 1x type("image/webp"));
  }
  html[data-scene="beach"] .scene {
    background-image: image-set(url("/assets/bg-beach-1920.avif") 1x type("image/avif"), url("/assets/bg-beach-1920.webp") 1x type("image/webp"));
  }
  html[data-scene="rain"] .scene {
    background-image: image-set(url("/assets/bg-rain-1920.avif") 1x type("image/avif"), url("/assets/bg-rain-1920.webp") 1x type("image/webp"));
  }
}

@keyframes scene-drift {
  0%   { transform: scale(1.04) translate(0, 0); }
  100% { transform: scale(1.1) translate(-1.5%, -1%); }
}

@media (prefers-reduced-motion: reduce) {
  .scene { animation: none; }
}

html[data-bg="0"] .scene {
  display: none;
}

.aurora {
  position: fixed;
  inset: 0;
  z-index: 1;
  animation: drift 26s ease-in-out infinite alternate;
}

/* Gradient variant 2 (default): cooler, single high teal bloom fading into deep indigo, less violet */
.aurora,
html[data-gradient="2"] .aurora {
  background:
    radial-gradient(65% 55% at 50% 8%, rgba(94, 234, 212, 0.24), transparent 60%),
    radial-gradient(50% 45% at 85% 90%, rgba(99, 102, 241, 0.22), transparent 65%),
    linear-gradient(200deg, #061018 0%, #0b2732 40%, #161138 82%, #061018 100%);
  background-size: 150% 150%, 150% 150%, 100% 100%;
}

/* Gradient variant 1: teal upper-left, violet lower-right, classic diagonal drift */
html[data-gradient="1"] .aurora {
  background:
    radial-gradient(60% 50% at 18% 20%, rgba(45, 212, 191, 0.28), transparent 65%),
    radial-gradient(55% 50% at 82% 75%, rgba(139, 92, 246, 0.28), transparent 65%),
    linear-gradient(160deg, #0a1420 0%, #0f2a3a 45%, #241f45 78%, #0a1420 100%);
  background-size: 140% 140%, 140% 140%, 100% 100%;
}

/* Gradient variant 3: warmer violet-forward, teal as a thin low accent, moodier */
html[data-gradient="3"] .aurora {
  background:
    radial-gradient(60% 55% at 75% 15%, rgba(167, 139, 250, 0.3), transparent 62%),
    radial-gradient(45% 40% at 15% 88%, rgba(45, 212, 191, 0.22), transparent 60%),
    linear-gradient(170deg, #0b0a1a 0%, #1c1440 45%, #0e2436 82%, #0b0a1a 100%);
  background-size: 145% 145%, 145% 145%, 100% 100%;
}

@keyframes drift {
  0%   { background-position: 0% 0%, 100% 100%, 0% 0%; }
  100% { background-position: 30% 20%, 70% 80%, 0% 0%; }
}

@media (prefers-reduced-motion: reduce) {
  .aurora { animation: none; }
}

#rain {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: block;
  pointer-events: none;
}

.stage {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6vh 20px;
  text-align: center;
}

.mark {
  width: 48px;
  height: 48px;
  margin-bottom: 22px;
  filter: drop-shadow(0 6px 24px rgba(45, 212, 191, 0.35));
}

.wordmark {
  font-family: "Alegreya", Georgia, serif;
  font-weight: 500;
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  letter-spacing: 0.01em;
  margin: 0;
  color: var(--foam);
}

.tagline {
  font-family: "Alegreya", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  color: var(--mist);
  margin: 14px 0 0;
}

.sub {
  max-width: 34ch;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--mist);
  margin: 18px 0 40px;
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 28px 26px;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 20px 60px rgba(4, 10, 20, 0.45);
  position: relative;
}

.field-row {
  display: flex;
  gap: 10px;
}

.field-row input[type="email"] {
  flex: 1;
  min-width: 0;
  background: rgba(10, 20, 32, 0.55);
  border: 1px solid rgba(244, 251, 250, 0.18);
  border-radius: 10px;
  padding: 13px 14px;
  color: var(--foam);
  font-size: 0.98rem;
  font-family: inherit;
}

.field-row input[type="email"]::placeholder {
  color: rgba(185, 201, 214, 0.6);
}

.field-row input[type="email"]:focus,
button:focus-visible,
input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--teal-soft);
  outline-offset: 2px;
}

.interests {
  margin-top: 16px;
  text-align: left;
  border: none;
  padding: 0;
}

.interests legend {
  font-size: 0.86rem;
  color: var(--mist);
  padding: 0 0 8px;
}

.interests-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.interests-options label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.9rem;
  color: var(--foam);
  cursor: pointer;
}

.interests-options input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--teal);
  cursor: pointer;
  flex: none;
}

button.submit {
  background: linear-gradient(135deg, var(--teal) 0%, var(--violet-soft) 100%);
  color: #071019;
  border: none;
  border-radius: 10px;
  padding: 13px 20px;
  font-size: 0.98rem;
  font-weight: 600;
  font-family: "Alegreya Sans", sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button.submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(45, 212, 191, 0.3);
}

button.submit:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.turnstile-wrap {
  margin-top: 16px;
  display: flex;
  justify-content: center;
}

.msg {
  margin-top: 14px;
  font-size: 0.9rem;
  min-height: 1.3em;
  color: var(--mist);
}

.msg.error {
  color: #f2a3a3;
}

.msg.success {
  color: var(--teal-soft);
}

.footnote {
  margin-top: 28px;
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 36ch;
  color: rgba(185, 201, 214, 0.75);
}

.footnote a {
  color: var(--teal-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Signup animation overlay, shown inside the card during/after submit */
.signup-anim {
  display: none;
  justify-content: center;
  align-items: center;
  padding: 6px 0 2px;
}

.signup-anim.active {
  display: flex;
  width: 96px;
  height: 96px;
  margin: 4px auto 0;
}

@media (max-width: 420px) {
  .field-row {
    flex-direction: column;
  }
  button.submit {
    width: 100%;
  }
}

/* Privacy page */
.doc {
  position: relative;
  z-index: 3;
  max-width: 640px;
  margin: 0 auto;
  padding: 10vh 20px 8vh;
  line-height: 1.7;
  color: var(--mist);
}

.doc h1 {
  font-family: "Alegreya", Georgia, serif;
  font-weight: 500;
  color: var(--foam);
  font-size: clamp(2rem, 5vw, 2.6rem);
}

.doc h2 {
  font-family: "Alegreya", Georgia, serif;
  font-weight: 500;
  color: var(--foam);
  font-size: 1.3rem;
  margin-top: 2em;
}

.doc a {
  color: var(--teal-soft);
}

.doc .back {
  display: inline-block;
  margin-top: 2.5em;
  color: var(--teal-soft);
  text-decoration: none;
  border-bottom: 1px solid rgba(94, 234, 212, 0.4);
}
