:root {
  color-scheme: light;
  --ink: #2a201d;
  --muted: #806d65;
  --paper: #fff8f2;
  --paper-strong: #fffdf8;
  --rose: #b85f67;
  --rose-deep: #7d3942;
  --sage: #73836f;
  --champagne: #ead5b7;
  --line: rgba(88, 59, 53, 0.18);
  --shadow: rgba(89, 50, 41, 0.18);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Outfit", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 14% 8%, rgba(184, 95, 103, 0.18), transparent 28rem),
    linear-gradient(135deg, #fff9f3 0%, #f9ece5 46%, #f2d9d7 100%);
  color: var(--ink);
  font-family: var(--font-body);
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

.gift-page {
  overflow: hidden;
}

.hero {
  position: relative;
  display: grid;
  min-height: 100dvh;
  isolation: isolate;
}

.hero__image,
.hero__veil {
  position: absolute;
  inset: 0;
}

.hero__image {
  z-index: -2;
  background-image: url("assets/vrijthof-concert-diner.png");
  background-position: center;
  background-size: cover;
  transform: scale(1.02);
}

.hero__veil {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(42, 32, 29, 0.78) 0%, rgba(42, 32, 29, 0.58) 42%, rgba(42, 32, 29, 0.12) 100%),
    linear-gradient(0deg, rgba(255, 249, 243, 1) 0%, rgba(255, 249, 243, 0) 23%);
}

.hero__content {
  align-self: center;
  width: min(92vw, 760px);
  padding: 8rem clamp(1.25rem, 5vw, 5.5rem) 12rem;
  color: #fffaf4;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--rose-deep);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #f3d5c3;
}

h1,
h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 650;
  letter-spacing: 0;
}

h1 {
  max-width: 11ch;
  font-size: clamp(3rem, 9vw, 6.8rem);
  line-height: 0.92;
}

h2 {
  color: var(--ink);
  font-size: clamp(2.2rem, 5vw, 4.7rem);
  line-height: 0.98;
}

.intro {
  max-width: 33rem;
  margin: 1.5rem 0 0;
  color: rgba(255, 250, 244, 0.88);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.55;
}

.hero__button {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 2rem;
  padding: 0.95rem 1.15rem 0.95rem 1.35rem;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: rgba(255, 248, 242, 0.13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
  color: #fffaf4;
  font-weight: 700;
  text-decoration: none;
  backdrop-filter: blur(16px);
  transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1), background 240ms ease;
}

.hero__button:hover {
  background: rgba(255, 248, 242, 0.2);
  transform: translateY(-2px);
}

.hero__button:active {
  transform: translateY(1px) scale(0.99);
}

.hero__button svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.play-area {
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6.5rem) clamp(1rem, 3vw, 2rem);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: 2rem;
  align-items: end;
  margin-bottom: clamp(2rem, 5vw, 4rem);
}

.section-heading .eyebrow {
  margin-bottom: 0.35rem;
}

.hint-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.4rem);
}

.envelope {
  position: relative;
  min-height: 300px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  perspective: 900px;
  -webkit-tap-highlight-color: transparent;
}

.envelope:focus-visible {
  outline: 3px solid rgba(184, 95, 103, 0.35);
  outline-offset: 0.6rem;
}

.envelope__paper,
.envelope__body,
.envelope__flap,
.envelope__label {
  position: absolute;
  left: 50%;
  width: min(86%, 260px);
  transform: translateX(-50%);
}

.envelope__paper {
  top: 0.9rem;
  z-index: 1;
  display: grid;
  align-content: start;
  min-height: 205px;
  padding: 1.15rem;
  border: 1px solid rgba(88, 59, 53, 0.12);
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.65), transparent 38%),
    var(--paper-strong);
  box-shadow: 0 22px 45px -28px var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(4rem) rotateX(-14deg);
  transition:
    opacity 420ms ease,
    transform 620ms cubic-bezier(0.16, 1, 0.3, 1);
}

.envelope__number {
  color: var(--rose);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.envelope__hint {
  display: block;
  margin-top: 1.05rem;
  color: #4b3934;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

.envelope__body {
  bottom: 2.3rem;
  z-index: 2;
  height: 166px;
  border: 1px solid rgba(98, 60, 54, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(145deg, transparent 49.5%, rgba(125, 57, 66, 0.18) 50%, transparent 51%),
    linear-gradient(215deg, transparent 49.5%, rgba(125, 57, 66, 0.16) 50%, transparent 51%),
    linear-gradient(180deg, #f7dfd5, #eec9c1);
  box-shadow: 0 24px 38px -24px var(--shadow);
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.envelope__flap {
  bottom: 8.9rem;
  z-index: 3;
  height: 88px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #f4d6cb, #e7bcb6);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: bottom center;
  transition: transform 520ms cubic-bezier(0.16, 1, 0.3, 1);
}

.envelope__label {
  bottom: 0;
  display: block;
  color: var(--rose-deep);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-align: center;
  text-transform: uppercase;
}

.envelope:hover .envelope__body {
  transform: translateX(-50%) translateY(-0.4rem);
}

.envelope:hover .envelope__flap {
  transform: translateX(-50%) translateY(-0.4rem) rotateX(-22deg);
}

.envelope.is-open .envelope__paper {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-2.5rem) rotateX(0deg);
}

.envelope.is-open .envelope__flap {
  transform: translateX(-50%) translateY(-1.2rem) rotateX(-168deg);
}

.envelope.is-open .envelope__body {
  transform: translateX(-50%) translateY(1rem);
}

.reveal {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(1rem, 4vw, 3rem);
  align-items: stretch;
  width: min(100%, 1240px);
  margin: 0 auto clamp(3rem, 7vw, 6rem);
  padding: 0 clamp(1rem, 3vw, 2rem);
  animation: reveal-in 620ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.reveal[hidden] {
  display: none;
}

.reveal__media {
  min-height: 420px;
  border-radius: 8px;
  background-image: url("assets/vrijthof-concert-diner.png");
  background-position: center;
  background-size: cover;
  box-shadow: 0 35px 75px -48px rgba(89, 50, 41, 0.46);
}

.reveal__content {
  display: grid;
  align-content: center;
  padding: clamp(1.4rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.reveal__content p:not(.eyebrow) {
  max-width: 34rem;
  margin: 1.35rem 0 0;
  color: #5f4c45;
  font-size: 1.08rem;
  line-height: 1.65;
}

.ticket {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 2rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.ticket div {
  min-width: 0;
  padding: 1rem;
  background: rgba(255, 253, 248, 0.78);
}

.ticket span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ticket strong {
  display: block;
  margin-top: 0.35rem;
  color: var(--ink);
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  line-height: 1.2;
}

.petals {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.petals span {
  position: absolute;
  top: -8vh;
  width: 0.65rem;
  height: 1rem;
  border-radius: 999px 999px 999px 2px;
  background: rgba(184, 95, 103, 0.28);
  animation: fall 12s linear infinite;
}

.petals span:nth-child(1) {
  left: 9%;
  animation-delay: 0s;
}

.petals span:nth-child(2) {
  left: 28%;
  animation-delay: 2.2s;
  animation-duration: 15s;
}

.petals span:nth-child(3) {
  left: 46%;
  animation-delay: 5.4s;
  animation-duration: 13s;
}

.petals span:nth-child(4) {
  left: 65%;
  animation-delay: 1.1s;
  animation-duration: 14.5s;
}

.petals span:nth-child(5) {
  left: 78%;
  animation-delay: 4s;
  animation-duration: 16s;
}

.petals span:nth-child(6) {
  left: 91%;
  animation-delay: 6.6s;
  animation-duration: 12.5s;
}

@keyframes fall {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  12% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(-5rem, 112vh, 0) rotate(330deg);
  }
}

@keyframes reveal-in {
  from {
    opacity: 0;
    transform: translateY(1.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 920px) {
  .hero__veil {
    background:
      linear-gradient(180deg, rgba(42, 32, 29, 0.76) 0%, rgba(42, 32, 29, 0.34) 58%, rgba(255, 249, 243, 1) 100%),
      linear-gradient(90deg, rgba(42, 32, 29, 0.62), rgba(42, 32, 29, 0.18));
  }

  .hero__content {
    width: min(100%, 680px);
    padding: 6rem 1.25rem 9rem;
  }

  h1 {
    max-width: 9.5ch;
  }

  .section-heading,
  .reveal {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 620px) {
  .hero {
    min-height: 100dvh;
  }

  h1 {
    font-size: clamp(2.75rem, 15vw, 4.1rem);
  }

  .intro {
    font-size: 1rem;
  }

  .hint-grid,
  .ticket {
    grid-template-columns: 1fr;
  }

  .envelope {
    min-height: 285px;
  }

  .reveal__media {
    min-height: 290px;
  }
}

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