:root {
  --ivory: #f5f1e8;
  --paper: #faf7f0;
  --ink: #23201b;
  --ink-soft: #5b5347;
  --gold: #c9a86a;
  --rule: #d9d0bd;
  --cream: #f3efe4;
  --cream-soft: #d8d2c2;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: #10130f;
  color: var(--cream);
  font-family: "helvetica-neue-world", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#preloader {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #10130f;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.7s ease;
}

#preloader.done {
  opacity: 0;
  pointer-events: none;
}

.preload-logo {
  position: relative;
  width: 92px;
  aspect-ratio: 267.22 / 401.38;
}

.preload-logo-track {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0.22;
}

.preload-logo-fill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  clip-path: inset(100% 0 0 0);
  transition: clip-path 0.4s ease-out;
}

.preload-logo-fill img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 0 10px rgba(201, 168, 106, 0.55));
}

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 32px;
  background: rgba(16, 19, 15, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav-links {
  display: flex;
  gap: 28px;
  flex: 1;
}

.nav-links a {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream-soft);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--cream);
}

.nav-center {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--cream-soft);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.nav.show-logo .nav-center {
  opacity: 1;
}

.nav-logo-wrap {
  display: block;
  width: 28px;
  height: auto;
}

.nav-logo {
  display: block;
  width: 100%;
  height: auto;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: flex-end;
  transition: gap 0.25s ease;
}

.nav-right:hover {
  gap: 14px;
}

.nav-contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 9px 20px 12px;
  border: 1px solid rgba(243, 239, 228, 0.4);
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cream);
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.nav-contact:hover {
  border-color: var(--gold);
}

.btn-fill {
  position: relative;
  z-index: 0;
  isolation: isolate;
  overflow: hidden;
}

.btn-fill::before {
  content: "";
  position: absolute;
  left: var(--fx, 50%);
  top: var(--fy, 50%);
  width: 560px;
  height: 560px;
  margin: -280px 0 0 -280px;
  background: var(--cream);
  border-radius: 50%;
  transform: scale(0);
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: -1;
  pointer-events: none;
}

.btn-fill:hover::before {
  transform: scale(1);
}

.btn-fill:hover {
  color: var(--ink);
}

.nav-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--cream);
  color: var(--ink);
  flex-shrink: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}

.nav-arrow:hover {
  background: var(--gold);
  transform: translate(1px, -1px);
}

@media (max-width: 700px) {
  .nav {
    padding: 16px 20px;
  }
  .nav-links {
    display: none;
  }
  .nav-center {
    flex: none;
  }
}

.page {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  overflow: hidden;
  background: #10130f;
}

.bg-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center 35%;
  background-repeat: no-repeat;
  opacity: 0;
  animation: bg-crossfade 27s ease-in-out infinite;
}

.bg-layer.bg-1 {
  background-image: url("images/hero-statue.jpg");
  animation-delay: 0s;
}

.bg-layer.bg-2 {
  background-image: url("images/hero-florence.jpg");
  background-position: center 55%;
  animation-delay: -9s;
}

.bg-layer.bg-3 {
  background-image: url("images/hero-storm.jpg");
  background-position: center 40%;
  animation-delay: -18s;
}

@keyframes bg-crossfade {
  0%, 26% { opacity: 1; }
  33%, 93% { opacity: 0; }
  100% { opacity: 1; }
}

.page::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 13, 9, 0.55) 0%, rgba(10, 13, 9, 0.35) 42%, rgba(10, 13, 9, 0.65) 100%);
  z-index: 1;
}

.content {
  position: relative;
  z-index: 2;
  max-width: 680px;
  width: 100%;
  text-align: center;
  padding: 64px 24px;
}

.logo {
  display: block;
  height: 68px;
  width: auto;
  margin: 0 auto 36px;
  filter: drop-shadow(0 2px 16px rgba(0, 0, 0, 0.35));
}

h1.tagline {
  margin: 0 0 44px;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
  font-family: "helvetica-neue-world", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream-soft);
  white-space: nowrap;
}

.tagline-rotate {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  transition: opacity 0.4s ease, transform 0.4s ease, width 0.4s ease;
}

.tagline-rotate.switching {
  opacity: 0;
  transform: translateY(6px);
}

h1.tagline em {
  display: block;
  margin-top: -5px;
  font-family: "ivypresto-display", "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 400;
  font-size: 80px;
  line-height: 1.2;
  letter-spacing: normal;
  text-transform: none;
  color: var(--cream);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

.contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 15px 38px 18px;
  border: 1px solid rgba(243, 239, 228, 0.4);
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream);
  text-decoration: none;
  transition: border-color 0.2s ease;
}

.contact:hover {
  border-color: var(--gold);
}

.sound-toggle {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 3;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(243, 239, 228, 0.4);
  background: rgba(16, 19, 15, 0.35);
  backdrop-filter: blur(4px);
  color: var(--cream-soft);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.sound-toggle svg {
  width: 19px;
  height: 19px;
}

.sound-toggle:hover {
  border-color: var(--gold);
  color: var(--cream);
}

.sound-toggle[aria-pressed="true"] {
  color: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(201, 168, 106, 0.12);
}

.invite {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

.invite-text {
  background: var(--ivory);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 64px;
}

.invite-eyebrow {
  margin: 0 0 20px;
  font-size: 12px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.invite-heading {
  margin: 0 0 28px;
  max-width: 420px;
  font-family: "ivypresto-display", "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(32px, 4.2vw, 54px);
  line-height: 1.15;
  color: var(--ink);
}

.invite-body {
  margin: 0 0 18px;
  max-width: 400px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink-soft);
}

.invite-body:last-of-type {
  margin-bottom: 0;
}

.invite-emphasis {
  font-family: "ivypresto-display", "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 400;
  font-size: 1.2em;
  color: var(--ink);
}

.invite-image {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  overflow: hidden;
}

.invite-bg {
  position: absolute;
  inset: -12% 0;
  background-image: url("images/section2-doors.jpg");
  background-size: cover;
  background-position: center;
  will-change: transform;
}

.invite-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 13, 9, 0.4) 0%, rgba(10, 13, 9, 0.15) 45%, rgba(10, 13, 9, 0.5) 100%);
}

.invite-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 320px;
  padding: 28px 28px 34px;
  text-align: center;
  background: var(--paper);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.invite-corner {
  position: absolute;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.invite-corner-tl {
  top: 26px;
  left: 26px;
}

.invite-corner-tr {
  top: 26px;
  right: 26px;
}

.invite-corner-bl {
  bottom: 30px;
  left: 26px;
}

.invite-corner-logo {
  position: absolute;
  bottom: 26px;
  right: 26px;
  width: 18px;
  height: auto;
}

.invite-arch {
  position: relative;
  width: 200px;
  height: 256px;
  margin: 48px auto 26px;
  border-radius: 100px 100px 0 0;
  overflow: hidden;
}

.invite-arch img {
  position: absolute;
  left: 0;
  top: -15%;
  width: 100%;
  height: 130%;
  object-fit: cover;
  object-position: 35% 50%;
  will-change: transform;
}

@media (max-width: 860px) {
  .invite {
    grid-template-columns: 1fr;
  }
  .invite-text {
    padding: 64px 32px;
  }
  .invite-image {
    min-height: 520px;
    padding: 48px 24px;
  }
}

@media (max-width: 480px) {
  .content { padding: 48px 16px; }
  .sound-toggle { right: 18px; bottom: 18px; }
  h1.tagline { font-size: 4vw; white-space: normal; }
  h1.tagline em { font-size: 11vw; }
  .invite-text { padding: 56px 24px; }
}
