@font-face{
  font-family:"Alice";
  src:url("/fonts/Alice-Regular.woff2") format("woff2");
}

:root{
  --cream:#f5f0e6;
  --ink:#1f1f1f;
  --navy:#1E3A8A;
  --navy-deep:#0c1b3a;
  --bordeaux:#8B0000;
  --bordeaux-deep:#6a0000;
  --gold:#C9A86A;
  --gold-soft:#E3CE9B;
  --hex:polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  --font-display:"Cormorant Garamond","Alice",serif;
  --font-body:"Alice",serif;
}

* {
  box-sizing: border-box;
}

main {
  padding-top: 60px;
}

body{
  margin:0;
  font-family:var(--font-body);
  background:var(--cream);
  background-image:
    url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 0.15 0'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23noise)'/%3E%3C/svg%3E");
  color:var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Effetto inchiostro sui testi */
.title, .page-title, .subtitle, .invitation-text, .invitation-date, .invitation-location, .cta-label {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* DECORATIVE ELEMENTS */
/* Divisore celestiale: linea dorata con piccolo astro */
.celestial-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 4px auto 0;
}

.celestial-divider::before,
.celestial-divider::after {
  content: '';
  height: 1px;
  width: clamp(40px, 12vw, 80px);
  background: linear-gradient(90deg, transparent, var(--gold));
}

.celestial-divider::after {
  background: linear-gradient(90deg, var(--gold), transparent);
}

.celestial-divider i {
  display: block;
  width: 7px;
  height: 7px;
  background: var(--gold);
  transform: rotate(45deg);
  box-shadow: 0 0 8px rgba(201, 168, 106, 0.6);
}

/* Nastro decorativo (riservato a usi futuri) */
.ribbon {
  position: relative;
  height: 12px;
  margin: 25px auto;
}

.ribbon::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  transform: translateY(-50%);
}

.ribbon::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  background: var(--gold);
  transform: translate(-50%, -50%) rotate(45deg);
  box-shadow: 0 0 8px rgba(201, 168, 106, 0.5);
}

/* ENVELOPE POPUP STYLE */
.envelope-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(245, 240, 230, 0.98);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  backdrop-filter: blur(5px);
}

.envelope-container {
  text-align: center;
  cursor: pointer;
  margin: 0 auto;
  perspective: 900px;
  animation: float 3s ease-in-out infinite;
}

/* --- BUSTA RETTANGOLARE A TEMA SPAZIO --- */
.rect-envelope {
  position: relative;
  width: min(380px, 86vw);
  height: calc(min(380px, 86vw) * 0.64);
  margin: 0 auto;
  transform-style: preserve-3d;
  transition: transform 0.7s ease, opacity 0.7s ease;
  filter: drop-shadow(0 18px 32px rgba(0, 0, 0, 0.45));
}

.env-body {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: radial-gradient(circle at 50% 45%, #1c2c6b 0%, #0c1430 60%, #05081c 100%);
  border: 2px solid var(--gold);
  overflow: hidden;
}

.env-stars {
  position: absolute;
  inset: 0;
  opacity: 0.85;
  animation: twinkle 5s ease-in-out infinite;
  background-image:
    radial-gradient(1.4px 1.4px at 18% 30%, #fff, transparent),
    radial-gradient(1px 1px at 70% 22%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 84% 50%, #fff, transparent),
    radial-gradient(1px 1px at 30% 60%, #fff, transparent),
    radial-gradient(1.3px 1.3px at 50% 80%, #fff, transparent),
    radial-gradient(1px 1px at 62% 68%, #fff, transparent),
    radial-gradient(1.1px 1.1px at 12% 70%, #fff, transparent),
    radial-gradient(1px 1px at 90% 78%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 40% 38%, #fff, transparent),
    radial-gradient(1px 1px at 78% 88%, #fff, transparent);
}

/* Tasca frontale (triangolo inferiore) con bordo dorato */
.env-pocket {
  position: absolute;
  inset: 0;
  z-index: 2;
  clip-path: polygon(0 100%, 100% 100%, 50% 46%);
  background: linear-gradient(135deg, #C9A86A, #9c7b3e);
}

.env-pocket::before {
  content: '';
  position: absolute;
  inset: 2px;
  clip-path: polygon(0 100%, 100% 100%, 50% 46%);
  background: linear-gradient(180deg, #16224e, #0e1838);
}

/* Lembo superiore triangolare che si apre (con bordo dorato) */
.env-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 54%;
  z-index: 4;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: linear-gradient(135deg, #E9D9A8, #C9A86A 55%, #9c7b3e);
  transform-origin: top center;
  transform: rotateX(0deg);
  transition: transform 0.9s cubic-bezier(0.5, 0.1, 0.2, 1);
}

.env-flap::before {
  content: '';
  position: absolute;
  inset: 2px;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: linear-gradient(180deg, #1c2c6b, #101d44);
}

/* Sigillo di ceralacca al centro (sopra la punta del lembo) */
.env-seal {
  position: absolute;
  top: 54%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 6;
  transition: box-shadow 0.6s ease, opacity 0.4s ease;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 35% 30%, #F0E0AE, #C9A86A 60%, #9c7b3e);
  color: var(--bordeaux);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 1px;
  box-shadow: 0 0 0 2px rgba(227, 206, 155, 0.8), 0 4px 10px rgba(0, 0, 0, 0.4);
}

.envelope-container.opening .env-flap {
  transform: rotateX(-170deg);
}

.envelope-container.opening .rect-envelope {
  transform: translateY(-10px) scale(0.96);
  opacity: 0;
  transition-delay: 0.45s;
}

.envelope-container.opening .env-seal {
  box-shadow: 0 0 0 2px rgba(227, 206, 155, 0.9), 0 0 24px rgba(232, 197, 71, 0.9);
  opacity: 0;
}

.envelope-container.opening .envelope-text {
  opacity: 0;
}

.envelope-text {
  font-family: var(--font-body);
  font-size: 18px;
  letter-spacing: 1px;
  color: var(--navy);
  margin-top: 22px;
  transition: opacity 0.5s ease;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes fadeOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.95); }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.95; }
}

.envelope-hidden {
  display: none;
}

/* INVITO ESAGONALE */
.invitation-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(245, 240, 230, 0.98);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  backdrop-filter: blur(5px);
}

.hex-invitation {
  position: relative;
  width: min(440px, 90vw);
  height: calc(min(440px, 90vw) * 1.1547);
  clip-path: var(--hex);
  /* Bordo dorato metallico (effetto specchio/lamina) */
  background: linear-gradient(135deg, #F4E6B8 0%, #C9A86A 32%, #a07e44 52%, #EFE0AC 72%, #C9A86A 100%);
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.3));
  animation: fadeIn 0.6s ease-out;
}

.hex-invitation-inner {
  position: absolute;
  inset: 7px;
  clip-path: var(--hex);
  background: radial-gradient(circle at 50% 35%, #ffffff 0%, var(--cream) 72%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 17% 13%;
}

.hex-star {
  color: var(--gold);
  font-size: 16px;
  margin-bottom: 10px;
}

.invitation-text {
  font-family: var(--font-body);
  font-size: clamp(16px, 2.8vw, 21px);
  color: var(--ink);
  margin: 0 0 12px 0;
  line-height: 1.3;
  max-width: 90%;
}

.invitation-names {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(24px, 5vw, 32px);
  color: var(--bordeaux);
  margin: 0 0 10px 0;
  line-height: 1.1;
  letter-spacing: 0.5px;
}

.invitation-date {
  font-family: var(--font-body);
  font-size: clamp(14px, 3vw, 18px);
  color: var(--navy);
  margin: 0 0 6px 0;
  letter-spacing: 1px;
}

.invitation-location {
  font-family: var(--font-body);
  font-size: clamp(12px, 2.5vw, 16px);
  color: var(--ink);
  margin: 0 0 20px 0;
  opacity: 0.75;
  font-style: italic;
}

.invitation-close {
  background: var(--navy);
  color: var(--cream);
  border: 1px solid var(--gold);
  padding: 11px 28px;
  font-family: var(--font-body);
  font-size: 15px;
  letter-spacing: 0.5px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

.invitation-close:hover {
  background: var(--bordeaux);
  border-color: var(--gold-soft);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(139, 0, 0, 0.3);
}

.invitation-hidden {
  display: none;
}

@media (max-width: 768px) {
  .envelope-text {
    font-size: 15px;
  }
  .env-seal {
    width: 56px;
    height: 56px;
    font-size: 19px;
  }
}

/* GALLERIA A SCORRIMENTO CONTINUO */
.gallery-section {
  width: 100%;
  padding: 56px 0 66px;
  text-align: center;
  background: linear-gradient(180deg, #0c1b3a 0%, #081427 100%);
  border-top: 1px solid rgba(201, 168, 106, 0.4);
  border-bottom: 1px solid rgba(201, 168, 106, 0.4);
}

.gallery-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(28px, 5vw, 44px);
  color: #fff;
  letter-spacing: 1px;
  margin: 14px 0 30px;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
}

.gallery {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
}

.gallery::-webkit-scrollbar {
  display: none;
}

.gallery.dragging {
  cursor: grabbing;
}

.gallery-track {
  display: flex;
  gap: 18px;
  padding: 0 18px;
  width: max-content;
}

.gallery-img {
  height: clamp(220px, 38vh, 360px);
  width: auto;
  flex: 0 0 auto;
  border-radius: 10px;
  border: 1px solid rgba(201, 168, 106, 0.5);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(245, 240, 230, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(201, 168, 106, 0.25);
}

.site-header.scrolled {
  background: rgba(245, 240, 230, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.lang-switcher {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.lang-btn {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--ink);
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  transition: all 0.2s ease;
  opacity: 0.8;
}

.lang-btn:hover {
  opacity: 1;
  background: rgba(201, 168, 106, 0.15);
}

.lang-btn.active {
  background: var(--navy);
  color: var(--cream);
  opacity: 1;
  border-color: var(--navy);
}

.header-title {
  font-family: var(--font-body);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: 0.5px;
  color: var(--bordeaux);
  opacity: 0.95;
}

.burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1001;
  padding: 0;
}

.burger-line {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  margin: 4px 0;
  transition: all 0.3s ease;
  border-radius: 1px;
}

.burger.open .burger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.burger.open .burger-line:nth-child(2) {
  opacity: 0;
}

.burger.open .burger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(245, 240, 230, 0.98);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 30px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
}

.menu.open {
  opacity: 1;
  visibility: visible;
}

.menu a {
  font-family: var(--font-display);
  font-size: 30px;
  letter-spacing: 0.5px;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s ease;
}

.menu a:hover {
  color: var(--bordeaux);
}

.hero{
  min-height:100vh;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:24px;
  text-align:center;
  padding:80px 20px;
}

.title{
  font-family: var(--font-body);
  font-size:clamp(60px, 8vw, 90px);
  font-weight: 500;
  letter-spacing: 1px;
  line-height: 1.05;
  color: var(--bordeaux);
}

.date{
  font-size: 22px;
  color: var(--navy);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.cta-label{
  font-size: 15px;
  opacity: 0.8;
  letter-spacing: 0.5px;
}

.btn{
  border: 1px solid var(--gold);
  padding: 14px 34px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  font-size: 15px;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  background: transparent;
  cursor: pointer;
}

.btn:hover {
  background: var(--navy);
  color: var(--cream);
  border-color: var(--navy);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

.btn:active {
  transform: translateY(0);
}

.solar-wrap {
  position: relative;
  width: min(70vw, 480px);
  height: min(70vw, 480px);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: visible;
  background: radial-gradient(circle at 50% 42%, #16306f 0%, var(--navy-deep) 55%, #050d20 100%);
  border-radius: 50%;
  box-shadow:
    0 0 0 1px rgba(201, 168, 106, 0.55),
    0 0 50px rgba(201, 168, 106, 0.15),
    0 18px 50px rgba(0, 0, 0, 0.35),
    inset 0 0 70px rgba(0, 0, 0, 0.55);
}

.solar{
  width: 100%;
  height: 100%;
}

.line {
  fill: none;
  stroke: rgba(201, 168, 106, 0.35);
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.star {
  fill: #fff;
  animation: twinkle 4s ease-in-out infinite;
}

.star:nth-child(3n) { animation-duration: 5.5s; animation-delay: 0.6s; }
.star:nth-child(3n+1) { animation-duration: 3.2s; animation-delay: 1.4s; }
.star:nth-child(4n) { animation-delay: 2.2s; }

circle.planet {
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.45));
}

.sun {
  fill: #E8C547;
  filter: drop-shadow(0 0 16px rgba(232, 197, 71, 0.95));
}

/* Pianeti: tonalità luminose per buon contrasto sulla volta navy */
#p1 { fill: #C9B27D; opacity: 0.95; } /* Mercurio */
#p2 { fill: #EAD9A6; opacity: 0.95; } /* Venere */
#p3 { fill: #8FB7D9; opacity: 0.95; } /* Terra */
#p4 { fill: #D98A6A; opacity: 0.95; } /* Marte */
#p5 { fill: #E0A94B; opacity: 0.95; } /* Giove */
#p6 { fill: #EAD18B; opacity: 0.95; } /* Saturno */
#p7 { fill: #B7D0E6; opacity: 0.95; } /* Urano */
#p8 { fill: #7FA0D8; opacity: 0.95; } /* Nettuno */
#p9 { fill: #C295AD; opacity: 0.95; } /* Plutone */



.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page .site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 15px 20px;
  background: rgba(245, 240, 230, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.page .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(44px, 7vw, 66px);
  font-weight: 500;
  letter-spacing: 0.5px;
  color: var(--bordeaux);
  margin-bottom: 14px;
}

.subtitle {
  font-size: 20px;
  color: var(--navy);
  letter-spacing: 0.5px;
  margin-bottom: 30px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 100px 20px 40px;
  width: 100%;
  text-align: center;
}

.map {
  width: 100%;
  height: 400px;
  max-width: 800px;
  margin: 0 auto 30px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border: 1px solid rgba(201, 168, 106, 0.4);
}

.location-details {
  text-align: center;
  margin: 22px auto 0;
  max-width: 760px;
  line-height: 1.6;
}

.location-details p {
  margin: 0 auto;
  opacity: 0.7;
  max-width: fit-content;
}

.map iframe {
  width: 100%;
  height: 100%;
  border: none;
}

#elisa-e-federico-rsvp-afk5gc {
  width: 100%;
  min-height: 600px;
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
  .hero {
    gap: 20px;
    padding: 60px 15px;
  }
  .title {
    font-size: clamp(48px, 13vw, 72px);
  }
  .date {
    font-size: 18px;
    letter-spacing: 2px;
  }
  .solar-wrap {
    width: min(85vw, 400px);
    height: min(85vw, 400px);
  }
  .container {
    padding: 80px 15px 30px;
  }
  .map {
    height: 300px;
  }
  #elisa-e-federico-rsvp-afk5gc {
    min-height: 500px;
  }
  .menu {
    padding: 20px;
    gap: 20px;
  }
  .menu a {
    font-size: 26px;
  }
  .site-header {
    padding: 12px 15px;
  }
  .header-title {
    font-size: 19px;
  }
  .lang-btn {
    padding: 4px 6px;
    font-size: 12px;
  }
  main {
    padding-top: 50px;
  }
  .gallery-section {
    padding: 44px 0 52px;
  }
}

body.loaded {
  opacity: 1;
  transition: opacity 0.6s ease;
}

body:not(.loaded) {
  opacity: 0;
}

body.menu-open {
  overflow: hidden;
}
