:root {
  --peach: #f0a884;
  --peach-soft: #f6c4a8;
  --teal: #b9e3df;
  --ink: #1a1a1a;
  --muted: #555;
  --bg: #ffffff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Montserrat", system-ui, -apple-system, sans-serif;
  min-height: 100%;
  overflow-x: hidden;
}

.invitation {
  max-width: 900px;
  margin: 0 auto;
  padding: 6vh 5vw 6vh;
  text-align: center;
  position: relative;
}

.title {
  margin: 0 0 3.5rem;
}

.names {
  font-family: "Yellowtail", "Brush Script MT", cursive;
  font-weight: 400;
  font-size: clamp(3.6rem, 13vw, 7rem);
  margin: 0 0 1.75rem;
  line-height: 1.05;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.announce {
  font-family: "Yellowtail", "Brush Script MT", cursive;
  font-weight: 400;
  font-size: clamp(2.5rem, 9vw, 4.5rem);
  margin: 0;
  line-height: 1.05;
}

.date {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.7rem;
  font-family: "Cormorant Garamond", "Times New Roman", serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(2.2rem, 7vw, 3.5rem);
  margin: 2.5rem 0 3rem;
}

.date .day {
  font-weight: 700;
  font-style: italic;
  font-size: 1.05em;
}

.date .month,
.date .year {
  font-weight: 500;
}

.celebrate {
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  font-size: clamp(0.85rem, 2.4vw, 1.1rem);
  letter-spacing: 0.18em;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.venue {
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  font-size: clamp(0.95rem, 2.7vw, 1.25rem);
  letter-spacing: 0.16em;
  color: var(--ink);
  margin: 0 0 3.25rem;
  line-height: 1.5;
}

.venue-sub {
  display: inline-block;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.car-stage {
  position: relative;
  /* Break out of the centred column so the car can drive across the
     full width of the viewport without being clipped early. */
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  width: 100vw;
  height: clamp(220px, 36vw, 360px);
  overflow: hidden;
}

.rsvp {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 0;
  padding: 0 1rem;
  font-family: "Cormorant Garamond", "Times New Roman", serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.2rem, 3.4vw, 1.85rem);
  line-height: 1.4;
  color: var(--ink);
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
  z-index: 1;
}

.rsvp.visible {
  opacity: 1;
  pointer-events: auto;
}

.rsvp-number {
  display: inline-block;
  margin-left: 0.35em;
  color: var(--peach);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid var(--peach-soft);
}

.rsvp-number:hover {
  color: #d6855e;
}

.car-track {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: none;
}

.car {
  width: min(95%, 760px);
  height: auto;
  display: block;
  /* The cropped car image has a white background; multiply blends it
     into the white page background so only the artwork shows. */
  mix-blend-mode: multiply;
  transform: translateX(0) translateY(0);
  will-change: transform;
}

.car.idle {
  animation: idle 1.6s ease-in-out infinite;
}

@keyframes idle {
  0%,
  100% {
    transform: translateX(0) translateY(0) rotate(-0.2deg);
  }
  50% {
    transform: translateX(0) translateY(-6px) rotate(0.2deg);
  }
}

.car.driving-out {
  animation: driveOut 3.2s cubic-bezier(0.45, 0, 0.55, 1) forwards;
}

@keyframes driveOut {
  0% {
    transform: translateX(0) translateY(0);
  }
  100% {
    transform: translateX(130vw) translateY(-2px);
  }
}

.car.driving-in {
  animation: driveIn 3.2s cubic-bezier(0.25, 0.5, 0.35, 1) forwards;
}

@keyframes driveIn {
  0% {
    transform: translateX(-130vw) translateY(0);
  }
  100% {
    transform: translateX(0) translateY(0);
  }
}

.car.hidden-right {
  transform: translateX(130vw);
}

.play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;

  width: clamp(72px, 11vw, 110px);
  height: clamp(72px, 11vw, 110px);
  padding: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  border: none;
  border-radius: 50%;
  background: var(--peach);
  color: white;
  cursor: pointer;

  box-shadow: 0 8px 24px rgba(240, 168, 132, 0.45),
    0 0 0 0 rgba(240, 168, 132, 0.55);
  animation: playPulse 1.8s ease-out infinite;
  transition: opacity 0.45s ease, transform 0.35s ease;
}

.play-btn:hover {
  background: #ec956a;
}

.play-btn:focus-visible {
  outline: 3px solid rgba(240, 168, 132, 0.5);
  outline-offset: 4px;
}

.play-btn__icon {
  width: 42%;
  height: 42%;
  /* Nudge the triangle slightly right so it looks optically centred. */
  margin-left: 6%;
  fill: currentColor;
  display: block;
}

.play-btn.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.85);
  animation: none;
}

@keyframes playPulse {
  0% {
    box-shadow: 0 8px 24px rgba(240, 168, 132, 0.45),
      0 0 0 0 rgba(240, 168, 132, 0.55);
  }
  100% {
    box-shadow: 0 8px 24px rgba(240, 168, 132, 0.45),
      0 0 0 22px rgba(240, 168, 132, 0);
  }
}

@media (max-width: 520px) {
  .venue-sub {
    display: block;
    margin-top: 0.45rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .play-btn {
    animation: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .car.idle,
  .car.driving-out,
  .car.driving-in {
    animation: none;
  }
}
