/* ═══════════════════════════════════════════════════════
   BASE RESET & TOKENS
══════════════════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans:  'Jost', system-ui, sans-serif;

  --color-sky:    #a8cfe0;
  --color-sand:   #e8d5b0;
  --color-frost:  rgba(255, 255, 255, 0.18);
  --color-white:  #ffffff;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;           /* no scroll during preloader */
  background: #c9a07a;        /* warm sunset sand — masks any flash before hero renders */
  -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════════════════
   PRELOADER
══════════════════════════════════════════════════════ */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Transition handled by JS class .fade-out */
  transition: opacity 0.9s var(--ease-out-expo), visibility 0.9s;
}

#preloader.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#preloader-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* White shimmer overlay that fades in at the very end of video */
#preloader-overlay {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease-in;
}

#preloader-overlay.glow {
  opacity: 1;
}


/* ═══════════════════════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════════════════════ */
#main-content {
  position: fixed;
  inset: 0;
  opacity: 0;
  transform: scale(1.04);
  transition:
    opacity 1s var(--ease-out-expo) 0.15s,
    transform 1.1s var(--ease-out-expo) 0.15s;
  will-change: opacity, transform;

  /* Scroll container */
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: y mandatory;
  
  /* Hide scrollbar for Firefox and IE/Edge */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* Hide scrollbar for Chrome, Safari, and Opera */
#main-content::-webkit-scrollbar {
  display: none;
}

#main-content.visible {
  opacity: 1;
  transform: scale(1);
}

/* ─── Hero background ─── */
.hero-bg {
  width: 100%;
  height: 100svh;      /* first snap section = full viewport */
  position: relative;
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* Bottom edge — fades hero into the shared amber at the seam */
.hero-bg .section-inner::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 36px;
  background: linear-gradient(to bottom, transparent 0%, #c89040 100%);
  pointer-events: none;
  z-index: 3;
}

/* ─── Section inner — the clipping/positioning context for content ─── */
.section-inner {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  /* Subtle Ken-Burns breathing effect — very slow */
  animation: breathe 18s ease-in-out infinite alternate;
}

@keyframes breathe {
  from { transform: scale(1);    }
  to   { transform: scale(1.04); }
}

/* ─── Hero text overlay ─── */
.hero-text {
  position: absolute;
  /* Arch opening sits roughly in the centre column;
     text appears in the upper sky portion of the arch */
  top: 38%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  width: 58%;          /* spans the arch opening width */
  pointer-events: none;

  /* Fade in slightly after the hero itself reveals */
  opacity: 0;
  animation: textReveal 1s var(--ease-out-expo) 1.2s forwards;
}

@keyframes textReveal {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0);    }
}

/* "You're Invited." */
.hero-invited {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(2rem, 11vw, 2.8rem);
  font-weight: 400;
  font-style: normal;
  color: #1a1a1a;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 0.35em;
}

/* "#naylibu23" */
.hero-hashtag {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(1.2rem, 6vw, 1.6rem);
  font-weight: 400;
  color: #1a1a1a;
  letter-spacing: 0.01em;
  opacity: 0.88;
}

/* ─── Scroll arrow ─── */
.scroll-arrow {
  position: absolute;
  bottom: 5vh;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  opacity: 0;
  animation:
    textReveal 1s var(--ease-out-expo) 1.6s forwards,
    arrowFloat 2s ease-in-out 2.6s infinite;
  z-index: 10;
}

.scroll-arrow svg {
  width: 28px;
  height: 28px;
  color: rgba(255, 255, 255, 0.75);
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.25));
}

@keyframes arrowFloat {
  0%, 100% { transform: translateX(-50%) translateY(0);    }
  50%       { transform: translateX(-50%) translateY(8px); }
}

/* ─── Sand section ─── */
.sand-section {
  width: 100%;
  min-height: 100svh;
  position: relative;
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* Top edge — fades from the shared amber into the sand image */
.sand-section .section-inner::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 36px;
  background: linear-gradient(to bottom, #c89040 0%, transparent 100%);
  pointer-events: none;
  z-index: 2;
}

.sand-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.sand-content {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 3svh; /* Moved downwards to center between arrows */
}

.sand-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(2rem, 8vw, 2.5rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  margin-bottom: -1.5rem;
}

.sand-desc {
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.4;
  opacity: 0.95;
}

.sand-details {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 1rem 0;
}

.detail-item h3 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 400;
  margin-bottom: 0.2rem;
  color: #2c1a0e;
}

.detail-item p {
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.4;
}

.detail-sub {
  font-size: 0.9rem;
  opacity: 0.8;
  font-style: italic;
}

.sand-special {
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.5;
  font-style: italic;
  padding: 0 1rem;
  opacity: 0.95;
  border-left: 1px solid rgba(92, 58, 33, 0.4);
  border-right: 1px solid rgba(92, 58, 33, 0.4);
}

.rsvp-section {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.rsvp-deadline {
  font-size: 1.05rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #3e2412;
}

.btn-rsvp {
  display: inline-block;
  transition: transform 0.3s var(--ease-out-expo);
  /* Removed fixed width and height to let the image dictate dimensions */
}

.btn-rsvp:hover {
  transform: translateY(-2px) scale(1.02);
}

.btn-icon {
  display: block;
  width: 150px;
  height: auto;
  /* Layered, warm drop-shadows to realistically anchor the shell on the sand */
  filter: 
    drop-shadow(0 2px 4px rgba(44, 21, 6, 0.6)) 
    drop-shadow(0 10px 15px rgba(44, 21, 6, 0.4))
    drop-shadow(0 20px 30px rgba(44, 21, 6, 0.25));
}



/* Bottom edge — covers dark shadow at Sand 2 bottom, blends into plane seam */
.sand-section .section-inner::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 90px;
  background: linear-gradient(
    to bottom,
    transparent        0%,
    rgba(192,120,48, 0.5)  50%,
    #c07830           100%
  );
  pointer-events: none;
  z-index: 3;
}

/* ─── Plane section ─── */
.plane-section {
  width: 100%;
  min-height: 100svh;
  position: relative;
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* Top edge — fades from seam amber into the plane's warm sky */
.plane-section .section-inner::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 90px;
  background: linear-gradient(
    to bottom,
    #c07830            0%,
    rgba(192,120,48, 0.5)  50%,
    transparent       100%
  );
  pointer-events: none;
  z-index: 2;
}

.plane-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.plane-content {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 15svh 2rem 18svh; /* Increased bottom padding to move text up */
  text-align: center;
  color: #1a0f05; /* Deep warm black/brown */
  font-family: var(--font-sans);
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.7), 0 0 40px rgba(255, 255, 255, 0.5); /* White glow for legibility against the sky */
}

.plane-top h2 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 2.2rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

.plane-top p {
  font-size: 1.15rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  opacity: 0.95;
}

.plane-bottom {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.flight-details p {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 400;
  margin: 0.2rem 0;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.transport-note {
  font-size: 0.9rem;
  font-weight: 300;
  font-style: italic;
  opacity: 0.85;
}

/* ═══════════════════════════════════════════════════════
   RSVP PAGE
══════════════════════════════════════════════════════ */
#rsvp-main {
  position: fixed;
  inset: 0;
  background: url('Assets/RSVP.jpg') center/cover no-repeat;
  background-attachment: scroll;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.rsvp-container {
  width: 100%;
  max-width: 380px;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  margin: auto;
  position: relative;
  z-index: 10;
}

.back-btn {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: #3e2412;
  text-decoration: none;
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-size: 1.3rem;
  transition: opacity 0.2s;
}
.back-btn:hover { opacity: 0.7; }

.rsvp-container h1 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 3rem;
  font-weight: 400;
  text-align: center;
  margin-bottom: 1.5rem;
  color: #2c1a0e;
}

.rsvp-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 400;
  color: #2c1a0e;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group select {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.15rem;
  padding: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.4);
  color: #2c1a0e;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.form-group input[type="text"]::placeholder,
.form-group input[type="email"]::placeholder,
.form-group input[type="tel"]::placeholder,
.form-group input[type="number"]::placeholder {
  color: rgba(44, 26, 14, 0.6);
  font-family: 'Instrument Serif', Georgia, serif;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="tel"]:focus,
.form-group input[type="number"]:focus,
.form-group select:focus {
  border-color: #c07830;
  background: rgba(255, 255, 255, 0.7);
}

/* ─── Attendance Toggle Buttons ─── */
.attendance-toggle {
  display: flex;
  gap: 1rem;
}

.toggle-btn {
  flex: 1;
  position: relative;
  cursor: pointer;
}

.toggle-btn input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-btn span {
  display: block;
  text-align: center;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.15rem;
  padding: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.4);
  color: #2c1a0e;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.toggle-btn input[type="radio"]:checked + span {
  background: #c07830;
  color: #fff;
  border-color: #c07830;
}

.toggle-btn input[type="radio"]:focus-visible + span {
  outline: 2px solid #c07830;
  outline-offset: 2px;
}

.submit-btn {
  margin-top: 1rem;
  padding: 0.9rem;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 400;
  color: #fff;
  background: #c07830;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.submit-btn:hover {
  background: #a96726;
  transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════════════
   DESKTOP — centred mobile-width column on dark background
══════════════════════════════════════════════════════ */
@media (min-width: 768px) {
  /* Dark outer shell */
  html, body {
    background: #111;
  }

  /* Center the entire scroll container and preloader */
  #preloader,
  #main-content,
  #rsvp-main {
    left: 50%;
    right: auto;
    width: min(430px, 100%);
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.7);
  }

  #preloader,
  #rsvp-main {
    transform: translateX(-50%);
  }

  #main-content {
    transform: translateX(-50%) scale(1.04);
  }

  #main-content.visible {
    transform: translateX(-50%) scale(1);
  }

  /* Reset inner columns to fill their new parent container */
  .section-inner,
  #preloader-video,
  #preloader-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    transform: none;
    box-shadow: none;
  }
}
