/* =============================================
   Stefanny & Delvis — Wedding Invitation
   Color palette from invitation design
   ============================================= */

:root {
  --cream: #faf6ee;
  --cream-dark: #f0e8d8;
  --gold: #c9a962;
  --gold-light: #dfc88a;
  --copper: #8b5e3c;
  --copper-dark: #6b4a30;
  --text-muted: #9a8575;
  --white-overlay: rgba(250, 246, 238, 0.92);
  --card-shadow: 0 8px 32px rgba(107, 74, 48, 0.12);
  --nav-height: 56px;
  --section-padding: clamp(2rem, 6vw, 4rem);
  --font-script: 'Great Vibes', cursive;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Montserrat', 'Helvetica Neue', sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 1rem);
}

body {
  font-family: var(--font-sans);
  color: var(--copper);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ---- Fixed Background ---- */

.bg-fixed {
  position: fixed;
  inset: 0;
  z-index: -1;
}

.bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(250, 246, 238, 0.15) 0%,
    rgba(250, 246, 238, 0.4) 40%,
    rgba(250, 246, 238, 0.55) 100%
  );
}

/* ---- Navigation ---- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(250, 246, 238, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(201, 169, 98, 0.3);
  transition: box-shadow 0.3s ease;
}

.nav.scrolled {
  box-shadow: 0 2px 16px rgba(107, 74, 48, 0.1);
}

.nav-links {
  display: flex;
  gap: clamp(0.75rem, 3vw, 2rem);
  list-style: none;
}

.nav-link {
  font-family: var(--font-sans);
  font-size: clamp(0.65rem, 2vw, 0.75rem);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--copper);
  padding: 0.5rem 0.25rem;
  position: relative;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width 0.3s ease, left 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--gold);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
  left: 0;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  position: absolute;
  right: 1rem;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--copper);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---- Sections ---- */

main {
  position: relative;
  z-index: 1;
}

.section {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-height) + 2rem) var(--section-padding) var(--section-padding);
}

.section-hero {
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---- Cards ---- */

.card {
  width: 100%;
  max-width: 680px;
  background: var(--white-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(201, 169, 98, 0.45);
  box-shadow: var(--card-shadow);
  padding: clamp(2rem, 5vw, 3.5rem);
  text-align: center;
  position: relative;
}

.card::before,
.card::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: var(--gold);
  border-style: solid;
}

.card::before {
  top: 8px;
  left: 8px;
  border-width: 1.5px 0 0 1.5px;
}

.card::after {
  bottom: 8px;
  right: 8px;
  border-width: 0 1.5px 1.5px 0;
}

.card-transparent {
  background: rgba(250, 246, 238, 0.82);
}

/* ---- Typography ---- */

.intro-text {
  font-size: clamp(0.65rem, 2.2vw, 0.78rem);
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.script-title {
  font-family: var(--font-script);
  font-size: clamp(2.8rem, 10vw, 4.5rem);
  font-weight: 400;
  color: var(--copper);
  line-height: 1.1;
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
  color: var(--copper-dark);
  margin-bottom: 0.5rem;
}

.section-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.names {
  margin: 1.5rem 0;
}

.name {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 3.5vw, 1.5rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--copper-dark);
}

.ampersand {
  font-family: var(--font-script);
  font-size: clamp(2rem, 6vw, 3rem);
  color: var(--gold);
  line-height: 1.2;
  margin: 0.25rem 0;
}

.closing-script {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(0.95rem, 2.5vw, 1.15rem);
  color: var(--copper);
  margin-top: 1.5rem;
}

/* ---- Dividers ---- */

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 1rem auto;
  max-width: 200px;
}

.divider-sm {
  max-width: 120px;
  margin: 0.75rem auto 1.25rem;
}

.heart-dot {
  color: var(--gold);
  font-size: 0.6rem;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold-light), transparent);
}

/* ---- Countdown ---- */

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(0.5rem, 2vw, 1.25rem);
  margin-top: 0.5rem;
}

.countdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(0.75rem, 2vw, 1.25rem) 0.5rem;
  border: 1px solid rgba(201, 169, 98, 0.35);
  background: rgba(255, 255, 255, 0.4);
}

.countdown-value {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 6vw, 3rem);
  font-weight: 600;
  color: var(--copper-dark);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.countdown-label {
  font-size: clamp(0.6rem, 1.8vw, 0.72rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* ---- Details Grid ---- */

.details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 1.5rem 0;
  position: relative;
}

.detail-item {
  padding: 0 0.75rem;
  position: relative;
}

.detail-item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 10%;
  height: 80%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--gold-light), transparent);
}

.detail-icon {
  width: 32px;
  height: 32px;
  color: var(--gold);
  margin: 0 auto 0.75rem;
  display: block;
}

.detail-item h3 {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.detail-item p {
  font-family: var(--font-serif);
  font-size: clamp(0.85rem, 2.2vw, 0.95rem);
  color: var(--copper-dark);
  line-height: 1.5;
}

.venue-name {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.map-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.map-link:hover {
  border-bottom-color: var(--gold);
}

/* ---- Dress Code & After Party ---- */

.dress-code {
  margin: 2rem 0 1.5rem;
  padding: 1.25rem;
  border-top: 1px solid rgba(201, 169, 98, 0.3);
  border-bottom: 1px solid rgba(201, 169, 98, 0.3);
}

.dress-code h3,
.after-party h3 {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.dress-code-value {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  font-weight: 600;
  color: var(--copper-dark);
}

.after-party {
  margin-top: 1.5rem;
}

.after-party p {
  font-family: var(--font-serif);
  font-size: clamp(0.9rem, 2.5vw, 1.05rem);
  color: var(--copper);
  max-width: 480px;
  margin: 0 auto;
}

.after-party .note {
  font-style: italic;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* ---- Gifts ---- */

.gift-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 0.5rem;
  text-align: left;
}

.gift-option {
  padding: 1.25rem;
  border: 1px solid rgba(201, 169, 98, 0.3);
  background: rgba(255, 255, 255, 0.35);
}

.gift-icon {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}

.gift-option h3 {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--copper-dark);
  margin-bottom: 0.5rem;
}

.gift-option p {
  font-size: 0.88rem;
  color: var(--copper);
  line-height: 1.55;
}

.gift-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  color: var(--gold);
  text-decoration: none;
  word-break: break-all;
}

.gift-link:hover {
  text-decoration: underline;
}

.copy-btn {
  display: inline-block;
  margin-top: 0.5rem;
  margin-left: 0.5rem;
  padding: 0.35rem 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--copper);
  background: transparent;
  border: 1px solid var(--gold);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.copy-btn:hover {
  background: var(--gold);
  color: var(--cream);
}

.copy-btn.copied {
  background: var(--copper);
  border-color: var(--copper);
  color: var(--cream);
}

/* ---- Photos CTA ---- */

.cta-button {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.9rem 2.5rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--cream);
  background: var(--copper);
  border: 1px solid var(--copper);
  transition: background 0.25s ease, color 0.25s ease;
}

.cta-button:hover {
  background: transparent;
  color: var(--copper);
}

#photos .card > p:not(.section-subtitle) {
  font-family: var(--font-serif);
  font-size: clamp(0.9rem, 2.5vw, 1.05rem);
  color: var(--copper);
  max-width: 480px;
  margin: 0 auto;
}

/* ---- RSVP Form ---- */

.rsvp-form {
  text-align: left;
  max-width: 480px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.25rem;
  border: none;
  padding: 0;
}

.form-group legend {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--copper-dark);
  margin-bottom: 0.6rem;
  padding: 0;
}

.form-group label {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--copper-dark);
  margin-bottom: 0.5rem;
}

.required {
  color: var(--gold);
}

.rsvp-form input[type="text"],
.rsvp-form input[type="email"],
.rsvp-form select,
.rsvp-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--copper-dark);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(201, 169, 98, 0.4);
  border-radius: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.rsvp-form 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 fill='%238b5e3c' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.rsvp-form input:focus,
.rsvp-form select:focus,
.rsvp-form textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(201, 169, 98, 0.2);
}

.rsvp-form textarea {
  resize: vertical;
  min-height: 80px;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--copper);
  cursor: pointer;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(201, 169, 98, 0.3);
  background: rgba(255, 255, 255, 0.35);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.radio-label:has(input:checked) {
  border-color: var(--gold);
  background: rgba(201, 169, 98, 0.12);
}

.radio-label input[type="radio"] {
  accent-color: var(--gold);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.rsvp-form .cta-button {
  width: 100%;
  margin-top: 0.5rem;
  cursor: pointer;
  border: none;
}

.rsvp-form .cta-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-status {
  text-align: center;
  margin-top: 1rem;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  min-height: 1.4em;
}

.form-status.success {
  color: var(--copper-dark);
}

.form-status.error {
  color: #a0522d;
}

/* ---- Footer ---- */

.footer {
  text-align: center;
  padding: 2rem var(--section-padding) 3rem;
  color: var(--text-muted);
}

.footer-flourish {
  font-size: 1.25rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.footer p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.85rem;
}

/* ---- Mobile ---- */

@media (max-width: 640px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: center;
    gap: 0;
    background: rgba(250, 246, 238, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(201, 169, 98, 0.3);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
  }

  .nav-links.open {
    max-height: 400px;
  }

  .nav-links li {
    width: 100%;
    text-align: center;
  }

  .nav-link {
    display: block;
    padding: 1rem;
    font-size: 0.82rem;
  }

  /* Mobile typography — larger for readability */
  .intro-text {
    font-size: 0.8rem;
  }

  .script-title {
    font-size: 3.4rem;
  }

  .section-title {
    font-size: 1.85rem;
  }

  .section-subtitle {
    font-size: 1.1rem;
  }

  .name {
    font-size: 1.3rem;
  }

  .ampersand {
    font-size: 2.6rem;
  }

  .closing-script {
    font-size: 1.1rem;
  }

  .countdown-value {
    font-size: 2.4rem;
  }

  .countdown-label {
    font-size: 0.75rem;
  }

  .detail-item h3,
  .dress-code h3,
  .after-party h3 {
    font-size: 0.8rem;
  }

  .detail-item p {
    font-size: 1.05rem;
  }

  .map-link {
    font-size: 0.85rem;
  }

  .dress-code-value {
    font-size: 1.3rem;
  }

  .after-party p {
    font-size: 1.05rem;
  }

  .after-party .note {
    font-size: 0.95rem;
  }

  .gift-option h3 {
    font-size: 1.2rem;
  }

  .gift-option p {
    font-size: 1rem;
  }

  .gift-link {
    font-size: 1rem;
  }

  .copy-btn {
    font-size: 0.78rem;
    padding: 0.45rem 1rem;
  }

  .cta-button {
    font-size: 0.85rem;
    padding: 1rem 2.5rem;
  }

  #photos .card > p:not(.section-subtitle) {
    font-size: 1.05rem;
  }

  .form-group label,
  .form-group legend {
    font-size: 0.82rem;
  }

  .rsvp-form input[type="text"],
  .rsvp-form input[type="email"],
  .rsvp-form select,
  .rsvp-form textarea,
  .radio-label {
    font-size: 1.05rem;
  }

  .form-status {
    font-size: 1.05rem;
  }

  .footer p {
    font-size: 0.95rem;
  }

  .countdown {
    grid-template-columns: repeat(2, 1fr);
  }

  .details-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .detail-item:not(:last-child)::after {
    display: none;
  }

  .detail-item:not(:last-child) {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(201, 169, 98, 0.25);
  }

  .gift-options {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 1.75rem 1.25rem;
  }
}

@media (max-width: 380px) {
  .script-title {
    font-size: 3rem;
  }

  .countdown-value {
    font-size: 2.1rem;
  }
}

/* ---- iOS fixed background fix ---- */

@supports (-webkit-touch-callout: none) {
  .bg-fixed {
    position: absolute;
    height: 100%;
  }

  .bg-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
}

/* ---- Reduced motion ---- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    transition-duration: 0.01ms !important;
  }
}
