/* Nomad Joe Apps — curtain teaser */
:root { --serif: "Instrument Serif", Georgia, "Times New Roman", serif; --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; --gold: #D9B25F; --gold2: #F3DB9A; --gold3: #8E6A22; --crimson: #7A0F1E; --stage: #0B0708; }
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body.teaser { margin: 0; font-family: var(--sans); line-height: 1.5; -webkit-font-smoothing: antialiased; background: var(--stage); color: #F4EBDD; overflow-x: hidden; min-height: 100svh; }
body.teaser[data-stage="before"], body.teaser[data-stage="playing"] { overflow: hidden; height: 100svh; }
.teaser :focus-visible { outline: 3px solid var(--gold2); outline-offset: 3px; }

/* ---------- Theatre ---------- */

.final-bg { position: fixed; inset: 0; z-index: 0; background: var(--stage) url(../assets/tease/plate.webp?v=1) center / cover no-repeat; }
.theatre { position: relative; z-index: 1; isolation: isolate; width: 100%; min-height: 100svh; display: flex; flex-direction: column; opacity: 0; visibility: hidden; text-shadow: 0 1px 3px #000, 0 0 16px #000a; transition: opacity 1.4s ease, visibility 0s linear 1.4s; }
body[data-stage="end"] .theatre { opacity: 1; visibility: visible; transition: opacity 1.4s ease; }
body[data-phase="before"][data-stage="end"]:not([data-reveal]) .theatre { transition: none; }

body[data-phase="before"][data-reveal][data-stage="end"] .theatre { transition: opacity .9s ease; }
body[data-phase="before"][data-reveal][data-stage="end"] .theatre-main { animation: tease-drop .9s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes tease-drop { from { opacity: 0; transform: translateY(-28px); } to { opacity: 1; transform: none; } }
.theatre::before { content: ""; position: fixed; inset: 0; z-index: -1; background: radial-gradient(ellipse 80% 70% at 50% 45%, #0A0407B8 0%, #0A04078F 60%, #0A0407B0 100%); }
.theatre-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; text-align: center; width: 100%; max-width: 1100px; margin: 0 auto; padding: 40px max(24px, 10vw) 24px; }
.teaser h1#teaser-heading { margin: 0; font: 600 13px/16px var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--gold); outline: none; }
.teaser .serif { font-family: var(--serif); font-weight: 400; }
.teaser-line { margin: 0; min-height: 3.3em; display: flex; align-items: center; justify-content: center; font: 400 clamp(34px, 6.4vw, 68px)/1.1 var(--serif); letter-spacing: -.01em; color: #FBF3E4; transition: opacity .6s ease; text-wrap: balance; }
.teaser-line.fade { opacity: 0; }
.arrival { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.arrival-head { margin: 0; font: 600 clamp(16px, 2.4vw, 20px)/1.3 var(--sans); color: var(--gold2); }
.arrival-local { margin: 0; font-size: 14px; color: #D8C7B1; }
.countdown { display: flex; gap: 12px; margin-top: 6px; }
.countdown div { min-width: 64px; padding: 10px 8px; border: 1px solid #5B3A20; border-radius: 12px; background: #1B0E10; }
.countdown b { display: block; font: 400 34px/1 var(--serif); font-variant-numeric: tabular-nums; color: #FBF3E4; }
.countdown span { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #D8C7B1; }
.notify { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.btn-gold { display: inline-flex; align-items: center; min-height: 48px; padding: 0 28px; border-radius: 999px; background: linear-gradient(180deg, var(--gold2), var(--gold) 55%, var(--gold3)); color: #2A0B10; font: 700 16px/1 var(--sans); text-decoration: none; box-shadow: 0 8px 24px #0009; }
.btn-gold:hover { filter: brightness(1.08); }
.notify p { margin: 0; font-size: 13px; line-height: 20px; color: #D8C7B1; max-width: 380px; }

.teaser [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.countdown-label { margin: 0; max-width: 460px; font: 600 15px/1.4 var(--sans); color: var(--gold2); }
.countdown-note { margin: 0; max-width: 460px; font: 600 15px/1.4 var(--sans); color: var(--gold2); }

@media (max-width: 600px) {
  .theatre-main { gap: 22px; padding-left: 24px; padding-right: 24px; }
  .countdown { gap: 8px; } .countdown div { min-width: 58px; }
  .countdown b { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .theatre, body[data-stage="end"] .theatre { transition: none; }
}

/* ---------- Phones / portrait: show the WHOLE 736x400 frame (contain) over a blurred copy of itself ---------- */
@media (max-width: 700px), (orientation: portrait) and (max-width: 900px) {
  :root { --ft: 8px; --fh: calc(100vw * 400 / 736); --fb: calc(var(--ft) + var(--fh)); }
  /* end state: blurred cover copy behind, sharp contained frame on top */
  .final-bg { background: var(--stage); overflow: hidden; }
  .final-bg::before { content: ""; position: absolute; inset: -40px; background: url(../assets/tease/plate.webp?v=1) center / cover no-repeat; filter: blur(22px) brightness(.7) saturate(1.1); transform: scale(1.15); }
  .final-bg::after { content: ""; position: absolute; left: 0; right: 0; top: var(--ft); height: var(--fh); background: url(../assets/tease/plate.webp?v=1) center / contain no-repeat; }
  
  body[data-phase="before"] { --fh: calc(100vw * 9 / 16); --fb: calc(var(--ft) + var(--fh)); }
  /* scrim: clear over the frame, darker behind the copy */
  .theatre::before { background: linear-gradient(180deg, #0A040700 0, #0A040700 var(--fb), #0A0407A6 calc(var(--fb) + 22px), #0A0407D0 100%); }
  .theatre-main { justify-content: flex-start; padding-top: calc(var(--fb) + 14px); }
}

/* ---------- Footer: full-width solid bar with the affiliation disclaimer ---------- */
.teaser-foot { position: relative; width: 100%; margin: 0; padding: 10px max(16px, 4vw) max(10px, env(safe-area-inset-bottom)); background: #1B0E10; border-top: 2px solid var(--gold); text-align: center; text-shadow: none; color: #F3E6CF; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.teaser-foot .foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 14px; font-size: 13px; line-height: 1.4; color: #F3E6CF; }
.teaser-foot a { color: var(--gold2); text-decoration: underline; text-underline-offset: 2px; }
.teaser-foot .foot-disclaimer { margin: 0; max-width: 1280px; padding-top: 6px; border-top: 1px solid #5B3A20; font-size: 13px; line-height: 1.4; color: #F3E6CF; }
@media (max-width: 700px) {
  .teaser-foot { padding-top: 6px; gap: 3px; }
  .teaser-foot .foot-links { font-size: 11.5px; line-height: 1.3; gap: 0 10px; }
  .teaser-foot .foot-disclaimer { font-size: 11px; line-height: 1.3; padding-top: 3px; }
}
@media (min-width: 701px) { .teaser-foot { padding-top: 14px; } .teaser-foot .foot-disclaimer { font-size: 14px; } }
/* Short phones (375x667): compact stack so the disclaimer bar fits */
@media (max-width: 700px) and (max-height: 700px) {
  .teaser-foot { border-top-width: 1px; padding-top: 4px; padding-bottom: max(5px, env(safe-area-inset-bottom)); gap: 2px; }
  .teaser-foot .foot-links { font-size: 11px; line-height: 1.2; }
  .teaser-foot .foot-disclaimer { line-height: 1.25; padding-top: 2px; }
}

/* ---------- Curtain tease (before phase only; layered still images) ---------- */

.tease { display: none; position: fixed; inset: 0; z-index: 40; }
body[data-phase="before"]:is([data-stage="before"], [data-stage="playing"]) .tease { display: block; }
.tease-view { position: absolute; inset: 0; overflow: hidden; container-type: size; pointer-events: none; }
.tease-rig { --rw: max(100vw, calc(100vh * 16 / 9)); --rw: max(100cqw, calc(100cqh * 16 / 9)); --u: calc(var(--rw) / 1280); position: absolute; left: 50%; top: 50%; width: var(--rw); aspect-ratio: 16 / 9; transform: translate(-50%, -50%); }
.tease-stack { position: absolute; inset: 0; opacity: 0; }
.tl { position: absolute; display: block; max-width: none; height: auto; left: calc(var(--u) * var(--x)); top: calc(var(--u) * var(--y)); width: calc(var(--u) * var(--w)); pointer-events: none; user-select: none; -webkit-user-drag: none; will-change: transform; }
.tl-gap { --x: 560; --y: 100; --w: 190; }
.tl-left { --x: 40; --y: 100; --w: 610; transform-origin: 0 0; }
.tl-right { --x: 630; --y: 100; --w: 610; transform-origin: 0 0; }
.tl-pal { --x: 673.25; --y: 490.5; --w: 77.5; transform-origin: 50% calc(100% - var(--u) * 1.5); }
.tl-rope { --x: 478; --y: -170; --w: 84; }
.tl-point { --x: 500; --y: 125; --w: 200; transform-origin: calc(var(--u) * 170) calc(var(--u) * 240); }
.tl-grip { --x: 470; --y: 235; --w: 230; }
.tl-rope-b { opacity: 0; }

.tease[data-tease] .tease-stack { animation: tz-stack 5.5s linear both; }
.tease[data-tease] .tl-left { animation: tz-left 5.5s linear both; }
.tease[data-tease] .tl-right { animation: tz-right 5.5s linear both; }
.tease[data-tease] .tl-pal { animation: tz-pal 5.5s linear both; }
.tease[data-tease] .tl-rope-a { animation: tz-rope-a 5.5s linear both; }
.tease[data-tease] .tl-rope-b { animation: tz-rope-b 5.5s linear both; }
.tease[data-tease] .tl-point { animation: tz-point 5.5s linear both; }
.tease[data-tease] .tl-grip { animation: tz-grip 5.5s linear both; }
.tl-point, .tl-grip { transform: translateX(calc(var(--u) * 200)); }
.tl-pal { transform: translateX(calc(var(--u) * 46)); }

.tease-hit { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tease-hit :focus-visible, .tease-hit:focus-visible { outline: 3px solid var(--gold2); outline-offset: -6px; }
.tease[data-tease] .tease-hint { display: none; }
.tease-hint { position: absolute; left: 50%; bottom: max(7vh, calc(env(safe-area-inset-bottom) + 28px)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; color: var(--gold2); font: 600 11px/1 var(--sans); letter-spacing: .26em; text-transform: uppercase; text-shadow: 0 1px 3px #000, 0 0 12px #000; opacity: .9; }
.tease-hint i { position: relative; display: block; width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--gold); background: radial-gradient(circle, var(--gold2) 0 3px, #D9B25F22 4px 100%); box-shadow: 0 0 14px #D9B25F55; }
.tease-hint i::after { content: ""; position: absolute; inset: -1.5px; border-radius: 50%; border: 1.5px solid var(--gold); animation: tease-ping 2.6s ease-out infinite; }
@keyframes tease-ping { 0% { transform: scale(1); opacity: .7; } 70%, 100% { transform: scale(1.9); opacity: 0; } }
.tease-skip { position: absolute; top: max(14px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right)); z-index: 2; min-width: 76px; min-height: 48px; padding: 0 24px; border-radius: 999px; background: #0B0708E6; border: 2px solid var(--gold); color: var(--gold2); font: 700 15px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; box-shadow: 0 4px 18px #000c; -webkit-tap-highlight-color: transparent; }
.tease-skip:hover { background: #2A0B10; }
.tease-skip[hidden] { display: none; }
@media (max-width: 700px), (orientation: portrait) and (max-width: 900px) {
  /* phones: the whole 16:9 stage is contained at the top (same frame as the closed-plate backdrop), hint sits below it */
  .tease-view { inset: var(--ft) 0 auto 0; height: var(--fh); }
  .tease-rig { --rw: 100cqw; }
  .tease-hint { bottom: auto; top: calc(var(--fb) + 40px); }
  .tease-skip { top: calc(var(--fb) + 14px); }   /* below the frame, not over the art */
}
@media (prefers-reduced-motion: reduce) { .tease-hint i::after { animation: none; opacity: 0; } }

@keyframes tz-stack {
  0% { opacity: 0; animation-timing-function: cubic-bezier(.22,.8,.3,1); }
  2.727% { opacity: 1; animation-timing-function: linear; }
  90.909% { opacity: 1; animation-timing-function: linear; }
  99.091% { opacity: 0; animation-timing-function: linear; }
  100% { opacity: 0; animation-timing-function: linear; }
}
@keyframes tz-left {
  0% { transform: translateX(calc(var(--u) * 6)) skewX(6.84deg); animation-timing-function: cubic-bezier(.22,.8,.3,1); }
  15.455% { transform: translateX(calc(var(--u) * 0)) skewX(0deg); animation-timing-function: linear; }
  66.364% { transform: translateX(calc(var(--u) * 0)) skewX(0deg); animation-timing-function: cubic-bezier(.45,0,.25,1); }
  79.091% { transform: translateX(calc(var(--u) * 6)) skewX(6.84deg); animation-timing-function: linear; }
  100% { transform: translateX(calc(var(--u) * 6)) skewX(6.84deg); animation-timing-function: linear; }
}
@keyframes tz-right {
  0% { transform: translateX(calc(var(--u) * -6)) skewX(-6.84deg); animation-timing-function: cubic-bezier(.22,.8,.3,1); }
  15.455% { transform: translateX(calc(var(--u) * 0)) skewX(0deg); animation-timing-function: linear; }
  66.364% { transform: translateX(calc(var(--u) * 0)) skewX(0deg); animation-timing-function: cubic-bezier(.45,0,.25,1); }
  79.091% { transform: translateX(calc(var(--u) * -102)) skewX(-6.84deg); animation-timing-function: linear; }
  86.364% { transform: translateX(calc(var(--u) * -102)) skewX(-6.84deg); animation-timing-function: cubic-bezier(.45,0,.25,1); }
  94.545% { transform: translateX(calc(var(--u) * -6)) skewX(-6.84deg); animation-timing-function: linear; }
  100% { transform: translateX(calc(var(--u) * -6)) skewX(-6.84deg); animation-timing-function: linear; }
}
@keyframes tz-point {
  0% { transform: translate(calc(var(--u) * 200), calc(var(--u) * 0)) rotate(0deg); opacity: 0; animation-timing-function: linear; }
  2.909% { transform: translate(calc(var(--u) * 200), calc(var(--u) * 0)) rotate(0deg); opacity: 1; animation-timing-function: linear; }
  8.182% { transform: translate(calc(var(--u) * 200), calc(var(--u) * 0)) rotate(0deg); opacity: 1; animation-timing-function: cubic-bezier(.22,.8,.3,1); }
  15.455% { transform: translate(calc(var(--u) * 0), calc(var(--u) * 0)) rotate(0deg); animation-timing-function: cubic-bezier(.45,0,.25,1); }
  18.182% { transform: translate(calc(var(--u) * 0), calc(var(--u) * 0)) rotate(-8deg); animation-timing-function: cubic-bezier(.45,0,.25,1); }
  21.818% { transform: translate(calc(var(--u) * 0), calc(var(--u) * 0)) rotate(8deg); animation-timing-function: cubic-bezier(.45,0,.25,1); }
  25.455% { transform: translate(calc(var(--u) * 0), calc(var(--u) * 0)) rotate(-8deg); animation-timing-function: cubic-bezier(.45,0,.25,1); }
  29.091% { transform: translate(calc(var(--u) * 0), calc(var(--u) * 0)) rotate(8deg); animation-timing-function: cubic-bezier(.45,0,.25,1); }
  32.727% { transform: translate(calc(var(--u) * 0), calc(var(--u) * 0)) rotate(-8deg); animation-timing-function: cubic-bezier(.45,0,.25,1); }
  36.364% { transform: translate(calc(var(--u) * 0), calc(var(--u) * 0)) rotate(8deg); animation-timing-function: cubic-bezier(.45,0,.25,1); }
  42.727% { transform: translate(calc(var(--u) * 0), calc(var(--u) * 0)) rotate(0deg); animation-timing-function: cubic-bezier(.5,0,.9,.6); }
  48.182% { transform: translate(calc(var(--u) * 200), calc(var(--u) * 0)) rotate(0deg); animation-timing-function: linear; }
  100% { transform: translate(calc(var(--u) * 200), calc(var(--u) * 0)) rotate(0deg); animation-timing-function: linear; }
}
@keyframes tz-grip {
  0% { transform: translate(calc(var(--u) * 200), calc(var(--u) * 0)) rotate(0deg); opacity: 0; animation-timing-function: linear; }
  2.909% { transform: translate(calc(var(--u) * 200), calc(var(--u) * 0)) rotate(0deg); opacity: 1; animation-timing-function: linear; }
  45.455% { transform: translate(calc(var(--u) * 200), calc(var(--u) * 0)) rotate(0deg); animation-timing-function: cubic-bezier(.22,.8,.3,1); }
  53.636% { transform: translate(calc(var(--u) * 0), calc(var(--u) * 0)) rotate(0deg); animation-timing-function: linear; }
  54.545% { transform: translate(calc(var(--u) * 0), calc(var(--u) * 0)) rotate(0deg); animation-timing-function: cubic-bezier(.45,0,.25,1); }
  66.364% { transform: translate(calc(var(--u) * 0), calc(var(--u) * 64)) rotate(0deg); animation-timing-function: linear; }
  78.182% { transform: translate(calc(var(--u) * 0), calc(var(--u) * 64)) rotate(0deg); animation-timing-function: cubic-bezier(.5,0,.9,.6); }
  85.455% { transform: translate(calc(var(--u) * 200), calc(var(--u) * 64)) rotate(0deg); animation-timing-function: linear; }
  100% { transform: translate(calc(var(--u) * 200), calc(var(--u) * 64)) rotate(0deg); animation-timing-function: linear; }
}
@keyframes tz-rope-a {
  0% { transform: translateY(calc(var(--u) * -640)); opacity: 1; animation-timing-function: linear; }
  2.727% { transform: translateY(calc(var(--u) * -640)); opacity: 1; animation-timing-function: cubic-bezier(.3,1.25,.5,1); }
  13.636% { transform: translateY(0); opacity: 1; animation-timing-function: linear; }
  51.818% { transform: translateY(0); opacity: 1; animation-timing-function: linear; }
  54.545% { transform: translateY(0); opacity: 0; animation-timing-function: linear; }
  100% { transform: translateY(0); opacity: 0; animation-timing-function: linear; }
}
@keyframes tz-rope-b {
  0% { transform: translateY(0); opacity: 0; animation-timing-function: linear; }
  51.818% { transform: translateY(0); opacity: 0; animation-timing-function: linear; }
  54.545% { transform: translateY(0); opacity: 1; animation-timing-function: cubic-bezier(.45,0,.25,1); }
  66.364% { transform: translateY(calc(var(--u) * 64)); opacity: 1; animation-timing-function: linear; }
  80% { transform: translateY(calc(var(--u) * 64)); opacity: 1; animation-timing-function: cubic-bezier(.5,0,.9,.6); }
  90% { transform: translateY(calc(var(--u) * -560)); opacity: 1; animation-timing-function: linear; }
  100% { transform: translateY(calc(var(--u) * -560)); opacity: 1; animation-timing-function: linear; }
}
@keyframes tz-pal {
  0% { transform: translateX(calc(var(--u) * 46)) rotate(0deg); opacity: 0; animation-timing-function: linear; }
  2.909% { transform: translateX(calc(var(--u) * 46)) rotate(0deg); opacity: 1; animation-timing-function: linear; }
  12.727% { transform: translateX(calc(var(--u) * 46)) rotate(0deg); animation-timing-function: cubic-bezier(.22,.8,.3,1); }
  20.909% { transform: translateX(calc(var(--u) * 0)) rotate(-22deg); animation-timing-function: linear; }
  39.091% { transform: translateX(calc(var(--u) * 0)) rotate(-22deg); animation-timing-function: cubic-bezier(.45,0,.25,1); }
  44.545% { transform: translateX(calc(var(--u) * 8)) rotate(-15deg); animation-timing-function: linear; }
  55.455% { transform: translateX(calc(var(--u) * 8)) rotate(-15deg); animation-timing-function: cubic-bezier(.5,0,.9,.6); }
  66.364% { transform: translateX(calc(var(--u) * 46)) rotate(0deg); animation-timing-function: linear; }
  100% { transform: translateX(calc(var(--u) * 46)) rotate(0deg); animation-timing-function: linear; }
}
