:root {
  --paper: #f6f1e8;
  --ink: #332f2b;
  --rose: #b98b8d;
  --rose-dark: #93696c;
  --sage: #7f8453;
  --peach: #d6a075;
  --line: rgba(51, 47, 43, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #e8ded0;
  font-family: "Oranienbaum", Georgia, serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.invitation {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(rgba(246, 241, 232, 0.12), rgba(246, 241, 232, 0.12)),
    url("assets/woodland-party.webp") center top / cover fixed;
}

.invitation::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(246, 241, 232, 0.2);
  pointer-events: none;
}

.paper-noise {
  position: fixed;
  inset: 0;
  z-index: 10;
  opacity: 0.16;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.19'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.hero {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 7rem 1.5rem 10rem;
  text-align: center;
}

.eyebrow {
  margin: 0 0 1.1rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.hero h1 {
  margin: 0;
  color: var(--rose);
  font-family: "Marck Script", cursive;
  font-size: clamp(5rem, 12vw, 9.5rem);
  font-weight: 400;
  line-height: 0.82;
}

.turns {
  margin: 1.3rem 0 -0.5rem;
  color: var(--rose-dark);
  font-family: "Marck Script", cursive;
  font-size: clamp(1.9rem, 4vw, 3rem);
}

.age {
  height: 8.2rem;
  color: var(--rose);
  font-family: "Marck Script", cursive;
  font-size: 9rem;
  line-height: 1;
}

.age-caption {
  color: var(--rose-dark);
  font-size: 1.15rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.details {
  width: min(960px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 5rem clamp(1.5rem, 5vw, 4.5rem);
  text-align: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(246, 241, 232, 0.86);
  backdrop-filter: blur(3px);
}

.flourish {
  display: block;
  margin-bottom: 1rem;
  color: var(--rose);
}

.intro h2,
.rsvp-section h2 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  font-weight: 400;
}

.intro > p {
  max-width: 620px;
  margin: 1rem auto 4rem;
  font-size: clamp(1.3rem, 2.8vw, 1.9rem);
  line-height: 1.45;
}

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

.event-detail {
  position: relative;
  min-height: 230px;
  padding: 2.5rem 2rem 1rem;
}

.event-detail + .event-detail {
  border-left: 1px solid var(--line);
}

.detail-number {
  position: absolute;
  top: 0;
  left: 50%;
  color: rgba(185, 139, 141, 0.28);
  font-family: "Marck Script", cursive;
  font-size: 4rem;
  transform: translateX(-50%);
}

.label {
  position: relative;
  margin: 0 0 0.75rem;
  font-family: "Marck Script", cursive;
  font-size: 1.8rem;
}

.event-detail h3 {
  position: relative;
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 400;
}

.event-detail > p:not(.label) {
  margin: 0.5rem 0;
  font-size: 1.15rem;
}

.text-link {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  margin-top: 0.8rem;
  padding-bottom: 0.2rem;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.text-link svg {
  width: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.countdown-section {
  padding: 7rem 1rem;
  text-align: center;
}

.countdown-section > p {
  margin: 0 0 1.25rem;
  font-family: "Marck Script", cursive;
  font-size: 1.9rem;
}

.countdown {
  display: flex;
  justify-content: center;
  gap: clamp(1.5rem, 6vw, 5rem);
}

.countdown div {
  min-width: 72px;
}

.countdown strong {
  display: block;
  color: var(--rose-dark);
  font-size: clamp(2.6rem, 7vw, 5rem);
  font-weight: 400;
  line-height: 1;
}

.countdown span {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.rsvp-section {
  width: min(720px, calc(100% - 2rem));
  margin: 0 auto 7rem;
  padding: 4rem 1.5rem;
  text-align: center;
  background: rgba(246, 241, 232, 0.9);
}

.script {
  margin: 0 0 0.5rem;
  color: var(--rose-dark);
  font-family: "Marck Script", cursive;
  font-size: 1.7rem;
}

.rsvp-section > p:not(.script) {
  font-size: 1.15rem;
}

.primary-button,
.calendar-button {
  min-height: 50px;
  border: 0;
  cursor: pointer;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  min-width: 190px;
  margin-top: 1.2rem;
  padding: 0.8rem 1.4rem;
  color: #fffaf4;
  background: var(--rose-dark);
  transition: transform 180ms ease, background 180ms ease;
}

.primary-button:hover {
  background: #7f585b;
  transform: translateY(-2px);
}

.primary-button svg {
  width: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.calendar-button {
  display: block;
  margin: 1rem auto 0;
  padding: 0.5rem;
  color: var(--ink);
  background: transparent;
  border-bottom: 1px solid var(--line);
}

footer {
  padding: 2rem 1rem 2.5rem;
  color: #fbf7f0;
  text-align: center;
  background: rgba(51, 47, 43, 0.86);
}

footer span {
  color: #d9aeb0;
  font-size: 1.6rem;
}

footer p {
  margin: 0.35rem 0 0;
}

dialog {
  width: min(460px, calc(100% - 2rem));
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  border: 0;
  box-shadow: 0 24px 80px rgba(51, 47, 43, 0.25);
}

dialog::backdrop {
  background: rgba(51, 47, 43, 0.55);
  backdrop-filter: blur(4px);
}

#rsvp-form {
  position: relative;
  padding: 3rem;
}

.close-button {
  position: absolute;
  top: 0.7rem;
  right: 0.8rem;
  width: 42px;
  height: 42px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  font-family: Arial, sans-serif;
  font-size: 1.8rem;
  cursor: pointer;
}

.dialog-script {
  margin: 0;
  color: var(--rose-dark);
  font-family: "Marck Script", cursive;
  font-size: 2rem;
}

dialog h2 {
  margin: 0 0 2rem;
  font-size: 2rem;
  font-weight: 400;
}

dialog label {
  display: block;
  margin: 1rem 0;
  font-size: 1rem;
}

dialog input,
dialog select {
  display: block;
  width: 100%;
  height: 48px;
  margin-top: 0.4rem;
  padding: 0 0.8rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--line);
  border-radius: 0;
}

.submit-button {
  width: 100%;
}

.form-note {
  margin: 1rem 0 0;
  color: rgba(51, 47, 43, 0.68);
  font-size: 0.85rem;
  text-align: center;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 20;
  max-width: calc(100% - 2rem);
  padding: 0.9rem 1.2rem;
  color: #fff;
  background: var(--ink);
  opacity: 0;
  transform: translateY(1rem);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 700px) {
  .invitation {
    background-attachment: scroll;
    background-position: center top;
    background-size: 100% 92svh;
    background-repeat: no-repeat;
    background-color: var(--paper);
  }

  .hero {
    min-height: 92svh;
    padding-top: 9rem;
    padding-bottom: 8rem;
  }

  .eyebrow {
    max-width: 220px;
    line-height: 1.5;
  }

  .details {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }

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

  .event-detail {
    min-height: 0;
    padding: 2.6rem 0 2.2rem;
  }

  .event-detail + .event-detail {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .countdown-section {
    padding: 6rem 0.75rem;
  }

  .countdown {
    gap: 1rem;
  }

  #rsvp-form {
    padding: 2.5rem 1.5rem;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
