/* =========================================================
   Martina & Simone — 29.05.2027
   Stile: editoriale moderno, tipografia ampia, hero fotografico
   Palette: "Peachy Sunrise" (vedi COLORI.md) — usare SEMPRE le variabili
   ========================================================= */

:root {
  /* Palette base */
  --ivory: #FBF6EF;   /* sfondo principale */
  --ink:   #4A3A30;   /* testo caldo */

  /* Accenti caldi */
  --sun:   #F2C879;   /* giallo sole: sfondi sezione caldi, highlight */
  --peach: #F7CBA6;   /* sfondi soft delle sezioni */
  --coral: #EE8C68;   /* accento principale: bottoni, link, "&" */
  --blush: #F2A9AC;   /* dettagli, hover delicati */

  /* Accenti freddi */
  --sky:   #AFD3E6;   /* accenti freschi */
  --dusty: #5F84A4;   /* testo secondario, etichette, bordi */

  /* Verde */
  --sage:  #8FA38C;   /* dettagli botanici */

  /* Token derivati (per non sparpagliare hex nelle regole) */
  --surface: #FFFFFF;
  --ivory-90: rgba(251, 246, 239, 0.9);
  --ivory-60: rgba(251, 246, 239, 0.6);
  --line: rgba(95, 132, 164, 0.18);          /* da --dusty */

  /* Velature tenui: i colori della palette appena accennati su carta avorio */
  --wash-sky:   #EDF3F7; /* azzurro sussurrato */
  --wash-sun:   #FBF3DF; /* giallo sole sussurrato */
  --wash-peach: #FCEFE3; /* pesca sussurrata */

  --shadow: 0 12px 30px rgba(74, 58, 48, 0.05);
  --shadow-lg: 0 22px 50px rgba(74, 58, 48, 0.09);
  --hero-overlay: linear-gradient(to bottom, rgba(74,58,48,0.5) 0%, rgba(74,58,48,0.22) 35%, rgba(74,58,48,0.66) 100%);

  --maxw: 1180px;
  --display: "Fraunces", Georgia, serif;
  --sans: "Outfit", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--ivory);
  line-height: 1.7;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.05; }
a { color: inherit; }
::selection { background: var(--coral); color: var(--ivory); }

/* ===== Nav ===== */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 32px;
  transition: background 0.4s var(--ease), padding 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.nav.scrolled {
  background: var(--ivory-90);
  backdrop-filter: blur(12px);
  padding: 14px 32px;
  box-shadow: 0 1px 0 var(--line);
}
.nav__brand {
  font-family: var(--display); font-size: 1.25rem; font-weight: 500;
  text-decoration: none; letter-spacing: 0.3px; color: var(--surface);
  transition: color 0.4s var(--ease);
}
.nav__brand span { font-style: italic; color: var(--coral); }
.nav.scrolled .nav__brand { color: var(--ink); }
.nav__menu { display: flex; gap: 30px; }
.nav__menu a {
  text-decoration: none; font-size: 0.78rem; text-transform: uppercase;
  letter-spacing: 1.6px; font-weight: 500; color: var(--surface);
  position: relative; transition: color 0.3s;
}
.nav.scrolled .nav__menu a { color: var(--ink); }
.nav__menu a::after {
  content: ""; position: absolute; left: 0; bottom: -6px;
  width: 0; height: 1.5px; background: var(--coral); transition: width 0.3s var(--ease);
}
.nav__menu a:hover::after { width: 100%; }
.nav__toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; z-index: 110; }
.nav__toggle span { width: 26px; height: 2px; background: var(--surface); transition: 0.3s var(--ease); }
.nav.scrolled .nav__toggle span { background: var(--ink); }

/* ===== Hero ===== */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  text-align: center; color: var(--surface); overflow: hidden;
  padding: 120px 24px 80px;
}
.hero__media {
  position: absolute; inset: 0;
  /* Salva la vostra foto come assets/img/hero.jpg */
  background: var(--ink) url("../img/hero.jpg") center 30% / cover no-repeat;
  transform: scale(1.05);
  animation: heroZoom 14s ease-out forwards;
}
@keyframes heroZoom { to { transform: scale(1); } }
.hero__overlay { position: absolute; inset: 0; background: var(--hero-overlay); }
.hero__inner { position: relative; z-index: 2; max-width: 900px; }
.hero__eyebrow {
  text-transform: uppercase; letter-spacing: 5px; font-size: 0.78rem;
  font-weight: 500; margin-bottom: 22px; opacity: 0; animation: fadeUp 1s var(--ease) 0.2s forwards;
}
.hero__names {
  font-size: clamp(3.4rem, 13vw, 9rem); font-weight: 400; letter-spacing: -1px;
  display: flex; flex-direction: column; align-items: center; line-height: 0.92;
  text-shadow: 0 2px 40px rgba(0,0,0,0.35);
  opacity: 0; animation: fadeUp 1.1s var(--ease) 0.35s forwards;
}
.hero__names em {
  font-style: italic; color: var(--peach); font-size: 0.42em; font-weight: 300;
  margin: 0.05em 0;
}
.hero__meta {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 14px;
  font-size: clamp(0.95rem, 2.5vw, 1.15rem); letter-spacing: 2px; text-transform: uppercase;
  margin-top: 28px; opacity: 0; animation: fadeUp 1s var(--ease) 0.55s forwards;
}
.hero__dot { opacity: 0.6; }

/* Countdown */
.countdown {
  display: flex; justify-content: center; gap: clamp(18px, 5vw, 48px);
  margin: 44px 0 40px; opacity: 0; animation: fadeUp 1s var(--ease) 0.7s forwards;
}
.countdown__item { display: flex; flex-direction: column; min-width: 54px; }
.countdown__num { font-family: var(--display); font-size: clamp(2.2rem, 7vw, 3.8rem); font-weight: 400; line-height: 1; font-variant-numeric: tabular-nums; }
.countdown__label { text-transform: uppercase; letter-spacing: 2.5px; font-size: 0.68rem; margin-top: 10px; opacity: 0.85; }

.hero__scroll {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 2; color: var(--surface); text-decoration: none; font-size: 1.4rem;
  opacity: 0.8; animation: bob 2s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Intro / Save the date ===== */
.intro {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(70px, 12vw, 130px) 32px;
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(36px, 6vw, 80px); align-items: center;
}
.intro__photo {
  position: relative; aspect-ratio: 5 / 4; border-radius: 24px; overflow: hidden;
  background: var(--ink); box-shadow: var(--shadow-lg);
}
.intro__photo::after {
  content: "La vostra foto comparirà qui"; position: absolute; inset: 0;
  display: grid; place-items: center; text-align: center; padding: 24px;
  color: var(--ivory-60); font-size: 0.95rem; letter-spacing: 1px;
}
.intro__photo img {
  position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 1.2s var(--ease);
}
.intro__photo img.is-missing { display: none; }
.intro:hover .intro__photo img { transform: scale(1.04); }
.intro__text h2 { font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -1px; margin: 14px 0 22px; }
.intro__text h2 em { font-style: italic; color: var(--coral); }
.intro__text p { color: var(--ink); opacity: 0.85; font-size: 1.08rem; }
.intro__sign { font-family: var(--display); font-style: italic; font-size: 1.5rem; color: var(--coral); margin-top: 22px; }

@media (max-width: 820px) {
  .intro { grid-template-columns: 1fr; }
}

/* ===== Buttons ===== */
.btn {
  display: inline-block; text-decoration: none; cursor: pointer; position: relative;
  padding: 15px 38px; border-radius: 999px; overflow: hidden;
  font-size: 0.76rem; text-transform: uppercase; letter-spacing: 2px; font-weight: 500;
  border: 1.5px solid transparent; transition: color 0.4s var(--ease), background 0.4s var(--ease), border-color 0.4s var(--ease), transform 0.3s var(--ease);
}
.btn:hover { transform: translateY(-3px); }
.btn--light { background: var(--surface); color: var(--ink); }
.btn--light:hover { background: var(--coral); color: var(--surface); }
.btn--dark { background: var(--coral); color: var(--surface); }
.btn--dark:hover { background: var(--ink); }
/* background esplicito: sui <button> altrimenti resta il grigio di sistema */
.btn--ghost { background: transparent; border-color: var(--coral); color: var(--coral); }
.btn--ghost:hover { background: var(--coral); color: var(--surface); border-color: var(--coral); }

/* ===== Sections ===== */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(70px, 12vw, 130px) 32px; }
.section--alt { max-width: none; background: var(--surface); }
.section--alt > * { max-width: var(--maxw); margin-inline: auto; }
.section--sky { max-width: none; background: var(--wash-sky); }
.section--sky > * { max-width: var(--maxw); margin-inline: auto; }
.section--sun { max-width: none; background: var(--wash-sun); }
.section--sun > * { max-width: var(--maxw); margin-inline: auto; }
.section--peach { max-width: none; background: var(--wash-peach); }
.section--peach > * { max-width: var(--maxw); margin-inline: auto; }
.section--cta { max-width: none; background: var(--ink); color: var(--ivory); }
.section--cta > * { max-width: var(--maxw); margin-inline: auto; }
.section--cta .section__index { color: var(--ivory); opacity: 0.85; }
.section--cta .section__sub { color: var(--ivory); opacity: 0.92; }
.section--cta .section__head h2 { color: var(--ivory); }
.section--cta .btn--dark { background: var(--coral); color: var(--surface); }
.section--cta .btn--dark:hover { background: var(--surface); color: var(--ink); }

.section__head { text-align: center; margin-bottom: 64px; }
.section__index { display: block; font-family: var(--sans); font-size: 0.8rem; letter-spacing: 4px; color: var(--coral); margin-bottom: 16px; font-weight: 500; }
.section__head h2 { font-size: clamp(2.4rem, 6vw, 4.2rem); letter-spacing: -1px; }
.section__sub { margin-top: 16px; color: var(--dusty); font-size: 1.02rem; }

/* ===== Timeline ===== */
.timeline { max-width: 680px; margin: 0 auto; }
.timeline__item {
  display: grid; grid-template-columns: 130px 1fr; gap: 30px; align-items: baseline;
  padding: 28px 0; border-bottom: 1px solid var(--line);
}
.timeline__item:last-child { border-bottom: none; }
.timeline__time { font-family: var(--display); font-size: 1.6rem; color: var(--coral); font-style: italic; }
.timeline__body h3 { font-size: 1.9rem; margin-bottom: 4px; }
.timeline__body p { color: var(--dusty); }

/* ===== Cards & grids ===== */
.cards, .info-grid { display: grid; gap: 28px; }
.cards { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.info-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card, .info-grid__item {
  background: var(--surface); border-radius: 20px; padding: 42px 34px;
  text-align: center; transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
  box-shadow: var(--shadow);
}
.card:hover, .info-grid__item:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.card__tag { display: block; text-transform: uppercase; letter-spacing: 3px; font-size: 0.72rem; color: var(--coral); margin-bottom: 16px; font-weight: 500; }
.card h3 { font-size: 1.75rem; margin-bottom: 12px; }
.card__addr { color: var(--dusty); margin-bottom: 26px; }
.info-grid__item h3 { font-size: 1.7rem; margin-bottom: 10px; }
.info-grid__item p { color: var(--dusty); font-size: 0.98rem; }
.info-grid__item a { color: var(--coral); text-decoration: none; font-weight: 500; }
.info-grid__item a:hover { text-decoration: underline; }

/* ===== RSVP ===== */
.rsvp { max-width: 600px; margin: 0 auto; text-align: center; }
.rsvp p { margin-bottom: 30px; font-size: 1.1rem; }

/* ===== Lista nozze / IBAN ===== */
.gift { max-width: 620px; margin: 0 auto; text-align: center; }
.gift > p { font-size: 1.1rem; margin-bottom: 28px; }
.gift .muted { margin-top: 22px; font-size: 0.92rem; }
.iban {
  background: var(--surface); border-radius: 20px; padding: 34px 30px;
  box-shadow: var(--shadow); text-align: left;
}
.iban__row { padding: 14px 0; border-bottom: 1px solid var(--line); }
.iban__row:first-child { padding-top: 0; }
.iban__label { display: block; text-transform: uppercase; letter-spacing: 2.5px; font-size: 0.7rem; color: var(--coral); margin-bottom: 6px; font-weight: 500; }
.iban__value { font-family: var(--display); font-size: 1.3rem; word-break: break-word; }
.iban__copy { margin-top: 24px; width: 100%; }
.iban__copy.copied { background: var(--coral); color: var(--surface); border-color: var(--coral); }
.muted { color: var(--dusty); font-style: italic; }

/* ===== Footer ===== */
.footer { background: var(--ink); color: var(--ivory); text-align: center; padding: 60px 24px; }
.footer__names { font-family: var(--display); font-style: italic; font-size: 2rem; margin-bottom: 8px; }
.footer p:last-child { letter-spacing: 6px; font-size: 0.85rem; opacity: 0.7; }

/* ===== Barra di avanzamento lettura ===== */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 200; pointer-events: none; }
.progress span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--coral), var(--sun));
  transform: scaleX(0); transform-origin: left;
}

/* ===== Scrollspy: voce di menu attiva ===== */
.nav__menu a.active::after { width: 100%; }

/* ===== Petali nell'hero ===== */
.hero__petals { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.hero__inner { will-change: transform, opacity; }

/* ===== Countdown: micro-animazione al cambio cifra ===== */
@keyframes tickIn { from { opacity: 0.2; transform: translateY(-0.14em); } }
.countdown__num.tick { animation: tickIn 0.5s var(--ease); }

/* ===== Marquee editoriale ===== */
.marquee { overflow: hidden; border-block: 1px solid var(--line); background: var(--surface); padding: 20px 0; }
.marquee__track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.marquee__track span {
  font-family: var(--display); font-style: italic;
  font-size: clamp(1.1rem, 2.6vw, 1.55rem); color: var(--ink);
  white-space: nowrap; opacity: 0.85;
}
.marquee__track em { color: var(--coral); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ===== Aggiungi al calendario ===== */
.addcal { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin-top: 56px; }
.addcal .btn { font-family: var(--sans); }

/* ===== Timeline: icone ===== */
.timeline__emoji { font-size: 0.85em; margin-right: 12px; }

/* ===== RSVP: si risponde dal QR sulla partecipazione (conferma.html) =====
   Il pulsante porta a conferma.html senza chiave: quella pagina mostra da sé
   «si apre dal QR» e i contatti. Qui spieghiamo come si fa e dove chiedere aiuto. */
.rsvp__cta { border: none; font-family: var(--sans); }
.rsvp__points {
  list-style: none; display: grid; gap: 10px; text-align: left;
  max-width: 420px; margin: 38px auto 0; font-size: 0.95rem;
}
.rsvp__points li { padding-left: 26px; position: relative; opacity: 0.9; }
.rsvp__points li::before {
  content: "✓"; position: absolute; left: 0; top: 0; color: var(--coral); font-weight: 500;
}
.rsvp__points strong { font-weight: 500; }
.rsvp__lost { margin: 36px 0 0; font-size: 0.95rem; }
.rsvp__lost a { color: var(--coral); text-decoration: underline; text-underline-offset: 3px; }
.rsvp__note { margin-top: 26px; font-size: 0.85rem; }
.section--cta .muted { color: var(--ivory); opacity: 0.55; }

/* ===== Foto dell'evento ===== */
.photos { max-width: 620px; margin: 0 auto; text-align: center; }
.photos__btn { border: none; font-family: var(--sans); }
.photos__btn.is-disabled { opacity: 0.55; cursor: not-allowed; }
.photos__btn.is-disabled:hover { transform: none; background: var(--coral); }
.photos__note { margin-top: 20px; font-size: 0.92rem; }

/* ===== Torna su ===== */
.totop {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: 48px; height: 48px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--coral); color: var(--surface); font-size: 1.2rem;
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(16px); pointer-events: none;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), background 0.3s;
}
.totop.visible { opacity: 1; transform: none; pointer-events: auto; }
.totop:hover { background: var(--ink); }

/* ===== Scroll reveal ===== */
[data-reveal] { opacity: 0; transform: translateY(36px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

/* Le card entrano a cascata */
.cards > [data-reveal]:nth-child(2), .info-grid > [data-reveal]:nth-child(2) { transition-delay: 0.1s; }
.cards > [data-reveal]:nth-child(3), .info-grid > [data-reveal]:nth-child(3) { transition-delay: 0.2s; }

/* ===== Responsive ===== */
@media (max-width: 820px) {
  .nav__toggle { display: flex; }
  .nav__menu {
    position: fixed; inset: 0 0 0 auto; width: min(78vw, 340px);
    flex-direction: column; justify-content: center; gap: 8px;
    background: var(--ink); padding: 40px;
    transform: translateX(100%); transition: transform 0.45s var(--ease);
  }
  .nav__menu.open { transform: translateX(0); }
  .nav__menu a, .nav.scrolled .nav__menu a { color: var(--ivory); font-size: 1.1rem; padding: 12px 0; }
  .timeline__item { grid-template-columns: 90px 1fr; gap: 18px; }
  .timeline__time { font-size: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* Durate quasi nulle invece di "none": le animazioni con `forwards`
     (hero) saltano subito allo stato finale e i transform funzionali
     (menu mobile, progress bar, torna-su) continuano a funzionare. */
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}
