@font-face {
  font-family: 'Outfit';
  src: url('assets/outfit.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --navy: #000918; --navy2: #061633; --card: rgba(18, 44, 96, .38); --blue: #0066F5; --sky: #1AB9FF; --cyan: #22FFFF;
  --ink: #F2F7FF; --muted: #9DB0CF; --soft: #C9D7EE; --line: rgba(150, 190, 255, .16);
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.22, 1, .36, 1); --spring: cubic-bezier(.34, 1.56, .64, 1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--navy); color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--ink);
  font: 400 16px/1.45 'Outfit', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--navy); overscroll-behavior-y: none; -webkit-font-smoothing: antialiased;
}
body.noscroll { overflow: hidden; }
[hidden] { display: none !important; }      /* .btn and other display rules must not show hidden things */
button, a.btn { font: inherit; color: inherit; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 12px; }
svg { display: block; }

/* background: deep navy with two slow glows */
.bg { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.bg i { position: absolute; border-radius: 50%; opacity: .6; }
.bg .g1 { width: 130vmax; height: 130vmax; left: -40vmax; top: -78vmax; background: radial-gradient(closest-side, rgba(0, 102, 245, .5), rgba(0, 102, 245, 0)); }
.bg .g2 { width: 100vmax; height: 100vmax; right: -52vmax; bottom: -62vmax; background: radial-gradient(closest-side, rgba(34, 255, 255, .2), rgba(34, 255, 255, 0)); }

main { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.screen { display: none; }
.screen.active { display: flex; animation: screenIn .45s var(--ease); }
@keyframes screenIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes rise { to { opacity: 1; transform: none; } }
.rise { opacity: 0; transform: translateY(12px); animation: rise .8s var(--ease) forwards; }

/* ---------- home ---------- */
#home {
  flex: 1; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: calc(var(--safe-t) + 18px) 20px 10px;
}
.chip { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 500;
  color: var(--soft); background: var(--card); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 0 rgba(34, 255, 255, .7); animation: ping 2.4s ease-out infinite; }
@keyframes ping { 70%, 100% { box-shadow: 0 0 0 7px rgba(34, 255, 255, 0); } }
.event-chip { opacity: 0; transform: translateY(-6px); animation: rise .7s var(--ease) .1s forwards; }
.hero { width: min(52vw, 220px); margin: 14px 0 12px; }
.logo { width: 100%; aspect-ratio: 760 / 488; }
.logo svg { width: 100%; height: 100%; overflow: visible; }
.logo .head { mix-blend-mode: screen; }
.letters { display: block; width: 86.7%; height: auto; margin: 7% auto 0; opacity: 0; transform: translateY(8px); filter: drop-shadow(0 4px 14px rgba(0, 102, 245, .45));
  animation: rise .7s var(--ease) 2.2s forwards; }
.title { margin: 0; display: flex; flex-direction: column; align-items: center; line-height: 1; opacity: 0; transform: translateY(10px); animation: rise .8s var(--ease) .3s forwards; }
.t-find { font-size: clamp(46px, 13.5vw, 64px); font-weight: 700; letter-spacing: -.025em; padding-bottom: .06em;
  background: linear-gradient(100deg, #fff 25%, var(--sky) 65%, var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.t-by { margin-top: 6px; font-size: 13px; font-weight: 600; letter-spacing: .38em; text-transform: uppercase; color: var(--sky); padding-left: .38em; }
.lead { margin: 12px 0 20px; max-width: 320px; color: var(--soft); font-size: 17px; line-height: 1.4; text-wrap: balance; opacity: 0; transform: translateY(10px); animation: rise .8s var(--ease) .45s forwards; }

.cta {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  width: min(100%, 340px); height: 62px; border: 0; border-radius: 999px; padding: 0 28px;
  font-size: 19px; font-weight: 600; letter-spacing: .01em; color: #fff;
  background: linear-gradient(100deg, var(--blue), #1597ff 55%, var(--sky));
  box-shadow: 0 12px 34px -10px rgba(0, 102, 245, .85), inset 0 1px 0 rgba(255, 255, 255, .28);
  overflow: hidden; opacity: 0; transform: translateY(10px) scale(.98);
  animation: rise .8s var(--ease) .58s forwards;
  transition: transform .15s var(--ease), box-shadow .2s;
}
.cta svg { width: 26px; height: 26px; flex: none; }
.cta::after { content: ''; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .42) 50%, transparent 70%); animation: sheen 7s ease-in-out 2.8s infinite; }
@keyframes sheen { 0% { transform: translateX(-120%); } 16%, 100% { transform: translateX(120%); } }
.cta:active { transform: scale(.97) !important; transition: transform .1s ease-out; }
.cta:disabled { filter: grayscale(.7); opacity: .6; }

.steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: min(100%, 360px); margin: 18px 0 0; padding: 0; }
.steps li { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px 10px; border-radius: 16px; background: var(--card); border: 1px solid var(--line);
  font-size: 12.5px; line-height: 1.25; color: var(--soft); opacity: 0; transform: translateY(12px); animation: rise .7s var(--ease) forwards; }
.steps li:nth-child(1) { animation-delay: .75s; } .steps li:nth-child(2) { animation-delay: .85s; } .steps li:nth-child(3) { animation-delay: .95s; }
.steps .ic { font-size: 22px; line-height: 1; }

.privacy { margin: 16px 0 0; max-width: 330px; font-size: 13.5px; color: var(--muted); text-wrap: balance; opacity: 0; animation: rise .8s var(--ease) 1.05s forwards; }
.privacy svg { display: inline-block; width: 14px; height: 14px; margin: 0 6px -2px 0; color: var(--cyan); }

.prep { margin-top: 14px; width: min(100%, 220px); font-size: 12.5px; color: var(--muted); }
.prep .bar { height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .08); overflow: hidden; margin-bottom: 6px; }
.prep .bar i { display: block; height: 100%; width: 100%; transform-origin: left; transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, var(--blue), var(--sky), var(--cyan)); transition: transform .25s linear; }
.prep.done { color: var(--cyan); }
.prep.done .bar { opacity: 0; transition: opacity .5s .3s; }

/* ---------- camera ---------- */
#camera { flex: 1; flex-direction: column; background: #000; height: 100vh; height: 100dvh; }
.cam { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #000; }
.cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.oval-wrap { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.oval { position: relative; width: min(64vw, 300px, 46vh); aspect-ratio: 100 / 130; border-radius: 50%; margin-top: -4%;
  box-shadow: 0 0 0 200vmax rgba(0, 9, 24, .58); transition: transform .3s var(--spring); }
.oval svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.oval .ring { fill: none; stroke: rgba(255, 255, 255, .7); stroke-width: 2; stroke-dasharray: 1.4 1.8; vector-effect: non-scaling-stroke; transition: stroke .2s; }
.oval .arc { fill: none; stroke: var(--cyan); stroke-width: 5; vector-effect: non-scaling-stroke; stroke-linecap: round;
  stroke-dasharray: 100 100; stroke-dashoffset: calc(100 - 100 * var(--f, 0)); transition: stroke-dashoffset .3s var(--ease);
  filter: drop-shadow(0 0 6px rgba(34, 255, 255, .9)); }
.oval.good .ring { stroke: var(--cyan); stroke-dasharray: none; }
.oval.good { transform: scale(1.02); }
/* head turn: two arrows beside the oval nudge outward, then become ticks as each side is caught */
.turn { position: absolute; top: 50%; width: 42px; height: 42px; margin-top: -21px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; background: rgba(0, 9, 24, .42); border: 1px solid rgba(255, 255, 255, .28);
  backdrop-filter: blur(12px) saturate(160%); -webkit-backdrop-filter: blur(12px) saturate(160%);
  opacity: 0; transform: scale(.6); transition: opacity .25s var(--ease), transform .45s var(--spring), background .2s, color .2s; }
.turn-l { left: -58px; } .turn-r { right: -58px; }
.turn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.turn .ck { display: none; }
.oval.turning .turn { opacity: 1; transform: none; }
.oval.turning .turn-l:not(.got) svg { animation: nudge-l .9s var(--ease) infinite alternate; }
.oval.turning .turn-r:not(.got) svg { animation: nudge-r .9s var(--ease) infinite alternate; }
.oval.turning .turn.got { background: var(--cyan); color: var(--navy); border-color: transparent; transform: scale(1.08); }
.turn.got .ch { display: none; } .turn.got .ck { display: block; }
@keyframes nudge-l { to { transform: translateX(-5px); } }
@keyframes nudge-r { to { transform: translateX(5px); } }
#camera.turning .look-here { opacity: 0; }
.look-here { position: absolute; top: calc(var(--safe-t) + 18px); left: 50%; transform: translateX(-50%); margin: 0; padding: 6px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 500; background: rgba(0, 9, 24, .55); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); white-space: nowrap;
  animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translate(-50%, -3px); } }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.flash.on { animation: flash .5s ease-out; }
@keyframes flash { 0% { opacity: .9; } 100% { opacity: 0; } }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(0, 9, 24, .55); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:disabled { opacity: .25; }
.cancel { position: absolute; top: calc(var(--safe-t) + 12px); left: 12px; }
.cam-panel { position: relative; margin-top: -26px; padding: 22px 20px calc(var(--safe-b) + 18px); text-align: center; border-radius: 26px 26px 0 0;
  background: rgba(0, 9, 24, .72); backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-top: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 -12px 36px rgba(0, 0, 0, .35); }
.hint { margin: 0; font-size: 21px; font-weight: 600; min-height: 1.4em; transition: color .2s; }
.hint.pop { animation: pop .35s var(--spring); }
@keyframes pop { from { transform: scale(.94); opacity: .4; } }
.hint[data-state='good'] { color: var(--cyan); }
.hint[data-state='error'] { color: #ffc2b8; font-size: 17px; font-weight: 500; }
.tips { list-style: none; display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; }
.tips li { padding: 5px 11px; border-radius: 999px; font-size: 13px; color: var(--soft); background: var(--card); border: 1px solid var(--line); }
.cam-help { margin-top: 14px; }
.pick { display: block; margin-top: 12px; font-size: 12px; color: var(--muted); }

/* ---------- searching ---------- */
#search { position: relative; flex: 1; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 24px; }
.search-retry { margin-top: 22px; }
.loader { width: min(60vw, 250px); }
.loader .base { opacity: .45; }
.search-text { margin: 30px 0 4px; font-size: 21px; font-weight: 600; }
.search-sub { margin: 0; color: var(--muted); font-size: 15px; min-height: 1.4em; }

/* ---------- results ---------- */
#results { position: relative; flex-direction: column; padding: calc(var(--safe-t) + 20px) 14px 8px; max-width: 1100px; width: 100%; margin: 0 auto; }
.res-bar { display: flex; align-items: center; justify-content: space-between; margin: -6px 0 6px; }
.brand-btn { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: 0; border-radius: 999px; background: transparent; font-size: 15px; font-weight: 600; color: var(--soft); }
.brand-btn img { width: 40px; height: auto; }
.brand-btn:active { background: var(--card); }
.res-head { text-align: center; padding: 4px 8px 12px; }
.res-count { display: inline-flex; align-items: baseline; gap: 10px; }
.res-count .n { font-size: 64px; font-weight: 700; line-height: 1; letter-spacing: -.03em;
  background: linear-gradient(120deg, #fff, var(--sky) 60%, var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.res-count .unit { font-size: 20px; font-weight: 600; color: var(--soft); }
.res-head h2 { margin: 6px 0 0; font-size: 18px; font-weight: 500; color: var(--soft); }
.res-head p { margin: 8px auto 0; max-width: 420px; color: var(--muted); font-size: 15px; }
.res-head p:empty { display: none; }
#results.empty .res-count { display: none; }
#results.empty .res-head { padding-top: 16vh; }
#results.empty .res-head h2 { font-size: 24px; font-weight: 700; color: var(--ink); }
.days { display: flex; gap: 8px; overflow-x: auto; padding: 4px 4px 10px; margin: 0 -14px; padding-left: 18px; padding-right: 18px; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.days:empty { display: none; }
.days a { flex: none; padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; text-decoration: none; color: var(--soft); background: var(--card); border: 1px solid var(--line); }
.days a b { color: var(--sky); font-weight: 600; margin-left: 4px; }
.day { scroll-margin-top: 8px; }
.day h3 { position: sticky; top: 0; z-index: 2; display: flex; align-items: baseline; gap: 8px; margin: 0 -14px; padding: calc(var(--safe-t) + 12px) 18px 12px; font-size: 16px; font-weight: 600; color: var(--ink);
  background: rgba(0, 9, 24, .5); backdrop-filter: blur(16px) saturate(150%); -webkit-backdrop-filter: blur(16px) saturate(150%);
  -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.day h3 span { color: var(--muted); font-weight: 400; font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 10px; } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.ph { position: relative; aspect-ratio: 3 / 2; padding: 0; border: 0; border-radius: 14px; overflow: hidden;
  background: linear-gradient(110deg, #08183a 30%, #102b5e 50%, #08183a 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite;
  box-shadow: 0 6px 18px -10px rgba(0, 0, 0, .8); }
@keyframes shimmer { to { background-position: -150% 0; } }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transform: scale(1.05); transition: opacity .5s var(--ease), transform .7s var(--ease); transition-delay: calc(var(--k, 0) * 30ms); }
.ph.in { animation: none; background: #07142e; }
.ph.in img { opacity: 1; transform: none; }
.ph.broken::after { content: 'Preview unavailable'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; color: var(--muted); }
.ph:active { transform: scale(.97); transition: transform .12s; }
.possible .ph { box-shadow: inset 0 0 0 1px rgba(157, 176, 207, .35); }
.possible-head { margin: 24px 4px 0; font-size: 17px; font-weight: 600; color: var(--soft); }
.tap-note { margin: 2px 0 6px; text-align: center; font-size: 13px; color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(16, 40, 90, .6); color: var(--ink); font-size: 16px; font-weight: 500; text-decoration: none; transition: transform .12s var(--ease); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn.primary { border: 0; background: linear-gradient(100deg, var(--blue), var(--sky)); color: #fff; font-weight: 600; box-shadow: 0 10px 26px -12px rgba(0, 102, 245, .9); }
.btn:active { transform: scale(.96); }
.more { margin: 18px auto 0; }
.res-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 28px 0 6px; }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 15; }

/* ---------- viewer ---------- */
.viewer { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; }
.viewer[hidden] { display: none; }
.v-scrim { position: absolute; inset: 0; background: #000610; }
.v-top, .v-actions { position: relative; z-index: 2; }
.v-top { display: flex; align-items: center; justify-content: space-between; padding: calc(var(--safe-t) + 10px) 12px 6px 18px; font-size: 14px; color: var(--muted); }
.v-meta b { color: var(--ink); font-weight: 600; margin-right: 10px; letter-spacing: .01em; }
.v-stage { position: relative; z-index: 1; flex: 1; min-height: 0; touch-action: none; overflow: visible; }
.v-track { position: absolute; inset: 0; will-change: transform; }
.v-slide { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.v-slide img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transform-origin: center; }
.btn.glass { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .14); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.spin { position: absolute; right: 16px; bottom: 14px; width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .25); border-top-color: var(--cyan); animation: spin .8s linear infinite; }
.spin[hidden] { display: none; }
@keyframes spin { to { transform: rotate(1turn); } }
.v-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 1; }
#v-prev { left: 8px; } #v-next { right: 8px; }
@media (hover: none) { .v-nav { display: none; } }
.v-actions { display: flex; gap: 10px; justify-content: center; padding: 14px 16px calc(var(--safe-b) + 18px); flex-wrap: wrap; }

/* ---------- footer, toast, debug ---------- */
.foot { position: relative; z-index: 1; padding: 14px 22px calc(var(--safe-b) + 16px); text-align: center; font-size: 12px; line-height: 1.5; color: var(--muted); opacity: .85; }
.foot p { margin: 1px 0; }
.foot a { color: var(--sky); }
body[data-screen='camera'] .foot, body[data-screen='search'] .foot { display: none; }
.toast { position: fixed; left: 50%; bottom: calc(var(--safe-b) + 24px); z-index: 30; transform: translate(-50%, 20px); opacity: 0; padding: 10px 18px; border-radius: 999px; background: #0d2552; color: #fff; font-size: 15px; transition: .25s var(--ease); pointer-events: none; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.debug { position: fixed; left: 6px; bottom: 6px; z-index: 40; max-width: calc(100vw - 12px); padding: 8px 10px; border-radius: 8px; background: rgba(0, 0, 0, .78); color: #9ff; font: 11px/1.45 ui-monospace, Menlo, monospace; pointer-events: none; }
.noscript { position: relative; z-index: 2; text-align: center; padding: 20px; }

@media (max-height: 700px) {
  .hero { width: min(46vw, 200px); margin: 10px 0 8px; }
  .lead { margin: 10px 0 16px; font-size: 16px; }
  .steps { margin-top: 14px; } .steps li { padding: 9px 4px 8px; }
}
@media (prefers-reduced-transparency: reduce) {
  .chip, .steps li, .tips li, .cam-panel, .icon-btn, .look-here, .btn.glass, .turn { backdrop-filter: none; -webkit-backdrop-filter: none; background: #0b1d40; }
}
@media (prefers-contrast: more) {
  :root { --muted: #D6E2F5; --soft: #fff; --line: rgba(255, 255, 255, .5); }
  .btn, .chip, .steps li { border-color: rgba(255, 255, 255, .6); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
#camera.screen.active { animation: none; }
