:root {
  /* Colors */
  --ink: #2e2e2e;
  --ink-mid: #555;
  --muted: #888;
  --rose: #c6a88f;
  --rose-dark: #a8866a;
  --rose-light: #f3e8df;
  --border: rgba(0, 0, 0, 0.08);

  /* Layout */
  --header-h: 110px;

  /* Easing */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (max-width: 768px) {
  :root { --header-h: 64px; }
}

/* ========= Reset ========= */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: linear-gradient(180deg, #faf7f5, #f2ebe7);
  color: #2e2e2e;
  line-height: 1.7;
  overflow-x: hidden;
}

/* ========= Hero section ========= */

main, .hero { padding-top: var(--header-h); }
.hero { min-height: calc(70vh - var(--header-h)); }


.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: radial-gradient(circle at top, #ffffff, #f6efea);
  animation: heroFade 1.4s ease forwards;
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.8rem;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.subtitle {
  font-size: 1.1rem;
  max-width: 420px;
  opacity: 0.8;
}

/* ========= Layout ========= */

main {
  max-width: 720px;
  margin: -4rem auto 4rem;
}

/* ========= Cards ========= */

.card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 20px 40px rgba(0,0,0,0.06);
  transition: transform 0.8s ease, opacity 0.8s ease;
}

.card.hidden {
  opacity: 0;
  transform: translateY(40px);
}

.card.visible {
  opacity: 1;
  transform: translateY(0);
}

.card h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  margin-bottom: 1rem;
}

/* ========= Event list ========= */

ul {
  margin-top: 1rem;
  padding-left: 1.2rem;
}

/* ========= Form ========= */

#rsvp-form {
  display: flex;
  flex-direction: column;
  margin-top: 1.4rem;
}
 
.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.1rem;
}
 
.form-field label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
 
.optional {
  font-size: 0.75rem;
  color: #ccc;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
 
input[type="text"],
input[type="number"],
select,
textarea {
  font-family: inherit;
  font-size: 0.96rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1.5px solid #e8e0d9;
  background: #fff;
  color: #000;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}
 
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23aaa' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}
 
textarea { resize: vertical; min-height: 90px; }
 
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(198,168,143,0.15);
}
 
#rsvp-submit {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.9rem 2rem;
  border-radius: 10px;
  border: none;
  background: #000;
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
  margin-top: 0.4rem;
  align-self: flex-start;
  position: relative;
  overflow: hidden;
}
 
/* Shimmer on hover */
#rsvp-submit::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #fff;
  color: #000;
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}
 
#rsvp-submit:hover::after { transform: translateX(100%); }
 
#rsvp-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(176,141,115,0.4);
}
 
#rsvp-submit:disabled { opacity: 0.7; cursor: not-allowed; }
#rsvp-submit.success { background: linear-gradient(135deg, #7db88a, #5a9e6a); }
#rsvp-submit.error   { background: linear-gradient(135deg, #d98c8c, #c06060); }
 
.rsvp-feedback {
  padding: 0.8rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 0.6rem;
}
 
.rsvp-feedback.success { background: green; color: #fff; border: 1px solid #b8dfc1; }
.rsvp-feedback.error   { background: red; color: #fff; border: 1px solid #f0c0c0; }


/* ========= Button ========= */

button {
  margin-top: 0.5rem;
  background: #000;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(176, 141, 115, 0.4);
}

/* Footer */
footer {
  text-align: center;
  padding: 2.5rem 1rem;
  font-size: 0.9rem;
  color: #777;
}


/* ====== PHOTO UPLOAD ===== */

.upload-area {
  margin-top: 1.2rem;
  border: 2px dashed #ddd4cb;
  border-radius: 14px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: #fdfaf8;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.2s ease;
  cursor: pointer;
}
 
.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--rose);
  background: rgba(198,168,143,0.05);
  transform: scale(1.005);
}
 
.upload-icon { font-size: 2.4rem; margin-bottom: 0.7rem; }
 
.upload-label {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  color: var(--ink-mid);
  margin-bottom: 0.3rem;
}
 
.upload-hint {
  font-size: 0.78rem;
  color: #bbb;
  margin-bottom: 1.2rem;
  letter-spacing: 0.03em;
}
 
.upload-btn {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.65rem 1.5rem;
  border-radius: 8px;
  border: 1.5px solid var(--rose);
  background: transparent;
  color: var(--rose-dark);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
 
.upload-btn:hover {
  background: var(--rose);
  color: #fff;
  transform: translateY(-1px);
}
 
.upload-list {
  margin-top: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
 
.upload-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.65rem 1rem;
  background: #fdfaf8;
  border-radius: 10px;
  border: 1px solid #ede5de;
  font-size: 0.86rem;
  animation: fadeUp 0.35s var(--ease-out) both;
}
 
.upload-item-thumb {
  width: 42px; height: 42px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--rose-light);
}
 
.upload-item-info { flex: 1; min-width: 0; }
 
.upload-item-name {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--ink-mid); font-weight: 500; font-size: 0.83rem;
}
 
.upload-item-status { font-size: 0.76rem; color: #aaa; margin-top: 0.1rem; }
.upload-item-status.uploading { color: var(--rose); }
.upload-item-status.done      { color: #5a9e6a; }
.upload-item-status.error     { color: #c06060; }
.upload-item-icon { font-size: 1rem; flex-shrink: 0; }


/* ========= Animations ========= */

@keyframes heroFade {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ========= Countdown timer ========= */

.countdown-section {
  text-align: center;
  padding: 5rem 1rem 3rem;
}

.countdown-section h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.2rem;
  max-width: 500px;
  margin: 0 auto;
}

.time-box {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border-radius: 18px;
  padding: 1.5rem 1.8rem;
  width: 100%;
  box-shadow: 0 15px 35px rgba(0,0,0,0.08);
  transition: transform 0.4s ease;
}

.time-box:hover {
  transform: translateY(-6px);
}

.time-box span {
  display: block;
  font-size: 2.4rem;
  font-weight: 600;
}

.time-box small {
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

@media (max-width: 600px) {
  .countdown {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .countdown-section {
    padding-top: 3rem;
  }

  .time-box span {
    font-size: 2rem;
  }
}


/* ========= Maps ========= */

.map-section {
  text-align: center;
}

.map-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.map-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}


/* ============ Header ============ */
.site-header {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  z-index: 100;
  background: rgba(250, 247, 245, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: box-shadow 0.4s ease;
}

.site-header.scrolled {
  box-shadow: 0 2px 24px rgba(0,0,0,0.07);
}

.header-top {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0.9rem 2rem 0.4rem;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.55rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  color: var(--ink);
  user-select: none;
}

.logo-amp { font-style: italic; color: var(--rose); }

.nav {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0.5rem 1.5rem;
}

.nav ul {
  display: flex;
  gap: 2rem;
  list-style: none;
  flex-wrap: wrap;
  justify-content: center;
}

.nav a {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #555;
  text-decoration: none;
  position: relative;
  padding: 0.4rem 0;
  white-space: nowrap;
  transition: color 0.25s ease;
}

.nav a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -1px;
  width: 100%; height: 1px;
  background: var(--rose);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-out);
}

.nav a:hover,
.nav a.active { color: var(--ink); }

.nav a:hover::after,
.nav a.active::after { transform: scaleX(1); }


/* ======= MOBILE BAR + HAMBURGER =========== */
.mobile-bar { display: none; }

.menu-toggle {
  width: 30px; height: 22px;
  background: none; border: none;
  cursor: pointer; position: relative; padding: 0;
}

.menu-toggle span {
  position: absolute; left: 0;
  width: 100%; height: 1.5px;
  background: var(--ink); border-radius: 2px;
  transition: transform 0.35s ease, opacity 0.25s ease, top 0.35s ease;
}

.menu-toggle span:nth-child(1) { top: 0; }
.menu-toggle span:nth-child(2) { top: 10px; }
.menu-toggle span:nth-child(3) { top: 20px; }

.menu-toggle.open span:nth-child(1) { top: 10px; transform: rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; transform: translateX(-6px); }
.menu-toggle.open span:nth-child(3) { top: 10px; transform: rotate(-45deg); }


/* ======= MOBILE NAV OVERLAY ====== */
.nav-overlay {
  position: fixed; inset: 0;
  z-index: 110;
  background: rgba(250, 247, 245, 0.98);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0; pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.4s ease, transform 0.4s var(--ease-out);
}

.nav-overlay.is-open {
  opacity: 1; pointer-events: auto; transform: translateY(0);
}

.nav-mobile ul {
  list-style: none; text-align: center;
  display: flex; flex-direction: column;
  gap: 1.6rem;
  padding: 2rem 1rem;
  max-height: 90vh;
  overflow-y: auto;
}

.nav-mobile a {
  font-family: 'Playfair Display', serif;
  font-size: 1.9rem;
  font-style: italic;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s ease;
  display: inline-block;
  transform: translateY(0);
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav-mobile a:hover {
  color: var(--rose);
  transform: translateY(-2px);
}

/* Stagger mobile links in */
.nav-overlay.is-open .nav-mobile li:nth-child(1) a { animation: fadeUp 0.4s 0.05s both; }
.nav-overlay.is-open .nav-mobile li:nth-child(2) a { animation: fadeUp 0.4s 0.10s both; }
.nav-overlay.is-open .nav-mobile li:nth-child(3) a { animation: fadeUp 0.4s 0.15s both; }
.nav-overlay.is-open .nav-mobile li:nth-child(4) a { animation: fadeUp 0.4s 0.20s both; }
.nav-overlay.is-open .nav-mobile li:nth-child(5) a { animation: fadeUp 0.4s 0.25s both; }
.nav-overlay.is-open .nav-mobile li:nth-child(6) a { animation: fadeUp 0.4s 0.30s both; }
.nav-overlay.is-open .nav-mobile li:nth-child(7) a { animation: fadeUp 0.4s 0.35s both; }
.nav-overlay.is-open .nav-mobile li:nth-child(8) a { animation: fadeUp 0.4s 0.40s both; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ======= MOBILE RESPONSIVE ======= */
@media (max-width: 768px) {

  .header-top, .nav { display: none; }

  .mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 1.4rem;
  }

  .mobile-logo { font-size: 1.3rem; }

  .site-header { flex-direction: row; }

  section { scroll-margin-top: 72px; }
}


/* ========= Scroll ========= */

html {
  scroll-behavior: smooth;
}

section { scroll-margin-top: calc(var(--header-h) + 16px); }


/* ========= Gallery ========= */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.6rem;
  margin-top: 1rem;
}
.gallery-item {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 10px;
  background: var(--rose-light);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s ease;
}
.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--ease-out);
}
.gallery-item:hover { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(0,0,0,0.12); }
.gallery-item:hover img { transform: scale(1.05); }
.gallery-empty {
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem;
  font-style: italic;
}
