:root {
  --bg: #f9fafb;
  --surface: #ffffff;
  --surface-alt: #eef4f0;
  --text: #2c3e36;
  --muted: #6b8076;
  --accent: #6aabcb;
  --accent-dark: #4d8fae;
  --border: #d4ddd8;
  --max-width: 1080px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

::selection {
  background: rgba(106, 171, 203, 0.25);
}

body.invite-gated {
  overflow: hidden;
}

.container {
  width: min(92%, var(--max-width));
  margin: 0 auto;
}

.invite-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: radial-gradient(circle at 50% 12%, #2f2a24 0%, #121111 58%);
  display: grid;
  place-items: center;
  padding: 1rem;
  transition: opacity 500ms ease, visibility 500ms ease;
}

.invite-experience {
  position: relative;
  width: min(94vw, 760px);
  min-height: 520px;
  display: grid;
  place-items: center;
  perspective: 1200px;
}

.envelope-shell {
  position: absolute;
  width: min(92vw, 520px);
  aspect-ratio: 1.5 / 1;
  border-radius: 8px;
  background: linear-gradient(180deg, #f2eadf, #e4d6c4);
  border: 1px solid #ccb9a3;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.38);
  overflow: hidden;
  z-index: 2;
}

.envelope-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(140deg, transparent 49.2%, rgba(168, 140, 110, 0.35) 50%, transparent 50.8%),
    linear-gradient(40deg, transparent 49.2%, rgba(168, 140, 110, 0.35) 50%, transparent 50.8%);
}

.envelope-shell::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 53%;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: linear-gradient(180deg, #f1e8db, #dbcab3);
  border-bottom: 1px solid #c2ad93;
}

.invite-for {
  margin: 0;
  font-family: Cinzel, serif;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.66rem;
  color: #7a6b5c;
}

.invite-center h2 {
  margin: 0.5rem 0 0.3rem;
  font-size: clamp(2rem, 4.5vw, 3rem);
  letter-spacing: 0.02em;
  text-transform: none;
  color: #1d1a17;
}

.invite-date {
  margin: 0 0 1.1rem;
  color: #5a4d40;
  font-size: 1.05rem;
}

.open-invite-btn {
  position: absolute;
  left: 50%;
  bottom: 22%;
  transform: translateX(-50%);
  z-index: 3;
  border: 1px solid #6a1c1c;
  background:
    radial-gradient(circle at 30% 26%, rgba(255, 219, 219, 0.45), rgba(255, 219, 219, 0) 33%),
    radial-gradient(circle at 68% 72%, rgba(0, 0, 0, 0.26), rgba(0, 0, 0, 0) 38%),
    radial-gradient(circle at 48% 44%, #b53f3f, #7c1f1f 66%);
  width: 86px;
  height: 86px;
  border-radius: 47% 53% 51% 49% / 46% 51% 49% 54%;
  color: #f0ded0;
  font-family: Cinzel, serif;
  letter-spacing: 0.08em;
  font-size: 0.62rem;
  cursor: pointer;
  box-shadow: inset 0 -10px 14px rgba(0, 0, 0, 0.3),
    inset 0 8px 12px rgba(255, 255, 255, 0.2), 0 10px 16px rgba(0, 0, 0, 0.32);
  transition: transform 320ms ease, opacity 220ms ease;
}

.wax-seal-btn:hover {
  transform: translateX(-50%) scale(1.06);
}

.wax-seal-btn::before {
  content: "";
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  border: 1px solid rgba(245, 216, 197, 0.34);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.26);
}

.wax-seal-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: conic-gradient(
    from 0deg,
    rgba(255, 255, 255, 0.08),
    rgba(0, 0, 0, 0.07),
    rgba(255, 255, 255, 0.08)
  );
  mix-blend-mode: soft-light;
}

.seal-hint {
  position: absolute;
  left: 50%;
  bottom: 9%;
  transform: translateX(-50%);
  margin: 0;
  font-family: Cinzel, serif;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.58rem;
  color: #c8b8a2;
  z-index: 4;
  pointer-events: none;
}

.invitation-card {
  position: absolute;
  width: min(92vw, 620px);
  min-height: 380px;
  background: linear-gradient(180deg, #f6f0e6, #ece1d2);
  border: 1px solid #cdb89e;
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.36);
  display: grid;
  grid-template-columns: 1fr 2.6fr 1fr;
  align-items: stretch;
  opacity: 0;
  transform: translateY(32px) scale(0.94);
  pointer-events: none;
  z-index: 1;
  transition: opacity 360ms ease, transform 700ms cubic-bezier(0.2, 0.8, 0.1, 1);
}

.invite-panel {
  background: linear-gradient(180deg, #ead8c0, #dcc6aa);
}

.invite-left {
  transform-origin: left center;
}

.invite-right {
  transform-origin: right center;
}

.invite-center {
  padding: 2.2rem 1.4rem;
  text-align: center;
  color: #2d2924;
}

.invite-meta {
  margin: 0.35rem 0 1.2rem;
  color: #695f52;
  font-family: Cinzel, serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.enter-site-btn {
  border: 1px solid #7d6648;
  background: #2a241d;
  color: #f2e7d8;
  font-family: Cinzel, serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.66rem;
  padding: 0.62rem 1rem;
  cursor: pointer;
}

.enter-site-btn:hover {
  background: #3a3128;
}

body.invite-opening .open-invite-btn,
body.invite-opening .seal-hint {
  opacity: 0;
}

body.invite-opening .envelope-shell {
  transform: translateY(24px) scale(0.98);
  transition: transform 520ms ease;
}

body.invite-opening .invitation-card {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  z-index: 5;
}

body.invite-opening .open-invite-btn {
  pointer-events: none;
  transform: translateX(-50%) scale(0.25) rotate(-20deg);
}

body.invite-opening .seal-hint {
  opacity: 0;
  transition: opacity 240ms ease;
}

body.invite-open .invite-gate {
  opacity: 0;
  visibility: hidden;
}

body.invite-entering .invite-left {
  transform: rotateY(86deg);
  transition: transform 560ms ease;
}

body.invite-entering .invite-right {
  transform: rotateY(-86deg);
  transition: transform 560ms ease;
}

body.invite-entering .invitation-card {
  opacity: 0;
  transform: translateY(-24px) scale(1.03);
  transition: transform 520ms ease, opacity 460ms ease;
}

.hero {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  background: linear-gradient(rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.55)),
    url("./assets/hero-background.jpg")
      60% 24% / cover no-repeat;
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.15rem 0;
  position: relative;
}

.menu-toggle {
  display: none;
  position: absolute;
  right: 0;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  padding: 0.4rem 0.72rem;
  font-family: Cinzel, serif;
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.2rem;
}

.nav-links a {
  text-decoration: none;
  color: #fff;
  font-family: Cinzel, serif;
  font-size: 0.67rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.93;
}

.hero-content {
  align-self: center;
  justify-self: start;
  max-width: 520px;
  padding: 2rem 1rem 6.5rem 1.25rem;
  margin-left: 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.hero-script {
  margin: 0 0 0.55rem;
  color: #d4e8d9;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-style: italic;
}

.hero-message {
  margin: 1rem 0 0;
  max-width: 46ch;
  color: #e8efe8;
  font-size: 1.2rem;
  line-height: 1.45;
}

h1 {
  margin: 0;
  font-size: clamp(2.8rem, 7.4vw, 5rem);
  line-height: 1;
  letter-spacing: 0.03em;
  font-weight: 500;
  color: #f2eee7;
}

.photo-credit {
  margin: 1.15rem 0 0.35rem;
  color: #e8e0d3;
  font-family: Cinzel, serif;
  font-size: 0.84rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.location {
  margin: 0.3rem 0 0;
  color: #d8cec1;
  font-size: 1.12rem;
  line-height: 1.35;
}

.hero-actions {
  display: flex;
  gap: 0.7rem;
  margin-top: 1.4rem;
  flex-wrap: wrap;
}

.section {
  padding: 4rem 0;
}

.details-strip {
  padding: 1.6rem 0 2.2rem;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 0.9rem;
}

.detail-pill {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 0.95rem 1.15rem;
}

.detail-label {
  margin: 0;
  color: var(--accent-dark);
  font-family: Cinzel, serif;
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.detail-value {
  margin: 0.28rem 0 0;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 600;
}

.section.alt {
  background: var(--surface-alt);
}

h2 {
  margin: 0 0 1rem;
  font-family: Cinzel, serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  color: var(--text);
}

p {
  color: var(--muted);
}

.timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.9rem;
}

.timeline article,
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1rem;
  border-radius: 8px;
}

.timeline h3,
.card h3 {
  margin: 0;
  font-size: 1.32rem;
  color: var(--text);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.card a {
  color: var(--accent-dark);
}

.guest-info-list {
  list-style: none;
  padding: 0;
  margin: 0.8rem 0 0;
  display: grid;
  gap: 0.65rem;
}

.guest-info-list li {
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1.08rem;
  line-height: 1.5;
}

.rsvp-form .name-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.btn {
  display: inline-block;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 0.58rem 1.2rem;
  font-family: Cinzel, serif;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.67rem;
  transition: background 200ms ease;
}

.btn:hover {
  background: var(--accent-dark);
}

.btn:focus-visible,
.nav-links a:focus-visible,
input:focus-visible,
select:focus-visible,
.open-invite-btn:focus-visible,
.enter-site-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn.ghost,
.btn.ghost-light {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn.ghost:hover,
.btn.ghost-light:hover {
  background: var(--surface-alt);
}

.registry-links {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.narrow {
  max-width: 560px;
}

.rsvp-form {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}

.rsvp-form label {
  display: grid;
  gap: 0.35rem;
  color: var(--text);
}

input,
select {
  width: 100%;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font: inherit;
  border-radius: 4px;
}

.form-note {
  min-height: 1.4rem;
  color: var(--accent);
}

.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  background: #2c3e36;
}

.footer p {
  color: #d4e8d9;
}

#registry p,
#rsvp p,
#guest-info p,
#venue p {
  max-width: 62ch;
}

@media (max-width: 860px) {
  .nav {
    justify-content: flex-end;
  }

  .menu-toggle {
    display: inline-block;
  }

  .nav-links {
    position: absolute;
    top: 4.2rem;
    right: 4%;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid var(--border);
    padding: 0.8rem;
    display: none;
    flex-direction: column;
    min-width: 190px;
    z-index: 5;
  }

  .nav-links a {
    color: var(--text);
  }

  .nav-links.open {
    display: flex;
  }

  .hero-content {
    max-width: 100%;
    padding-bottom: 3.2rem;
    margin-left: 0;
  }

  .details-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}

@media (max-width: 560px) {
  .rsvp-form .name-row {
    grid-template-columns: 1fr;
  }

  .invitation-card {
    grid-template-columns: 1fr;
    min-height: 330px;
  }

  .invite-panel {
    display: none;
  }

  .open-invite-btn {
    width: 74px;
    height: 74px;
    bottom: 20%;
  }

  .seal-hint {
    font-size: 0.53rem;
    bottom: 7%;
  }

  .details-grid {
    grid-template-columns: 1fr;
  }
}
