:root {
  --paper: #f6efe1;
  --paper-deep: #efe5d0;
  --ink: #2b2118;
  --ink-soft: #6d5f4e;
  --red: #b8434e;
  --green: #234f3a;
  --green-deep: #1a3d2c;
  --gold: #c9973f;
  --cream: #f7f0de;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

[hidden] {
  display: none !important;
}

body {
  font-family: "Karla", "Gill Sans", sans-serif;
  background-color: var(--paper);
  background-image:
    radial-gradient(900px 500px at 50% -10%, rgba(201, 151, 63, 0.14), transparent 60%),
    radial-gradient(700px 500px at 100% 100%, rgba(35, 79, 58, 0.08), transparent 60%);
  color: var(--ink);
  min-height: 100dvh;
  line-height: 1.6;
}

::selection {
  background: var(--gold);
  color: var(--ink);
}

/* ---------- snow ---------- */

.snow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.snow span {
  position: absolute;
  top: -3vh;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  opacity: 0.18;
  animation: fall linear infinite;
}

.snow span:nth-child(1)  { left: 5%;  animation-duration: 14s; animation-delay: -2s; }
.snow span:nth-child(2)  { left: 15%; animation-duration: 18s; animation-delay: -9s; width: 3px; height: 3px; }
.snow span:nth-child(3)  { left: 26%; animation-duration: 12s; animation-delay: -5s; }
.snow span:nth-child(4)  { left: 37%; animation-duration: 20s; animation-delay: -11s; width: 4px; height: 4px; }
.snow span:nth-child(5)  { left: 48%; animation-duration: 15s; animation-delay: -1s; }
.snow span:nth-child(6)  { left: 59%; animation-duration: 13s; animation-delay: -7s; width: 6px; height: 6px; }
.snow span:nth-child(7)  { left: 68%; animation-duration: 19s; animation-delay: -13s; width: 3px; height: 3px; }
.snow span:nth-child(8)  { left: 78%; animation-duration: 12s; animation-delay: -4s; }
.snow span:nth-child(9)  { left: 88%; animation-duration: 17s; animation-delay: -10s; width: 4px; height: 4px; }
.snow span:nth-child(10) { left: 96%; animation-duration: 14s; animation-delay: -6s; }

@keyframes fall {
  to { transform: translateY(108vh); }
}

@media (prefers-reduced-motion: reduce) {
  .snow { display: none; }
}

/* ---------- envelope screen ---------- */

.envelope-screen {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.6rem;
  padding: 2rem 1.25rem;
  text-align: center;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.envelope-screen.closing {
  opacity: 0;
  transform: translateY(-16px);
  pointer-events: none;
}

.envelope {
  position: relative;
  width: 220px;
  height: 150px;
  background: var(--cream);
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: 0 18px 40px -18px rgba(43, 33, 24, 0.45);
  animation: sway 3.4s ease-in-out infinite;
}

.flap {
  position: absolute;
  inset: 0;
  clip-path: polygon(0 0, 50% 62%, 100% 0);
  background: var(--paper-deep);
  border-radius: 6px 6px 0 0;
  border-bottom: 2px solid var(--ink);
}

.seal {
  position: absolute;
  left: 50%;
  top: 58%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--red);
  color: var(--cream);
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  font-size: 1.5rem;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 10px rgba(43, 33, 24, 0.3);
}

@keyframes sway {
  0%, 100% { transform: rotate(-1.2deg); }
  50% { transform: rotate(1.2deg); }
}

@media (prefers-reduced-motion: reduce) {
  .envelope { animation: none; }
}

.env-line {
  font-size: 1.1rem;
  color: var(--ink-soft);
}

.open-btn {
  font: inherit;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0.85rem 2.4rem;
  border: none;
  border-radius: 99px;
  background: var(--red);
  color: var(--cream);
  cursor: pointer;
  box-shadow: 0 12px 26px -12px rgba(184, 67, 78, 0.8);
  transition: transform 0.12s ease, filter 0.15s ease;
}

.open-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.open-btn:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- letter ---------- */

.letter {
  position: relative;
  z-index: 1;
  max-width: 34rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 8vw, 4.5rem) 1.4rem 4rem;
}

.reveal {
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--i) * 0.55s);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { animation-duration: 0.01s; animation-delay: 0s; }
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--red);
  text-align: center;
  margin-bottom: 2rem;
}

.story p {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.15rem, 4vw, 1.35rem);
  line-height: 1.6;
  margin-bottom: 1.3rem;
  text-wrap: pretty;
}

.beat {
  font-style: italic;
  color: var(--green);
}

/* ---------- coupon ---------- */

.coupon-wrap {
  margin: 2.2rem 0 2.6rem;
}

.coupon {
  display: flex;
  background: var(--green);
  color: var(--cream);
  border-radius: 14px;
  box-shadow: 0 24px 50px -22px rgba(26, 61, 44, 0.7);
  overflow: hidden;
  transform: rotate(-1.2deg);
}

.coupon-main {
  flex: 1;
  padding: 1.8rem 1.4rem;
  text-align: center;
  background-image: radial-gradient(500px 200px at 50% 0%, rgba(201, 151, 63, 0.2), transparent 70%);
}

.coupon-kicker {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.6rem;
}

.coupon-value {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-size: clamp(3rem, 12vw, 4.2rem);
  line-height: 1;
  color: var(--cream);
}

.coupon-for {
  font-size: 0.98rem;
  margin-top: 0.4rem;
  color: rgba(247, 240, 222, 0.85);
}

.coupon-tagline {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-size: 1.15rem;
  margin-top: 1.1rem;
  color: var(--gold);
}

.coupon-code {
  display: inline-block;
  margin-top: 1.1rem;
  padding: 0.35rem 1rem;
  border: 1.5px dashed rgba(247, 240, 222, 0.5);
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
}

.coupon-stub {
  position: relative;
  width: 84px;
  border-left: 2px dashed rgba(247, 240, 222, 0.4);
  background: var(--green-deep);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  padding: 1rem 0.5rem;
}

/* punched notches on the perforation line */
.coupon-stub::before,
.coupon-stub::after {
  content: "";
  position: absolute;
  left: -12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--paper);
}

.coupon-stub::before { top: -13px; }
.coupon-stub::after { bottom: -13px; }

.barcode {
  width: 44px;
  height: 70px;
  background: repeating-linear-gradient(
    to bottom,
    var(--cream) 0 2px,
    transparent 2px 5px,
    var(--cream) 5px 8px,
    transparent 8px 10px
  );
  opacity: 0.85;
}

.stub-text {
  writing-mode: vertical-rl;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(247, 240, 222, 0.75);
}

.fine-print {
  margin-top: 1.1rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
  text-align: center;
  text-wrap: balance;
}

/* ---------- redeem ---------- */

.redeem h2 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.5rem;
  margin-bottom: 0.9rem;
}

.redeem ol {
  padding-left: 1.4rem;
  display: grid;
  gap: 0.55rem;
  font-size: 1.05rem;
}

.redeem li::marker {
  font-weight: 700;
  color: var(--red);
}

.aside {
  margin-top: 0.9rem;
  font-style: italic;
  color: var(--ink-soft);
}

/* ---------- closing ---------- */

.closing {
  margin-top: 2.4rem;
  border-top: 2px solid rgba(43, 33, 24, 0.12);
  padding-top: 2rem;
}

.closing p {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.15rem, 4vw, 1.35rem);
  margin-bottom: 1.2rem;
  text-wrap: pretty;
}

.signature {
  font-family: "Caveat", cursive;
  font-size: 2.4rem;
  color: var(--red);
  transform: rotate(-2deg);
  margin-bottom: 0 !important;
}

.signature-note {
  font-family: "Karla", sans-serif !important;
  font-size: 0.9rem !important;
  color: var(--ink-soft);
}
