:root {
  --navy: #1d2b45;
  --navy-2: #2c3e63;
  --cream: #f7f1e8;
  --paper: #fffcf6;
  --coral: #e07a5f;
  --sand: #f2cc8f;
  --sage: #81b29a;
  --forest: #3d5a4a;
  --sky: #9ccfe9;
  --gold: #c9a24a;
  --ink: #1d2b45;
  --muted: #6b7489;
  --f-display: 'DM Serif Display', Georgia, serif;
  --f-script: 'Allura', cursive;
  --f-sans: 'Inter', system-ui, sans-serif;
  --f-mono: 'Space Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--f-sans);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; height: 100svh; }
main { max-width: 30rem; margin: 0 auto; padding: 0 1.1rem 2rem; overflow-x: hidden; }
section { padding: 3.5rem 0 .5rem; text-align: center; }

.eyebrow {
  font-family: var(--f-mono); font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--coral);
}
h2 { font-family: var(--f-display); font-weight: 400; font-size: 2.3rem; line-height: 1.1; margin: .3rem 0 .4rem; }
.sub { color: var(--muted); font-size: .95rem; }
.script { font-family: var(--f-script); font-size: 2rem; color: var(--coral); line-height: 1.2; }
.panel {
  background: var(--paper); border-radius: 1.4rem; padding: 1.6rem 1.3rem;
  box-shadow: 0 12px 30px rgba(29, 43, 69, .08); border: 1px solid rgba(29, 43, 69, .06);
}

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ============ GATE ============ */
.gate {
  position: fixed; inset: 0; z-index: 100; overflow-x: hidden; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.1rem;
  padding: 1.5rem; text-align: center;
  background: linear-gradient(180deg, #ffd9c2 0%, #fbe6d4 30%, #cfe7f3 70%, var(--sky) 100%);
  transition: transform 1s cubic-bezier(.7, 0, .3, 1), opacity 1s ease;
}
.departed .gate { transform: translateY(-100%); opacity: .6; }
.gate-eyebrow { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--navy); }
.gate-hint { font-size: .85rem; color: var(--navy-2); opacity: .75; }

.cloud {
  position: absolute; background: #fff; border-radius: 999px; opacity: .85;
  filter: blur(1px); animation: drift linear infinite;
}
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 55%; height: 160%; left: 15%; bottom: 20%; }
.cloud::after { width: 40%; height: 130%; right: 12%; bottom: 25%; }
.c1 { width: 130px; height: 34px; top: 9%; animation-duration: 38s; }
.c2 { width: 90px; height: 24px; top: 24%; animation-duration: 28s; animation-delay: -12s; }
.c3 { width: 160px; height: 40px; bottom: 14%; animation-duration: 45s; animation-delay: -20s; }
.c4 { width: 80px; height: 22px; bottom: 30%; animation-duration: 32s; animation-delay: -5s; }
@keyframes drift { from { transform: translateX(-40vw); } to { transform: translateX(140vw); } }

.fly-plane {
  position: absolute; left: -60px; top: 18%; width: 48px; fill: var(--navy); opacity: 0;
}
.checking .fly-plane { animation: takeoff 1.6s ease-in forwards; }
@keyframes takeoff {
  0% { opacity: 1; transform: translate(0, 40vh) rotate(-18deg) scale(.8); }
  100% { opacity: 1; transform: translate(120vw, -10vh) rotate(-18deg) scale(1.3); }
}

/* Boarding pass */
.pass {
  width: min(22rem, 100%); background: var(--paper); border-radius: 1.3rem; overflow: hidden; text-align: left;
  box-shadow: 0 24px 50px rgba(29, 43, 69, .25);
  animation: float 4s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-6px); } }
.pass-main { padding: 1.2rem 1.3rem 1rem; }
.pass-head {
  display: flex; justify-content: space-between; align-items: center;
  margin: -1.2rem -1.3rem 1rem; padding: .7rem 1.3rem;
  background: var(--navy); color: var(--sand);
  font-family: var(--f-mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
}
.airline { font-weight: 700; color: #fff; }
.pass-route { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.pass-route > div { display: flex; flex-direction: column; }
.pass-route .to { text-align: right; }
.pass-route small, .pass-grid small, .seat small {
  font-family: var(--f-mono); font-size: .58rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.pass-route b { font-family: var(--f-mono); font-size: 2rem; line-height: 1.1; }
.pass-route span { font-size: .72rem; color: var(--muted); }
.mini-plane { width: 34px; fill: var(--coral); flex-shrink: 0; }
.pass-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem 1rem; margin-top: 1rem; }
.pass-grid > div { display: flex; flex-direction: column; }
.pass-grid b { font-size: .95rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pass-couple { margin-top: .9rem; font-family: var(--f-script); font-size: 2rem; color: var(--coral); text-align: center; line-height: 1; }

.pass-stub {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.3rem 1.1rem; border-top: 2px dashed rgba(29, 43, 69, .25); background: var(--paper);
  transition: transform .9s cubic-bezier(.5, 0, .6, 1), opacity .9s ease;
  transform-origin: left top;
}
.pass-stub::before, .pass-stub::after {
  content: ""; position: absolute; top: -12px; width: 22px; height: 22px; border-radius: 50%; background: #e9eef2;
}
.pass-stub::before { left: -11px; }
.pass-stub::after { right: -11px; }
.checking .pass-stub { transform: translateY(70px) rotate(12deg); opacity: 0; }
.barcode {
  flex: 1; height: 42px;
  background: repeating-linear-gradient(90deg, var(--navy) 0 2px, transparent 2px 4px, var(--navy) 4px 7px, transparent 7px 9px, var(--navy) 9px 10px, transparent 10px 13px);
}
.seat { display: flex; flex-direction: column; align-items: flex-end; }
.seat b { font-family: var(--f-mono); font-size: 1.3rem; color: var(--coral); }

.checkin-btn {
  font-family: var(--f-mono); font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: #fff; background: var(--coral); border: 0; border-radius: 999px; padding: 1rem 1.8rem; cursor: pointer;
  box-shadow: 0 10px 24px rgba(224, 122, 95, .45);
  animation: ping 2s ease-in-out infinite;
}
.checkin-form { display: flex; flex-direction: column; align-items: center; gap: .7rem; width: min(22rem, 100%); }
.checkin-form input {
  width: 100%; padding: .85rem 1.1rem; border-radius: 999px; text-align: center;
  font: inherit; font-size: 1rem; color: var(--navy);
  background: rgba(255, 255, 255, .85); border: 1.5px solid rgba(29, 43, 69, .15);
}
.checkin-form input:focus { outline: none; border-color: var(--coral); box-shadow: 0 0 0 3px rgba(224, 122, 95, .2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@keyframes ping { 50% { box-shadow: 0 0 0 10px rgba(224, 122, 95, .15), 0 10px 24px rgba(224, 122, 95, .45); } }

/* ============ CONFETTI & MUSIC ============ */
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 120; overflow: hidden; }
#confetti i {
  position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall { to { transform: translate(var(--x), 110vh) rotate(var(--r)); } }

.music-toggle {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 60; width: 3rem; height: 3rem; border-radius: 50%;
  background: var(--navy); border: 0; cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 8px 18px rgba(29, 43, 69, .3);
}
.bars { display: flex; gap: 3px; align-items: flex-end; height: 16px; }
.bars i { width: 3px; height: 5px; background: var(--sand); border-radius: 2px; }
.music-toggle.playing .bars i { animation: eq .9s ease-in-out infinite; }
.music-toggle.playing .bars i:nth-child(2) { animation-delay: .2s; }
.music-toggle.playing .bars i:nth-child(3) { animation-delay: .4s; }
@keyframes eq { 50% { height: 16px; } }

/* ============ HERO ============ */
.hero { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; gap: .6rem; padding-top: 2.5rem; }
.couple { font-family: var(--f-display); font-weight: 400; font-size: clamp(3rem, 15vw, 4.2rem); line-height: 1; display: flex; flex-direction: column; }
.couple .amp { font-family: var(--f-script); color: var(--coral); font-size: .8em; line-height: 1.1; }
.lead { color: var(--muted); font-size: 1.05rem; }
.lead b { color: var(--ink); }

.route-card {
  margin-top: 1.4rem; padding: 1.3rem 1.2rem; border-radius: 1.4rem; color: #fff; text-align: left;
  background: linear-gradient(140deg, var(--navy), var(--navy-2));
  box-shadow: 0 18px 36px rgba(29, 43, 69, .3);
}
.route-row { display: flex; align-items: center; gap: .4rem; }
.route-row .code { display: flex; flex-direction: column; min-width: 3.8rem; }
.route-row .code:last-child { text-align: right; }
.route-row .code b { font-family: var(--f-mono); font-size: 1.7rem; line-height: 1.1; }
.route-row .code span { font-size: .7rem; opacity: .7; }
.route-svg { flex: 1; color: var(--sand); fill: var(--sand); overflow: visible; }
.route-plane { fill: var(--coral); }
.route-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed rgba(255, 255, 255, .25); }
.route-meta small { display: block; font-family: var(--f-mono); font-size: .58rem; letter-spacing: .14em; text-transform: uppercase; color: var(--sand); }
.route-meta b { font-size: 1rem; }

.scroll-cue {
  margin: 1.8rem auto 0; display: inline-flex; flex-direction: column; align-items: center;
  font-family: var(--f-mono); font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); text-decoration: none;
}
.scroll-cue span { font-size: 1.4rem; animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(5px); } }

/* ============ SCRATCH CARD ============ */
.scratch {
  position: relative; width: min(20rem, 100%); height: 13rem; margin: 1.2rem auto .6rem;
  border-radius: 1.4rem; overflow: hidden; box-shadow: 0 16px 34px rgba(29, 43, 69, .2);
}
.scratch-under {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 20%, var(--navy-2), var(--navy)); color: #fff;
}
.scratch-under small { font-family: var(--f-mono); font-size: .66rem; letter-spacing: .18em; text-transform: uppercase; color: var(--sand); }
.scratch-under b { font-family: var(--f-display); font-weight: 400; font-size: 3.4rem; line-height: 1.05; }
.scratch-under span { font-family: var(--f-mono); letter-spacing: .14em; text-transform: uppercase; font-size: .85rem; }
.scratch-under em { margin-top: .4rem; font-family: var(--f-script); font-style: normal; font-size: 1.6rem; color: var(--sand); }
.scratch canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; transition: opacity .7s ease; }
.scratch.revealed canvas { opacity: 0; pointer-events: none; }
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; font: inherit; font-size: .85rem; cursor: pointer; }

.countdown-wrap { margin-top: 1rem; animation: pop .6s ease; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-top: .6rem; }
.countdown div { background: var(--paper); border-radius: 1rem; padding: .6rem 0; box-shadow: 0 6px 16px rgba(29, 43, 69, .08); }
.countdown b { display: block; font-family: var(--f-mono); font-size: 1.6rem; line-height: 1.1; }
.countdown span { font-family: var(--f-mono); font-size: .58rem; letter-spacing: .14em; text-transform: uppercase; color: var(--coral); }

/* ============ ITINERARY ============ */
.legs {
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  margin: 1.2rem -1.1rem 0; padding: .5rem 1.1rem 1.4rem;
}
.legs::-webkit-scrollbar { display: none; }
.leg {
  flex: 0 0 86%; scroll-snap-align: center; text-align: left;
  background: var(--paper); border-radius: 1.4rem; overflow: hidden; position: relative;
  box-shadow: 0 14px 30px rgba(29, 43, 69, .12);
  padding: 0 1.2rem 1.2rem;
}
.leg:nth-child(4n+1) { --accent: var(--sage); }
.leg:nth-child(4n+2) { --accent: #7b6cf6; }
.leg:nth-child(4n+3) { --accent: #e9b949; }
.leg:nth-child(4n+4) { --accent: var(--coral); }
.leg-top {
  display: flex; justify-content: space-between; align-items: center; margin: 0 -1.2rem 1rem; padding: .7rem 1.2rem;
  background: var(--accent); color: #fff;
}
.leg-no { font-family: var(--f-mono); font-size: .7rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.leg-emoji { font-size: 1.4rem; }
.leg h3 { font-family: var(--f-display); font-weight: 400; font-size: 1.7rem; line-height: 1.15; }
.leg-when { display: flex; align-items: baseline; gap: .5rem; margin-top: .2rem; }
.leg-when b { font-family: var(--f-mono); font-size: 1.6rem; color: var(--accent); }
.leg-when span { font-family: var(--f-mono); font-size: .75rem; letter-spacing: .12em; color: var(--muted); }
.leg-desc { margin-top: .5rem; font-size: .95rem; color: var(--muted); min-height: 3em; }
.leg-perf { position: relative; margin: 1rem -1.2rem; border-top: 2px dashed rgba(29, 43, 69, .18); }
.leg-perf::before, .leg-perf::after { content: ""; position: absolute; top: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--cream); }
.leg-perf::before { left: -10px; }
.leg-perf::after { right: -10px; }
.leg-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: .6rem .8rem; }
.leg-grid div:last-child { grid-column: 1 / -1; }
.leg-grid small { display: block; font-family: var(--f-mono); font-size: .58rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.leg-grid b { font-size: .95rem; }

.dots { display: flex; justify-content: center; gap: .45rem; }
.dots button { width: 8px; height: 8px; border-radius: 999px; border: 0; background: rgba(29, 43, 69, .2); cursor: pointer; transition: width .3s ease, background .3s ease; }
.dots button.active { width: 22px; background: var(--coral); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 3.2rem; padding: 0 1.6rem; border-radius: 999px; border: 0; cursor: pointer; text-decoration: none;
  font-family: var(--f-mono); font-size: .76rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: #fff; background: var(--navy); box-shadow: 0 10px 22px rgba(29, 43, 69, .25);
}
.btn-outline { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); box-shadow: none; margin-top: 1.3rem; }

/* ============ DESTINATION ============ */
.postcard {
  position: relative; margin: 1.3rem auto; padding: 2.2rem 1.2rem; border-radius: 1rem; color: #fff; text-align: left;
  display: flex; flex-direction: column; transform: rotate(-2deg);
  background:
    radial-gradient(circle at 80% 20%, rgba(242, 204, 143, .55), transparent 40%),
    linear-gradient(160deg, #5f8f73, var(--forest) 70%);
  box-shadow: 0 18px 36px rgba(29, 43, 69, .25);
  border: 6px solid #fff;
}
.postcard::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 40%; border-radius: 0 0 .6rem .6rem;
  background: radial-gradient(ellipse at 20% 100%, #2c4537 40%, transparent 41%), radial-gradient(ellipse at 75% 100%, #33503f 45%, transparent 46%);
  opacity: .9;
}
.pc-greet { font-family: var(--f-script); font-size: 1.8rem; line-height: 1; position: relative; z-index: 1; }
.pc-city { font-family: var(--f-display); font-size: 3rem; line-height: 1.05; text-transform: uppercase; letter-spacing: .04em; position: relative; z-index: 1; }
.pc-venue { font-family: var(--f-mono); font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; color: var(--sand); position: relative; z-index: 1; }
.pc-stamp {
  position: absolute; top: .8rem; right: .8rem; z-index: 1; width: 3.6rem; height: 4.2rem;
  display: grid; place-items: center; text-align: center; line-height: 1.1;
  font-family: var(--f-mono); font-size: .8rem; font-weight: 700; color: var(--coral); background: var(--paper);
  outline: 2px dashed var(--paper); outline-offset: 3px; transform: rotate(6deg);
}
.info { text-align: left; }
.how { list-style: none; display: grid; gap: .9rem; }
.how li { display: flex; gap: .8rem; align-items: flex-start; }
.how li > span { font-size: 1.4rem; line-height: 1.2; }
.how b { font-size: .98rem; }
.how p { font-size: .92rem; color: var(--muted); }
.travel-note { margin-top: 1rem; padding: .8rem 1rem; border-radius: .9rem; background: rgba(129, 178, 154, .15); color: var(--forest); font-size: .92rem; }
.info .btn-outline { width: 100%; }

/* ============ PACKING ============ */
.checklist { list-style: none; text-align: left; margin-top: 1.2rem; display: grid; gap: .2rem; }
.checklist label { display: flex; align-items: center; gap: .8rem; padding: .55rem 0; cursor: pointer; font-size: 1rem; }
.checklist input { width: 1.3rem; height: 1.3rem; accent-color: var(--coral); flex-shrink: 0; }
.checklist input:checked + span { text-decoration: line-through; color: var(--muted); }

/* ============ RSVP ============ */
.form { position: relative; display: grid; gap: 1.05rem; text-align: left; margin-top: 1.2rem; }
.form > .sub { text-align: center; }
.form label > span, .legend {
  display: block; margin-bottom: .35rem;
  font-family: var(--f-mono); font-size: .62rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.form input, .form select, .form textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: #fff;
  padding: .75rem .9rem; border: 1.5px solid rgba(29, 43, 69, .15); border-radius: .85rem;
}
.form textarea { resize: none; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--coral); box-shadow: 0 0 0 3px rgba(224, 122, 95, .2); }
fieldset { border: 0; }
.checks { display: grid; gap: .4rem; }
.checks label { display: flex; align-items: center; gap: .5rem; font-size: .98rem; }
.checks input { width: 1.15rem; height: 1.15rem; accent-color: var(--coral); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.form-error { color: #b3261e; font-weight: 600; text-align: center; }
.form .btn { width: 100%; background: var(--coral); box-shadow: 0 10px 22px rgba(224, 122, 95, .4); }

.stamp {
  position: absolute; top: 1rem; right: .8rem; padding: .3rem .7rem; border: 3px double var(--coral); border-radius: .5rem;
  font-family: var(--f-mono); font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--coral);
  opacity: 0; transform: rotate(-14deg) scale(2.2); pointer-events: none;
}
.stamp.show { animation: stamp .5s cubic-bezier(.2, 1.6, .4, 1) forwards; }
@keyframes stamp { to { opacity: .9; transform: rotate(-14deg) scale(1); } }

/* ============ FOOTER ============ */
footer { text-align: center; padding: 3.5rem 0 3rem; }
.footer-code { font-family: var(--f-mono); font-size: 4rem; font-weight: 700; letter-spacing: .1em; line-height: 1; color: var(--navy); }
.hashtag { margin-top: .6rem; font-weight: 700; color: var(--coral); }
.hosts { margin-top: .4rem; font-size: .92rem; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .gate, .pass-stub { transition-duration: .3s; }
}
