/* =========================================================
   Giuseppe & Maria — Invito di matrimonio
   Palette: bordeaux · oro · crema
   ========================================================= */

@font-face {
  font-family: "Maratre";
  src: url("../assets/fonts/maratre.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bordeaux: #8e1f35;
  --bordeaux-deep: #6f1428;
  --bordeaux-soft: #9e3749;
  --gold: #c6a24a;
  --gold-deep: #a9852f;
  --cream: #fbf6ef;
  --cream-2: #f4ead9;
  --ink: #3a2126;
  --ink-soft: #6d545a;

  --script: "Maratre", "Snell Roundhand", cursive;
  --serif-caps: "Cinzel", "Trajan Pro", serif;
  --serif: "Cormorant Garamond", "EB Garamond", Georgia, serif;

  --maxw: 1100px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1rem + 0.5vw, 1.3rem);
  line-height: 1.7;
  overflow-x: hidden;
  /* trama carta molto tenue */
  background-image:
    radial-gradient(circle at 20% 15%, rgba(198, 162, 74, 0.05), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(142, 31, 53, 0.045), transparent 45%);
  background-attachment: fixed;
}

body.is-locked { overflow: hidden; height: 100vh; }

img { max-width: 100%; display: block; }

/* ---------- LAYOUT ---------- */
.section {
  position: relative;
  padding: clamp(4rem, 10vh, 7rem) clamp(1.4rem, 5vw, 3rem);
  max-width: var(--maxw);
  margin-inline: auto;
  text-align: center;
}

.eyebrow,
.section__label {
  font-family: var(--serif-caps);
  font-size: 0.78rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 1.4rem;
}
.section__label--light { color: var(--gold); }

.rule { display: flex; justify-content: center; margin: 0.5rem 0 2rem; }
.rule span {
  display: inline-block; width: 64px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  position: relative;
}
.rule span::after {
  content: "❦"; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%); color: var(--gold);
  font-size: 1.1rem; background: var(--cream); padding: 0 0.5rem;
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  margin-top: 1.8rem;
  padding: 0.85rem 2rem;
  font-family: var(--serif-caps);
  font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--bordeaux);
  text-decoration: none;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: transparent;
  transition: background 0.4s var(--ease), color 0.4s var(--ease), transform 0.3s var(--ease);
}
.btn:hover { background: var(--bordeaux); color: var(--cream); border-color: var(--bordeaux); transform: translateY(-2px); }
.btn--gold { background: var(--gold); color: var(--bordeaux-deep); border-color: var(--gold); }
.btn--gold:hover { background: var(--cream); color: var(--bordeaux); border-color: var(--cream); }

/* =========================================================
   BUSTA / APERTURA
   ========================================================= */
.envelope-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(1.4rem, 5vh, 2.6rem);
  background:
    radial-gradient(circle at 50% 40%, #a8324a, var(--bordeaux) 45%, var(--bordeaux-deep) 100%);
  transition: opacity 0.9s var(--ease), transform 1s var(--ease);
  padding: 1.5rem;
}
.envelope-overlay.is-open { opacity: 0; transform: translateY(-6%) scale(1.04); pointer-events: none; }

.envelope {
  position: relative;
  width: min(88vw, 400px);
  aspect-ratio: 4 / 3;
  perspective: 1400px;
  filter: drop-shadow(0 30px 60px rgba(0,0,0,0.4));
}
.env-body, .env-flap { position: absolute; inset: 0; border-radius: 8px; }

.env-body {
  background: linear-gradient(160deg, var(--cream) 0%, var(--cream-2) 100%);
  box-shadow: inset 0 0 0 1px rgba(198,162,74,0.4);
  z-index: 1;
  /* solchi laterali della busta */
  background-image:
    linear-gradient(160deg, var(--cream) 0%, var(--cream-2) 100%),
    linear-gradient(45deg, transparent 49.6%, rgba(169,133,47,0.18) 49.8%, transparent 50%),
    linear-gradient(-45deg, transparent 49.6%, rgba(169,133,47,0.18) 49.8%, transparent 50%);
}
.env-hint {
  font-family: var(--serif-caps); text-transform: uppercase;
  letter-spacing: 0.34em; font-size: 0.72rem; color: var(--gold);
}
.env-cta {
  font-family: var(--serif); font-style: italic; color: rgba(251,246,239,0.9);
  font-size: 1.05rem;
}

/* sigillo di ceralacca — centrato sopra il lembo */
.wax-seal {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: clamp(104px, 30%, 132px); aspect-ratio: 1; border-radius: 50%;
  border: none; cursor: pointer; padding: 0; z-index: 4;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 35% 30%, #b83a52 0%, var(--bordeaux) 45%, var(--bordeaux-deep) 100%);
  box-shadow:
    0 10px 24px rgba(111,20,40,0.5),
    inset 0 3px 8px rgba(255,255,255,0.25),
    inset 0 -6px 12px rgba(0,0,0,0.35);
  animation: sealPulse 2.6s var(--ease) infinite;
  transition: transform 0.4s var(--ease);
}
.wax-seal::before {
  /* bordo frastagliato della ceralacca */
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  background: radial-gradient(circle, transparent 60%, rgba(111,20,40,0.25) 62%);
  filter: blur(1px);
}
.wax-seal__ring {
  position: absolute; inset: 12px; border-radius: 50%;
  border: 1.5px dashed rgba(251,246,239,0.55);
}
.wax-seal__mono { width: 66%; height: 66%; object-fit: contain; opacity: 0.92; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.3)); }
.wax-seal:hover { transform: translate(-50%, -50%) scale(1.06); }
.wax-seal:active { transform: translate(-50%, -50%) scale(0.97); }

@keyframes sealPulse {
  0%, 100% { box-shadow: 0 10px 24px rgba(111,20,40,0.5), inset 0 3px 8px rgba(255,255,255,0.25), inset 0 -6px 12px rgba(0,0,0,0.35), 0 0 0 0 rgba(198,162,74,0.5); }
  50%      { box-shadow: 0 10px 24px rgba(111,20,40,0.5), inset 0 3px 8px rgba(255,255,255,0.25), inset 0 -6px 12px rgba(0,0,0,0.35), 0 0 0 14px rgba(198,162,74,0); }
}

/* lembo della busta */
.env-flap {
  z-index: 3; transform-origin: top center;
  transition: transform 0.8s var(--ease);
  background: linear-gradient(180deg, #f6ecdb, var(--cream-2));
  clip-path: polygon(0 0, 100% 0, 50% 60%);
  box-shadow: 0 6px 10px rgba(111,20,40,0.08);
}
/* apertura: il lembo si ribalta verso l'alto, il sigillo cede */
.envelope.is-opening .env-flap { transform: rotateX(-172deg); z-index: 5; }
.envelope.is-opening .wax-seal { animation: sealBreak 0.5s var(--ease) forwards; }
@keyframes sealBreak {
  60% { transform: translate(-50%, -50%) scale(1.12) rotate(6deg); }
  100% { transform: translate(-50%, 40%) scale(0.6) rotate(14deg); opacity: 0; }
}

/* =========================================================
   HERO
   ========================================================= */
#site { opacity: 0; transition: opacity 1s var(--ease); }
#site.is-visible { opacity: 1; }

.hero {
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.4rem; padding-top: 3rem;
}
.hero__ornament { margin-bottom: 0.5rem; }
.hero__mono { width: clamp(120px, 30vw, 190px); }
.hero .eyebrow { margin-bottom: 0.6rem; }

.names {
  font-family: var(--script);
  font-weight: 400;
  color: var(--bordeaux);
  line-height: 0.9;
  font-size: clamp(3.8rem, 15vw, 8rem);
  display: flex; flex-direction: column; align-items: center;
}
.names__amp { color: var(--gold); font-size: 0.62em; margin: -0.1em 0; }
.names__line { display: block; }

.hero__meta {
  font-family: var(--serif-caps);
  letter-spacing: 0.22em; text-transform: uppercase;
  font-size: clamp(0.75rem, 2.5vw, 0.95rem);
  color: var(--ink-soft);
  margin-top: 1.4rem;
  display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; justify-content: center;
}
.hero__meta .dot { color: var(--gold); }

.scroll-cue { margin-top: 2.6rem; width: 26px; height: 42px; border: 1.5px solid var(--gold); border-radius: 20px; position: relative; }
.scroll-cue span { position: absolute; top: 8px; left: 50%; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--gold); animation: scrollDot 1.8s var(--ease) infinite; }
@keyframes scrollDot { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 80%, 100% { opacity: 0; transform: translateY(16px); } }

/* =========================================================
   ANNUNCIO
   ========================================================= */
.announce__intro { font-size: clamp(1.3rem, 1rem + 1.6vw, 1.9rem); font-style: italic; color: var(--ink); max-width: 26ch; margin-inline: auto; }
.announce__intro strong { font-style: normal; font-weight: 600; color: var(--bordeaux); }

/* =========================================================
   COUNTDOWN
   ========================================================= */
.countdown { background: var(--cream-2); max-width: none; border-block: 1px solid rgba(198,162,74,0.3); }
.cd { display: flex; align-items: center; justify-content: center; gap: clamp(0.4rem, 2vw, 1.4rem); }
.cd__unit { display: flex; flex-direction: column; align-items: center; min-width: clamp(56px, 16vw, 96px); }
.cd__num {
  font-family: var(--serif-caps); font-weight: 600;
  font-size: clamp(2.2rem, 8vw, 4rem); line-height: 1; color: var(--bordeaux);
  font-variant-numeric: tabular-nums;
}
.cd__lab { font-family: var(--serif-caps); text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.62rem; color: var(--gold-deep); margin-top: 0.6rem; }
.cd__sep { font-family: var(--serif-caps); font-size: clamp(1.6rem, 6vw, 3rem); color: var(--gold); align-self: flex-start; margin-top: 0.2rem; }
.cd__done { font-family: var(--script); font-size: clamp(2rem, 8vw, 3.4rem); color: var(--bordeaux); }

/* =========================================================
   LUOGHI (cerimonia / ricevimento)
   ========================================================= */
.place { display: grid; gap: 1rem; align-items: center; }
.place__art img { width: min(78%, 420px); margin-inline: auto; }
.place--ceremony .place__art img { width: min(90%, 520px); }
.place__name { font-family: var(--script); font-weight: 400; color: var(--bordeaux); font-size: clamp(2.4rem, 9vw, 4rem); line-height: 0.95; margin-bottom: 0.6rem; }
.place__addr { color: var(--ink-soft); font-size: 1.15rem; }
.place__time { font-family: var(--serif-caps); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.82rem; color: var(--ink); margin-top: 0.9rem; }

/* =========================================================
   PROGRAMMA / TIMELINE
   ========================================================= */
.timeline { list-style: none; max-width: 460px; margin: 2rem auto 0; text-align: left; position: relative; }
.timeline::before { content: ""; position: absolute; left: 86px; top: 8px; bottom: 8px; width: 1px; background: linear-gradient(var(--gold), transparent); }
.timeline__item { display: grid; grid-template-columns: 72px 1fr; column-gap: 2rem; row-gap: 0.1rem; padding: 0.9rem 0; position: relative; }
.timeline__item::before { content: ""; position: absolute; left: 82px; top: 1.5rem; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px var(--cream); }
.timeline__time { font-family: var(--serif-caps); font-weight: 600; color: var(--bordeaux); font-size: 1rem; text-align: right; white-space: nowrap; }
.timeline__title { font-weight: 600; color: var(--ink); font-size: 1.25rem; grid-column: 2; }
.timeline__note { grid-column: 2; color: var(--ink-soft); font-size: 1rem; font-style: italic; }

/* =========================================================
   SERVIZIO NAVETTA
   ========================================================= */
.shuttle__icon { color: var(--gold); margin: 0 auto 1rem; }
.shuttle__intro { max-width: 34ch; margin: 0 auto; color: var(--ink-soft); font-style: italic; }
.shuttle__grid { display: grid; gap: 1.2rem; max-width: 620px; margin: 2.4rem auto 0; }
.shuttle__item {
  background: var(--cream); border: 1px solid rgba(198, 162, 74, 0.4);
  border-radius: 12px; padding: 1.5rem 1.4rem; text-align: center;
}
.shuttle__time { display: block; font-family: var(--serif-caps); font-weight: 600; color: var(--bordeaux); font-size: 1.3rem; }
.shuttle__title { display: block; font-family: var(--serif-caps); text-transform: uppercase; letter-spacing: 0.22em; font-size: 0.66rem; color: var(--gold-deep); margin: 0.5rem 0 0.7rem; }
.shuttle__note { color: var(--ink-soft); font-size: 1.02rem; }
.shuttle__note strong { color: var(--bordeaux); font-weight: 600; }
.shuttle__map {
  display: inline-block; margin-top: 1rem;
  font-family: var(--serif-caps); text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 0.66rem; color: var(--bordeaux); text-decoration: none;
  border-bottom: 1px solid var(--gold); padding-bottom: 2px; transition: color 0.3s var(--ease);
}
.shuttle__map:hover { color: var(--gold-deep); }
.shuttle__cta { max-width: 40ch; margin: 2rem auto 0; font-style: italic; color: var(--ink); }

@media (min-width: 620px) {
  .shuttle__grid { grid-template-columns: 1fr 1fr; }
}

/* =========================================================
   LISTA NOZZE / PENSIERO
   ========================================================= */
.gift__card {
  max-width: 560px; margin-inline: auto;
  background: var(--cream); border: 1px solid rgba(198,162,74,0.4);
  border-radius: 14px; padding: clamp(2rem, 6vw, 3rem);
  box-shadow: 0 20px 50px rgba(142,31,53,0.08);
}
.gift__text { font-style: italic; color: var(--ink-soft); margin: 0.4rem 0 1.8rem; }
.gift__iban {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.6rem 0.9rem;
  background: var(--cream-2); border-radius: 10px; padding: 1rem 1rem;
}
.gift__iban-lab { font-family: var(--serif-caps); font-size: 0.7rem; letter-spacing: 0.2em; color: var(--gold-deep); flex: 0 0 auto; }
.gift__iban code {
  font-family: "SFMono-Regular", ui-monospace, Menlo, monospace;
  font-size: clamp(0.7rem, 3.5vw, 0.95rem); color: var(--bordeaux);
  letter-spacing: 0; white-space: nowrap; flex: 1 1 100%; text-align: center; order: 2;
}
.gift__copy { order: 3; }
.gift__copy { border: 1px solid var(--gold); background: transparent; color: var(--bordeaux); border-radius: 999px; padding: 0.35rem 1rem; font-family: var(--serif-caps); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; transition: all 0.3s var(--ease); }
.gift__copy:hover { background: var(--gold); color: var(--bordeaux-deep); }
.gift__copy.copied { background: var(--bordeaux); color: var(--cream); border-color: var(--bordeaux); }
.gift__note { margin-top: 1rem; font-size: 0.95rem; color: var(--ink-soft); }

/* =========================================================
   RSVP
   ========================================================= */
.rsvp {
  max-width: none; color: var(--cream);
  background: radial-gradient(circle at 50% 20%, var(--bordeaux-soft), var(--bordeaux) 55%, var(--bordeaux-deep) 100%);
}
.rsvp__mono { width: 96px; margin: 0 auto 1.4rem; opacity: 0.9; }
.rsvp__title { font-family: var(--script); font-size: clamp(3rem, 12vw, 5rem); color: var(--cream); line-height: 0.9; margin-bottom: 1rem; }
.rsvp__text { color: rgba(251,246,239,0.85); font-style: italic; }
.rsvp__hint { margin-top: 1.4rem; font-family: var(--serif-caps); text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.72rem; color: var(--gold); }

/* --- Form RSVP --- */
.rsvp-form { max-width: 440px; margin: 2.2rem auto 0; text-align: left; display: flex; flex-direction: column; gap: 1.05rem; }
.rsvp-form .field { display: flex; flex-direction: column; gap: 0.4rem; }
.rsvp-form .field--row { flex-direction: row; gap: 1rem; align-items: flex-end; }
.rsvp-form .field--row > .field { flex: 1; }
.rsvp-form .field--guests { flex: 0 0 34%; }
.rsvp-form label {
  font-family: var(--serif-caps); text-transform: uppercase;
  letter-spacing: 0.14em; font-size: 0.66rem; color: var(--gold);
}
.rsvp-form label span { text-transform: none; letter-spacing: 0.02em; opacity: 0.7; font-style: italic; font-family: var(--serif); font-size: 0.82rem; }
.rsvp-form input,
.rsvp-form select,
.rsvp-form textarea {
  font-family: var(--serif); font-size: 1.05rem; color: var(--cream);
  background: rgba(251, 246, 239, 0.08);
  border: 1px solid rgba(251, 246, 239, 0.32);
  border-radius: 9px; padding: 0.72rem 0.9rem; width: 100%;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
  -webkit-appearance: none; appearance: none;
}
.rsvp-form textarea { resize: vertical; min-height: 74px; line-height: 1.5; }
.rsvp-form input::placeholder,
.rsvp-form textarea::placeholder { color: rgba(251, 246, 239, 0.45); font-style: italic; }
.rsvp-form input:focus,
.rsvp-form select:focus,
.rsvp-form textarea:focus {
  outline: none; border-color: var(--gold); background: rgba(251, 246, 239, 0.14);
}
/* freccia del select */
.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='none' stroke='%23c6a24a' stroke-width='1.6' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.9rem center; padding-right: 2.2rem;
}
.rsvp-form select option { color: var(--ink); background: var(--cream); }
/* checkbox servizio navetta */
.rsvp-form .field--check { margin-top: 0.2rem; }
.rsvp-form .check {
  flex-direction: row; align-items: flex-start; gap: 0.75rem; cursor: pointer;
  background: rgba(251, 246, 239, 0.06); border: 1px solid rgba(251, 246, 239, 0.28);
  border-radius: 9px; padding: 0.85rem 1rem;
  text-transform: none; letter-spacing: normal;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.rsvp-form .check:hover { border-color: var(--gold); background: rgba(251, 246, 239, 0.1); }
.rsvp-form .check input[type="checkbox"] {
  -webkit-appearance: auto; appearance: auto;
  width: 20px; height: 20px; flex: 0 0 20px; margin: 1px 0 0; padding: 0;
  background: none; border: none; border-radius: 0; accent-color: var(--gold); cursor: pointer;
}
.rsvp-form .check span {
  font-family: var(--serif); font-size: 1rem; line-height: 1.45; color: var(--cream);
  text-transform: none; letter-spacing: normal;
}
.rsvp-form .check span strong { color: var(--gold); font-weight: 600; }

.rsvp-form .btn { margin-top: 0.5rem; align-self: center; cursor: pointer; }
.rsvp-form .btn:disabled { opacity: 0.7; cursor: default; }
/* honeypot invisibile */
.rsvp-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.rsvp-form__status { margin: 0.2rem 0 0; text-align: center; min-height: 1.2em; font-style: italic; color: rgba(251, 246, 239, 0.85); }
.rsvp-form__status.is-ok { color: var(--gold); font-style: normal; }
.rsvp-form__status.is-error { color: #ffd6cc; }
.rsvp-form__status a { color: var(--gold); }

/* =========================================================
   FOOTER
   ========================================================= */
.footer { background: var(--bordeaux-deep); color: rgba(251,246,239,0.8); text-align: center; padding: clamp(3rem, 8vh, 5rem) 1.5rem; }
.footer__mono { width: 74px; margin: 0 auto 1.4rem; opacity: 0.85; }
.footer__date { font-family: var(--serif-caps); letter-spacing: 0.2em; text-transform: uppercase; font-size: 0.78rem; color: var(--gold); margin-bottom: 2rem; }
.footer__families { display: flex; flex-wrap: wrap; gap: 1.6rem; justify-content: center; margin-bottom: 2rem; }
.footer__families > div { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.95rem; }
.footer__fam-name { font-family: var(--serif-caps); text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.72rem; color: var(--cream); }
.footer__credit { display: flex; flex-direction: column; align-items: center; gap: 0.7rem; font-size: 0.9rem; font-style: italic; }
.footer__credit > span { opacity: 0.7; font-family: var(--serif-caps); font-style: normal; text-transform: uppercase; letter-spacing: 0.22em; font-size: 0.64rem; color: var(--gold); }
.footer__planner-logo { width: auto; max-width: 112px; max-height: 26px; object-fit: contain; opacity: 0.9; }
.footer__credit strong { font-style: normal; color: var(--gold); font-weight: 500; letter-spacing: 0.04em; font-size: 1rem; }

/* =========================================================
   ANIMAZIONI REVEAL / FLOAT
   ========================================================= */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.float { animation: floaty 6s ease-in-out infinite; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* =========================================================
   DESKTOP / TABLET
   ========================================================= */
@media (min-width: 760px) {
  .place { grid-template-columns: 1fr 1fr; gap: 3rem; text-align: left; }
  .place--reception { direction: rtl; }
  .place--reception > * { direction: ltr; }
  .place__art img, .place--ceremony .place__art img { width: 100%; }
  .place__body .rule { justify-content: flex-start; }
  .place .btn { align-self: start; }
  .place__name { font-size: clamp(3rem, 5vw, 4.4rem); }
}

/* =========================================================
   ACCESSIBILITÀ — riduzione movimento
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .wax-seal { animation: none; }
}
