:root {
  --bg: #f4f1ec;
  --paper: #fffdfa;
  --ink: #171515;
  --muted: #6a625d;
  --rule: rgba(23, 21, 21, 0.12);
  --rule-strong: rgba(23, 21, 21, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background: #fffdfa;
}

body.is-loading,
body.is-modal-open,
body.is-lightbox-open {
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.screen-loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 28px;
  text-align: center;
  color: var(--ink);
  background: var(--paper);
  transition: opacity 420ms ease, visibility 420ms ease;
}

.screen-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-line {
  position: relative;
  width: min(360px, 88vw);
  height: 156px;
  overflow: visible;
}

.loader-line-track {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 20px;
  height: 2px;
  background: linear-gradient(
    90deg,
    rgba(23, 21, 21, 0),
    rgba(23, 21, 21, 0.18) 18%,
    rgba(23, 21, 21, 0.18) 82%,
    rgba(23, 21, 21, 0)
  );
}

.loader-dog-runner {
  position: absolute;
  left: 0;
  bottom: 18px;
  width: 144px;
  animation: loader-dog-run 3.8s linear infinite;
}

.loader-dog-video {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  background: transparent;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(23, 21, 21, 0.14));
}

.loader-text {
  color: var(--muted);
}

.loader-title,
.loader-text,
.sheet-kicker,
.panel-feedback,
.form-feedback,
.field span,
.choice-group legend,
.guest-card-title,
.section-kicker {
  margin: 0;
}

.loader-title {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2rem, 8vw, 3.1rem);
  line-height: 0.94;
}

.loader-text {
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.loader-cta {
  min-width: min(244px, 76vw);
  min-height: 42px;
  margin-top: 4px;
  padding: 0 18px;
  border: 1px solid rgba(23, 21, 21, 0.18);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.loader-cta:hover,
.loader-cta:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(23, 21, 21, 0.34);
}

.site-shell {
  position: relative;
  min-height: 100vh;
}

.intro-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: #000;
  opacity: 1;
  --intro-screen-transform: none;
  --intro-screen-out-transform: scale(1.02);
  transform: var(--intro-screen-transform);
  transform-origin: center center;
  filter: blur(0);
  transition:
    opacity 560ms ease,
    transform 560ms ease,
    filter 560ms ease,
    visibility 0s linear 560ms;
}

.intro-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

body.is-loading .intro-screen {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: var(--intro-screen-out-transform);
  filter: blur(10px);
}

.intro-screen.is-ending {
  opacity: 0;
  transform: var(--intro-screen-out-transform);
  filter: blur(10px);
}

.intro-screen.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

.intro-video-element {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center center;
  background: #000;
}

.intro-sound-toggle {
  position: absolute;
  right: 16px;
  bottom: 22px;
  z-index: 2;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(12, 12, 12, 0.42);
  backdrop-filter: blur(8px);
  color: #fff;
}

.intro-sound-icon {
  position: relative;
  width: 16px;
  height: 14px;
}

.intro-sound-icon::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 8px;
  height: 8px;
  background: currentColor;
  clip-path: polygon(0 25%, 45% 25%, 78% 0, 78% 100%, 45% 75%, 0 75%);
}

.intro-sound-icon::after {
  content: "";
  position: absolute;
  right: 0;
  top: 1px;
  width: 7px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-top: 2px solid transparent;
  border-bottom: 2px solid transparent;
  border-radius: 0 10px 10px 0;
}

.intro-sound-toggle[aria-pressed="false"] .intro-sound-icon::after {
  width: 12px;
  height: 2px;
  top: 6px;
  right: -1px;
  border: 0;
  background: currentColor;
  transform: rotate(-45deg);
  border-radius: 999px;
}

.intro-progress {
  position: absolute;
  left: 16px;
  right: 68px;
  bottom: 42px;
  z-index: 2;
  height: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.18);
}

.intro-progress-bar {
  display: block;
  width: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.92);
  transition: width 180ms ease;
}

.main-content {
  opacity: 0;
  transform: translateY(20px);
  overflow-anchor: none;
  transition:
    opacity 700ms ease,
    transform 700ms ease;
  padding: 0 0 56px;
}

.main-content.is-ready {
  opacity: 1;
  transform: translateY(0);
}

.invitation-sheet {
  width: 100%;
  margin: 0 auto;
  background: var(--paper);
  border: none;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
}

.sheet-panel,
.form-card {
  position: relative;
  padding: 24px 20px;
  background: var(--paper);
}

.sheet-panel + .sheet-panel,
.sheet-panel + .form-card,
.form-card + .form-card {
  border-top: 1px solid rgba(23, 21, 21, 0.06);
}

.sheet-panel-photo {
  padding: 0;
  aspect-ratio: 0.82;
  background: #ece7e0;
}

.sheet-main-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 24%;
  filter: grayscale(1) contrast(1.04);
  transition: filter 220ms ease, transform 220ms ease;
}

.sheet-kicker,
.section-kicker,
.field span,
.choice-group legend,
.guest-card-title,
.countdown-item span {
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.sheet-kicker,
.section-kicker,
.field span,
.choice-group legend,
.guest-card-title,
.countdown-item span {
  color: var(--muted);
}

.sheet-kicker-light,
.sheet-panel-countdown .countdown-item span,
.sheet-panel-countdown .sheet-kicker {
  color: rgba(255, 255, 255, 0.74);
}

.sheet-date-title,
.sheet-section-title,
.section-heading h2,
.countdown-item strong {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  color: var(--ink);
}

.sheet-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.72;
  text-align: center;
}

.sheet-copy-left {
  text-align: left;
}

.sheet-copy + .sheet-copy {
  margin-top: 12px;
}

.sheet-panel-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.18fr);
  gap: 16px;
  align-items: center;
}

.split-photo-card,
.location-image-card {
  margin: 0;
  overflow: hidden;
  background: #ece7e0;
}

.split-photo-card {
  aspect-ratio: 0.74;
}

.split-photo-image,
.location-image-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.04);
  transition: filter 220ms ease, transform 220ms ease;
}

.gallery-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.04);
  transition: filter 220ms ease, transform 220ms ease;
}

.split-copy-card .sheet-section-title,
.sheet-panel-location .sheet-section-title,
.sheet-panel-rsvp .sheet-section-title {
  margin-top: 0;
}

.sheet-section-title {
  font-size: clamp(1.9rem, 7.4vw, 2.8rem);
  line-height: 0.94;
}

.sheet-panel-date-band {
  background:
    linear-gradient(180deg, rgba(17, 17, 17, 0.9), rgba(17, 17, 17, 0.86)),
    url("/assets/slider/IMG_6823.jpg") center center / cover no-repeat;
  text-align: center;
  margin-top: 0;
}

.sheet-date-title {
  margin-top: 12px;
  font-size: clamp(2.1rem, 8.4vw, 3.2rem);
}

.sheet-date-title-light {
  color: #ffffff;
}

.sheet-panel-gallery {
  text-align: center;
}

.gallery-slider {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  overflow-anchor: none;
  scrollbar-width: none;
}

.gallery-slider.is-mobile-gallery-stable {
  scroll-snap-type: none;
}

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

.gallery-slide {
  flex: 0 0 56%;
  margin: 0;
  aspect-ratio: 0.92;
  overflow: hidden;
  background: #ece7e0;
  scroll-snap-align: start;
}

.gallery-slider.is-mobile-gallery-stable .gallery-slide {
  scroll-snap-align: none;
}

.moodboard-card img:hover,
.moodboard-card img:active,
.moodboard-card img.is-revealed {
  filter: grayscale(0) contrast(1);
}

.sheet-panel-location {
  padding: 22px 20px 24px;
  text-align: center;
}

.location-card {
  width: min(100%, 320px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.location-kicker {
  margin-bottom: 8px;
}

.location-title {
  margin: 0;
  font-size: clamp(2.2rem, 8.6vw, 2.9rem);
  line-height: 0.92;
  letter-spacing: -0.015em;
}

.location-text {
  width: min(100%, 280px);
  margin: 12px auto 0;
  display: grid;
  gap: 4px;
  text-align: center;
}

.location-text .sheet-copy {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.42;
  text-align: center;
}

.location-copy-secondary {
  color: #756d68;
}

.location-divider {
  display: block;
  width: 72px;
  height: 1px;
  margin: 16px auto 0;
  background: linear-gradient(90deg, rgba(28, 24, 22, 0), rgba(28, 24, 22, 0.28), rgba(28, 24, 22, 0));
}

.sheet-panel-countdown {
  overflow: hidden;
  text-align: center;
  background: #151515;
}

.countdown-backdrop {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(17, 17, 17, 0.72), rgba(17, 17, 17, 0.78)),
    url("/assets/slider/IMG_6774.jpg") center center / cover no-repeat;
  filter: grayscale(1);
}

.sheet-panel-countdown > * {
  position: relative;
  z-index: 1;
}

.countdown-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.countdown-item {
  padding: 12px 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
}

.countdown-item strong {
  display: block;
  font-size: 1.68rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
}

.countdown-item span {
  display: block;
  margin-top: 8px;
}

.sheet-panel-rsvp {
  padding: 24px 20px;
  text-align: center;
}

.sheet-panel-rsvp .sheet-section-title {
  margin-top: 0;
}

.attendance-actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.primary-action,
.secondary-action,
.submit-button,
.lightbox-close {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--rule-strong);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.66rem;
  transition:
    background-color 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
}

.primary-action,
.submit-button {
  background: #171515;
  color: #ffffff;
  border-color: #171515;
}

.secondary-action,
.lightbox-close {
  background: #ffffff;
  color: #171515;
}

.primary-action:hover,
.secondary-action:hover,
.submit-button:hover,
.lightbox-close:hover {
  filter: brightness(0.98);
}

.primary-action:focus-visible,
.secondary-action:focus-visible,
.submit-button:focus-visible,
.lightbox-close:focus-visible,
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(23, 21, 21, 0.08);
}

.section-heading h2 {
  margin-top: 12px;
  padding-top: 8px;
  font-size: clamp(1.45rem, 6vw, 2rem);
  line-height: 1;
  text-align: center;
}

#decline-panel .section-heading h2 {
  margin-top: 18px;
}

#rsvp-modal-title,
#rsvp-modal-title-decline {
  padding-top: 10px;
}

.field {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  background: #ffffff;
  color: var(--ink);
}

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

.choice-group {
  margin: 14px 0 0;
  padding: 0;
  border: none;
}

.choice-group legend {
  margin-bottom: 10px;
}

.choice-card {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  margin-top: 8px;
  padding: 0 12px;
  border: 1px solid var(--rule);
  background: #ffffff;
}

.choice-card input {
  accent-color: #171515;
}

.guest-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.guest-card {
  padding: 10px;
  border: 1px solid var(--rule);
  background: #ffffff;
}

.guest-card-title {
  margin-bottom: 8px;
}

.submit-button {
  margin-top: 16px;
}

.submit-button:disabled,
.primary-action:disabled,
.secondary-action:disabled {
  opacity: 0.72;
  cursor: wait;
}

.panel-feedback,
.form-feedback {
  min-height: 0;
  margin-top: 0;
  font-size: 0.76rem;
  line-height: 1.5;
  text-align: center;
}

.panel-feedback:not(:empty),
.form-feedback:not(:empty) {
  min-height: 18px;
  margin-top: 12px;
}

.panel-feedback.is-success,
.form-feedback.is-success {
  color: #2d5f2d;
}

.panel-feedback.is-error,
.form-feedback.is-error {
  color: #9b2d2d;
}

.hidden,
.form-card.hidden,
.extra-guests.hidden {
  display: none !important;
}

.rsvp-modal {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: grid;
  align-items: end;
  padding: 16px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.52);
}

.rsvp-modal.hidden {
  display: none;
}

.rsvp-modal-dialog {
  position: relative;
  width: min(100%, 420px);
  margin: 0 auto;
  max-height: calc(100vh - 32px);
}

.rsvp-modal-dialog .form-card {
  margin: 0;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 24px;
  box-shadow: 0 24px 44px rgba(0, 0, 0, 0.18);
}

.rsvp-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(23, 21, 21, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.88);
}

.lightbox.hidden {
  display: none;
}

.lightbox-image {
  display: block;
  width: min(100%, 520px);
  max-height: calc(100vh - 96px);
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: auto;
}

@keyframes loader-dog-run {
  0% {
    transform: translateX(-36%) translateY(0);
  }
  100% {
    transform: translateX(160%) translateY(0);
  }
}

@media (max-width: 359px) {
  .sheet-panel,
  .form-card {
    padding-inline: 16px;
  }

  .sheet-panel-split,
  .location-layout {
    grid-template-columns: 1fr;
  }

  .location-copy {
    width: 100%;
  }

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

  .gallery-slider {
    gap: 8px;
  }

  .gallery-slide {
    flex-basis: 72%;
  }
}

@media (min-width: 720px) {
  body {
    background: var(--bg);
  }

  .screen-loader {
    left: 50%;
    width: 420px;
    max-width: 100%;
    transform: translateX(-50%);
  }

  .intro-screen {
    top: 50%;
    left: 50%;
    right: auto;
    width: min(1040px, calc(100vw - 40px));
    height: min(74vh, 680px);
    --intro-screen-transform: translate(-50%, -50%) scale(1);
    --intro-screen-out-transform: translate(-50%, -50%) scale(1.035);
    transform: var(--intro-screen-transform);
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.22);
  }

  .intro-screen::after {
    inset: 10px;
    border: 1.5px solid rgba(255, 253, 250, 0.82);
    box-shadow: inset 0 0 0 1px rgba(255, 253, 250, 0.18);
    z-index: 3;
  }

  .site-shell {
    width: 100%;
  }

  .main-content {
    padding: 32px 24px 48px;
  }

  .invitation-sheet {
    width: min(1120px, calc(100vw - 48px));
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    grid-template-areas:
      "photo date"
      "photo location"
      "gallery countdown"
      "gallery rsvp";
    gap: 24px;
    align-items: stretch;
    background: transparent;
    overflow: visible;
  }

  .sheet-panel,
  .form-card {
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 20px 44px rgba(23, 21, 21, 0.08);
  }

  .sheet-panel + .sheet-panel,
  .sheet-panel + .form-card,
  .form-card + .form-card {
    border-top: 0;
  }

  .sheet-panel-photo {
    grid-area: photo;
    min-height: 760px;
    aspect-ratio: auto;
  }

  .sheet-panel-date-band {
    grid-area: date;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 28px;
  }

  .sheet-panel-location {
    grid-area: location;
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 28px;
  }

  .sheet-panel-countdown {
    grid-area: countdown;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px 28px;
  }

  .sheet-panel-gallery {
    grid-area: gallery;
    padding: 28px;
    text-align: left;
    min-height: 0;
  }

  .sheet-panel-rsvp {
    grid-area: rsvp;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px 28px;
  }

  .sheet-main-photo {
    object-position: center 20%;
  }

  .sheet-section-title {
    font-size: clamp(2.7rem, 4vw, 4rem);
  }

  .sheet-date-title {
    font-size: clamp(3rem, 4.8vw, 4.6rem);
  }

  .sheet-copy,
  .location-text .sheet-copy {
    font-size: 0.96rem;
  }

  .location-card {
    width: min(100%, 360px);
  }

  .location-text {
    width: min(100%, 320px);
  }

  .countdown-strip {
    gap: 12px;
    margin-top: 20px;
  }

  .countdown-item {
    padding: 18px 10px;
  }

  .countdown-item strong {
    font-size: 2.2rem;
  }

  .gallery-slider {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
    padding-bottom: 0;
    overflow: visible;
    min-height: auto;
    scroll-snap-type: none;
  }

  .gallery-slide {
    flex: none;
    min-height: 210px;
    aspect-ratio: 0.86;
  }

  .gallery-slide[data-clone="true"] {
    display: none;
  }

  .gallery-slide img {
    height: 100%;
  }

  .sheet-panel-gallery .sheet-kicker {
    display: block;
    text-align: left;
  }

  .sheet-panel-rsvp .sheet-copy {
    max-width: 320px;
    margin-inline: auto;
  }

  .attendance-actions {
    gap: 10px;
    margin-top: 18px;
  }

  .primary-action,
  .secondary-action {
    min-height: 52px;
  }
}

@media (min-width: 720px) and (max-width: 959px) {
  .main-content {
    padding-inline: 18px;
  }

  .intro-screen {
    top: 50%;
    width: min(820px, calc(100vw - 24px));
    height: min(68vh, 560px);
    border-radius: 24px;
  }

  .invitation-sheet {
    width: min(880px, calc(100vw - 36px));
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.82fr);
    gap: 18px;
  }

  .sheet-panel-photo {
    min-height: 620px;
  }

  .sheet-panel,
  .form-card {
    border-radius: 24px;
  }

  .gallery-slide {
    min-height: 180px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
