@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&family=Pinyon+Script&display=swap');

/* ===== Tokens ===== */
:root {
  --color-bg: #fdfbf7;
  --color-bg-alt: #f6efe2;
  --color-champagne: #e8d5b7;
  --color-champagne-dark: #b99a63;
  --color-text: #3a332c;
  --color-text-light: #7a6f5f;
  --color-white: #ffffff;
  --color-border: #e4d8c3;
  /* darker sibling of aged gold, used only where gold carries text or button
     labels — b99a63 fails 4.5:1 as text/text-background, this passes */
  --color-gold-ink: #7c6234;

  --font-sans: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-script: 'Pinyon Script', cursive;

  --max-width: 720px;
  --section-padding: 4.5rem 1.5rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-sans); font-weight: 600; margin: 0; }

a { color: inherit; }

a:focus-visible,
button:focus-visible,
.dot-nav__dot:focus-visible {
  outline: 2px solid var(--color-champagne-dark);
  outline-offset: 2px;
}
.rsvp-form input:focus-visible,
.rsvp-form textarea:focus-visible {
  outline: none;
  border-color: var(--color-champagne-dark);
}

section.section {
  padding: var(--section-padding);
  max-width: var(--max-width);
  margin: 0 auto;
  scroll-margin-top: 1rem;
}
.section--alt { background: var(--color-bg-alt); max-width: 100%; }
.section--alt > * { max-width: var(--max-width); margin-left: auto; margin-right: auto; }

.section__title {
  font-size: 1.8rem;
  text-align: center;
  letter-spacing: 0.02em;
}

.divider {
  width: 90px;
  height: 20px;
  margin: 1rem auto 2.5rem;
  color: var(--color-champagne-dark);
}
.divider svg { width: 100%; height: 100%; }

/* ===== Invitation gate (full-screen envelope intro) ===== */
.envelope-gate {
  position: fixed;
  inset: 0;
  z-index: 300;
  overflow: hidden;
  background: var(--color-bg);
}
body.gate-active { overflow: hidden; }

.paper-texture {
  background-color: #faf6ee;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.45  0 0 0 0 0.36  0 0 0 0 0.24  0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

.envelope-paper {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 60px rgba(58, 51, 44, 0.08);
  transition: transform 0.9s cubic-bezier(0.6, 0, 0.4, 1);
}
.envelope-paper.is-leaving { transform: translateY(100%); }

.envelope__flap {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 58vh;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transition: transform 0.8s ease 0.25s;
  z-index: 2;
}
.envelope-paper.is-open .envelope__flap { transform: rotateX(180deg); }

.envelope__lace {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.envelope__fold { stroke: var(--color-champagne-dark); stroke-width: 0.3; opacity: 0.5; }
.envelope__lace-line { stroke: var(--color-champagne-dark); stroke-width: 0.5; opacity: 0.85; }
.envelope__pearls circle { fill: var(--color-champagne-dark); }

.envelope__eyebrow {
  position: absolute;
  top: 22%; left: 0; right: 0;
  text-align: center;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-text-light);
  margin: 0;
  transition: opacity 0.4s ease;
}
.envelope__names {
  position: absolute;
  top: 30%; left: 0; right: 0;
  text-align: center;
  font-family: var(--font-script);
  font-style: normal;
  font-size: clamp(2.1rem, 8vw, 2.8rem);
  color: var(--color-text);
  margin: 0;
  transition: opacity 0.4s ease;
}
.envelope__amp { color: var(--color-champagne-dark); }

.envelope__seal {
  position: absolute;
  left: 50%; top: 58vh;
  transform: translate(-50%, -50%);
  width: 72px; height: 72px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  padding: 0;
  background: radial-gradient(circle at 35% 30%, #8a6a4a 0%, #6b4f34 55%, #4c3722 100%);
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.25),
    inset 0 -3px 5px rgba(0, 0, 0, 0.45),
    0 4px 12px rgba(58, 51, 44, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: transform 0.35s ease, opacity 0.35s ease;
}
.envelope__seal-logo { width: 32px; height: auto; filter: brightness(0) invert(1) opacity(0.9); }
.envelope-paper.is-open .envelope__seal { transform: translate(-50%, -50%) scale(0.4); opacity: 0; }

.envelope-gate__hint {
  position: absolute;
  left: 0; right: 0;
  top: calc(58vh + 46px);
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-light);
  letter-spacing: 0.03em;
  margin: 0;
  transition: opacity 0.4s ease;
}
.envelope-paper.is-open .envelope-gate__hint { opacity: 0; }


/* ===== Desktop dot nav ===== */
.dot-nav {
  display: none;
}
@media (min-width: 900px) {
  .dot-nav {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    position: fixed;
    right: 1.75rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
  }
  .dot-nav__dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--color-champagne);
    border: 1px solid var(--color-champagne-dark);
    position: relative;
    transition: background 0.2s;
  }
  .dot-nav__dot:hover, .dot-nav__dot.is-active { background: var(--color-champagne-dark); }
  .dot-nav__dot::after {
    content: attr(data-label);
    position: absolute;
    right: 20px; top: 50%; transform: translateY(-50%);
    font-size: 0.75rem;
    white-space: nowrap;
    background: var(--color-white);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
  }
  .dot-nav__dot:hover::after { opacity: 1; }
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.75rem;
  overflow: hidden;
  background: url('../assets/hero-photo.jpg') center 30% / cover no-repeat;
}
/* #hero (id) beats the section.section element+class rule's max-width/margin,
   so the photo can break out full-bleed while other sections stay column-width */
#hero {
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}
.hero::before {
  /* a soft vignette focused where the text sits, so the photo stays vivid at the edges */
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 75% 65% at 50% 46%, rgba(253, 251, 247, 0.88) 0%, rgba(253, 251, 247, 0.6) 55%, rgba(253, 251, 247, 0.15) 100%),
    linear-gradient(180deg, rgba(253, 251, 247, 0.2) 0%, transparent 20%, transparent 75%, rgba(253, 251, 247, 0.75) 100%);
  z-index: 0;
}
.hero > * { position: relative; z-index: 1; }
.hero__eyebrow, .hero__names, .hero__date, .hero__location,
.countdown__value, .countdown__label {
  text-shadow: 0 1px 10px rgba(253, 251, 247, 0.7);
}
.hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}
.hero__names {
  font-family: var(--font-script);
  font-style: normal;
  font-size: clamp(3rem, 12vw, 4.5rem);
  letter-spacing: 0.02em;
  color: var(--color-text);
}
.hero__amp { font-family: var(--font-script); font-style: normal; margin: 0 0.2em; }
.hero__date { text-transform: uppercase; letter-spacing: 0.15em; font-size: 0.9rem; font-weight: 600; color: var(--color-text); margin: 0.5rem 0 0; }
.hero__location { color: var(--color-text-light); margin: 0 0 1.5rem; }

.countdown { display: flex; gap: 1.25rem; }
.countdown__unit { display: flex; flex-direction: column; align-items: center; min-width: 3.2rem; }
.countdown__value { font-family: var(--font-sans); font-size: 1.9rem; }
.countdown__label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-text-light); }

.hero__scroll {
  position: absolute;
  bottom: 1.5rem;
  text-decoration: none;
  font-size: 1.3rem;
  color: var(--color-champagne-dark);
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

.hero__crest { width: 64px; height: auto; opacity: 0.85; margin-bottom: 0.25rem; }

.hero__intro { max-width: 440px; margin-top: 0.75rem; }
.hero__intro-title {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 0.5rem;
  text-shadow: 0 1px 10px rgba(253, 251, 247, 0.7);
}
.hero__intro-text {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--color-text);
  margin: 0;
  text-shadow: 0 1px 10px rgba(253, 251, 247, 0.85);
}

.vinyl-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  width: 100%;
}
.vinyl-player__stage {
  position: relative;
  align-self: flex-start;
  margin-left: -110px;
  width: 280px; height: 280px;
  flex-shrink: 0;
}
.vinyl-player__disc {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%; height: 100%; border-radius: 50%;
  background: repeating-radial-gradient(circle, #2b2b2b 0px, #2b2b2b 1.5px, #3a3a3a 1.5px, #3a3a3a 3px);
  border: none; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(58, 51, 44, 0.25);
  animation: vinyl-spin 10s linear infinite;
  animation-play-state: paused;
}
.vinyl-player__disc.is-playing { animation-play-state: running; }
.vinyl-player__text { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.vinyl-player__text-label {
  fill: var(--color-white);
  font-family: var(--font-script);
  font-size: 24px;
}
.vinyl-player__label {
  position: relative;
  z-index: 1;
  width: 100px; height: 100px; border-radius: 50%;
  background: var(--color-champagne-dark);
  display: flex; align-items: center; justify-content: center;
}
.vinyl-player__label-logo { width: 52px; height: auto; filter: brightness(0) invert(1) opacity(0.9); }
@keyframes vinyl-spin { to { transform: rotate(360deg); } }
.vinyl-player__caption { font-size: 0.75rem; color: var(--color-text-light); margin: 0; align-self: center; }

/* ===== Dove e quando ===== */
.venue-grid { display: grid; gap: 1.5rem; }
@media (min-width: 640px) { .venue-grid { grid-template-columns: 1fr 1fr; } }
.venue-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
}
.venue-card__title { font-family: var(--font-sans); font-size: 1.2rem; margin-bottom: 0.5rem; }
.venue-card__name { font-weight: 600; margin: 0.25rem 0; }
.venue-card__address, .venue-card__time { color: var(--color-text-light); margin: 0.15rem 0; font-size: 0.9rem; }
.venue-card__link { display: inline-block; margin-top: 0.75rem; text-decoration: none; color: var(--color-gold-ink); font-size: 0.9rem; border-bottom: 1px solid var(--color-gold-ink); }

/* ===== Programma ===== */
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--color-champagne); }
.timeline__item { position: relative; padding: 0 0 1.75rem 1.5rem; }
.timeline__item::before {
  content: ''; position: absolute; left: -6.5px; top: 4px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--color-champagne-dark); border: 2px solid var(--color-bg-alt);
}
.timeline__time { font-family: var(--font-sans); font-size: 1rem; color: var(--color-gold-ink); display: block; }
.timeline__title { font-weight: 600; margin: 0.1rem 0; }
.timeline__desc { color: var(--color-text-light); font-size: 0.9rem; margin: 0; }

/* ===== Alloggi ===== */
.hotels-grid { display: grid; gap: 1.25rem; }
@media (min-width: 640px) { .hotels-grid { grid-template-columns: repeat(3, 1fr); } }
.hotel-card { background: var(--color-white); border: 1px solid var(--color-border); border-radius: 10px; padding: 1.25rem; }
.hotel-card__name { font-family: var(--font-sans); font-size: 1.05rem; margin: 0 0 0.4rem; }
.hotel-card__desc { color: var(--color-text-light); font-size: 0.88rem; margin: 0 0 0.5rem; }
.hotel-card__distance { font-size: 0.8rem; color: var(--color-gold-ink); margin: 0 0 0.6rem; }
.hotel-card__link { text-decoration: none; font-size: 0.85rem; border-bottom: 1px solid currentColor; color: var(--color-text); }

/* ===== Dress code ===== */
.dress-code__title { text-align: center; font-family: var(--font-sans); font-size: 1.3rem; margin: 0 0 0.5rem; }
.dress-code__intro { text-align: center; color: var(--color-text-light); max-width: 480px; margin: 0 auto 2rem; }
.dress-code__cols { display: grid; gap: 2rem; }
@media (min-width: 640px) { .dress-code__cols { grid-template-columns: 1fr 1fr; } }
.dress-code__col h3 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.08em; text-align: center; margin-bottom: 0.75rem; color: var(--color-text-light); }
.swatch-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; }
.swatch-list li { display: flex; align-items: center; gap: 0.4rem; font-size: 0.88rem; background: var(--color-white); border: 1px solid var(--color-border); padding: 0.35rem 0.7rem 0.35rem 0.4rem; border-radius: 999px; }
.swatch { width: 14px; height: 14px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,0.15); }

/* ===== Lista nozze ===== */
.gift-card { background: var(--color-white); border: 1px solid var(--color-border); border-radius: 10px; padding: 2rem; text-align: center; }
.gift-card__text { color: var(--color-text-light); margin: 0 0 1.25rem; }
.gift-card__iban-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--color-text-light); margin: 0; }
.gift-card__iban { font-family: var(--font-sans); font-size: 1.15rem; letter-spacing: 0.03em; margin: 0.25rem 0; }
.gift-card__intestatario { font-size: 0.85rem; color: var(--color-text-light); margin: 0 0 1.25rem; }
.gift-card__copy { background: var(--color-champagne); border: 1px solid var(--color-champagne-dark); border-radius: 999px; padding: 0.5rem 1.4rem; font-size: 0.85rem; cursor: pointer; }
.gift-card__copy:hover { background: var(--color-gold-ink); border-color: var(--color-gold-ink); color: var(--color-white); }

/* ===== Galleria ===== */
.gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
@media (min-width: 640px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
.gallery-grid--empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 3rem 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-white);
}
.gallery-empty__icon { width: 40px; height: 40px; color: var(--color-champagne-dark); }
.gallery-empty__text { color: var(--color-text-light); text-align: center; max-width: 320px; margin: 0; }

/* ===== RSVP ===== */
.rsvp__intro { text-align: center; color: var(--color-text-light); margin: 0 0 2rem; }
.rsvp-form { display: flex; flex-direction: column; gap: 1.1rem; }
.rsvp-form__field { display: flex; flex-direction: column; gap: 0.4rem; }
.rsvp-form__field label, .rsvp-form__field legend { font-size: 0.85rem; font-weight: 600; padding: 0; }
fieldset.rsvp-form__field { border: 1px solid var(--color-border); border-radius: 6px; padding: 0.8rem; margin: 0; }
fieldset.rsvp-form__field legend { padding: 0 0.3rem; margin-left: -0.3rem; }
.optional { font-weight: 400; color: var(--color-text-light); }
.rsvp-form input[type="text"],
.rsvp-form input[type="number"],
.rsvp-form textarea {
  font-family: inherit; font-size: 1rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-white);
}
.rsvp-form input:disabled { background: var(--color-bg-alt); color: var(--color-text-light); }
.rsvp-form__radios { display: flex; gap: 1.5rem; font-weight: 400; }
.rsvp-form__radios label { display: flex; align-items: center; gap: 0.4rem; font-size: 0.95rem; }
.rsvp-form__submit {
  background: var(--color-gold-ink); color: var(--color-white);
  border: none; border-radius: 999px; padding: 0.85rem; font-size: 1rem;
  cursor: pointer; margin-top: 0.5rem;
}
.rsvp-form__submit:hover { opacity: 0.9; }
.rsvp-form__note { text-align: center; font-size: 0.85rem; color: var(--color-text-light); min-height: 1.2em; }

/* ===== Il gioco (teaser) ===== */
.game-teaser__text { text-align: center; color: var(--color-text-light); max-width: 480px; margin: 0 auto 1.75rem; }
.game-teaser { text-align: center; }
.game-teaser__cta {
  display: inline-block;
  text-decoration: none;
  background: var(--color-gold-ink);
  color: var(--color-white);
  border-radius: 999px;
  padding: 0.75rem 2rem;
  font-size: 0.95rem;
}
.game-teaser__cta:hover { opacity: 0.9; }

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .envelope-paper,
  .envelope__flap,
  .envelope__seal,
  .envelope__eyebrow,
  .envelope__names,
  .envelope-gate__hint {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  .vinyl-player__disc { animation: none !important; }
  .hero__scroll { animation: none !important; }
}

/* ===== Footer ===== */
.footer { text-align: center; padding: 3rem 1.5rem 4rem; color: var(--color-text-light); font-size: 0.9rem; }
.footer__names { font-family: var(--font-sans); font-size: 1.3rem; color: var(--color-text); margin: 0 0 0.5rem; }
.footer__contacts { margin: 0 0 0.75rem; }
.footer__contacts a { text-decoration: none; border-bottom: 1px solid currentColor; }
.footer__copy { margin: 0; font-size: 0.8rem; }
