:root {
  --ink: #2b332b;
  --muted: #5c6b59;
  --sage: #55704e;
  --olive: #7f9163;
  --cream: #f1f4ec;
  --paper: #fbfcf7;
  --shadow: 0 18px 50px rgba(44, 53, 45, 0.12);
  --radius: 1.25rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Outfit", system-ui, sans-serif;
  font-weight: 300;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(148, 176, 143, 0.34), transparent 55%),
    radial-gradient(900px 500px at 110% 10%, rgba(127, 145, 99, 0.18), transparent 50%),
    var(--cream);
  line-height: 1.6;
}

img,
svg {
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

a {
  color: var(--sage);
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
}

.topbar,
main,
footer {
  position: relative;
  z-index: 1;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.15rem;
  background: rgba(241, 244, 236, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(85, 112, 78, 0.12);
}

.mark {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.15rem;
  letter-spacing: 0.18em;
  text-decoration: none;
  color: var(--ink);
  text-transform: uppercase;
}

.mark span {
  font-family: "Great Vibes", cursive;
  letter-spacing: 0;
  color: var(--sage);
  padding: 0 0.2rem;
}

.nav-toggle {
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  gap: 6px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 1.35rem;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.25s ease;
}

.nav-open .nav-toggle span:first-child {
  transform: translateY(3.75px) rotate(40deg);
}

.nav-open .nav-toggle span:last-child {
  transform: translateY(-3.75px) rotate(-40deg);
}

.nav {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  flex-direction: column;
  padding: 0.5rem 1.15rem 1.1rem;
  background: rgba(251, 252, 247, 0.97);
  border-bottom: 1px solid rgba(85, 112, 78, 0.12);
}

.nav a {
  text-decoration: none;
  color: var(--ink);
  padding: 0.7rem 0;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-open .nav {
  display: flex;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: calc(100svh - 4.2rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3.5rem 1.25rem 4rem;
}

.eyebrow {
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0 0 1.4rem;
}

h1 {
  margin: 0;
  display: grid;
  gap: 0.15rem;
}

.script {
  font-family: "Great Vibes", cursive;
  font-weight: 400;
  font-size: clamp(2.8rem, 12vw, 7.2rem);
  line-height: 0.95;
  color: var(--sage);
}

.amp {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: clamp(1.4rem, 4vw, 2rem);
  color: var(--olive);
}

.invite-line {
  max-width: 26rem;
  margin: 1.4rem 0 0;
  color: var(--muted);
  font-family: "Cormorant Garamond", serif;
  font-size: 1.2rem;
  font-style: italic;
}

.hero-meta {
  margin: 1.8rem 0 2rem;
}

.date-line,
.year,
.place {
  margin: 0.15rem 0;
}

.date-line,
.year {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.15rem, 3.4vw, 1.55rem);
  letter-spacing: 0.04em;
}

.place {
  margin-top: 0.7rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.7rem 1.5rem;
  border: 0;
  border-radius: 999px;
  background: var(--sage);
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.btn:hover,
.btn:focus-visible {
  background: #435a3d;
}

.btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.countdown-band {
  margin: 0 1rem 2.5rem;
  padding: 1.4rem 1rem 1.6rem;
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
  text-align: center;
}

.countdown-label {
  margin: 0 0 0.9rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: var(--muted);
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
}

.countdown strong {
  display: block;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  line-height: 1;
}

.countdown span {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.story,
.schedule,
.rsvp {
  max-width: 40rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
  text-align: center;
}

.ornament {
  display: block;
  width: min(38vw, 9rem);
  height: auto;
  margin: 0 auto 1rem;
  opacity: 0.85;
  filter: saturate(0.88) brightness(1.04);
}

h2 {
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  font-size: clamp(2rem, 6vw, 2.8rem);
  margin: 0 0 0.8rem;
}

.story p,
.rsvp-lead {
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.05rem;
}

.details {
  display: grid;
  gap: 1rem;
  padding: 0 1rem 1.5rem;
  max-width: 70rem;
  margin: 0 auto;
}

.card {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 1.5rem 1.3rem 1.6rem;
  box-shadow: var(--shadow);
  text-align: center;
}

.card-kicker {
  margin: 0 0 0.4rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-size: 0.68rem;
  color: var(--olive);
}

.card h3 {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.55rem;
  margin: 0 0 0.5rem;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.text-link {
  display: inline-block;
  margin-top: 0.85rem;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.timeline {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  text-align: left;
}

.timeline li {
  display: grid;
  grid-template-columns: 4.4rem 1fr;
  gap: 0.9rem;
  padding: 1rem 0;
  border-top: 1px solid rgba(85, 112, 78, 0.16);
}

.timeline time {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.15rem;
  color: var(--sage);
}

.timeline h3 {
  margin: 0;
  font-size: 1.05rem;
}

.timeline p {
  margin: 0.15rem 0 0;
  color: var(--muted);
}

form {
  display: grid;
  gap: 0.9rem;
  margin-top: 1.5rem;
  text-align: left;
}

label,
legend {
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(85, 112, 78, 0.22);
  border-radius: 0.7rem;
  background: var(--paper);
  font: inherit;
  color: var(--ink);
  accent-color: var(--sage);
}

input[readonly] {
  background: #eef2ea;
  color: var(--ink);
}

.rsvp-locked {
  margin: 1.4rem auto 0;
  max-width: 28rem;
  color: var(--muted);
}

fieldset {
  border: 0;
  padding: 0;
  margin: 0.2rem 0;
  display: grid;
  gap: 0.45rem;
}

.choice {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-transform: none;
  letter-spacing: 0;
  font-size: 1rem;
  color: var(--ink);
}

.choice input {
  width: auto;
  margin: 0;
}

form .btn {
  justify-self: center;
  margin-top: 0.4rem;
  min-width: 12rem;
}

.form-status {
  min-height: 1.4rem;
  margin: 1rem 0 0;
  color: var(--sage);
}

footer {
  text-align: center;
  padding: 2.5rem 1rem 3rem;
}

.footer-names {
  font-size: 2.4rem;
  margin: 0;
}

.footer-wreath {
  position: relative;
  display: grid;
  place-items: center;
  width: min(66vw, 17rem);
  aspect-ratio: 368 / 328;
  margin: 1.1rem auto 0;
}

.footer-wreath img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.85;
  filter: saturate(0.88) brightness(1.04);
  transition: transform 1.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.footer-wreath.reveal img {
  transform: rotate(-10deg) scale(0.88);
}

.footer-wreath.in-view img {
  transform: none;
}

.footer-date {
  position: relative;
  margin: 0;
  letter-spacing: 0.16em;
  color: var(--muted);
  font-size: 0.64rem;
}

body.sealed {
  overflow: hidden;
}

.opening {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.2rem;
  padding: 1.5rem;
  background:
    radial-gradient(900px 500px at 50% 20%, rgba(148, 176, 143, 0.4), transparent 60%),
    var(--cream);
  transition: opacity 0.9s ease, visibility 0s linear 0.9s;
}

.opening.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.envelope {
  position: relative;
  /* The last term keeps room above for the card to slide fully into view
     on short windows. */
  --env-w: min(86vw, 27rem, calc(61vh - 48px));
  width: var(--env-w);
  aspect-ratio: 3 / 2;
  cursor: pointer;
  animation: envelope-in 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
  transition: transform 0.9s cubic-bezier(0.55, 0, 0.75, 0.2), opacity 0.9s ease-in;
}

.envelope:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 1rem;
}

.opening.done .envelope {
  transform: translateY(-4%) scale(1.18);
  opacity: 0;
}

.env-back {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 0.45rem;
  background: linear-gradient(155deg, #e6ecdf, #cfdac6);
  box-shadow: 0 26px 60px rgba(44, 53, 45, 0.22);
}

.card-slip {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 4%;
  height: 88%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1rem;
  overflow: hidden;
  border-radius: 0.35rem;
  background: var(--paper);
  box-shadow: 0 10px 26px rgba(44, 53, 45, 0.16);
  transition: transform 1.1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.envelope.card-out .card-slip {
  transform: translateY(-92%);
}

.slip-eyebrow {
  margin: 0;
  flex: none;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  font-size: clamp(0.52rem, calc(var(--env-w) * 0.0222), 0.6rem);
  color: var(--muted);
}

.slip-names {
  margin: 0.2rem 0 0;
  flex: none;
  font-size: clamp(1.5rem, calc(var(--env-w) * 0.107), 2.9rem);
  line-height: 1.1;
}

.slip-date {
  margin: 0.1rem 0 0;
  flex: none;
  letter-spacing: 0.24em;
  font-size: clamp(0.58rem, calc(var(--env-w) * 0.0259), 0.7rem);
  color: var(--muted);
}

.slip-photo {
  margin-top: 0.55rem;
  height: min(calc(var(--env-w) * 0.24), 6.4rem);
  min-height: 0;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center 88%;
  border-radius: 0.3rem;
  box-shadow: 0 5px 14px rgba(44, 53, 45, 0.24);
}

.env-front {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: 0.45rem;
  /* The V notch is painted with gradients rather than cut with clip-path,
     which some browsers drop and then render the pocket as a flat block. */
  background: linear-gradient(to top right, #d3dec8 49.9%, transparent 50.3%) left top / 50.3% 62.2% no-repeat,
    linear-gradient(to top left, #d3dec8 49.9%, transparent 50.3%) right top / 50.3% 62.2% no-repeat,
    linear-gradient(180deg, #d3dec8, #c3d1b8) left bottom / 100% 38% no-repeat;
}

.env-flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 62%;
  z-index: 5;
  border-radius: 0.45rem 0.45rem 0 0;
  background: linear-gradient(to top right, transparent 49.7%, #e4ebda 50.1%, #f0f4ea) left top / 50.3% 100% no-repeat,
    linear-gradient(to top left, transparent 49.7%, #e4ebda 50.1%, #f0f4ea) right top / 50.3% 100% no-repeat;
  filter: drop-shadow(0 3px 4px rgba(44, 53, 45, 0.16));
  transform-origin: top center;
  transform: perspective(1000px) rotateX(0deg);
  transition: transform 1s ease-in-out;
}

.envelope.is-open .env-flap {
  transform: perspective(1000px) rotateX(-168deg);
}

.envelope.flap-back .env-flap {
  z-index: 0;
}

.wax {
  position: absolute;
  top: 60%;
  left: 50%;
  z-index: 6;
  display: grid;
  place-items: center;
  width: clamp(3rem, 13vw, 3.9rem);
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 35% 30%, #7c9873, var(--sage) 60%, #3c5236);
  color: #f4f8f1;
  font-family: "Cormorant Garamond", serif;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  box-shadow: 0 6px 14px rgba(44, 53, 45, 0.3);
  transition: transform 0.5s ease, opacity 0.5s ease;
}

.envelope.is-open .wax {
  transform: translate(-50%, -50%) scale(0.4) rotate(-25deg);
  opacity: 0;
}

.open-hint {
  margin: 0;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.68rem;
  color: var(--muted);
  animation: pulse 2.4s ease-in-out infinite;
}

.envelope.is-open ~ .open-hint {
  opacity: 0;
  transition: opacity 0.4s ease;
}

@keyframes envelope-in {
  from {
    opacity: 0;
    transform: translateY(2rem) scale(0.94);
  }
}

@keyframes pulse {
  50% {
    opacity: 0.4;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(1.4rem);
  }
}

body.revealed .hero > *:not(.hero-bloom) {
  animation: rise 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

body.revealed .hero > *:nth-child(2) {
  animation-delay: 0.12s;
}

body.revealed .hero > *:nth-child(3) {
  animation-delay: 0.24s;
}

body.revealed .hero > *:nth-child(4) {
  animation-delay: 0.36s;
}

body.revealed .hero > *:nth-child(5) {
  animation-delay: 0.48s;
}

.reveal {
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.in-view {
  opacity: 1;
  transform: none;
}

.fireflies {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

body.sealed .fireflies {
  z-index: 61;
}

.fireflies span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  height: var(--size);
  animation-duration: var(--drift);
  animation-delay: var(--drift-delay);
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.fireflies span::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(248, 245, 226, 0.85) 0%,
    rgba(176, 164, 116, 0.7) 36%,
    rgba(168, 158, 114, 0.32) 62%,
    rgba(168, 158, 114, 0) 78%
  );
  box-shadow: 0 0 calc(var(--size) * 1.6) calc(var(--size) * 0.3) rgba(172, 162, 116, 0.22),
    0 0 calc(var(--size) * 3.4) calc(var(--size) * 0.9) rgba(172, 162, 116, 0.1);
  opacity: 0;
  will-change: opacity, transform;
  animation: firefly-glow var(--glow) ease-in-out var(--glow-delay) infinite;
}

.fireflies span:nth-child(3n + 1) {
  --size: 6px;
  --glow: 5.6s;
  animation-name: firefly-a;
}

.fireflies span:nth-child(3n + 2) {
  --size: 7px;
  --glow: 7.4s;
  animation-name: firefly-b;
}

.fireflies span:nth-child(3n + 3) {
  --size: 4px;
  --glow: 6.3s;
  animation-name: firefly-c;
}

.fireflies span:nth-child(1) {
  --x: 7%;
  --y: 22%;
  --drift: 26s;
  --drift-delay: 0s;
  --glow-delay: 0.2s;
}

.fireflies span:nth-child(2) {
  --x: 19%;
  --y: 68%;
  --drift: 32s;
  --drift-delay: 2.5s;
  --glow-delay: 1.6s;
}

.fireflies span:nth-child(3) {
  --x: 31%;
  --y: 14%;
  --drift: 29s;
  --drift-delay: 5s;
  --glow-delay: 3.1s;
}

.fireflies span:nth-child(4) {
  --x: 44%;
  --y: 79%;
  --drift: 35s;
  --drift-delay: 1s;
  --glow-delay: 0.9s;
}

.fireflies span:nth-child(5) {
  --x: 57%;
  --y: 33%;
  --drift: 24s;
  --drift-delay: 7s;
  --glow-delay: 2.4s;
}

.fireflies span:nth-child(6) {
  --x: 68%;
  --y: 61%;
  --drift: 31s;
  --drift-delay: 3.5s;
  --glow-delay: 4.2s;
}

.fireflies span:nth-child(7) {
  --x: 81%;
  --y: 18%;
  --drift: 27s;
  --drift-delay: 6s;
  --glow-delay: 1.1s;
}

.fireflies span:nth-child(8) {
  --x: 92%;
  --y: 47%;
  --drift: 34s;
  --drift-delay: 0.5s;
  --glow-delay: 3.6s;
}

.fireflies span:nth-child(9) {
  --x: 12%;
  --y: 89%;
  --drift: 28s;
  --drift-delay: 8s;
  --glow-delay: 2s;
}

.fireflies span:nth-child(10) {
  --x: 38%;
  --y: 51%;
  --drift: 36s;
  --drift-delay: 4s;
  --glow-delay: 5s;
}

.fireflies span:nth-child(11) {
  --x: 74%;
  --y: 86%;
  --drift: 25s;
  --drift-delay: 9.5s;
  --glow-delay: 0.6s;
}

.fireflies span:nth-child(12) {
  --x: 88%;
  --y: 72%;
  --drift: 30s;
  --drift-delay: 6.5s;
  --glow-delay: 2.8s;
}

.fireflies span:nth-child(13) {
  --x: 25%;
  --y: 39%;
  --drift: 33s;
  --drift-delay: 11s;
  --glow-delay: 4.6s;
}

.fireflies span:nth-child(14) {
  --x: 63%;
  --y: 8%;
  --drift: 23s;
  --drift-delay: 12.5s;
  --glow-delay: 1.9s;
}

@media (max-width: 639px) {
  .fireflies span:nth-child(n + 11) {
    display: none;
  }
}

@keyframes firefly-glow {
  0%,
  100% {
    opacity: 0;
    transform: scale(0.5);
  }

  20% {
    opacity: 0.5;
    transform: scale(1);
  }

  45% {
    opacity: 0.14;
    transform: scale(0.82);
  }

  70% {
    opacity: 0.62;
    transform: scale(1.06);
  }
}

@keyframes firefly-a {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }

  25% {
    transform: translate3d(3.5vw, -5vh, 0);
  }

  50% {
    transform: translate3d(-2vw, -9vh, 0);
  }

  75% {
    transform: translate3d(4vw, -3vh, 0);
  }
}

@keyframes firefly-b {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }

  30% {
    transform: translate3d(-4vw, 4vh, 0);
  }

  60% {
    transform: translate3d(2.5vw, 8vh, 0);
  }

  80% {
    transform: translate3d(-1.5vw, 3vh, 0);
  }
}

@keyframes firefly-c {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }

  35% {
    transform: translate3d(5vw, 3vh, 0);
  }

  65% {
    transform: translate3d(1vw, -6vh, 0);
  }
}

.hero-bloom {
  position: absolute;
  z-index: -1;
  width: min(26vw, 8rem);
  opacity: 0;
  pointer-events: none;
}

.hero-bloom img {
  display: block;
  width: 100%;
  height: auto;
  filter: saturate(0.88) brightness(1.04);
}

.hero-bloom-a {
  bottom: 1rem;
  left: 0.5rem;
}

.hero-bloom-b {
  right: 0.5rem;
  bottom: 1rem;
  --flip: -1;
}

.hero-bloom-b img {
  transform: scaleX(-1);
}

body.revealed .hero-bloom {
  animation: bloom-in 1.3s cubic-bezier(0.2, 0.8, 0.2, 1) 0.45s forwards;
}

body.revealed .hero-bloom-b {
  animation-delay: 0.7s;
}

body.revealed .hero-bloom img {
  animation: bloom-sway 9s ease-in-out 1.9s infinite alternate;
}

@keyframes bloom-in {
  from {
    opacity: 0;
    transform: translateY(1.4rem) scale(0.94);
  }

  to {
    opacity: 0.72;
    transform: none;
  }
}

@keyframes bloom-sway {
  from {
    transform: scaleX(var(--flip, 1)) rotate(-1.4deg);
  }

  to {
    transform: scaleX(var(--flip, 1)) rotate(1.6deg);
  }
}

.wax-sprig {
  position: absolute;
  top: 60%;
  left: 50%;
  z-index: 5;
  width: clamp(3.4rem, 15vw, 4.6rem);
  transform: translate(-58%, -64%) rotate(-40deg);
  transition: transform 0.6s ease, opacity 0.5s ease;
}

.envelope.is-open .wax-sprig {
  opacity: 0;
  transform: translate(-58%, -64%) rotate(-40deg) scale(0.5);
}

.burst {
  position: absolute;
  top: 60%;
  left: 50%;
  z-index: 8;
  pointer-events: none;
}

.burst img {
  position: absolute;
  top: 0;
  left: 0;
  width: 2.5rem;
  max-width: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.4);
}

.envelope.is-open .burst img {
  animation: petal-out 1.9s cubic-bezier(0.22, 0.6, 0.3, 1) forwards;
}

.burst img:nth-child(1) {
  --x: -12rem;
  --y: -8rem;
  --r: -150deg;
  animation-delay: 0s;
}

.burst img:nth-child(2) {
  --x: 11rem;
  --y: -9.5rem;
  --r: 130deg;
  animation-delay: 0.07s;
}

.burst img:nth-child(3) {
  --x: -7rem;
  --y: -14rem;
  --r: -70deg;
  animation-delay: 0.13s;
}

.burst img:nth-child(4) {
  --x: 6.5rem;
  --y: -15rem;
  --r: 95deg;
  animation-delay: 0.04s;
}

.burst img:nth-child(5) {
  --x: -14.5rem;
  --y: -2rem;
  --r: -210deg;
  animation-delay: 0.16s;
}

.burst img:nth-child(6) {
  --x: 14rem;
  --y: -1rem;
  --r: 180deg;
  animation-delay: 0.1s;
}

@keyframes petal-out {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4) rotate(0deg);
  }

  15% {
    opacity: 1;
  }

  70% {
    opacity: 0.85;
  }

  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1) rotate(var(--r));
  }
}

@media (min-width: 768px) {
  .topbar {
    padding: 0.95rem 2rem;
  }

  .nav-toggle {
    display: none;
  }

  .nav {
    display: flex;
    position: static;
    flex-direction: row;
    gap: 1.4rem;
    padding: 0;
    background: transparent;
    border: 0;
  }

  .nav a {
    padding: 0;
  }

  .hero {
    padding-top: 4.5rem;
  }

  .countdown-band {
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
  }

  .details {
    grid-template-columns: repeat(3, 1fr);
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .hero-bloom {
    width: min(24vw, 13rem);
  }

  .hero-bloom-a {
    top: 1rem;
    bottom: auto;
    left: 1.5rem;
  }

  .hero-bloom-b {
    right: 1.5rem;
    bottom: 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .opening {
    display: none;
  }

  body.sealed {
    overflow: auto;
  }

  .fireflies,
  .burst {
    display: none;
  }

  .envelope,
  .card-slip,
  .env-flap,
  .wax,
  .wax-sprig,
  .open-hint,
  body.revealed .hero > *,
  .footer-wreath img,
  .reveal {
    animation: none !important;
    transition: none !important;
    opacity: 1;
    transform: none;
  }

  .hero-bloom,
  .hero-bloom img {
    animation: none !important;
  }

  .hero-bloom {
    opacity: 0.8;
  }
}

.dash-body {
  min-height: 100vh;
}

.dash-gate {
  position: relative;
  z-index: 1;
  max-width: 26rem;
  margin: 12vh auto;
  padding: 2rem 1.25rem;
  text-align: center;
}

.dash-gate h1,
.dash-main h1 {
  font-family: "Great Vibes", cursive;
  font-weight: 400;
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  margin: 0.2rem 0 0.6rem;
}

.dash-main h1 {
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 2.8rem);
}

.dash-lead {
  color: var(--muted);
  margin: 0 0 1.4rem;
}

.dash-main {
  position: relative;
  z-index: 1;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem 1.15rem 3rem;
}

.dash-topbar .dash-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-ghost {
  background: transparent;
  color: var(--sage);
  border: 1px solid rgba(85, 112, 78, 0.28);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  background: rgba(85, 112, 78, 0.08);
}

.dash-stats {
  display: grid;
  gap: 0.8rem;
  margin: 1.4rem 0 1.2rem;
}

.dash-stat {
  font-family: "Cormorant Garamond", serif;
  font-size: 2.2rem;
  margin: 0;
}

.dash-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}

.dash-filter {
  min-width: 12rem;
}

.dash-table-wrap {
  overflow-x: auto;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.dash-table th,
.dash-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(85, 112, 78, 0.12);
  vertical-align: top;
}

.dash-table th {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--olive);
  font-weight: 500;
}

.dash-table td.is-yes {
  color: var(--sage);
  font-weight: 500;
}

.dash-table td.is-no {
  color: #8a5a52;
}

.dash-empty {
  margin: 0;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
}

.dash-create {
  margin: 0 0 2.4rem;
  text-align: left;
}

.dash-create h2 {
  margin-bottom: 0.35rem;
}

.dash-create .dash-lead {
  text-align: left;
}

.dash-create form {
  display: grid;
  gap: 0.8rem;
  margin: 1rem 0 0.4rem;
  max-width: none;
}

.btn-tiny {
  min-height: 2.2rem;
  min-width: 0;
  padding: 0.35rem 0.8rem;
  font-size: 0.64rem;
}

@media (min-width: 720px) {
  .dash-stats {
    grid-template-columns: repeat(4, 1fr);
  }

  .dash-create form {
    grid-template-columns: 1fr 10rem auto;
    align-items: end;
  }

  .dash-create form .btn {
    justify-self: start;
    margin: 0;
  }
}
