@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Outfit:wght@200;300;400;500&display=swap');

/* ─── Design Tokens ─── */
:root {
  --bg: #ffffff;
  --bg-warm: #faf8f5;
  --surface: #f5f1ec;
  --surface-raised: #efe9e2;
  --ink: #1a1614;
  --ink-soft: #4a4038;
  --ink-muted: #8a7e76;
  --gold: #b08d57;
  --gold-light: #c9a96e;
  --gold-dark: #8a6d3b;
  --gold-glow: rgba(176, 141, 87, 0.12);
  --rose: #c4868a;
  --border: rgba(26, 22, 20, 0.08);
  --border-strong: rgba(176, 141, 87, 0.25);
  --shadow: 0 24px 64px rgba(26, 22, 20, 0.08);
  --shadow-sm: 0 8px 24px rgba(26, 22, 20, 0.06);
  --radius: 2px;
  --radius-lg: 4px;

  --serif: 'Cormorant Garamond', 'Georgia', serif;
  --sans: 'Outfit', system-ui, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-weight: 300;
  overflow-x: hidden;
}

/* Noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 200px;
}

/* ─── Typography ─── */
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.15;
}

h2 {
  font-size: clamp(2rem, 5.5vw, 3.2rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.15rem, 2.5vw, 1.4rem);
  font-weight: 500;
}

p { margin: 0; }

a {
  color: inherit;
  text-decoration: none;
}

/* ─── Navigation ─── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  transition: background 0.5s var(--ease), padding 0.5s var(--ease), opacity 0.6s var(--ease), transform 0.6s var(--ease);
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
}

.nav.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nav.scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  position: relative;
  z-index: 1000;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.nav-toggle {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 1000;
}

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

.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(3.75px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-3.75px) rotate(-45deg);
}

.nav-links {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s var(--ease), visibility 0.5s;
}

.nav-links.open {
  opacity: 1;
  visibility: visible;
}

.nav-links a {
  font-family: var(--serif);
  font-size: 2rem;
  color: var(--ink);
  letter-spacing: 0.04em;
  transition: color 0.3s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width 0.4s var(--ease);
}

.nav-links a:hover { color: var(--gold); }
.nav-links a:hover::after { width: 100%; }

@media (min-width: 768px) {
  .nav { padding: 24px 48px; }
  .nav.scrolled { padding: 16px 48px; }
  .nav-toggle { display: none; }
  .nav-links {
    position: static;
    width: auto;
    height: auto;
    z-index: auto;
    flex-direction: row;
    gap: 40px;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    opacity: 1;
    visibility: visible;
  }
  .nav-links a {
    font-family: var(--sans);
    font-size: 0.82rem;
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }
}

/* ─── Reveal Animation ─── */
[data-reveal] {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Sections ─── */
main {
  display: flex;
  flex-direction: column;
}

section {
  padding: 80px 20px;
}

.section-head {
  text-align: center;
  margin-bottom: 48px;
}

.eyebrow {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--gold);
  margin-bottom: 16px;
}

.section-head h2 {
  color: var(--ink);
}

@media (min-width: 768px) {
  section { padding: 120px 48px; }
  .section-head { margin-bottom: 64px; }
}

/* ─── Intro Video ─── */
.intro {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #000;
  padding: 0;
  z-index: 50;
}

.intro-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.intro-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: rgba(0, 0, 0, 0.35);
  transition: opacity 0.6s var(--ease);
}

.intro-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.intro-play {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: #faf6f1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 90px;
  height: 90px;
  transition: transform 0.4s var(--ease);
}

.intro-play:hover {
  transform: scale(1.1);
}

.intro-play-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(250, 246, 241, 0.5);
  animation: introRingPulse 2.5s ease-in-out infinite;
}

.intro-play-ring::after {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px solid rgba(250, 246, 241, 0.12);
}

@keyframes introRingPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.6; }
}

.intro-play-icon {
  position: relative;
  margin-left: 4px;
}

.intro-hint {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(250, 246, 241, 0.5);
  font-weight: 300;
}

.intro-skip {
  position: absolute;
  bottom: 28px;
  right: 28px;
  z-index: 3;
  background: none;
  border: 1px solid rgba(250, 246, 241, 0.25);
  color: rgba(250, 246, 241, 0.6);
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 8px 18px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.4s var(--ease), color 0.3s, border-color 0.3s;
  pointer-events: none;
}

.intro-skip.visible {
  opacity: 1;
  pointer-events: auto;
}

.intro-skip:hover {
  color: #faf6f1;
  border-color: rgba(250, 246, 241, 0.5);
}

.intro.done {
  position: relative;
  height: 0;
  min-height: 0;
  overflow: hidden;
  transition: height 0.8s var(--ease);
}

@media (min-width: 768px) {
  .intro-play { width: 110px; height: 110px; }
}

/* ─── Site Content (revealed after intro) ─── */
.site-content {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  pointer-events: none;
}

.site-content.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ─── Hero Section (after intro) ─── */
.hero-section {
  position: relative;
  padding: 100px 24px 80px;
  text-align: center;
  display: flex;
  justify-content: center;
  background-image: url(/scrivana.webp);
  background-repeat: none;
  background-size: cover;
  background-position: center center;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:rgba(250, 248, 245, 0.78);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero-eyebrow {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 28px;
  font-weight: 300;
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 9vw, 5.5rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.hero-name {
  display: block;
}

.hero-amp {
  display: block;
  font-style: italic;
  font-size: 0.45em;
  color: var(--gold);
  margin: 6px 0;
  font-weight: 300;
}

.hero-divider {
  margin: 24px auto;
  color: var(--gold);
  opacity: 0.4;
}

.hero-date {
  font-family: var(--sans);
  font-size: 0.88rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 300;
}

.hero-place {
  font-family: var(--serif);
  font-size: 1.55rem;
  color: var(--ink-muted);
  font-style: italic;
  margin-top: 8px;
  font-weight: 300;
}

.hero-actions {
  margin-top: 40px;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ─── Buttons ─── */
.btn {
  display: inline-block;
  padding: 14px 32px;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.4s var(--ease);
  cursor: pointer;
}

.btn--gold {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
}

.btn--gold:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
  box-shadow: 0 8px 32px rgba(176, 141, 87, 0.3);
  transform: translateY(-2px);
}

.btn--outline {
  background: rgba(255,255,255,1);
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn--outline:hover {
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-2px);
}

/* ─── Countdown ─── */
.countdown {
  background: var(--bg);
  padding-top: 40px;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: 480px;
  margin: 0 auto;
}

.time-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 24px 12px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.time-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.4;
}

.time-value {
  display: block;
  font-family: var(--serif);
  font-size: 2.8rem;
  font-weight: 300;
  color: var(--gold);
  line-height: 1;
}

.time-label {
  display: block;
  margin-top: 8px;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

@media (min-width: 768px) {
  .countdown-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .time-value { font-size: 3.4rem; }
}

/* ─── Programma / Timeline ─── */
.programma {
  background: var(--bg-warm);
}

.timeline {
  max-width: 260px;
  margin: 0 auto;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 62px;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--gold), var(--gold), transparent);
  opacity: 0.25;
}

.tl-item {
  display: grid;
  grid-template-columns: 52px 20px 1fr;
  gap: 0;
  align-items: center;
  padding: 20px 0;
  position: relative;
}

.tl-time {
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--gold);
  text-align: right;
  font-weight: 400;
  padding-right: 0;
}

.tl-colon {
  opacity: 0.5;
}

.tl-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  margin: 0 auto;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 12px var(--gold-glow);
}

.tl-content {
  padding-left: 16px;
}

.tl-content h3 {
  color: var(--ink);
  margin-bottom: 2px;
  font-size: 1.15rem;
}

.tl-content p {
  color: var(--ink-muted);
  font-size: 0.88rem;
}

.programma-note {
  text-align: center;
  margin-top: 32px;
  color: var(--ink-muted);
  font-size: 0.82rem;
  font-style: italic;
}

/* ─── Location ─── */
.location {
  background: var(--bg);
}

.loc-photo {
  max-width: 800px;
  height: 250px;
  margin: 0 auto 32px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.loc-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.6s var(--ease);
}

.loc-photo:hover img {
  transform: scale(1.05);
}

/* Maps button */
.btn-maps {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid var(--border-strong);
  transition: all 0.3s var(--ease);
}

.btn-maps:hover {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
}


.location-grid {
  display: grid;
  gap: 16px;
  max-width: 800px;
  margin: 0 auto;
}

.loc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 32px 28px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.4s var(--ease);
}

.loc-card:hover {
  border-color: var(--border-strong);
}

.loc-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.3;
}

.loc-icon {
  color: var(--gold);
  margin-bottom: 20px;
  opacity: 0.7;
}

.loc-card h3 {
  font-size: 1.35rem;
  margin-bottom: 12px;
  color: var(--ink);
}

.loc-address {
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 12px;
}

.loc-time {
  color: var(--gold);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  font-weight: 400;
}

.loc-description {
  max-width: 640px;
  margin: 40px auto 0;
  text-align: center;
  color: var(--ink-muted);
  font-family: var(--serif);
  font-size: 1.1rem;
  font-style: italic;
  line-height: 1.8;
}

@media (min-width: 768px) {
  .location-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
  .loc-card { padding: 40px 36px; }
}

/* ─── RSVP ─── */
.rsvp {
  background: var(--bg-warm);
  position: relative;
}

.rsvp::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 80px;
  background: linear-gradient(180deg, transparent, var(--gold));
  opacity: 0.3;
}

.rsvp-form {
  max-width: 640px;
  margin: 0 auto;
  display: grid;
  gap: 20px;
}

.form-row {
  display: grid;
  gap: 20px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.rsvp-form input,
.rsvp-form textarea {
  background: #ffffff;
  border: 1px solid rgba(26, 22, 20, 0.12);
  padding: 14px 16px;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--ink);
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  outline: none;
}

.rsvp-form input:focus,
.rsvp-form textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.rsvp-form input::placeholder,
.rsvp-form textarea::placeholder {
  color: var(--ink-muted);
  opacity: 0.6;
}

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

.btn--submit {
  justify-self: start;
  margin-top: 8px;
}

.rsvp-confirmation {
  margin-top: 16px;
  padding: 16px 20px;
  background: var(--gold-glow);
  border: 1px solid var(--border-strong);
  color: var(--gold-dark);
  font-weight: 400;
  text-align: center;
}

.guest-names {
  display: grid;
  gap: 12px;
}

.guest-names .form-field {
  animation: guestFadeIn 0.3s var(--ease) both;
}

@keyframes guestFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 768px) {
  .form-row { grid-template-columns: 1fr 1fr; }
  .guest-names { grid-template-columns: 1fr 1fr; }
}

/* Info Cards */
.info-cards {
  max-width: 640px;
  margin: 48px auto 0;
  display: grid;
  gap: 16px;
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 28px 24px;
  position: relative;
}

.info-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: var(--gold);
  opacity: 0.4;
}

.info-card h3 {
  color: var(--gold);
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.info-card p {
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.7;
}

@media (min-width: 768px) {
  .info-cards { grid-template-columns: 1fr 1fr; gap: 20px; }
}

/* ─── Raccomandazioni ─── */
.raccomandazioni {
  background: var(--bg);
}

.tips {
  max-width: 560px;
  margin: 0 auto;
  display: grid;
  gap: 24px;
}

.tip {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.tip-icon {
  color: var(--gold);
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 2px;
  opacity: 0.6;
}

.tip p {
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ─── Finale Video ─── */
.finale {
  position: relative;
  overflow: hidden;
  padding: 160px 20px;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.finale-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.finale-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.5);
}

.finale-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 640px;
}

.finale-inner .eyebrow {
  color: rgba(250, 246, 241, 0.6);
}

.finale-inner h2 {
  font-style: italic;
  font-weight: 300;
  color: #faf6f1;
}

/* ─── Footer ─── */
.footer {
  padding: 60px 20px 80px;
  text-align: center;
  background: var(--bg);
  border-top: 1px solid var(--border);
  opacity: 0;
  transition: opacity 1s var(--ease);
}

.footer-ornament {
  color: var(--gold);
  opacity: 0.35;
  margin-bottom: 20px;
}

.footer-names {
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.footer-date {
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  color: var(--ink-muted);
  text-transform: uppercase;
}

/* ─── Reduced Motion ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal] {
    opacity: 1;
    transform: none;
  }
  .scroll-dot { animation: none; }
}
