:root {
  color-scheme: light;
  --paper: #f6f1ec;
  --paper-deep: #e9ded4;
  --ink: #3f3731;
  --muted: #81756e;
  --soft-type: #d8cec3;
  --sage: #8f9a82;
  --sage-deep: #65705b;
  --rose: #b28d80;
  --white: #fffdf9;
  --shadow: 0 24px 60px rgba(63, 55, 49, 0.16);
  --soft-shadow: 0 16px 30px rgba(63, 55, 49, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(115deg, rgba(143, 154, 130, 0.14), transparent 38%),
    linear-gradient(295deg, rgba(178, 141, 128, 0.16), transparent 44%),
    var(--paper);
  color: var(--ink);
  font-family: Avenir, "Avenir Next", Montserrat, "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0;
}

button {
  font: inherit;
}

.page-shell {
  display: grid;
  min-height: 100vh;
  padding: clamp(18px, 4vw, 48px);
  place-items: center;
}

.save-card {
  position: relative;
  display: grid;
  width: min(100%, 1120px);
  min-height: min(820px, calc(100vh - clamp(36px, 8vw, 96px)));
  overflow: hidden;
  padding: clamp(22px, 4vh, 50px) clamp(22px, 5vw, 62px);
  border: 1px solid rgba(63, 55, 49, 0.08);
  background:
    linear-gradient(rgba(255, 253, 249, 0.72), rgba(255, 253, 249, 0.72)),
    repeating-linear-gradient(0deg, rgba(63, 55, 49, 0.026) 0 1px, transparent 1px 5px),
    var(--paper);
  box-shadow: var(--shadow);
  isolation: isolate;
}

.save-card::before,
.save-card::after {
  position: absolute;
  z-index: -1;
  color: rgba(63, 55, 49, 0.055);
  font-family: "Bodoni 72", Didot, "Times New Roman", serif;
  font-size: clamp(13rem, 28vw, 28rem);
  line-height: 1;
  pointer-events: none;
}

.save-card::before {
  content: "07";
  top: -0.15em;
  left: -0.08em;
}

.save-card::after {
  right: -0.1em;
  bottom: -0.22em;
  content: "27";
}

.polaroid-wall {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.polaroid {
  position: absolute;
  width: clamp(115px, 14vw, 176px);
  margin: 0;
  padding: 10px 10px 38px;
  border: 1px solid rgba(63, 55, 49, 0.08);
  background: var(--white);
  box-shadow: var(--soft-shadow);
  opacity: 0;
  transform-origin: 50% 18px;
  will-change: transform, opacity;
}

.polaroid::before {
  position: absolute;
  top: -14px;
  left: 50%;
  width: 68px;
  height: 24px;
  border: 1px solid rgba(63, 55, 49, 0.1);
  background: rgba(232, 224, 214, 0.68);
  box-shadow: 0 2px 8px rgba(63, 55, 49, 0.08);
  content: "";
  transform: translateX(-50%) rotate(-2deg);
}

.polaroid img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  filter: saturate(0.9) contrast(0.98);
}

.polaroid figcaption {
  position: absolute;
  right: 12px;
  bottom: 10px;
  left: 12px;
  overflow: hidden;
  color: var(--muted);
  font-family: "Snell Roundhand", "Apple Chancery", "Segoe Script", cursive;
  font-size: clamp(1.15rem, 2.1vw, 1.55rem);
  line-height: 1.05;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.polaroid-one {
  top: clamp(30px, 8vw, 84px);
  left: clamp(10px, 3vw, 44px);
  animation: dropOne 850ms 140ms cubic-bezier(0.18, 0.85, 0.28, 1.08) forwards;
}

.polaroid-two {
  right: clamp(10px, 4vw, 42px);
  bottom: clamp(132px, 20vw, 210px);
  width: clamp(126px, 15vw, 188px);
  animation: dropTwo 900ms 300ms cubic-bezier(0.18, 0.85, 0.28, 1.08) forwards;
}

.polaroid-three {
  bottom: clamp(34px, 7vw, 82px);
  left: clamp(-6px, 2vw, 26px);
  width: clamp(108px, 13vw, 164px);
  animation: dropThree 920ms 460ms cubic-bezier(0.18, 0.85, 0.28, 1.08) forwards;
}

.hero-copy {
  position: relative;
  z-index: 2;
  align-self: center;
  justify-self: center;
  width: min(100%, 760px);
  padding: clamp(20px, 5vh, 56px) 0 clamp(12px, 3vh, 32px);
  text-align: center;
}

.eyebrow {
  margin: 0 0 clamp(24px, 5vh, 56px);
  color: var(--ink);
  font-size: clamp(1rem, 2.1vw, 1.45rem);
  font-weight: 400;
  letter-spacing: 0.42em;
  text-transform: uppercase;
}

h1 {
  position: relative;
  display: grid;
  gap: 0;
  margin: 0;
  color: var(--soft-type);
  font-family: "Bodoni 72", Didot, "Times New Roman", serif;
  font-size: clamp(5.2rem, 12vw, 9.2rem);
  font-weight: 500;
  line-height: 0.72;
  text-transform: uppercase;
}

h1 em {
  position: absolute;
  top: 50%;
  left: 50%;
  color: var(--ink);
  font-family: "Snell Roundhand", "Apple Chancery", "Segoe Script", cursive;
  font-size: clamp(3.8rem, 8vw, 6.35rem);
  font-style: normal;
  font-weight: 400;
  line-height: 1;
  text-transform: none;
  transform: translate(-50%, -50%) rotate(-9deg);
}

.date-line {
  margin: clamp(28px, 5vh, 54px) 0 0;
  color: var(--ink);
  font-size: clamp(1rem, 2.25vw, 1.45rem);
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.details {
  position: relative;
  z-index: 2;
  align-self: end;
  justify-self: center;
  display: grid;
  width: min(100%, 760px);
  gap: clamp(12px, 2vh, 18px);
  justify-items: center;
  text-align: center;
}

.note {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-family: "Bodoni 72", Didot, "Times New Roman", serif;
  font-size: clamp(1.05rem, 1.8vw, 1.45rem);
  line-height: 1.35;
}

.countdown {
  display: grid;
  width: min(100%, 560px);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(8px, 2vw, 14px);
}

.countdown-item {
  display: grid;
  min-width: 0;
  min-height: 72px;
  align-content: center;
  padding: 10px 8px;
  border: 1px solid rgba(63, 55, 49, 0.1);
  background: rgba(255, 253, 249, 0.72);
}

.countdown-item span {
  display: block;
  color: var(--sage-deep);
  font-family: "Bodoni 72", Didot, "Times New Roman", serif;
  font-size: clamp(1.8rem, 3.8vw, 2.75rem);
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}

.countdown-item small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.calendar-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 22px;
  border: 1px solid rgba(63, 55, 49, 0.18);
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

.calendar-button:hover {
  background: var(--sage-deep);
  box-shadow: 0 10px 28px rgba(63, 55, 49, 0.18);
  transform: translateY(-2px);
}

.calendar-button:focus-visible {
  outline: 3px solid rgba(143, 154, 130, 0.45);
  outline-offset: 4px;
}

.calendar-mark {
  position: relative;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.calendar-mark::before,
.calendar-mark::after {
  position: absolute;
  content: "";
}

.calendar-mark::before {
  top: 4px;
  right: -2px;
  left: -2px;
  border-top: 2px solid currentColor;
}

.calendar-mark::after {
  top: -5px;
  left: 3px;
  width: 8px;
  height: 5px;
  border-right: 2px solid currentColor;
  border-left: 2px solid currentColor;
}

@keyframes dropOne {
  0% {
    opacity: 0;
    transform: translate3d(-32px, -120px, 0) rotate(-18deg) scale(0.96);
  }
  72% {
    opacity: 1;
    transform: translate3d(0, 8px, 0) rotate(-7deg) scale(1);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(-9deg) scale(1);
  }
}

@keyframes dropTwo {
  0% {
    opacity: 0;
    transform: translate3d(42px, -145px, 0) rotate(16deg) scale(0.96);
  }
  72% {
    opacity: 1;
    transform: translate3d(0, 9px, 0) rotate(7deg) scale(1);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(5deg) scale(1);
  }
}

@keyframes dropThree {
  0% {
    opacity: 0;
    transform: translate3d(-18px, -135px, 0) rotate(-3deg) scale(0.96);
  }
  72% {
    opacity: 1;
    transform: translate3d(0, 10px, 0) rotate(10deg) scale(1);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(8deg) scale(1);
  }
}

@media (max-width: 820px) {
  .page-shell {
    padding: 0;
  }

  .save-card {
    width: 100%;
    min-height: 100vh;
    border: 0;
    box-shadow: none;
  }

  .hero-copy {
    padding-top: clamp(112px, 21vh, 170px);
  }

  .polaroid {
    width: clamp(106px, 31vw, 152px);
    padding: 8px 8px 30px;
  }

  .polaroid-two {
    right: 14px;
    bottom: auto;
    top: clamp(92px, 18vh, 138px);
    width: clamp(112px, 32vw, 156px);
  }

  .polaroid-three {
    bottom: clamp(176px, 22vh, 220px);
    left: 18px;
    width: clamp(106px, 31vw, 146px);
  }

  .polaroid figcaption {
    font-size: 1.05rem;
  }

  .eyebrow {
    letter-spacing: 0.28em;
  }

  h1 {
    font-size: clamp(4.8rem, 22vw, 7.2rem);
  }

  h1 em {
    font-size: clamp(3.25rem, 15vw, 5.1rem);
  }

  .date-line {
    letter-spacing: 0.16em;
  }
}

@media (max-width: 520px) {
  .save-card {
    padding: 34px 16px 28px;
  }

  .polaroid-wall {
    position: relative;
    inset: auto;
    height: 252px;
    margin-bottom: 8px;
  }

  .polaroid {
    width: 106px;
    padding: 7px 7px 28px;
  }

  .polaroid::before {
    top: -10px;
    width: 52px;
    height: 18px;
  }

  .polaroid-one {
    top: 8px;
    left: 10px;
  }

  .polaroid-two {
    top: 46px;
    right: 4px;
    width: 108px;
  }

  .polaroid-three {
    top: 74px;
    bottom: auto;
    left: calc(50% - 54px);
    width: 102px;
  }

  .polaroid figcaption {
    right: 8px;
    bottom: 8px;
    left: 8px;
    font-size: 0.95rem;
  }

  .hero-copy {
    padding-top: 2px;
  }

  .eyebrow {
    margin-bottom: 36px;
    font-size: 0.9rem;
    letter-spacing: 0.22em;
  }

  .date-line {
    margin-top: 44px;
    font-size: 0.86rem;
    line-height: 1.6;
    letter-spacing: 0.12em;
  }

  .note {
    max-width: 320px;
    font-size: 1.12rem;
  }

  .countdown {
    gap: 7px;
  }

  .countdown-item {
    min-height: 72px;
    padding: 10px 4px;
  }

  .countdown-item span {
    font-size: clamp(1.55rem, 8vw, 2.1rem);
  }

  .countdown-item small {
    font-size: 0.62rem;
    letter-spacing: 0.08em;
  }

  .calendar-button {
    width: min(100%, 310px);
    min-height: 50px;
    padding: 0 16px;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .polaroid-one {
    opacity: 1;
    transform: rotate(-9deg);
  }

  .polaroid-two {
    opacity: 1;
    transform: rotate(5deg);
  }

  .polaroid-three {
    opacity: 1;
    transform: rotate(8deg);
  }
}
