:root {
  --color-text: #2d392f;
  --color-accent: #91a194;
  --color-secondary: #7c8d9d;
  --color-card: #b9c7d6;
  --color-bg: #edebe7;
  --color-white: #f9f7f2;
  --radius-lg: 32px;
  --radius-md: 20px;
  --radius-sm: 12px;
  --shadow: 0 22px 60px rgba(45, 57, 47, 0.15);
  --shadow-soft: 0 12px 30px rgba(45, 57, 47, 0.12);
  --font-display: "Inter", sans-serif;
  --font-body: "Inter", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: linear-gradient(180deg, #f3f1ed 0%, #edebe7 45%, #e7e4df 100%);
  color: var(--color-text);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

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

.page-thanks main {
  flex: 1;
}

.page-thanks .footer {
  margin-top: auto;
}

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

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

h1,
h2,
h3 {
  font-family: var(--font-display);
  margin: 0 0 0.6rem;
}

h1 {
  font-size: clamp(2.6rem, 4vw, 4.2rem);
  line-height: 1.05;
}

h2 {
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.1;
}

p {
  margin: 0 0 1.2rem;
}

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-secondary);
  margin-bottom: 0.8rem;
  display: inline-block;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.8rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--color-accent);
  color: var(--color-white);
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: var(--shadow-soft);
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.button-ghost {
  background: transparent;
  border-color: rgba(45, 57, 47, 0.2);
  color: var(--color-text);
  box-shadow: none;
}

.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 2rem;
  align-items: center;
  padding: 6.5rem 0 6rem;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(237, 235, 231, 0.9) 38%, rgba(237, 235, 231, 0.4));
  z-index: 0;
}

.nav {
  position: absolute;
  top: 1.5rem;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  background: rgba(249, 247, 242, 0.78);
  border: 1px solid rgba(45, 57, 47, 0.08);
  box-shadow: var(--shadow-soft);
  z-index: 2;
  backdrop-filter: blur(12px);
}

@media (min-width: 601px) {
  .nav {
    left: 0;
    right: 0;
    transform: none;
    width: min(1120px, 92vw);
    margin-inline: auto;
  }
}

.nav-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem;
  border: none;
  background: transparent;
  color: var(--color-text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.nav-toggle-icon {
  position: relative;
  width: 1.2rem;
  height: 2px;
  background: var(--color-text);
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-text);
}

.nav-toggle-icon::before {
  top: -6px;
}

.nav-toggle-icon::after {
  top: 6px;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.nav-links a {
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.4rem;
  width: 100%;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.nav-links a:hover::after {
  transform: scaleX(1);
}

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

.hero-lead {
  font-size: 1.05rem;
  color: rgba(45, 57, 47, 0.82);
}

.hero-date {
  font-size: 1.2rem;
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.hero-image {
  position: relative;
  width: 100%;
  height: 72vh;
  max-height: 900px;
  border-top-left-radius: 12% 10%;
  border-bottom-left-radius: 12% 12%;
  border-top-right-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
  overflow: hidden;
  z-index: 0;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: heroZoom 8s ease-in-out infinite alternate;
}

@keyframes heroZoom {
  from {
    transform: scale(1) translateY(0);
  }
  to {
    transform: scale(1.08) translateY(8px);
  }
}

.section {
  padding: 5rem 0;
}

.section-alt {
  background: linear-gradient(180deg, rgba(185, 199, 214, 0.2), rgba(185, 199, 214, 0.05));
}

.section-heading {
  max-width: 640px;
  margin-bottom: 3rem;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3rem;
  align-items: center;
}

.thanks-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 3rem;
  align-items: center;
}

.thanks-photo {
  position: relative;
  z-index: 0;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(145, 161, 148, 0.25), rgba(124, 141, 157, 0.2));
  box-shadow: var(--shadow-soft);
}

.thanks-photo::before {
  content: "";
  position: absolute;
  inset: -0.65rem;
  border-radius: calc(var(--radius-lg) + 0.65rem);
  border: 1px dashed rgba(45, 57, 47, 0.18);
  z-index: -1;
}

.thanks-photo img {
  border-radius: 22px;
  transform: rotate(-2deg);
  box-shadow: 0 18px 40px rgba(45, 57, 47, 0.18);
}

.thanks-caption {
  margin-top: 0.9rem;
  font-size: 0.9rem;
  color: rgba(45, 57, 47, 0.7);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-text {
  max-width: 520px;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.5rem;
}

.timeline-item {
  padding: 1.8rem;
  border-radius: var(--radius-md);
  background: rgba(249, 247, 242, 0.8);
  border: 1px solid rgba(45, 57, 47, 0.08);
  box-shadow: var(--shadow-soft);
}

.timeline-time {
  display: inline-flex;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: rgba(145, 161, 148, 0.15);
  color: var(--color-accent);
  font-weight: 700;
  margin-bottom: 1rem;
}

.map-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(45, 57, 47, 0.08);
}

.map-card iframe {
  width: 100%;
  height: 360px;
  border: 0;
}

.dress-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.dress-grid img {
  border-radius: var(--radius-sm);
  aspect-ratio: 4 / 5;
  object-fit: cover;
  box-shadow: var(--shadow-soft);
}

.palette {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.palette span {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: rgba(249, 247, 242, 0.7);
  border: 1px solid rgba(45, 57, 47, 0.08);
}

.palette span::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--swatch, var(--color-accent));
  border: 1px solid rgba(45, 57, 47, 0.2);
}

.qr-card {
  justify-self: center;
  text-align: center;
  padding: 2rem;
  border-radius: var(--radius-md);
  background: rgba(249, 247, 242, 0.75);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(45, 57, 47, 0.08);
}

.qr-card img {
  width: min(260px, 70vw);
  margin: 0 auto 1rem;
}

.qr-note {
  font-size: 0.9rem;
  color: rgba(45, 57, 47, 0.7);
}

.rsvp-form {
  display: grid;
  gap: 1.2rem;
  padding: 2rem;
  border-radius: var(--radius-lg);
  background: rgba(249, 247, 242, 0.75);
  border: 1px solid rgba(45, 57, 47, 0.08);
  box-shadow: var(--shadow);
}

.rsvp-form label,
.rsvp-form fieldset {
  display: grid;
  gap: 0.6rem;
  font-weight: 600;
}

.rsvp-form legend {
  grid-column: 1 / -1;
  font-weight: 600;
  padding: 0 0.2rem;
  margin-bottom: 0.2rem;
}

.rsvp-form input {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(45, 57, 47, 0.2);
  background: rgba(255, 255, 255, 0.9);
  font-family: var(--font-body);
}

.rsvp-form fieldset {
  border: 1px solid rgba(45, 57, 47, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem 1rem;
  margin: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem 0.9rem;
}

.radio {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 500;
  line-height: 1.3;
}

.rsvp-form input[type="radio"] {
  width: 18px;
  height: 18px;
  padding: 0;
  margin: 0;
}

.form-status {
  font-weight: 600;
  color: var(--color-accent);
  min-height: 1.4rem;
}

.faq {
  display: grid;
  gap: 1rem;
}

.faq details {
  padding: 1.1rem 1.4rem;
  border-radius: var(--radius-md);
  background: rgba(249, 247, 242, 0.8);
  border: 1px solid rgba(45, 57, 47, 0.08);
  box-shadow: var(--shadow-soft);
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  float: right;
  font-size: 1.2rem;
  color: var(--color-accent);
}

.faq details[open] summary::after {
  content: "–";
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.9rem;
}

.gallery-grid img {
  border-radius: var(--radius-sm);
  aspect-ratio: 3 / 4;
  object-fit: cover;
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s ease;
  cursor: zoom-in;
}

.gallery-grid img:hover {
  transform: translateY(-6px);
}

.footer {
  padding: 2rem 0 3rem;
  text-align: center;
  font-family: var(--font-display);
}

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  transition-delay: var(--delay, 0s);
}

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

body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(32, 40, 35, 0.65);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 50;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox__content {
  position: relative;
  max-width: min(900px, 90vw);
  max-height: 85vh;
  display: grid;
  place-items: center;
  padding: 2.5rem 3.5rem;
  border-radius: var(--radius-lg);
  background: rgba(249, 247, 242, 0.95);
  box-shadow: var(--shadow);
}

.lightbox__image {
  max-width: 100%;
  max-height: 65vh;
  width: auto;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  border: none;
  background: rgba(249, 247, 242, 0.9);
  color: var(--color-text);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.5rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lightbox__close {
  top: 1rem;
  right: 1rem;
}

.lightbox__close:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__nav:hover {
  transform: translateY(-50%) scale(1.02);
  box-shadow: var(--shadow);
}

.lightbox__nav.lightbox__prev {
  left: 0.6rem;
}

.lightbox__nav.lightbox__next {
  right: 0.6rem;
}

.lightbox__counter {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: rgba(45, 57, 47, 0.7);
}

@media (max-width: 960px) {
  .hero {
    padding-top: 7.5rem;
    grid-template-columns: 1fr;
  }

  .hero-image {
    height: 50vh;
    border-radius: var(--radius-lg);
    margin-top: 2rem;
  }

  .hero-content {
    max-width: 100%;
  }

  .section-grid {
    grid-template-columns: 1fr;
  }

  .thanks-layout {
    grid-template-columns: 1fr;
  }

  .thanks-photo {
    width: min(520px, 100%);
    margin-inline: auto;
  }

  .dress-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav {
    flex-direction: column;
    border-radius: var(--radius-lg);
  }
}

@media (max-width: 600px) {
  .hero {
    min-height: auto;
    padding: 2rem 0 4rem;
  }

  .nav {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    width: min(92vw, 100%);
    padding: 0.6rem 0.9rem;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
    margin-inline: auto;
    align-items: stretch;
  }

  .nav-header {
    width: 100%;
    justify-content: space-between;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    overflow-x: visible;
    padding-bottom: 0;
  }

  .nav.is-open .nav-links {
    display: flex;
  }

  .nav-links a {
    font-size: 0.85rem;
    white-space: normal;
  }

  .hero-image {
    width: min(92vw, 100%);
    height: clamp(38vh, 48vw, 52vh);
    min-height: 260px;
    max-height: 420px;
    border-radius: 24px;
    margin-inline: auto;
  }

  .hero-image img {
    object-position: center 25%;
    animation-name: heroZoomMobile;
  }

  .thanks-photo img {
    transform: rotate(-1deg);
  }

  @keyframes heroZoomMobile {
    from {
      transform: scale(0.94);
    }
    to {
      transform: scale(1.04);
    }
  }

  h1 {
    font-size: clamp(2.2rem, 9vw, 3rem);
  }

  .hero-date {
    font-size: 1.05rem;
  }

  .hero-lead {
    font-size: 1rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .button {
    width: 100%;
  }

  .section {
    padding: 3.6rem 0;
  }

  .section-heading {
    margin-bottom: 2rem;
  }

  .timeline {
    grid-template-columns: 1fr;
  }

  .dress-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
  }

  .map-card iframe {
    height: 300px;
  }

  .rsvp-form {
    padding: 1.6rem;
  }

  .rsvp-form fieldset {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
  }

  .lightbox__content {
    padding: 2.2rem 1.8rem;
  }

  .lightbox__image {
    max-width: 100%;
  }

  .lightbox__nav {
    width: 38px;
    height: 38px;
  }
}

@media (max-width: 420px) {
  .dress-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
