:root {
  color-scheme: dark;
  --ink: #f3ead7;
  --muted: #b3a589;
  --paper: #f6eedd;
  --paper-strong: #fbf5e8;
  --gold: #d8b15e;
  --gold-deep: #c9a24b;
  --brass: #8a6a32;
  --night: #14110d;
  --night-soft: #1d1813;
  --line: rgba(216, 177, 94, 0.22);
  --shadow: rgba(0, 0, 0, 0.55);
  --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 16% 6%, rgba(216, 177, 94, 0.12), transparent 26rem),
    radial-gradient(circle at 88% 0%, rgba(138, 106, 50, 0.16), transparent 30rem),
    linear-gradient(160deg, #14110d 0%, #1b1610 48%, #221a12 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/morricone-concert.svg");
  background-position: center;
  background-size: cover;
  transform: scale(1.02);
}

.hero__veil {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(12, 10, 8, 0.84) 0%, rgba(12, 10, 8, 0.6) 44%, rgba(12, 10, 8, 0.1) 100%),
    linear-gradient(0deg, rgba(20, 17, 13, 1) 0%, rgba(20, 17, 13, 0) 24%);
}

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

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

.hero .eyebrow {
  color: var(--gold);
}

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(253, 246, 231, 0.85);
  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(216, 177, 94, 0.42);
  border-radius: 999px;
  background: rgba(216, 177, 94, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 240, 200, 0.16);
  color: #fdf6e7;
  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(216, 177, 94, 0.18);
  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(216, 177, 94, 0.4);
  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(120, 92, 44, 0.35);
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.7), transparent 38%),
    var(--paper-strong);
  box-shadow: 0 26px 50px -26px rgba(0, 0, 0, 0.7);
  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(--brass);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.envelope__hint {
  display: block;
  margin-top: 1.05rem;
  color: #2c2110;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
}

.envelope__body {
  bottom: 2.3rem;
  z-index: 2;
  height: 166px;
  border: 1px solid rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  background:
    linear-gradient(145deg, transparent 49.5%, rgba(0, 0, 0, 0.32) 50%, transparent 51%),
    linear-gradient(215deg, transparent 49.5%, rgba(0, 0, 0, 0.28) 50%, transparent 51%),
    linear-gradient(180deg, #b98f43, #8a6531);
  box-shadow: 0 26px 40px -22px rgba(0, 0, 0, 0.75);
  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, #cda050, #a87c38);
  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(--gold);
  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 {
  z-index: 5;
  min-height: 230px;
  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/morricone-concert.svg");
  background-position: center;
  background-size: cover;
  box-shadow: 0 35px 75px -42px rgba(0, 0, 0, 0.8);
}

.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: #d8cbb0;
  font-size: 1.08rem;
  line-height: 1.65;
}

.reveal__content em {
  color: var(--gold);
  font-style: italic;
}

.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(29, 24, 19, 0.92);
}

.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.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: rgba(216, 177, 94, 0.5);
  box-shadow: 0 0 8px rgba(216, 177, 94, 0.55);
  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(12, 10, 8, 0.82) 0%, rgba(12, 10, 8, 0.4) 58%, rgba(20, 17, 13, 1) 100%),
      linear-gradient(90deg, rgba(12, 10, 8, 0.68), rgba(12, 10, 8, 0.2));
  }

  .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;
  }
}
