/* TapPark page — cinematic windscreen scene (loaded only by home/tappark.php).
   The photograph of a TapPark sticker on a car's windscreen, with a slow push-in, a light sweep over the glass,
   a scan glow on the sticker's QR, the phone that scans it and the owner's alert. */

.tc-grain { position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: .04;
  background-image: 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%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: tcGrain 1.2s steps(6) infinite; }
@keyframes tcGrain { 0%{transform:translate(0,0)} 25%{transform:translate(-3%,2%)} 50%{transform:translate(2%,-3%)} 75%{transform:translate(-2%,3%)} 100%{transform:translate(0,0)} }

/* the frame: the photo's own 3:2 shape on a desktop, a taller crop on phones */
.tc-scene { position: relative; aspect-ratio: 3 / 2; border-radius: 34px; overflow: hidden; container-type: inline-size; isolation: isolate; background: #1b1d22;
  box-shadow: 0 40px 100px -40px rgba(28,25,23,.55), 0 0 0 1px rgba(28,25,23,.08); }

/* the stage always has the photo's shape, so everything placed in % stays on the sticker */
.tc-stage { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 100%; aspect-ratio: 3 / 2; transition: transform 1s cubic-bezier(.16,1,.3,1); will-change: transform; }
.tc-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform-origin: 58% 52%; animation: tcPush 16s ease-in-out infinite alternate; }
@keyframes tcPush { from { transform: scale(1); } to { transform: scale(1.07); } }

/* a soft band of light slides across the glass */
.tc-shine { position: absolute; inset: 0 0 25% 0; pointer-events: none; mix-blend-mode: screen;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.18) 45%, rgba(255,255,255,.04) 52%, transparent 60%) -80% 0 / 220% 100% no-repeat;
  animation: tcShine 9s ease-in-out infinite; }
@keyframes tcShine { 0%, 15% { background-position: -80% 0; } 65%, 100% { background-position: 180% 0; } }

/* the sticker's QR: it glows while it is scanned and a line runs down it */
.tc-qr-hit { position: absolute; left: 51.6%; top: 44%; width: 14.6%; height: 17.6%; border-radius: 1.2cqw; transform-origin: 58% 52%; animation: tcPush 16s ease-in-out infinite alternate;
  box-shadow: 0 0 0 .25cqw rgba(251,146,60,0), 0 0 0 rgba(251,146,60,0); transition: box-shadow .5s; overflow: hidden; }
.tc-scene.is-scanning .tc-qr-hit { box-shadow: 0 0 0 .25cqw rgba(251,146,60,.95), 0 0 4cqw rgba(251,146,60,.65); }
.tc-scene.is-alerted .tc-qr-hit { box-shadow: 0 0 0 .2cqw rgba(34,197,94,.9), 0 0 3cqw rgba(34,197,94,.45); }
.tc-qr-line { position: absolute; left: 0; right: 0; top: -12%; height: 12%; background: linear-gradient(transparent, rgba(251,146,60,.75), transparent); opacity: 0; }
.tc-scene.is-scanning .tc-qr-line { animation: tcLine 1.2s ease-in-out 2; }
@keyframes tcLine { 0% { top: -12%; opacity: 1; } 100% { top: 100%; opacity: 1; } }

/* the phone that scans the sticker */
.tc-phone { position: absolute; z-index: 6; right: 4%; bottom: -8%; width: 16cqw; aspect-ratio: 9 / 18.5; border-radius: 2.6cqw; padding: .55cqw; background: #0b0a09; rotate: -7deg;
  box-shadow: 0 3cqw 6cqw -2cqw rgba(0,0,0,.85), 0 0 0 .1cqw rgba(255,255,255,.14) inset; transition: transform .9s cubic-bezier(.16,1,.3,1); }
.tc-screen { position: relative; height: 100%; border-radius: 2.1cqw; overflow: hidden; background: radial-gradient(120% 80% at 50% 30%, #3a3f47, #15171b); }
.tc-view { position: absolute; inset: 0; transition: opacity .45s, translate .45s cubic-bezier(.16,1,.3,1); }
.tc-cam { display: grid; place-items: center; }
.tc-frame { position: relative; width: 58%; aspect-ratio: 1; }
.tc-frame span { position: absolute; width: 24%; height: 24%; border: .32cqw solid #fff; }
.tc-frame span:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-radius: .6cqw 0 0 0; }
.tc-frame span:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-radius: 0 .6cqw 0 0; }
.tc-frame span:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 .6cqw; }
.tc-frame span:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-radius: 0 0 .6cqw 0; }
.tc-scene.is-scanning .tc-frame span { border-color: #fb923c; transition: border-color .3s; }
.tc-cam-label { position: absolute; left: 0; right: 0; bottom: 22%; text-align: center; color: rgba(255,255,255,.85); font-size: .9cqw; }
.tc-page { background: #fffaf3; color: #1c1917; padding: 1.4cqw 1.1cqw; display: grid; align-content: start; gap: .6cqw; opacity: 0; translate: 0 2cqw; }
.tc-page b { font-size: 1.15cqw; line-height: 1.2; }
.tc-page small { font-size: .8cqw; color: #78716c; }
.tc-opt { display: flex; align-items: center; gap: .6cqw; padding: .7cqw .8cqw; border-radius: .9cqw; background: #fff; box-shadow: inset 0 0 0 .1cqw #eadfd2; font-size: .9cqw; font-weight: 600; transition: background .3s, color .3s, box-shadow .3s; }
.tc-opt i { width: 1.2cqw; text-align: center; color: #ea580c; }
.tc-scene.is-alerted .tc-opt.is-pick { background: #ea580c; color: #fff; box-shadow: none; }
.tc-scene.is-alerted .tc-opt.is-pick i { color: #fff; }
.tc-sent { margin-top: .3cqw; text-align: center; font-size: .8cqw; color: #15803d; font-weight: 700; opacity: 0; transition: opacity .4s .3s; }
.tc-scene.is-alerted .tc-sent { opacity: 1; }
.tc-scene.is-alerted .tc-cam { opacity: 0; }
.tc-scene.is-alerted .tc-page { opacity: 1; translate: 0 0; }

/* the owner's notification */
.tc-notif { position: absolute; z-index: 7; left: 4%; top: 6%; display: flex; align-items: center; gap: 1cqw; padding: 1cqw 1.4cqw; border-radius: 1.6cqw;
  background: rgba(255,250,243,.95); backdrop-filter: blur(8px); color: #1c1917; font-size: 1.05cqw; line-height: 1.3; box-shadow: 0 1.4cqw 3cqw -1cqw rgba(0,0,0,.45);
  opacity: 0; translate: 0 -1.4cqw; transition: opacity .5s .9s, translate .6s cubic-bezier(.16,1,.3,1) .9s; }
.tc-notif i { display: grid; place-items: center; width: 2.6cqw; height: 2.6cqw; border-radius: .8cqw; background: #ea580c; color: #fff; font-size: 1.2cqw; }
.tc-notif b { display: block; font-size: 1.1cqw; }
.tc-notif small { color: #78716c; }
.tc-scene.is-alerted .tc-notif { opacity: 1; translate: 0 0; }
.tc-cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 26px; }

/* phones: a taller frame; the stage fills its height and is cropped at the sides, the sticker stays in view */
@media (max-width: 700px) {
  .tc-scene { aspect-ratio: 4 / 5; border-radius: 24px; }
  .tc-stage { width: auto; height: 100%; left: 32%; }
  .tc-qr-hit { border-radius: 2cqw; }
  .tc-phone { width: 32cqw; right: 3%; bottom: -20%; border-radius: 5cqw; padding: 1.1cqw; } .tc-screen { border-radius: 4cqw; }
  .tc-frame span { border-width: .7cqw; } .tc-cam-label { font-size: 2cqw; }
  .tc-page { padding: 3cqw 2.4cqw; gap: 1.3cqw; } .tc-page b { font-size: 2.6cqw; } .tc-page small { font-size: 1.8cqw; }
  .tc-opt { font-size: 2cqw; padding: 1.5cqw 1.6cqw; border-radius: 2cqw; gap: 1.2cqw; } .tc-opt i { width: 2.6cqw; } .tc-sent { font-size: 1.8cqw; }
  .tc-notif { left: 4%; top: 4%; max-width: 62%; font-size: 2.4cqw; padding: 2.2cqw; border-radius: 3cqw; gap: 2cqw; }
  .tc-notif i { width: 6cqw; height: 6cqw; font-size: 2.8cqw; border-radius: 1.8cqw; } .tc-notif b { font-size: 2.6cqw; }
}
@media (prefers-reduced-motion: reduce) {
  .tc-grain, .tc-photo, .tc-shine, .tc-qr-hit { animation: none !important; }
}
