/* ---------------- Home: title on the left, the letter on the right ---------------- */
.hero { position: relative; z-index: 4; max-width: 1180px; margin: 0 auto; padding: 40px 28px 120px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px); gap: 56px; align-items: start; }
.hero[hidden] { display: none; }
.intro-col { position: sticky; top: 90px; padding-top: 50px; min-width: 0; }
.hero h1 { font-family: Fraunces, serif; font-weight: 800; font-size: clamp(60px, 8.4vw, 116px); line-height: .88; letter-spacing: -2px; margin: 0 0 22px; text-shadow: 0 2px 0 var(--red-900), 0 18px 40px rgba(0,0,0,.35); }
.hero h1 em { font-style: italic; font-weight: 400; color: var(--gold); display: block; padding-left: .5em; }
.tagline { font-family: Fraunces, serif; font-style: italic; font-size: 26px; color: var(--cream); margin: -6px 0 18px; opacity: .95; }
.lead { font-size: 18px; line-height: 1.6; max-width: 460px; color: rgba(251,244,230,.85); margin: 0 0 30px; }
.steps { display: flex; gap: 22px; margin: 0; padding: 0; list-style: none; flex-wrap: wrap; }
.steps li { display: flex; gap: 10px; align-items: center; font-size: 14px; color: rgba(251,244,230,.85); }
.steps .n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid rgba(231,183,95,.55); font-family: Fraunces, serif; color: var(--gold); }
.trust { margin-top: 30px; font-size: 13px; color: rgba(251,244,230,.6); }
.trust a { color: rgba(251,244,230,.8); }

/* ---------------- Full-page screens (after sending, draw, expired, lost mail) ---------------- */
.scr { position: relative; z-index: 4; display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 1180px; margin: 0 auto; padding: 36px 16px 140px; }
.scr[hidden] { display: none; }
.scr h1, .scr h2 { font-family: Fraunces, serif; font-weight: 800; font-size: clamp(34px, 5vw, 46px); line-height: 1; margin: 18px 0 14px; letter-spacing: -1px; text-wrap: balance; text-shadow: 0 2px 0 var(--red-900); }
.scr h1 em, .scr h2 em { font-weight: 400; color: var(--gold); }
.scr > p { max-width: 440px; font-size: 17px; line-height: 1.6; color: rgba(251,244,230,.85); margin: 0 0 22px; text-wrap: pretty; }
.scr .small { font-size: 13px; opacity: .65; margin-top: 16px; max-width: 420px; line-height: 1.5; }
.scr .small a, .scr > p a { color: var(--gold); }
.scr .err { font-family: Caveat, cursive; font-size: 22px; color: var(--gold); min-height: 0; margin: 14px 0 0; max-width: 440px; }
.scr .err:empty { display: none; }
/* arrival of a screen, child after child; the end state is each element's own style (opacity included) */
.screen-in > * { animation: upIn .8s cubic-bezier(.2,.8,.2,1) both; }
.screen-in > :nth-child(2) { animation-delay: .12s; } .screen-in > :nth-child(3) { animation-delay: .24s; }
.screen-in > :nth-child(4) { animation-delay: .36s; } .screen-in > :nth-child(5) { animation-delay: .48s; } .screen-in > :nth-child(n+6) { animation-delay: .6s; }

.mailbox { width: 150px; height: 150px; flex: none; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.screen-in > .mailbox { animation: upIn .8s cubic-bezier(.2,.8,.2,1) both, bob 2.4s .8s ease-in-out infinite; }
.counter { font-family: Fraunces, serif; font-size: 22px; min-height: 30px; margin: 0 0 18px; }
.counter b { color: var(--gold); font-size: 30px; }

/* draw page */
.hat { position: relative; width: 260px; height: 220px; margin-top: 10px; flex: none; }
.hat > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.slip { position: absolute; left: 50%; top: 120px; padding: 6px 14px; background: #fffaf0; color: var(--ink); font-family: Caveat, cursive; font-size: 22px; border-radius: 2px; box-shadow: 0 4px 10px rgba(0,0,0,.25); white-space: nowrap; transform: translate(-50%, 0) scale(.6); opacity: 0; pointer-events: none; }
.mini-env { position: fixed; width: 34px; height: 22px; background: #f1dfbd; border-radius: 3px; z-index: 20; pointer-events: none; box-shadow: 0 4px 10px rgba(0,0,0,.3); }
.mini-env::after { content: ""; position: absolute; inset: 0; background: #e4caa0; clip-path: polygon(0 0, 100% 0, 50% 60%); }
.confetti { position: fixed; top: -20px; z-index: 30; pointer-events: none; font-size: 18px; animation: confetti linear forwards; }
@keyframes confetti { to { transform: translateY(110vh) rotate(540deg); } }
.fade { transition: opacity .6s; }
.fade.out { opacity: 0; pointer-events: none; }
.draw-done { opacity: 0; transition: opacity .6s; }
.draw-done.show { opacity: 1; }

.ticket { margin: 2px 0 26px; padding: 7px; transform: rotate(-1.5deg); color: var(--ink); filter: drop-shadow(0 12px 18px rgba(40,5,8,.45)); max-width: 100%;
  background: radial-gradient(circle at 5px 5px, transparent 3.2px, #fffaf0 3.8px) -5px -5px / 10px 10px; }
.ticket .in { border: 1.5px dashed rgba(154,42,44,.5); padding: 10px 22px 12px; background: linear-gradient(180deg, #fffaf0, #f6ead2); display: grid; gap: 2px; }
.ticket .k { font-family: "Special Elite", monospace; font-size: 10px; letter-spacing: 2.5px; color: var(--red-600); }
.ticket .t { font-family: Fraunces, serif; font-weight: 600; font-size: 22px; overflow-wrap: anywhere; }
.ticket .d { font-family: Caveat, cursive; font-size: 21px; color: var(--pine-700); }
.gold-mark { position: absolute; width: 104px; height: 104px; border-radius: 50%; border: 2px solid rgba(231,183,95,.75); outline: 1px solid rgba(231,183,95,.45); outline-offset: 4px;
  display: grid; place-items: center; text-align: center; font-family: "Special Elite", monospace; font-size: 10px; line-height: 1.6; color: var(--gold); transform: rotate(-14deg); }
.art { position: relative; display: flex; justify-content: center; }
.gift { width: 230px; height: 196px; flex: none; }

/* expired link: an envelope sent back */
.env { position: relative; width: 300px; height: 190px; flex: none; margin: 6px 0 4px; transform: rotate(-3deg); }
.env .back { position: absolute; inset: 0; background: #e9d3ad; border-radius: 6px; box-shadow: 0 24px 40px rgba(40,5,8,.5); }
.env .front { position: absolute; inset: 0; border-radius: 6px; background: #f1dfbd; clip-path: polygon(0 0, 50% 58%, 100% 0, 100% 100%, 0 100%); }
.env .flap { position: absolute; left: 0; right: 0; top: 0; height: 112px; background: #e4caa0; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.env .addr { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; font-family: Caveat, cursive; font-size: 22px; color: var(--ink); }
.env .rubber { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-11deg); font-family: "Special Elite", monospace; color: rgba(154,42,44,.88); text-align: center;
  border: 3px solid rgba(154,42,44,.8); border-radius: 5px; padding: 6px 14px 5px; line-height: 1.2; mix-blend-mode: multiply; white-space: nowrap; animation: rubber .4s .5s ease-in both; }
.env .rubber b { display: block; font-weight: 400; font-size: 24px; letter-spacing: 3px; }
.env .rubber small { font-size: 10px; letter-spacing: 2px; }
@keyframes rubber { from { opacity: 0; transform: translate(-50%, -50%) rotate(-11deg) scale(1.7); } }
.puddle { width: 230px; height: 20px; margin-top: -2px; border-radius: 50%; background: radial-gradient(ellipse, rgba(255,255,255,.28), transparent 70%); }

/* lost mail: a small ruled letter */
.small-letter { width: 100%; max-width: 470px; margin: 0 auto; text-align: left; }
.lost-mail { font-family: Inter, sans-serif; font-size: 16px; flex: 1; width: 0; border-bottom: 1.5px dotted #b49a78; padding-bottom: 2px; }

/* split pages: intro on the left, a letter on the right (like the hero) */
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 34px; max-width: 1180px; margin: 0 auto; padding: 30px 16px 140px; position: relative; z-index: 4; }
.split .intro { text-align: left; min-width: 0; }
.split .intro h1 { font-family: Fraunces, serif; font-weight: 800; font-size: clamp(40px, 6vw, 72px); line-height: .95; letter-spacing: -1.5px; margin: 6px 0 16px; text-shadow: 0 2px 0 var(--red-900), 0 18px 40px rgba(0,0,0,.35); }
.split .intro h1 em { font-weight: 400; color: var(--gold); font-style: italic; }
.split .intro p { font-size: 17px; line-height: 1.6; color: rgba(251,244,230,.85); margin: 0 0 18px; max-width: 440px; }
.split .intro .fine { font-size: 14px; opacity: .75; }
.letter .flow.cv.qa-q { color: var(--red-700); font-size: 24px; --shift: -2px; }
.letter .sig { font-family: Caveat, cursive; font-size: 30px; color: var(--red-700); justify-content: flex-end; padding-right: 10px; }
.letter a { color: var(--red-700); }
.letter .flow.fr.stamp-gap { padding-right: 72px; }

/* "Comment ça marche": four postage stamps */
.stamps { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; max-width: 400px; }
.stamps li { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 14px; align-items: center; }
.stamps .st { width: 74px; height: 88px; padding: 6px; background: radial-gradient(circle at 5px 5px, transparent 3.2px, #fffaf0 3.8px) -5px -5px / 10px 10px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.3)); }
.stamps li:nth-child(odd) .st { transform: rotate(-4deg); } .stamps li:nth-child(even) .st { transform: rotate(3deg); }
.stamps .st .in { height: 100%; outline: 2px solid #fffaf0; display: grid; place-items: center; position: relative; }
.stamps .st .in.pine { background: linear-gradient(180deg,#1d4a37,#0f2a20); } .stamps .st .in.red { background: linear-gradient(180deg,#9a2a2c,#64161a); }
.stamps .st .in b { position: absolute; top: 3px; left: 5px; font-family: Fraunces, serif; font-size: 13px; color: var(--gold); }
.stamps .st svg { width: 46px; height: 46px; }
.stamps strong { display: block; font-family: Caveat, cursive; font-size: 24px; color: var(--gold); line-height: 1; margin-bottom: 4px; }
.stamps span { font-size: 14px; line-height: 1.45; color: rgba(251,244,230,.8); }

/* no JavaScript: a short note on the paper instead of the letter */
.nojs .letter { padding-bottom: var(--line); }

@media (min-width: 981px) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: 56px; padding: 40px 28px 140px; align-items: start; }
  .split .intro { position: sticky; top: 90px; padding-top: 40px; }
}
@media (max-width: 980px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .intro-col { position: static; padding-top: 0; }
}
@media (max-width: 560px) {
  .hero { padding: 20px 16px 120px; }
  .gift { width: 190px; height: 162px; }
  .gold-mark { width: 88px; height: 88px; font-size: 9px; }
  .env { width: 270px; height: 171px; }
  .env .flap { height: 100px; }
  .env .rubber b { font-size: 20px; }
}

/* the lid lifts around its own centre, so it never flies into the title */
#lid { transform-box: fill-box; transform-origin: 50% 50%; }
