:root {
  --maroon: #5a1518;
  --maroon-dark: #330f12;
  --cream: #f3e9da;
  --cream-dim: rgba(243, 233, 218, 0.72);
  --border: rgba(243, 233, 218, 0.35);
  --frame-width: 480px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: #1a0a0b;
  color: var(--cream);
  font-family: "Montserrat", sans-serif;
  display: flex;
  justify-content: center;
}

.script {
  font-family: "Alex Brush", cursive;
  font-weight: 400;
  line-height: 1.2;
}

.frame {
  width: 100%;
  max-width: var(--frame-width);
  background: var(--maroon);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
  min-height: 100vh;
}

.section {
  padding: 4rem 1.75rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.section:last-of-type {
  border-bottom: none;
}

.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--cream-dim);
  margin: 0 0 0.75rem;
}

.names {
  font-size: 3rem;
  margin: 0 0 2rem;
  color: var(--cream);
}

/* Hero */

.hero-video {
  width: 100%;
  max-width: 260px;
  margin-bottom: 2rem;
}

.hero-video video {
  display: block;
  width: 100%;
  aspect-ratio: 576 / 1024;
  object-fit: cover;
}

.photo-slot {
  position: relative;
  background: #fff;
  overflow: hidden;
}

.photo-slot .photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-strip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #fff;
  padding: 8px;
}

.photo-strip .photo-slot {
  aspect-ratio: 4 / 3;
}

.photo-slot.missing .photo {
  display: none;
}

.photo-slot.missing::after {
  content: attr(data-placeholder);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  font-size: 0.65rem;
  line-height: 1.4;
  letter-spacing: 0.05em;
  text-align: center;
  color: #8a7a6a;
  background: repeating-linear-gradient(135deg,
      #f1ece2,
      #f1ece2 10px,
      #e7dfd0 10px,
      #e7dfd0 20px);
  border: 1px dashed #b7a98e;
}

.save-date {
  font-size: 2.75rem;
  margin: 0;
  color: var(--cream);
}

.date {
  margin: 0.25rem 0 0;
  font-size: 1rem;
  letter-spacing: 0.15em;
}

.calendar-link {
  margin-top: 1.5rem;
  font-size: 0.65rem;
  padding: 0.7rem 1.4rem;
}

/* Venue */

.venue-name {
  font-size: 2.6rem;
  margin: 0 0 0.5rem;
}

.collage {
  position: relative;
  width: 100%;
  max-width: 320px;
  height: 340px;
  margin: 2.5rem 0 1.5rem;
}

.collage-card {
  position: absolute;
  background: #fdfbf6;
  color: #2b2320;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  border-radius: 2px;
}

.card-savedate {
  width: 180px;
  height: 130px;
  top: 10px;
  left: 10px;
  transform: rotate(-6deg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.savedate-title {
  font-family: "Alex Brush", cursive;
  font-size: 1.8rem;
  margin: 0;
  line-height: 1;
}

.savedate-names {
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0.5rem 0 0;
}

.card-polaroid {
  width: 100px;
  height: 120px;
  top: 0;
  right: 20px;
  transform: rotate(8deg);
  padding: 6px 6px 16px;
}

.card-polaroid .photo-slot,
.card-polaroid.photo-slot {
  aspect-ratio: auto;
}

.card-polaroid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-strip {
  width: 90px;
  height: 190px;
  bottom: 20px;
  left: 0;
  transform: rotate(-4deg);
  padding: 5px;
}

.card-strip .photo-strip {
  height: 100%;
  padding: 0;
  gap: 3px;
}

.card-strip .photo-strip .photo-slot {
  aspect-ratio: auto;
  flex: 1;
  min-height: 0;
}

.card-note {
  width: 200px;
  top: 150px;
  right: 10px;
  transform: rotate(3deg);
  padding: 1rem;
  font-size: 0.7rem;
  font-style: italic;
  line-height: 1.5;
}

.venue-address {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--cream-dim);
  margin: 0;
}

.subtle-link {
  display: inline-block;
  margin-top: 5rem;
  font-family: "Montserrat", sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cream-dim);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}

.subtle-link:hover {
  color: var(--cream);
}

/* Countdown */

.timer {
  display: flex;
  gap: 0.75rem;
  margin: 1.5rem 0 2rem;
}

.unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 44px;
}

.unit span {
  font-size: 1.6rem;
  font-weight: 500;
}

.unit label {
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cream-dim);
  margin-top: 0.25rem;
}

.cta-copy {
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  line-height: 1.6;
  color: var(--cream-dim);
  margin: 0 0 1.75rem;
  max-width: 260px;
}

.btn-outline,
.btn-solid {
  font-family: "Montserrat", sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.9rem 2rem;
  cursor: pointer;
  border-radius: 2px;
  display: inline-block;
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--cream);
  border: 1px solid var(--cream);
  transition: background 0.2s, color 0.2s;
}

.btn-outline:hover {
  background: var(--cream);
  color: var(--maroon-dark);
}

.btn-solid {
  background: var(--cream);
  color: var(--maroon-dark);
  border: none;
  width: 100%;
  margin-top: 0.5rem;
}

.btn-solid:hover {
  background: #fff;
}

.btn-solid:disabled {
  opacity: 0.6;
  cursor: default;
}

.btn-solid:disabled:hover {
  background: var(--cream);
}

/* Gift / bank details */

.gift .cta-copy strong {
  color: var(--cream);
  font-weight: 600;
}

.bank-list {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  text-align: left;
}

.bank-account {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.bank-account:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.bank-heading {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cream);
  margin: 0 0 0.5rem;
}

.bank-field {
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  line-height: 1.6;
  color: var(--cream);
  margin: 0;
}

.field-label {
  color: var(--cream-dim);
}

.copy-btn {
  flex-shrink: 0;
  font-family: "Montserrat", sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: none;
  color: var(--cream-dim);
  border: none;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
  cursor: pointer;
  transition: color 0.15s;
}

.copy-btn:hover {
  color: var(--cream);
}

/* Footer */

.footer {
  padding-top: 0.2rem;
  padding-bottom: 3rem;
}

.footer-photo-slot {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 4 / 3;
  margin-bottom: 1.5rem;
  filter: grayscale(1);
  background: transparent;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 60%, transparent 100%);
  mask-image: radial-gradient(ellipse at center, #000 60%, transparent 100%);
}

.footer .names {
  margin-bottom: 0;
}

/* Details overlay */

.details-overlay {
  position: fixed;
  inset: 0;
  background: var(--maroon);
  z-index: 10;
  overflow-y: auto;
  display: flex;
  justify-content: center;
}

.details-overlay[hidden] {
  display: none;
}

.details-panel {
  width: 100%;
  max-width: var(--frame-width);
  padding: 2.5rem 1.75rem 4rem;
  text-align: center;
}

.go-back {
  background: none;
  border: none;
  color: var(--cream-dim);
  font-family: "Montserrat", sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0;
  margin-bottom: 1.5rem;
  display: block;
}

.details-panel h2.script {
  font-size: 2.75rem;
  margin: 0 0 1.25rem;
}

.details-copy {
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--cream-dim);
  margin: 0 0 1rem;
}

.rsvp-by {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 2rem;
}

#details-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  text-align: left;
}

#details-form label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cream-dim);
}

#details-form input,
#details-form textarea {
  font-family: "Montserrat", sans-serif;
  font-size: 0.9rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--cream);
  padding: 0.7rem 0.8rem;
  resize: vertical;
}

#details-form input:focus,
#details-form textarea:focus {
  outline: none;
  border-color: var(--cream);
}

#details-form input.invalid,
#details-form textarea.invalid {
  border-color: #e2a3a3;
}

#details-form fieldset.dietary {
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.9rem 1rem 1.1rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

#details-form fieldset.dietary legend {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cream-dim);
  padding: 0 0.3rem;
}

#details-form label.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--cream);
  padding: 0.45rem 0.3rem;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.15s;
}

#details-form label.checkbox:hover {
  background: rgba(243, 233, 218, 0.06);
}

#details-form label.checkbox input {
  appearance: none;
  -webkit-appearance: none;
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: transparent;
  position: relative;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

#details-form label.checkbox input:hover {
  border-color: var(--cream);
}

#details-form label.checkbox input:focus-visible {
  outline: 1px solid var(--cream);
  outline-offset: 2px;
}

#details-form label.checkbox input:checked {
  background: var(--cream);
  border-color: var(--cream);
}

#details-form label.checkbox input:checked::after {
  content: "";
  position: absolute;
  left: 3px;
  top: -1px;
  width: 5px;
  height: 9px;
  border: solid var(--maroon-dark);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.form-status {
  text-align: center;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  min-height: 1.2em;
  margin: 0;
}

.form-status.success {
  color: var(--cream);
}

.form-status.error {
  color: #f2b8b8;
}

@media (min-width: 540px) {
  .frame {
    margin: 2rem 0;
    min-height: auto;
    border-radius: 8px;
    overflow: hidden;
  }
}