/* BombayLocal demo: the Android apps' dark design system (apps/passenger and apps/scanner ui/theme). The pass QR card is the only bright object. */
:root {
  --ground: #10161c;
  --raised: #19212a;
  --line: #2a3541;
  --text: #ecf1f6;
  --muted: #8d9ba9;
  --paper: #ffffff;
  --firstA: #e0462f;
  --firstB: #f4c64e;
  --ac: #5ba7e8;
  --error: #f28b82;
  --green: #157a33;
  --amber: #e8a33d;
  --red: #c62828;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); color: var(--text); font: 16px/1.45 var(--font); }
a { color: var(--text); }
button { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.error { color: var(--error); font-size: 13px; margin: 0; }
[hidden] { display: none !important; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; max-width: 1180px; margin: 0 auto; }
.brand { display: flex; align-items: center; line-height: 0; }
.brand img { height: 40px; width: auto; mix-blend-mode: lighten; } /* the artwork's navy ground melts into the page */
.top nav { display: flex; gap: 20px; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a:hover { color: var(--text); }

main { max-width: 1180px; margin: 0 auto; padding: 0 24px 140px; }
.intro { max-width: 760px; margin: 24px auto 8px; text-align: center; }
.intro h1 { font-size: 34px; line-height: 40px; letter-spacing: -0.02em; font-weight: 600; margin: 0 0 12px; }
.intro p { color: var(--muted); margin: 0; }
.intro strong, .intro em { color: var(--text); }

/* ---- stage ---- */
.stage { position: relative; display: flex; justify-content: center; align-items: flex-start; gap: 120px; padding: 36px 0 16px; touch-action: none; }
.phone { width: 300px; flex: none; }
.phone-label { color: var(--muted); font-size: 13px; text-align: center; margin-bottom: 10px; }
.phone-label b { color: var(--text); font-weight: 500; }
.screen { position: relative; height: 600px; border-radius: 36px; background: var(--ground); border: 10px solid #05080b;
  box-shadow: 0 0 0 1px var(--line), 0 24px 60px rgba(0,0,0,.45); overflow: hidden; padding: 22px 18px; }
.note { color: var(--muted); font-size: 12px; text-align: center; margin: 12px 8px 0; }
.scanner { z-index: 5; }
.scanner .phone-label { cursor: grab; }
.scanner.dragging .phone-label, .scanner.dragging .screen { cursor: grabbing; }
.scanner .screen { padding: 0; background: #000; cursor: grab; user-select: none; }
.hint-arrow { position: absolute; top: 300px; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 13px; pointer-events: none; }

/* passenger views */
.view h2 { font-size: 22px; line-height: 28px; margin: 6px 0 4px; font-weight: 600; }
.products { display: grid; gap: 10px; margin: 16px 0; }
.product { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; min-height: 60px; padding: 10px 14px;
  background: var(--raised); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; position: relative; }
.product.selected { border: 2px solid var(--text); padding: 9px 13px; }
.product b { display: block; font-weight: 500; font-size: 15px; }
.product small { color: var(--muted); font-size: 12px; }
.product .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--muted); flex: none; }
.product.selected .dot { border-color: var(--text); background: radial-gradient(circle, var(--text) 4px, transparent 4.5px); }
.product .band { position: absolute; right: 14px; width: 26px; height: 8px; border-radius: 2px; }
.band.first { background: repeating-linear-gradient(-55deg, var(--firstA) 0 5px, var(--firstB) 5px 10px); }
.band.ac { background: var(--ac); }
.buybar { position: absolute; left: 18px; right: 18px; bottom: 18px; display: grid; gap: 8px; text-align: center; }
.primary { background: var(--text); color: var(--ground); border: 0; border-radius: 10px; min-height: 48px; padding: 0 16px; font-weight: 500; cursor: pointer; }
.primary:disabled { background: var(--line); color: var(--muted); cursor: default; }
.ghost { background: transparent; border: 1px solid var(--line); border-radius: 10px; min-height: 44px; padding: 0 14px; cursor: pointer; }
.link { background: none; border: 0; padding: 6px 0; color: var(--muted); text-decoration: underline; cursor: pointer; }

.steps { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 14px; font-size: 14px; }
.steps li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; }
.steps li .ic { width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--line); }
.steps li.done .ic { border-color: var(--text); background: var(--text) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%2310161c' stroke-width='2'/%3E%3C/svg%3E") center/14px no-repeat; }
.steps li.active .ic { border-color: var(--muted); border-top-color: var(--text); animation: spin 0.9s linear infinite; }
.steps a { color: var(--muted); font-size: 12px; }

.ticket { position: relative; background: var(--raised); border: 1px solid var(--line); border-radius: 16px; padding: 18px 16px 12px; overflow: hidden; }
.ticket .band { position: absolute; left: 0; right: 0; top: 0; height: 5px; border-radius: 0; }
.t-name { font-weight: 600; font-size: 18px; }
.t-valid { font-size: 14px; color: var(--muted); }
.t-valid b { color: var(--text); font-weight: 500; }
.t-class { font-size: 13px; }
.qrcard { position: relative; margin: 14px auto 0; background: var(--paper); border-radius: 16px; padding: 10px; width: 264px; height: 264px; }
.qrcard canvas { display: block; width: 244px; height: 244px; image-rendering: pixelated; }
.qr-busy { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; background: rgba(255,255,255,.92); color: #121212; border-radius: 16px; font-size: 14px; }
.countdown { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 12px; color: var(--muted); font-size: 14px; }
.countdown svg { width: 18px; height: 18px; transform: rotate(-90deg); }
.countdown circle { fill: none; stroke-width: 2.5; }
.countdown .track { stroke: var(--line); }
.countdown .ring { stroke: var(--text); stroke-dasharray: 50.27; stroke-linecap: round; }
#againBtn { display: block; margin: 6px auto 0; }

/* scanner screen */
#cam { position: absolute; inset: 0; width: 100%; height: 100%; }
.reticle { position: absolute; left: 50%; top: 46%; width: 210px; height: 210px; transform: translate(-50%, -50%); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0,0,0,.45); pointer-events: none; }
.reticle i { position: absolute; width: 30px; height: 30px; border: 4px solid #fff; }
.reticle i:nth-child(1) { left: -2px; top: -2px; border-right: 0; border-bottom: 0; border-top-left-radius: 18px; }
.reticle i:nth-child(2) { right: -2px; top: -2px; border-left: 0; border-bottom: 0; border-top-right-radius: 18px; }
.reticle i:nth-child(3) { left: -2px; bottom: -2px; border-right: 0; border-top: 0; border-bottom-left-radius: 18px; }
.reticle i:nth-child(4) { right: -2px; bottom: -2px; border-left: 0; border-top: 0; border-bottom-right-radius: 18px; }
.chip { position: absolute; top: 16px; left: 14px; padding: 7px 14px; border-radius: 999px; font-size: 13px; background: rgba(25,33,42,.92); }
.chip.amber { background: var(--amber); color: #121212; }
.chip.red { background: var(--red); color: #fff; }
.cam-hint { position: absolute; left: 0; right: 0; bottom: 78px; text-align: center; font-size: 14px; margin: 0; }
.scanbtn { position: absolute; left: 18px; right: 18px; bottom: 18px; }
.verdict { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; color: #fff; }
.verdict.GREEN { background: var(--green); }
.verdict.AMBER { background: var(--amber); color: #121212; }
.verdict.RED { background: var(--red); }
.glyph { width: 84px; height: 84px; }
.glyph circle, .glyph path { fill: none; stroke: currentColor; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.v-title { font-size: 30px; line-height: 36px; font-weight: 600; letter-spacing: -0.01em; }
.v-detail { font-size: 17px; }
.v-meta { font-size: 13px; opacity: .85; }

/* panels */
.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 28px; }
.panel { background: var(--raised); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; min-width: 0; }
.panel h3 { margin: 0 0 8px; font-size: 16px; font-weight: 600; }
.facts { margin: 12px 0 0; display: grid; gap: 6px; }
.facts div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; border-top: 1px solid var(--line); padding-top: 6px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; max-height: 220px; overflow: auto; }
.log li { overflow-wrap: anywhere; }
.log a { color: var(--muted); }

.how { margin-top: 48px; max-width: 820px; }
.how h2 { font-size: 22px; }
.how-steps { padding-left: 20px; display: grid; gap: 10px; }
.how-steps b { font-weight: 600; }

.foot { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: center; padding: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

/* downloads */
.downloads { position: fixed; right: 20px; bottom: 20px; z-index: 30; background: var(--raised); border: 1px solid var(--line); border-radius: 16px; padding: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.5); max-width: calc(100vw - 32px); }
.dl-toggle { background: none; border: 0; font-weight: 600; font-size: 14px; padding: 2px 4px 8px; cursor: pointer; width: 100%; text-align: left; }
.dl-body { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dl { display: grid; justify-items: center; gap: 6px; text-decoration: none; text-align: center; }
.dl canvas { width: 96px; height: 96px; background: #fff; border-radius: 8px; padding: 4px; image-rendering: pixelated; }
.dl b { display: block; font-size: 13px; font-weight: 500; }
.dl small { color: var(--muted); font-size: 11px; }
.dl-body .tiny { grid-column: 1 / -1; margin: 0; text-align: center; }
.downloads.collapsed .dl-body { display: none; }
.downloads.collapsed .dl-toggle { padding-bottom: 2px; }

/* tour */
.coach { position: absolute; z-index: 40; max-width: 280px; background: var(--text); color: var(--ground); border-radius: 12px; padding: 12px 14px; box-shadow: 0 12px 40px rgba(0,0,0,.5); font-size: 14px; }
.coach p { margin: 0 0 8px; }
.coach::after { content: ""; position: absolute; width: 12px; height: 12px; background: var(--text); transform: rotate(45deg); left: var(--ax, 24px); }
.coach.below::after { top: -6px; }
.coach.above::after { bottom: -6px; }
.coach-actions { display: flex; justify-content: space-between; align-items: center; }
.coach .link { color: #4a5663; }
.coach .ghost { border-color: #b9c4cf; color: var(--ground); min-height: 32px; }
.hand { position: absolute; z-index: 41; width: 44px; height: 44px; pointer-events: none; border-radius: 50%; background: rgba(236,241,246,.92); box-shadow: 0 0 0 8px rgba(236,241,246,.25);
  animation: drag-demo 2.6s ease-in-out infinite; }
@keyframes drag-demo {
  0% { transform: translate(var(--hx0), var(--hy0)) scale(1); opacity: 0; }
  12% { opacity: 1; transform: translate(var(--hx0), var(--hy0)) scale(.85); }
  70% { transform: translate(var(--hx1), var(--hy1)) scale(.85); opacity: 1; }
  85%, 100% { transform: translate(var(--hx1), var(--hy1)) scale(1); opacity: 0; }
}
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #c8d0d8; border-top-color: #121212; animation: spin .9s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .hand { display: none !important; }
  .steps li.active .ic, .spin { animation: none; }
}

/* small screens: phones stack, Scan button instead of dragging */
@media (max-width: 760px) {
  .top { padding: 14px 16px; }
  .top nav { gap: 14px; font-size: 14px; }
  main { padding: 0 16px 160px; }
  .intro h1 { font-size: 26px; line-height: 32px; }
  .stage { flex-direction: column; align-items: center; gap: 28px; touch-action: auto; }
  .hint-arrow { display: none; }
  .phone { width: min(300px, 100%); }
  .scanner .screen { cursor: default; }
  .cam-hint { display: none; }
  .panels { grid-template-columns: 1fr; }
  .downloads { right: 12px; bottom: 12px; left: 12px; }
}

/* ---- motion: one physical metaphor (you pick the checker's phone up, it goes back down) + quiet fades ---- */
html { scroll-behavior: smooth; }
.scanner { will-change: transform; }
.scanner .screen { transition: box-shadow .25s ease; }
.scanner.dragging .screen { box-shadow: 0 0 0 1px var(--line), 0 40px 90px rgba(0,0,0,.6); }
.scanner.returning { transition: transform .55s cubic-bezier(.2, 1.25, .35, 1); }
.hint-arrow { animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateX(-50%); opacity: .55; } 50% { transform: translateX(calc(-50% + 6px)); opacity: 1; } }

.view.enter { animation: rise .32s cubic-bezier(.2, .8, .2, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.steps li { transition: color .2s ease; }
.steps li.done .ic { animation: pop .28s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes pop { from { transform: scale(.6); } }
.qrcard { animation: settle .4s cubic-bezier(.2, .9, .3, 1.05); }
@keyframes settle { from { opacity: 0; transform: scale(.94); } }

.verdict { animation: verdict-in .22s ease-out; }
.verdict.again { animation: verdict-again .22s ease-out; }
@keyframes verdict-in { from { opacity: 0; transform: scale(.97); } }
@keyframes verdict-again { from { filter: brightness(1.25); } }
.glyph path { stroke-dasharray: 90; stroke-dashoffset: 90; animation: draw .38s .08s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.chip { transition: background-color .3s ease, color .3s ease; }

.primary, .ghost, .product { transition: background-color .18s ease, border-color .18s ease, transform .12s ease, box-shadow .18s ease; }
.primary:not(:disabled):hover { box-shadow: 0 6px 20px rgba(236,241,246,.12); }
.primary:not(:disabled):active, .ghost:active, .product:active { transform: scale(.985); }
.product:hover:not(.selected) { background: #1d2631; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.coach { animation: rise .25s ease-out; }
.downloads { transition: transform .2s ease, box-shadow .2s ease; }
.downloads:hover { transform: translateY(-2px); box-shadow: 0 16px 48px rgba(0,0,0,.55); }
.log li:first-child { animation: rise .3s ease-out; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .glyph path { stroke-dashoffset: 0; }
}
.hint-arrow.used { display: none; }
.downloads { transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease; }
body.is-dragging .downloads { opacity: .12; pointer-events: none; }
