:root {
  --navy: #12213d;
  --navy-2: #0b1528;
  --navy-3: #1b2e52;
  --cream: #f5eedf;
  --paper: #fbf6ea;
  --ink: #1c2742;
  --muted: #6d7286;
  --coral: #d4633f;
  --coral-2: #e8896a;
  --gold: #c9a45a;
  --gold-2: #e6cc8c;
  --mono: 'DM Mono', ui-monospace, monospace;
  --serif: 'DM Serif Display', Georgia, serif;
  --script: 'Parisienne', cursive;
  --sans: 'Jost', system-ui, sans-serif;
  --spring: cubic-bezier(.2, 1.4, .35, 1);
  --ease: cubic-bezier(.22, .8, .2, 1);
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans); font-weight: 300; color: var(--ink);
  background: #070d1a; min-height: 100svh;
  -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; height: 100svh; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }

.stage {
  position: relative; max-width: 480px; margin: 0 auto; min-height: 100svh; overflow: hidden;
  background: var(--noise), radial-gradient(120% 70% at 50% 0%, var(--navy-3) 0%, var(--navy) 45%, var(--navy-2) 100%);
  box-shadow: 0 0 80px rgba(0, 0, 0, .5);
}
.stage::before { /* faint route lines */
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background:
    radial-gradient(circle at 20% 18%, rgba(201, 164, 90, .12) 0 1px, transparent 2px) 0 0 / 28px 28px;
}

.mono-sm { font: 500 11px/1 var(--mono); letter-spacing: .32em; text-transform: uppercase; }

/* ───────── Intro ───────── */
.intro {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  width: min(100vw, 480px); height: 100svh; z-index: 20;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 64px;
  background: var(--noise), radial-gradient(120% 70% at 50% 10%, var(--navy-3), var(--navy) 50%, var(--navy-2));
  color: var(--cream);
}
.intro-top { text-align: center; color: var(--gold-2); }
.intro-for { font: 400 34px/1 var(--script); color: var(--cream); margin-top: 12px; }
.intro-hint { margin-top: -30px; font: 400 12px var(--mono); letter-spacing: .3em; text-transform: uppercase; color: var(--gold-2); opacity: .8; animation: blink 2.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .3; } }

.wallet { position: relative; width: 270px; height: 340px; perspective: 900px; }
.wallet-back {
  position: absolute; inset: 0; border-radius: 22px;
  background: linear-gradient(160deg, #213861, #142544);
  box-shadow: 0 30px 60px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.peek {
  position: absolute; left: 22px; right: 22px; top: -30px; height: 200px;
  border-radius: 14px; background: var(--paper); color: var(--ink); padding: 16px 16px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, .25);
  animation: peekUp 1.4s var(--spring) both .3s;
}
@keyframes peekUp { from { transform: translateY(80px); } }
.peek-head { display: flex; align-items: center; gap: 7px; white-space: nowrap; font: 500 8.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.peek-head .peek-bp { margin-left: auto; color: var(--coral); }
.peek-route { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
.peek-route b { font: 400 34px var(--serif); }
.peek-route i { flex: 1; border-top: 1.5px dashed rgba(28, 39, 66, .35); }
.plane-ico { width: 14px; height: 14px; background: currentColor; -webkit-mask: var(--plane) center / contain no-repeat; mask: var(--plane) center / contain no-repeat; color: var(--coral); }
:root { --plane: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21 16v-2l-8-5V3.5a1.5 1.5 0 0 0-3 0V9l-8 5v2l8-2.5V19l-2 1.5V22l3.5-1 3.5 1v-1.5L13 19v-5.5z'/%3E%3C/svg%3E"); }

.wallet-front {
  position: absolute; left: 0; right: 0; bottom: 0; height: 250px; border-radius: 22px;
  background: linear-gradient(170deg, #1e3459 0%, #15284a 60%, #10203d 100%);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .08);
  display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--gold-2);
}
.wallet-front::before { /* pocket curve */
  content: ''; position: absolute; left: 50%; top: -1px; width: 120px; height: 26px; transform: translateX(-50%);
  border-radius: 0 0 60px 60px; background: rgba(0, 0, 0, .18);
}
.stitch { position: absolute; inset: 10px; border-radius: 15px; border: 1.5px dashed rgba(230, 204, 140, .35); pointer-events: none; }
.emblem { width: 84px; height: 84px; }
.emblem svg { width: 100%; height: 100%; }
.wallet-title { font: 400 22px var(--serif); letter-spacing: .04em; margin-top: 8px; color: var(--gold-2);
  background: linear-gradient(100deg, #b78f43 10%, #f3dea4 40%, #c9a45a 60%, #f0d79a 85%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  background-size: 200% 100%; animation: foil 4s linear infinite; }
@keyframes foil { to { background-position: -200% 0; } }
.wallet-sub { font: 400 10px var(--mono); letter-spacing: .3em; text-transform: uppercase; margin-top: 8px; opacity: .7; }

/* ───────── Pass ───────── */
.pass-screen { position: relative; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 18px 30px; }
.pass {
  position: relative; width: 100%; max-width: 360px; color: var(--ink);
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, .45));
}
.pass-body {
  position: relative; background: var(--paper); border-radius: 18px 18px 0 0; overflow: hidden;
  background-image: var(--noise);
}
.pass-head { display: flex; align-items: center; gap: 8px; padding: 14px 18px; background: var(--navy); color: var(--cream); }
.pass-head .plane-ico { color: var(--gold-2); width: 16px; height: 16px; }
.pass-head .air { font: 400 17px var(--serif); letter-spacing: .02em; }
.pass-head .bp { margin-left: auto; font: 500 9px var(--mono); letter-spacing: .24em; color: var(--gold-2); text-align: right; line-height: 1.5; }
.pass-photo { position: relative; height: 176px; overflow: hidden; }
.pass-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 62%; display: block; filter: saturate(.85) contrast(1.02); }
.pass-photo::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(18, 33, 61, .05) 40%, rgba(251, 246, 234, 1) 100%); }
.names {
  position: absolute; left: 0; right: 0; bottom: 4px; z-index: 1; text-align: center;
  font: 400 40px/1 var(--script); color: var(--navy);
}
.names span { color: var(--coral); font-size: 30px; padding: 0 4px; }

.route { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 6px; padding: 10px 20px 6px; }
.route .code { font: 400 46px/1 var(--serif); letter-spacing: .01em; }
.route .city { font: 500 9px var(--mono); letter-spacing: .24em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.route .to { text-align: right; }
.route svg { width: 100%; height: 52px; overflow: visible; align-self: center; margin-bottom: 10px; }
.route .flight-path { fill: none; stroke: var(--coral); stroke-width: 1.6; stroke-dasharray: 2 5; stroke-linecap: round; }
.route .end-dot { fill: var(--coral); }

.fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 10px; padding: 12px 20px 18px; }
.field label { display: block; font: 500 8.5px var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.field b { display: block; font: 500 14px/1.25 var(--mono); margin-top: 3px; color: var(--ink); }
.field.wide { grid-column: span 2; }
.field b.accent { color: var(--coral); }

.perf { position: relative; height: 22px; background: var(--paper); background-image: var(--noise); }
.perf::before { content: ''; position: absolute; left: 16px; right: 16px; top: 50%; border-top: 2px dashed rgba(28, 39, 66, .22); }
.perf::after, .perf .n2 { content: ''; position: absolute; top: 50%; width: 22px; height: 22px; border-radius: 50%; background: var(--navy); transform: translateY(-50%); }
.perf::after { left: -11px; }
.perf .n2 { right: -11px; }
.perf .scissors { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--paper); padding: 0 8px; font: 500 9px var(--mono); letter-spacing: .2em; color: var(--muted); text-transform: uppercase; }

.stub {
  position: relative; background: var(--paper); background-image: var(--noise); border-radius: 0 0 18px 18px;
  padding: 12px 20px 18px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px;
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; transform-origin: 0 0;
}
.stub:active { cursor: grabbing; }
.stub .mini { display: flex; gap: 18px; white-space: nowrap; }
.stub .mini b { font-size: 13px; }
.stub .barcode { width: 100%; height: 46px; margin-top: 10px; display: block; }
.stub .seal {
  width: 64px; height: 64px; border-radius: 50%; border: 1.5px solid var(--coral); color: var(--coral);
  display: flex; align-items: center; justify-content: center; flex-direction: column; transform: rotate(-12deg);
  font: 500 8px/1.4 var(--mono); letter-spacing: .14em; text-align: center; text-transform: uppercase;
}
.stub .seal b { font: 400 18px/1 var(--script); letter-spacing: 0; text-transform: none; }
.torn-edge { display: none; height: 10px; background: var(--paper); margin-top: -1px;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 12px 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 12px 100%; }
.pass.torn .torn-edge { display: block; }
.pass.torn .perf .scissors { display: none; }
.pass.torn .perf::before { display: none; }
.pass.torn .perf::after, .pass.torn .perf .n2 { display: none; }
.pass.torn .perf { height: 6px; }

.tear-hint { margin-top: 22px; white-space: nowrap; font: 400 10px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--gold-2); display: flex; align-items: center; gap: 10px; opacity: .85; transition: opacity .4s; }
.tear-hint .arrow { width: 14px; height: 14px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(5px) rotate(45deg); } }
.pass.torn ~ .tear-hint { opacity: 0; }

/* ───────── Itinerary ───────── */
.itinerary { position: relative; padding: 0 14px 60px; }
.doc {
  position: relative; background: var(--paper); background-image: var(--noise); border-radius: 20px; padding: 34px 22px 40px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
}
.doc + .doc { margin-top: 18px; }
.eyebrow { display: flex; align-items: center; gap: 10px; font: 500 10px var(--mono); letter-spacing: .26em; text-transform: uppercase; color: var(--coral); }
.eyebrow::after { content: ''; flex: 1; border-top: 1.5px dashed rgba(28, 39, 66, .18); }
.doc h2 { font: 400 32px/1.1 var(--serif); margin: 14px 0 12px; color: var(--navy); }
.doc h2 em { font-style: italic; color: var(--coral); }
.doc p { font-size: 16px; line-height: 1.6; color: #3d465f; }

.welcome { text-align: center; padding-top: 40px; }
.welcome .eyebrow { justify-content: center; }
.welcome .eyebrow::after { display: none; }
.welcome .script { font: 400 50px/1 var(--script); color: var(--coral); margin: 8px 0 4px; }

/* Split-flap board */
.board { background: #0b1222; border-radius: 16px; padding: 18px 14px 16px; color: #f2e9d6; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05), 0 18px 40px rgba(0, 0, 0, .4); }
.board-top { display: flex; justify-content: space-between; align-items: center; font: 500 10px var(--mono); letter-spacing: .26em; color: var(--gold-2); text-transform: uppercase; }
.board-top .lamp { width: 8px; height: 8px; border-radius: 50%; background: #5fd38a; box-shadow: 0 0 8px #5fd38a; animation: blink 1.8s infinite; }
.board-rows { margin-top: 14px; display: grid; gap: 8px; }
.brow { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 8px; }
.brow > label { font: 500 8.5px var(--mono); letter-spacing: .2em; color: rgba(242, 233, 214, .5); text-transform: uppercase; }
.flaps { display: flex; gap: 2px; flex-wrap: wrap; }
.cell {
  position: relative; width: 18px; height: 26px; border-radius: 3px; perspective: 200px;
  font: 500 16px/26px var(--mono); text-align: center; color: #f6eedb;
}
.cell .h { position: absolute; left: 0; right: 0; height: 50%; overflow: hidden; background: #1a2338; backface-visibility: hidden; }
.cell .h span { display: block; height: 26px; }
.cell .t { top: 0; border-radius: 3px 3px 0 0; transform-origin: 50% 100%; }
.cell .b { bottom: 0; border-radius: 0 0 3px 3px; transform-origin: 50% 0; background: #182033; }
.cell .b span { transform: translateY(-13px); }
.cell::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(0, 0, 0, .7); z-index: 3; }
.cell.big { width: 27px; height: 42px; font-size: 25px; line-height: 42px; border-radius: 4px; }
.cell.big .h span { height: 42px; }
.cell.big .b span { transform: translateY(-21px); }


.cd { display: flex; justify-content: center; gap: 4px; margin-top: 18px; }
.cd-unit { text-align: center; }
.cd-unit .flaps { justify-content: center; }
.cd-unit small { display: block; margin-top: 7px; font: 500 8.5px var(--mono); letter-spacing: .22em; text-transform: uppercase; color: rgba(242, 233, 214, .55); }
.cd-colon { width: 10px; text-align: center; font: 500 20px/42px var(--mono); color: rgba(242, 233, 214, .4); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 26px; border-radius: 999px; text-decoration: none;
  font: 500 11px var(--mono); letter-spacing: .24em; text-transform: uppercase;
  background: var(--navy); color: var(--cream); transition: transform .2s, background .3s;
}
.btn:active { transform: scale(.97); }
.btn.coral { background: var(--coral); color: #fff; }
.btn.ghost { background: transparent; color: var(--navy); box-shadow: inset 0 0 0 1.5px var(--navy); }
.board .btn.ghost { color: var(--gold-2); box-shadow: inset 0 0 0 1px rgba(230, 204, 140, .5); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; justify-content: center; }

/* Schedule */
.sched { position: relative; margin-top: 20px; }
.sched::before { content: ''; position: absolute; left: 76px; top: 8px; bottom: 8px; border-left: 1.5px dashed rgba(212, 99, 63, .45); }
.srow { position: relative; display: grid; grid-template-columns: 66px 1fr; gap: 26px; padding: 10px 0 14px; }
.srow .time { font: 500 13px var(--mono); color: var(--navy); text-align: right; padding-top: 3px; white-space: nowrap; }
.srow .dot { position: absolute; left: 70px; top: 13px; width: 14px; height: 14px; color: var(--coral); background: var(--paper); }
.srow .dot .plane-ico { width: 14px; height: 14px; transform: rotate(180deg); display: block; }
.srow h3 { font: 400 20px/1.2 var(--serif); color: var(--navy); }
.srow p { font-size: 14.5px; line-height: 1.5; margin-top: 3px; }

/* Airplane window photo */
.window-wrap { display: flex; justify-content: center; padding: 26px 0 8px; }
.window {
  position: relative; width: 230px; aspect-ratio: 3 / 4.1; border-radius: 115px / 140px; padding: 16px;
  background: linear-gradient(145deg, #f1ece2, #d9d2c3 60%, #cfc6b4);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35), inset 0 2px 3px rgba(255, 255, 255, .8), inset 0 -3px 6px rgba(0, 0, 0, .12);
}
.window .pane { position: relative; width: 100%; height: 100%; border-radius: 100px / 124px; overflow: hidden; box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .08), inset 0 6px 14px rgba(0, 0, 0, .35); }
.window img { width: 100%; height: 100%; object-fit: cover; display: block; }
.window .blind {
  position: absolute; inset: 0; z-index: 1;
  background: repeating-linear-gradient(180deg, #ece6da 0 10px, #e2dbcd 10px 11px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .25);
  transform: translateY(0); transition: transform 1.6s var(--ease) .3s;
}
.window .blind::after { content: ''; position: absolute; left: 50%; bottom: 10px; width: 38px; height: 6px; margin-left: -19px; border-radius: 3px; background: #c9c0ae; }
.window.in .blind { transform: translateY(-88%); }
.window .glare { position: absolute; inset: 0; z-index: 2; background: linear-gradient(120deg, rgba(255, 255, 255, .28) 0 18%, transparent 30%); pointer-events: none; }
.window-cap { text-align: center; font: 400 26px var(--script); color: var(--cream); margin-top: 14px; }
.window-cap small { display: block; font: 500 9px var(--mono); letter-spacing: .3em; text-transform: uppercase; color: var(--gold-2); margin-top: 6px; }

/* Destination */
.dest { position: relative; }
.dest .addr { font: 500 14px/1.6 var(--mono); color: var(--navy); margin-top: 6px; }
.stamp { position: absolute; right: 10px; top: 54px; width: 116px; height: 116px; opacity: 0; transform: scale(1.8) rotate(-30deg); transition: opacity .35s ease, transform .5s cubic-bezier(.3, 1.6, .5, 1); }
.stamp.in { opacity: .82; transform: scale(1) rotate(-14deg); }
.stamp svg { width: 100%; height: 100%; }

/* Baggage */
.bag-list { margin-top: 16px; display: grid; gap: 10px; }
.bag { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1.5px dashed rgba(28, 39, 66, .2); }
.bag b { font: 500 17px var(--mono); color: var(--coral); text-align: center; }
.bag span { font-size: 15px; color: #3d465f; }
.tag {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; padding: 8px 14px 8px 22px; position: relative;
  background: var(--coral); color: #fff; font: 500 10px var(--mono); letter-spacing: .2em; text-transform: uppercase;
  border-radius: 4px 8px 8px 4px; clip-path: polygon(10px 0, 100% 0, 100% 100%, 10px 100%, 0 50%);
}
.tag::before { content: ''; position: absolute; left: 10px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--paper); }

/* Photos */
.photo-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 4px; }
.photo-pair figure { border-radius: 12px; overflow: hidden; aspect-ratio: 3 / 4; }
.photo-pair figure:nth-child(2) { transform: translateY(24px); }
.photo-pair img, .wide-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wide-photo { border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 10; margin-top: 18px; }

/* Check-in */
.checkin { text-align: center; background: var(--navy); color: var(--cream); }
.checkin .eyebrow { justify-content: center; color: var(--gold-2); }
.checkin .eyebrow::after { display: none; }
.checkin h2 { color: var(--cream); }
.checkin p { color: rgba(245, 238, 223, .75); }
.checkin .btn.ghost { color: var(--cream); box-shadow: inset 0 0 0 1.5px rgba(245, 238, 223, .5); }
.checkin .barcode { width: 220px; height: 40px; margin: 26px auto 0; display: block; opacity: .9; }
.sign { text-align: center; color: var(--gold-2); padding: 38px 20px 10px; font: 400 26px var(--script); }
.sign small { display: block; font: 500 9px var(--mono); letter-spacing: .3em; color: rgba(230, 204, 140, .6); margin-top: 8px; text-transform: uppercase; }

[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }

.music-btn {
  position: fixed; right: max(16px, calc(50vw - 240px + 16px)); bottom: 18px; z-index: 30;
  width: 44px; height: 44px; border-radius: 50%; background: rgba(245, 238, 223, .9); color: var(--navy);
}
.music-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.4; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}
.status .cell { color: #7fe0a0; }
