/* ═══════════════════════════════════════════════════
   ESCAPE VELOCITY — DESIGN SYSTEM
   Moody · Cinematic · Dark · Seductive
   ═══════════════════════════════════════════════════ */

/* ── Custom Properties ────────────────────────────── */
:root {
  --black:         #050505;
  --black-warm:    #0a0808;
  --surface:       #0f0d0e;
  --surface-hover: #161314;
  --border:        #1e1a1c;
  --border-active: #3d1525;
  --text:          #e2dbd8;
  --text-muted:    #7a706e;
  --text-dim:      #4a4244;

  --crimson:       #7a1830;
  --crimson-glow:  #b82050;
  --crimson-soft:  rgba(184, 32, 80, 0.12);
  --gold:          #c4a24e;
  --gold-dim:      #7a6530;
  --ember:         #d44a30;
  --deep-purple:   #1a0f20;

  --font-display:  'Cormorant Garamond', Georgia, serif;
  --font-body:     'Inter', -apple-system, sans-serif;
  --font-mono:     'Space Mono', monospace;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Reset ────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--text);
  background: var(--black);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

/* ═══════════════════════════════════════════════════
   PAGES
   ═══════════════════════════════════════════════════ */
.page {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page--landing {
  overflow: hidden;
}

.page--rsvp {
  overflow-y: auto;
  padding: 4rem 1.5rem;
  min-height: 100vh;
}

/* Page transition */
.page--rsvp {
  animation: pageSlideIn 1.2s var(--ease-out-expo) forwards;
}

@keyframes pageSlideIn {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ═══════════════════════════════════════════════════
   CANVAS BACKGROUNDS
   ═══════════════════════════════════════════════════ */
#particle-canvas,
#particle-canvas-2 {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

#grain-canvas,
#grain-canvas-2 {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: overlay;
}

/* ── Video Background ─────────────────────────────── */
.video-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
}

.video-bg video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  object-fit: cover;
  filter: brightness(0.85) saturate(0.8) contrast(1.1);
}

/* ── Overlays ─────────────────────────────────────── */
.overlay-vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 30%,
    rgba(5, 5, 5, 0.65) 70%,
    rgba(5, 5, 5, 0.92) 100%
  );
}

.overlay-vignette--rsvp {
  background:
    radial-gradient(
      ellipse at center,
      rgba(5, 5, 5, 0.25) 0%,
      rgba(5, 5, 5, 0.5) 60%,
      rgba(5, 5, 5, 0.8) 100%
    );
}

.overlay-glow {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(122, 24, 48, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(26, 15, 32, 0.15) 0%, transparent 50%);
  animation: glowPulse 8s ease-in-out infinite alternate;
}

@keyframes glowPulse {
  0%   { opacity: 0.6; }
  100% { opacity: 1; }
}

/* ═══════════════════════════════════════════════════
   REVEAL ANIMATION
   ═══════════════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1.4s var(--ease-out-expo),
              transform 1.4s var(--ease-out-expo);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════════════════════════════════════════════
   LANDING PAGE
   ═══════════════════════════════════════════════════ */
.landing__content {
  position: relative;
  z-index: 3;
  text-align: center;
  max-width: 600px;
  padding: 2rem;
}

.landing__kicker {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.65rem;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 2s var(--ease-out-expo) 0.2s forwards;
}

.landing__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(3.8rem, 12vw, 9rem);
  line-height: 0.9;
  letter-spacing: -0.03em;
  margin-bottom: 2rem;
}

.landing__title-line {
  display: block;
  opacity: 0;
  transform: translateY(50px);
  animation: fadeUp 1.2s var(--ease-out-expo) forwards;
}

.landing__title-line:nth-child(1) {
  animation-delay: 0.5s;
  color: var(--text);
}

.landing__title-line--accent {
  animation-delay: 0.8s;
  color: var(--crimson-glow);
  font-style: italic;
  font-weight: 400;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.landing__tagline {
  font-family: var(--font-display);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fadeUp 1.5s var(--ease-out-expo) 1.2s forwards;
}

.landing__date {
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 2vw, 1.1rem);
  letter-spacing: 0.2em;
  color: var(--text-dim);
  margin-bottom: 3.5rem;
  opacity: 0;
  animation: fadeUp 1.5s var(--ease-out-expo) 1.5s forwards;
}

.landing__arrow {
  color: var(--crimson-glow);
  display: inline-block;
  margin-left: 0.3em;
  animation: arrowPulse 2s ease-in-out infinite;
}

@keyframes arrowPulse {
  0%, 100% { opacity: 1; transform: translateX(0); }
  50% { opacity: 0.3; transform: translateX(4px); }
}

/* ── Invite Code Input ────────────────────────────── */
.landing__code-area {
  opacity: 0;
  animation: fadeUp 1.2s var(--ease-out-expo) 2s forwards;
}

.landing__code-label {
  display: block;
  font-size: 0.6rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.landing__code-input-wrap {
  position: relative;
  max-width: 280px;
  margin: 0 auto;
}

.landing__code-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 0.8rem 0;
  font-family: var(--font-mono);
  font-size: 1.4rem;
  letter-spacing: 0.35em;
  text-align: center;
  color: var(--text);
  outline: none;
  caret-color: var(--crimson-glow);
  transition: border-color 0.4s ease;
}

.landing__code-input:focus {
  border-color: var(--crimson);
}

.landing__code-input::placeholder {
  color: var(--text-dim);
  letter-spacing: 0.5em;
  font-size: 0.9rem;
}

.landing__code-line {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--crimson-glow), transparent);
  transform: translateX(-50%);
  transition: width 0.6s var(--ease-out-expo);
}

.landing__code-input:focus ~ .landing__code-line {
  width: 100%;
}

.landing__code-hint {
  margin-top: 0.8rem;
  font-size: 0.75rem;
  color: var(--crimson-glow);
  height: 1.2em;
  transition: opacity 0.3s ease;
}

/* Success flash */
.landing__code-input.code-success {
  color: var(--gold);
  border-color: var(--gold-dim);
}

.landing__code-input.code-success ~ .landing__code-line {
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  width: 100%;
}

/* ═══════════════════════════════════════════════════
   RSVP PAGE
   ═══════════════════════════════════════════════════ */
.rsvp__wrapper {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
}

/* ── Hero Text (larger, better contrast) ──────────── */
.rsvp__hero {
  text-align: center;
  margin-bottom: 3rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s var(--ease-out-expo),
              transform 1s var(--ease-out-expo);
}

.rsvp__hero.visible {
  opacity: 1;
  transform: translateY(0);
}

.rsvp__eyebrow {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: #ffd84a;
  margin-bottom: 1rem;
  text-shadow:
    0 0 10px rgba(255, 216, 74, 0.8),
    0 0 30px rgba(255, 216, 74, 0.5),
    0 0 60px rgba(255, 216, 74, 0.3),
    0 2px 4px rgba(0,0,0,1);
}

.rsvp__heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(4rem, 12vw, 7rem);
  letter-spacing: 0.15em;
  margin-bottom: 0.5rem;
  color: #fff;
  text-shadow:
    0 0 40px rgba(255,255,255,0.15),
    0 0 80px rgba(184, 32, 80, 0.2),
    0 4px 20px rgba(0,0,0,0.9);
}

/* ── Rotating Location ────────────────────────────── */
.rsvp__location {
  display: block;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 400;
  font-style: italic;
  color: #fff;
  margin-bottom: 0.8rem;
  text-shadow: 0 2px 12px rgba(0,0,0,0.8);
  line-height: 1;
}

.rsvp__location-country {
  color: rgba(255, 255, 255, 0.5);
}

.location-rotator {
  display: block;
  position: relative;
  height: 1.15em;
  overflow: hidden;
}

.location-rotator__item {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  text-align: center;
  opacity: 0;
  transform: translateY(100%);
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.location-rotator__active {
  opacity: 1;
  transform: translateY(0);
}

.location-rotator__exit {
  opacity: 0;
  transform: translateY(-100%);
}

.rsvp__sub {
  font-family: var(--font-display);
  font-style: italic;
  color: #fff;
  font-size: clamp(1.2rem, 3vw, 1.55rem);
  text-shadow: 0 2px 12px rgba(0,0,0,0.9), 0 0 30px rgba(0,0,0,0.5);
}

/* ═══════════════════════════════════════════════════
   MULTI-STEP FORM
   ═══════════════════════════════════════════════════ */
.rsvp__form {
  position: relative;
  min-height: 200px;
}

.form-step {
  display: none;
}

.form-step--active {
  display: block;
  animation: stepSlideIn 0.5s var(--ease-out-expo) forwards;
}

.form-step--exit {
  display: block;
  animation: stepSlideOut 0.4s var(--ease-out-expo) forwards;
}

.form-step--enter {
  animation: stepSlideIn 0.5s var(--ease-out-expo) forwards;
}

@keyframes stepSlideIn {
  from { opacity: 0; transform: translateX(60px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes stepSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-60px); }
}

.form-step__inner {
  padding: 0.5rem 0;
}

/* Step labels */
.step-label {
  display: block;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
  font-style: italic;
  color: #fff;
  text-shadow:
    0 1px 3px rgba(0,0,0,1),
    0 2px 10px rgba(0,0,0,0.9),
    0 0 30px rgba(0,0,0,0.5);
  margin-bottom: 1rem;
  letter-spacing: 0;
  text-transform: none;
  text-align: center;
}

.step-hint {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.3);
  margin-top: 0.6rem;
  letter-spacing: 0.1em;
}

/* Step input row (name + arrow) */
.step-input-row {
  display: flex;
  gap: 0;
  align-items: center;
  max-width: 50%;
  margin: 0 auto;
}

.step-input-row--full {
  max-width: 50%;
}

.step-input-row input {
  flex: 1;
  border-radius: 8px 0 0 8px !important;
}

/* Next arrow button */
.step-next {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 0.85rem;
  background: rgba(184, 32, 80, 0.2);
  border: 1px solid rgba(184, 32, 80, 0.4);
  border-left: none;
  border-radius: 0 8px 8px 0;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s var(--ease-out-expo);
  flex-shrink: 0;
}

.step-next:hover {
  background: rgba(184, 32, 80, 0.4);
  border-color: var(--crimson-glow);
  transform: translateX(3px);
  box-shadow: 0 0 20px rgba(184, 32, 80, 0.2);
}

.step-next--wide {
  width: 100%;
  margin-top: 1rem;
  padding: 1rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* Shake for validation */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

.shake {
  animation: shake 0.5s ease;
  border-color: var(--crimson-glow) !important;
}

/* ── Form Inputs ──────────────────────────────────── */
.form-group {
  margin-bottom: 1rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.step-input-row input {
  width: 100%;
  padding: 1rem 1.1rem;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 300;
  color: #fff;
  background: rgba(10, 8, 10, 0.85);
  border: 1px solid rgba(80, 65, 72, 0.5);
  border-radius: 8px;
  outline: none;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.step-input-row input:focus {
  border-color: var(--crimson-glow);
  box-shadow: 0 0 0 3px var(--crimson-soft), 0 0 20px rgba(184, 32, 80, 0.1);
}

.form-group input::placeholder,
.step-input-row input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.form-group__hint {
  font-size: 0.85rem;
  color: #fff;
  font-style: italic;
  margin-bottom: 0.75rem;
  text-align: center;
  text-shadow:
    0 1px 3px rgba(0,0,0,1),
    0 2px 10px rgba(0,0,0,0.9);
}

.req { color: var(--crimson-glow); }

/* ── Radio Cards ──────────────────────────────────── */
.radio-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.radio-cards--inline { flex-direction: row; }

.radio-card {
  display: block;
  cursor: pointer;
}

.radio-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-card__body {
  padding: 1rem 1.25rem;
  background: rgba(10, 8, 10, 0.75);
  border: 1px solid rgba(80, 65, 72, 0.4);
  border-radius: 8px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.4s var(--ease-out-expo);
}

.radio-card:hover .radio-card__body {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(20, 16, 18, 0.8);
}

.radio-card input:checked + .radio-card__body {
  border-color: var(--crimson-glow);
  background: rgba(184, 32, 80, 0.12);
  box-shadow: 0 0 30px rgba(184, 32, 80, 0.15);
}

.radio-card__title {
  display: block;
  font-size: 0.95rem;
  font-weight: 500;
  color: #fff;
  margin-bottom: 0.15rem;
}

.radio-card__desc {
  display: block;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
}

.radio-card--sm .radio-card__body {
  padding: 0.85rem 1rem;
  text-align: center;
}

.radio-cards--inline .radio-card { flex: 1; }

/* ── Submit ───────────────────────────────────────── */
.rsvp__submit {
  display: block;
  width: 100%;
  padding: 1.1rem;
  margin-top: 1.5rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, var(--crimson) 0%, var(--crimson-glow) 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s var(--ease-out-expo), box-shadow 0.3s ease;
}

.rsvp__submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--crimson-glow) 0%, var(--ember) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.rsvp__submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(184, 32, 80, 0.35);
}

.rsvp__submit:hover::before { opacity: 1; }

.rsvp__submit span {
  position: relative;
  z-index: 1;
}

/* ── Confirmation ─────────────────────────────────── */
.rsvp__confirmation {
  animation: pageSlideIn 0.8s var(--ease-out-expo) forwards;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.rsvp__confirmation[hidden] {
  display: none;
}

.confirm__content {
  text-align: center;
  padding: 3rem 3.5rem;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  display: inline-block;
}

.confirm__icon {
  font-size: 3.5rem;
  color: var(--gold);
  margin-bottom: 1rem;
  animation: spinIn 1s var(--ease-out-expo);
  text-shadow: 0 0 30px rgba(196, 162, 78, 0.5);
}

@keyframes spinIn {
  from { opacity: 0; transform: rotate(-180deg) scale(0.5); }
  to   { opacity: 1; transform: rotate(0deg) scale(1); }
}

.confirm__title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  color: #fff;
  text-shadow: 0 0 30px rgba(255,255,255,0.1), 0 4px 15px rgba(0,0,0,0.8);
}

.confirm__text {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
  line-height: 1.9;
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .page--rsvp {
    padding: 2.5rem 1rem;
  }

  .rsvp__wrapper {
    max-width: 100%;
  }

  .rsvp__heading {
    font-size: clamp(3rem, 10vw, 4.5rem);
  }

  .rsvp__eyebrow {
    font-size: 0.9rem;
    letter-spacing: 0.3em;
  }

  .rsvp__location {
    font-size: clamp(1.1rem, 4vw, 1.5rem);
  }

  .step-input-row,
  .step-input-row--full {
    max-width: 90%;
  }

  .step-label {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .page--rsvp {
    padding: 2rem 0.75rem;
  }

  .rsvp__heading {
    font-size: 2.8rem;
    letter-spacing: 0.1em;
  }

  .rsvp__eyebrow {
    font-size: 0.75rem;
    letter-spacing: 0.25em;
  }

  .rsvp__sub {
    font-size: 1rem;
  }

  .step-input-row,
  .step-input-row--full {
    max-width: 100%;
  }

  .step-label {
    font-size: 1rem;
  }

  .radio-cards--inline {
    flex-direction: column;
  }

  .radio-card__body {
    padding: 0.85rem 1rem;
  }

  .radio-card__title {
    font-size: 0.85rem;
  }

  .radio-card__desc {
    font-size: 0.75rem;
  }

  .rsvp__submit {
    padding: 1rem;
    font-size: 0.75rem;
  }

  .confirm__title {
    font-size: 1.8rem;
  }

  .confirm__text {
    font-size: 0.9rem;
  }

  .location-rotator {
    width: 140px;
  }
}

/* ── Selection & Scrollbar ────────────────────────── */
::selection { background: var(--crimson); color: #fff; }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--crimson); }

/* ── Page transition out ──────────────────────────── */
.page--landing.exiting {
  animation: pageFadeOut 0.8s var(--ease-out-expo) forwards;
}

@keyframes pageFadeOut {
  to {
    opacity: 0;
    transform: scale(1.02);
    filter: blur(8px);
  }
}
