/* ───────────────────────────────────────────────
   The Fifth Arrangement — Design System
   ─────────────────────────────────────────────── */

:root {
  /* Palette */
  --black: #0a0a0a;
  --charcoal: #141414;
  --charcoal-mid: #1c1c1c;
  --gold: #c9a84c;
  --gold-bright: #dfc06b;
  --gold-dim: #a8893e;
  --amber: #8b3a3a;
  --burgundy: #5e1d1d;
  --cream: #f0e6d2;
  --cream-dim: rgba(240, 230, 210, 0.45);

  /* Typography */
  --ff-serif:  'Waterfall', cursive;
  --ff-sans:   'Montserrat', sans-serif;
  --ff-main:   var(--ff-sans);

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
}

/* ── Reset ──────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
  /* no scroll */
}

body {
  font-family: var(--ff-sans);
  color: var(--cream);
  background: var(--black);
}

/* ── Background texture + atmosphere ────────── */
body::before {
  content: '';
  position: fixed;
  inset: -10%;
  /* Darker modern blurred "picture" mesh gradient */
  background:
    radial-gradient(circle at 70% 30%, rgba(201, 168, 76, 0.10) 0%, transparent 40%),
    radial-gradient(circle at 30% 70%, rgba(139, 58, 58, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 50% 100%, rgba(80, 80, 100, 0.08) 0%, transparent 60%),
    var(--black);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: drift 20s ease-in-out infinite alternate;
}

/* High-quality grain overlay to smooth gradients and add cinematic texture */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: url('noise.svg');
  opacity: 0.15; /* Subtly textures the dark areas */
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: overlay;
}

@keyframes drift {
  0% { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.05) translate(-2%, 2%); }
}

/* Warm ambient glow from "chandelier" */
.ambient-glow {
  position: fixed;
  top: -20%;
  left: 50%;
  translate: -50% 0;
  width: 110vw;
  height: 70vh;
  background: radial-gradient(ellipse 50% 40% at 50% 0%,
      rgba(201, 168, 76, 0.15) 0%,
      rgba(139, 58, 58, 0.08) 40%,
      transparent 100%);
  pointer-events: none;
  z-index: 1;
  animation: glowPulse 6s ease-in-out infinite alternate;
}

@keyframes glowPulse {
  0% { opacity: 0.5; transform: scale(1) translate(-50%, 0); }
  100% { opacity: 1; transform: scale(1.15) translate(-50%, 4%); }
}

/* Dust / particle canvas */
#dust-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* ── Landing layout ─────────────────────────── */
.landing {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  height: 100dvh;
  padding: var(--space-lg) var(--space-md);
}

/* ── Brand ──────────────────────────────────── */
.brand {
  position: absolute;
  top: var(--space-lg);
  left: 50%;
  translate: -50% 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.brand__name {
  font-family: var(--ff-sans);
  font-weight: 300;
  font-size: clamp(0.6rem, 1.1vw, 0.85rem);
  letter-spacing: 0.55em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0;
  animation: fadeDown 1.8s ease-out 0.3s forwards;
}

.brand__sub {
  font-family: var(--ff-sans);
  font-weight: 300;
  font-size: 0.5rem;
  letter-spacing: 0.6em;
  text-transform: lowercase;
  color: var(--gold-dim);
  opacity: 0;
  animation: fadeIn 2.5s ease-out 1.2s forwards;
}

/* ── Hero ───────────────────────────────────── */
.hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.hero__headline {
  font-family: var(--ff-serif);
  font-weight: 400;
  font-size: clamp(4rem, 10vw, 8.5rem);
  line-height: 1.05;
  padding-bottom: 0.2em; /* Scripts get clipped sometimes without padding */
  letter-spacing: 0.04em;
  color: transparent;
  background: linear-gradient(170deg,
      var(--gold-bright) 0%,
      var(--gold) 35%,
      var(--gold-dim) 70%,
      var(--gold-bright) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: 0 0 30px rgba(201, 168, 76, 0.25);
  opacity: 0;
  animation:
    fadeUp 2s ease-out 0.7s forwards,
    goldShimmer 6s ease-in-out 2.7s infinite,
    headlineGlow 3s ease-in-out infinite alternate;
}

@keyframes headlineGlow {
  0% { text-shadow: 0 0 30px rgba(201, 168, 76, 0.2); }
  100% { text-shadow: 0 0 80px rgba(201, 168, 76, 0.5), 0 0 120px rgba(201, 168, 76, 0.2); }
}

/* Decorative rule line */
.hero__rule {
  position: relative;
  width: clamp(60px, 12vw, 140px);
  height: 1px;
  background: linear-gradient(90deg,
      transparent 0%,
      var(--gold-dim) 30%,
      var(--gold) 50%,
      var(--gold-dim) 70%,
      transparent 100%);
  opacity: 0;
  animation: fadeIn 1.6s ease-out 1.4s forwards;
}

.hero__rule-diamond {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: 6px;
  height: 6px;
  background: var(--gold);
  rotate: 45deg;
  box-shadow: 0 0 8px rgba(201, 168, 76, 0.4);
}

/* ── Waitlist form ──────────────────────────── */
.waitlist {
  width: 100%;
  max-width: 480px;
  opacity: 0;
  animation: fadeUp 1.8s ease-out 1.8s forwards;
}

.waitlist__status {
  font-family: var(--ff-sans);
  font-weight: 300;
  font-size: 0.55rem;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 0.8rem;
  opacity: 0;
  animation: fadeIn 2.5s ease-out 2.5s forwards;
}

.waitlist__field-group {
  display: flex;
  border: 1px solid var(--gold-dim);
  border-radius: 2px;
  overflow: hidden;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.waitlist__field-group:focus-within {
  border-color: var(--gold-bright);
  box-shadow:
    0 0 20px rgba(201, 168, 76, 0.10),
    0 0 60px rgba(201, 168, 76, 0.05);
}

.waitlist__input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 0.9rem 1.2rem;
  font-family: var(--ff-sans);
  font-weight: 300;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--cream);
  caret-color: var(--gold);
}

.waitlist__input::placeholder {
  color: var(--cream-dim);
  font-style: italic;
}

/* Fix browser autofill background override */
.waitlist__input:-webkit-autofill,
.waitlist__input:-webkit-autofill:hover,
.waitlist__input:-webkit-autofill:focus,
.waitlist__input:-webkit-autofill:active {
  -webkit-background-clip: text;
  -webkit-text-fill-color: var(--cream);
  transition: background-color 5000s ease-in-out 0s;
}

.waitlist__btn {
  background: linear-gradient(170deg,
      var(--gold-bright) 0%,
      var(--gold) 50%,
      var(--gold-dim) 100%);
  border: none;
  padding: 0.9rem 2rem;
  font-family: var(--ff-sans);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  color: var(--black);
  cursor: pointer;
  transition: all 0.35s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(201, 168, 76, 0.1);
  animation: buttonGlow 3s ease-in-out infinite alternate;
}

@keyframes buttonGlow {
  0% { box-shadow: 0 0 10px rgba(201, 168, 76, 0.05); }
  100% { box-shadow: 0 0 25px rgba(201, 168, 76, 0.25); }
}

.waitlist__btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg,
      transparent 30%,
      rgba(255, 255, 255, 0.5) 50%,
      transparent 70%);
  translate: -150% 0;
  animation: autoShine 4s ease-in-out infinite;
}

@keyframes autoShine {
  0%, 70% { translate: -150% 0; }
  100% { translate: 150% 0; }
}

.waitlist__btn:hover {
  background: linear-gradient(170deg,
      var(--gold-bright) 10%,
      var(--gold-bright) 50%,
      var(--gold) 100%);
  box-shadow: 0 0 30px rgba(201, 168, 76, 0.2);
}

.waitlist__btn:hover::before {
  translate: 150% 0;
}

.waitlist__btn:active {
  scale: 0.97;
}

/* Form feedback */
.waitlist__message {
  margin-top: var(--space-xs);
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-align: center;
  min-height: 1.2em;
  transition: opacity 0.4s ease;
}

.waitlist__message--success {
  color: var(--gold);
}

.waitlist__message--error {
  color: #c97a4c;
}

/* ── Footer ─────────────────────────────────── */
.foot {
  position: absolute;
  bottom: var(--space-md);
  right: var(--space-md);
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

.foot__contact {
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--ff-sans);
  font-weight: 300;
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: lowercase;
  color: var(--cream-dim);
  text-decoration: none;
  transition: color 0.4s ease, text-shadow 0.4s ease;
}

.foot__contact:hover {
  color: var(--gold);
  text-shadow: 0 0 8px rgba(201, 168, 76, 0.3);
}

/* ── Modal ──────────────────────────────────── */
.modal {
  margin: auto;
  border: none;
  background: transparent;
  padding: 0;
  overflow: visible;
  outline: none;
}

.modal::backdrop {
  background: rgba(10, 10, 10, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: backdropFadeIn 0.5s ease forwards;
}

.modal[open] {
  animation: modalFadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal__inner {
  position: relative;
  background: linear-gradient(145deg, rgba(20, 20, 20, 0.9), rgba(10, 10, 10, 0.95));
  border: 1px solid rgba(201, 168, 76, 0.15);
  border-radius: 2px;
  padding: var(--space-xl) var(--space-lg);
  max-width: 420px;
  width: 90vw;
  text-align: center;
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.8),
    0 0 40px rgba(201, 168, 76, 0.03) inset;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.modal__close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: transparent;
  border: none;
  color: var(--cream-dim);
  font-size: 1.8rem;
  font-weight: 300;
  cursor: pointer;
  transition: color 0.3s ease, transform 0.3s ease;
  line-height: 1;
  padding: 0.2rem 0.5rem;
}

.modal__close:hover {
  color: var(--gold-bright);
  transform: scale(1.1);
}

.modal__title {
  font-family: var(--ff-serif);
  font-weight: 400;
  font-size: 3.5rem;
  color: var(--gold);
  line-height: 1;
  margin-top: var(--space-xs);
  text-shadow: 0 0 20px rgba(201, 168, 76, 0.2);
}

.modal__rule {
  position: relative;
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--gold-dim) 50%, transparent 100%);
}

.modal__rule-diamond {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: 4px;
  height: 4px;
  background: var(--gold);
  rotate: 45deg;
}

.modal__desc {
  font-family: var(--ff-sans);
  font-size: 0.8rem;
  font-weight: 300;
  line-height: 1.6;
  color: var(--cream);
  opacity: 0.85;
}

.modal__email {
  font-family: var(--ff-sans);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--gold-bright);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 0.1em;
  transition: border-color 0.3s ease, text-shadow 0.3s ease, color 0.3s ease;
}

.modal__email:hover {
  color: #fff;
  border-color: var(--gold-dim);
  text-shadow: 0 0 15px rgba(223, 192, 107, 0.5);
}

.modal__details {
  margin-top: var(--space-sm);
  font-family: var(--ff-sans);
  font-size: 0.55rem;
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--cream-dim);
}

@keyframes backdropFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalFadeUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── Animations ─────────────────────────────── */
@keyframes fadeDown {
  from {
    opacity: 0;
    translate: 0 -16px;
  }

  to {
    opacity: 1;
    translate: 0 0;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    translate: 0 20px;
  }

  to {
    opacity: 1;
    translate: 0 0;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes goldShimmer {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

/* ── Responsive ─────────────────────────────── */
@media (max-width: 600px) {
  .brand__name {
    font-size: 0.65rem;
    letter-spacing: 0.45em;
  }

  .hero {
    gap: var(--space-lg);
  }

  .hero__headline {
    font-size: clamp(3.8rem, 16vw, 5rem);
    line-height: 0.95;
    margin-top: 1rem;
  }

  .waitlist {
    max-width: 300px;
    width: 85vw;
    margin-top: 2.5rem;
  }
  
  .waitlist__status {
    font-size: 0.5rem;
    letter-spacing: 0.5em;
    margin-bottom: 1.2rem;
  }

  .waitlist__input {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
  }

  .waitlist__btn {
    padding: 0.75rem 1.4rem;
    font-size: 0.75rem;
  }

  .foot {
    right: 50%;
    translate: 50% 0;
    width: max-content;
  }
}