/* v2 "Scroll To Drive". Default rules = the stacked page (reduced motion / no JS).
   html.drive-on switches the first section into the sticky canvas drive. Tokens come from /shared/base.css. */
:root { --dock-h: 66px; --hud-h: 132px; }
html { scroll-padding-bottom: var(--dock-h); }
body { background: var(--white); padding-bottom: calc(var(--dock-h) + env(safe-area-inset-bottom)); }
h1, h2, h3 { font-weight: 700; }
.skip { position: absolute; left: 8px; top: -80px; z-index: 300; background: var(--red); color: var(--white); font-family: var(--px); font-size: 14px; padding: 10px 14px; text-decoration: none; }
.skip:focus { top: 8px; }
a.btn-px { display: inline-block; text-decoration: none; }
.btn-px.inv { background: var(--white); color: var(--red); box-shadow: 4px 4px 0 var(--red-deep); }
:focus-visible { outline: 3px dashed var(--red); outline-offset: 3px; }
.finish :focus-visible, .title :focus-visible, .card-red :focus-visible { outline-color: var(--white); }
section[tabindex="-1"]:focus, .entry:focus { outline: none; }
.wavy { background: var(--checker); }
.wavy-on .wavy { background: var(--wavy) 0 0 / 480px 480px repeat; image-rendering: pixelated; }

/* ================= drive section — stacked defaults ================= */
.drive { position: relative; }
.stage { position: relative; padding: 16px 16px 8px; }
html:not(.drive-on) .stage { background: var(--checker); }
.wavy-on:not(.drive-on) .stage { background: var(--wavy) 0 0 / 480px 480px repeat; }
#road, .hud, .pops, .drive-only, .cp-fin { display: none; }

/* title card (hero in stacked mode, intro card in drive mode) */
.title {
  position: relative; max-width: 560px; margin: 0 auto; text-align: center;
  background: var(--red); color: var(--white); padding: 22px 18px 20px;
  border: 3px solid var(--white); outline: 3px solid var(--red); box-shadow: 10px 10px 0 var(--red-deep);
}
.title::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, transparent 0 2px, rgba(180, 13, 16, .35) 2px 3px); }
.title > * { position: relative; z-index: 1; }
.title-hero { display: none; }
html:not(.drive-on) .title-hero { display: block; aspect-ratio: 720 / 545; max-width: 380px; margin: 0 auto 14px; background: var(--white) url(/art/miami-scene.png) center / contain no-repeat; border: 3px solid var(--white); }
.kicker { font-family: var(--px); text-transform: uppercase; font-size: 12px; margin: 0; }
.title h1 { margin: 10px auto 8px; }
.title h1 img { width: min(100%, 330px); height: auto; margin: 0 auto; filter: brightness(0) invert(1); image-rendering: auto; }
.stage-tag { font-family: var(--px); text-transform: uppercase; font-size: 18px; margin: 0 0 6px; }
.title-when { font-size: 22px; line-height: 1.15; margin: 0 0 16px; }
.title-when b { font-family: var(--px); text-transform: uppercase; font-size: 15px; font-weight: 400; }
.press {
  display: inline-block; font-family: var(--px); text-transform: uppercase; font-size: 20px; text-decoration: none;
  color: var(--red); background: var(--white); padding: 12px 20px; box-shadow: 5px 5px 0 var(--red-deep);
  transition: transform .12s var(--ease), box-shadow .12s var(--ease);
}
.press:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--red-deep); }
.press:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--red-deep); }
.press span { display: inline-block; animation: blink 1s steps(1) infinite; }
.hint { font-size: 19px; margin: 12px 0 0; }
html:not(.drive-on) .hint { display: none; }

/* checkpoint cards */
.cps { list-style: none; margin: 26px auto 10px; padding: 0; max-width: 720px; display: grid; gap: 22px; }
.card { position: relative; background: var(--white); border: 3px solid var(--red); box-shadow: 6px 6px 0 var(--red); padding: 14px; }
.card-red { background: var(--red); color: var(--white); border-color: var(--white); outline: 3px solid var(--red); box-shadow: 6px 6px 0 var(--red-deep); }
.cp-tag { display: inline-block; font-family: var(--px); text-transform: uppercase; font-size: 11px; background: var(--red); color: var(--white); padding: 3px 7px; margin: 0 0 8px; }
.card-red .cp-tag { background: var(--white); color: var(--red); }
.cp-h { font-family: var(--px); text-transform: uppercase; font-size: 30px; line-height: 1; margin: 0 0 6px; }
.cp-h span { display: block; font-size: 16px; margin-top: 5px; }
.card p { margin: 0 0 6px; font-size: 20px; line-height: 1.1; }
.cp-act { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.cp-act .btn-px { font-size: 13px; padding: 11px 14px; }
.card-vid { display: grid; grid-template-columns: 100px 1fr; gap: 12px; align-items: start; }
.card-vid .cp-h { font-size: 24px; }
.card-vid video { width: 100px; aspect-ratio: 9 / 16; object-fit: cover; border: 3px solid var(--red); background: var(--checker); }
.tip { font-family: var(--px); text-transform: uppercase; font-size: 11px !important; }
.strip { list-style: none; display: flex; gap: 4px; padding: 0; margin: 6px 0; overflow: hidden; }
.strip img { width: 34px; height: 34px; flex: none; border: 2px solid var(--red); image-rendering: auto; }
.passing { font-family: var(--px); text-transform: uppercase; font-size: 12px !important; }
.pit { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pit-item { all: unset; box-sizing: border-box; cursor: pointer; width: 100%; display: flex; flex-direction: column; background: var(--white); border: 2px solid var(--red); box-shadow: 3px 3px 0 var(--red); transition: transform .12s var(--ease), box-shadow .12s var(--ease); }
.pit-item:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--red); }
.pit-item:focus-visible { outline: 3px dashed var(--red); outline-offset: 3px; }
.pit-m { aspect-ratio: 1; background: var(--checker); border-bottom: 2px solid var(--red); display: grid; place-items: center; overflow: hidden; }
.pit-m img { width: 100%; height: 100%; object-fit: contain; image-rendering: auto; }
.pit-n { font-family: var(--px); text-transform: uppercase; font-size: 9px; line-height: 1.1; padding: 4px 4px 0; }
.pit-p { font-size: 17px; padding: 0 4px 3px; }

/* ================= drive mode ================= */
.drive-on .drive { height: 1000vh; }
.drive-on .stage { position: sticky; top: 0; height: 100vh; height: 100dvh; padding: 0; overflow: hidden; background: var(--white); }
.drive-on #road { display: block; position: absolute; left: 0; top: 0; image-rendering: pixelated; image-rendering: crisp-edges; }
.drive-on .drive-only { display: block; }
.drive-on .cp-fin { display: block; }

.drive-on .hud { display: block; position: absolute; z-index: 3; left: 0; right: 0; top: 0; padding: 12px 16px 0; pointer-events: none; max-width: 1240px; margin: 0 auto; }
.hud-stats { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 8px; }
.lbl, .stage-name, #h-gear { display: block; font-family: var(--px); text-transform: uppercase; font-size: 12px; line-height: 1.1; }
.hud b { display: block; font-family: var(--px); font-size: 25px; line-height: 1; letter-spacing: -.02em; }
.hud-c { text-align: center; }
.hud-c b { font-size: 40px; transform: skewX(-8deg); }
.hud-r { text-align: right; }
.stage-name { margin-top: 5px; white-space: nowrap; font-size: 11px; }
.rpm { display: block; width: 118px; height: 13px; margin: 5px 0 3px auto; border: 2px solid var(--red); padding: 1px; }
#h-rpm { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--red) 0 6px, transparent 6px 8px); clip-path: inset(0 100% 0 0); }
#h-gear.shift { animation: shift .36s steps(3); }
@keyframes shift { 0% { transform: translateX(-6px); } 50% { transform: translateX(3px); } 100% { transform: none; } }

.mm { position: relative; height: 26px; margin: 8px 13px 0; pointer-events: auto; }
.mm-line { position: absolute; left: 0; right: 0; top: 12px; height: 2px; background: repeating-linear-gradient(90deg, var(--red) 0 4px, transparent 4px 7px); }
.mm-car { position: absolute; left: -6px; top: -5px; width: 12px; height: 12px; background: var(--red); box-shadow: 0 0 0 2px var(--white); will-change: transform; z-index: 1; }
.mm button { position: absolute; top: 0; left: calc(var(--at) * 100%); transform: translateX(-50%); width: 26px; height: 26px; padding: 0; display: grid; place-items: center; font-family: var(--px); font-size: 12px; color: var(--red); background: var(--white); border: 2px solid var(--red); box-shadow: 2px 2px 0 var(--red); }
.mm button:hover { background: var(--red); color: var(--white); }

.drive-on .pops { display: block; position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.pop { position: absolute; left: 0; right: 0; top: 49%; text-align: center; opacity: 0; }
.pop.on { opacity: 1; animation: pop-in .32s steps(4) both; }
.pop-t { display: block; font-family: var(--px); font-size: clamp(36px, 11.5vw, 92px); line-height: 1; transform: skewX(-10deg); text-shadow: -2px -2px 0 var(--white), 2px -2px 0 var(--white), -2px 2px 0 var(--white), 2px 2px 0 var(--white), 6px 6px 0 var(--pink); white-space: nowrap; }
.pop-n { display: block; font-family: var(--px); font-size: 28px; margin-top: 6px; color: var(--white); text-shadow: -2px -2px 0 var(--red), 2px -2px 0 var(--red), -2px 2px 0 var(--red), 2px 2px 0 var(--red), 4px 4px 0 var(--red-deep); }
.pop-c { display: inline-block; font-family: var(--px); text-transform: uppercase; font-size: 14px; margin-top: 6px; color: var(--white); background: var(--red); padding: 2px 8px; }
.pop-c:empty { display: none; }
@keyframes pop-in { 0% { transform: scale(.3); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
.count { position: absolute; left: 0; right: 0; top: 30%; text-align: center; font-family: var(--px); font-weight: 700; font-size: clamp(130px, 42vw, 280px); line-height: 1; opacity: 0; text-shadow: -3px -3px 0 var(--white), 3px -3px 0 var(--white), -3px 3px 0 var(--white), 3px 3px 0 var(--white), 10px 10px 0 var(--pink); }
.count.go { font-size: clamp(90px, 30vw, 220px); transform: skewX(-10deg); }
.count.on { animation: count .6s steps(6) both; }
@keyframes count { 0% { opacity: 0; scale: 2.2; } 30% { opacity: 1; scale: 1; } 85% { opacity: 1; scale: 1; } 100% { opacity: 0; scale: .9; } }
.count.go.on { animation-duration: .65s; }

.drive-on .title { position: absolute; z-index: 5; left: 16px; right: 16px; top: 52%; transform: translateY(-50%); transition: opacity .3s steps(3), transform .3s steps(3); }
.drive-on .title.gone { opacity: 0; transform: translateY(-50%) scale(.85); pointer-events: none; }

.drive-on .cps { position: absolute; z-index: 4; left: 12px; right: 12px; top: var(--hud-h); margin: 0; max-width: none; display: block; }
.drive-on .cp { position: absolute; left: 0; right: 6px; top: 0; visibility: hidden; transform: translateX(-120%); transition: transform .42s steps(6), visibility 0s .42s; }
.drive-on .cp:nth-child(even) { transform: translateX(120%); }
.drive-on .cp.on { visibility: visible; transform: none; transition: transform .42s steps(6); }
.drive-on .card { background: color-mix(in srgb, var(--white) 94%, transparent); }
.drive-on .card-red { background: var(--red); }
.drive-on .opt { display: none; }

/* ================= finish / results ================= */
.finish { position: relative; overflow: hidden; background: var(--red); color: var(--white); padding: 0 16px 56px; }
.finish::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, transparent 0 2px, rgba(180, 13, 16, .35) 2px 3px); }
.flagline { position: relative; height: 28px; margin: 0 -16px 30px; background: repeating-conic-gradient(var(--red-deep) 0 25%, var(--white) 0 50%) 0 0 / 28px 28px; border-bottom: 4px solid var(--white); }
.finish .wrap { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; display: grid; gap: 22px; grid-template-areas: 'head' 'front' 'results' 'entry' 'where'; }
.finish .head { grid-area: head; }
.complete { font-family: var(--px); text-transform: uppercase; font-size: 18px; margin: 0; }
.big { font-family: var(--px); text-transform: uppercase; font-size: clamp(36px, 10.6vw, 120px); line-height: .92; margin: 4px 0 0; transform: skewX(-8deg); transform-origin: left; text-shadow: 5px 5px 0 var(--red-deep); }
.front { grid-area: front; margin: 0; background: var(--white); border: 4px solid var(--white); box-shadow: 10px 10px 0 var(--red-deep); }
.front img { width: 100%; height: auto; image-rendering: auto; }
.results { grid-area: results; margin: 0; font-family: var(--px); text-transform: uppercase; }
.results div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 2px dashed rgba(255, 253, 253, .55); }
.results dt { font-size: 14px; }
.results dd { margin: 0; font-size: 22px; font-weight: 700; }
.entry { grid-area: entry; background: var(--white); color: var(--red); padding: 20px 18px; box-shadow: 10px 10px 0 var(--red-deep); }
.blink { font-family: var(--px); text-transform: uppercase; font-size: 13px; margin: 0; animation: blink 1s steps(1) infinite; }
.entry h3 { font-family: var(--px); text-transform: uppercase; font-size: 28px; line-height: 1; margin: 6px 0; }
.entry-sub { margin: 0 0 14px; font-size: 21px; }
.where { grid-area: where; font-size: 22px; }
.where p { margin: 0 0 12px; }
.where-d { font-family: var(--px); text-transform: uppercase; font-size: 36px; line-height: 1; }
.where-d span { display: block; font-size: 18px; margin-top: 6px; }

/* ================= store + roster ================= */
.sec { padding: 56px 16px; }
.panel { max-width: 1100px; margin: 0 auto; background: var(--white); border: 4px solid var(--red); box-shadow: 10px 10px 0 var(--red); padding: 22px 16px 26px; }
.eyebrow { display: inline-block; font-family: var(--px); text-transform: uppercase; font-size: 13px; background: var(--red); color: var(--white); padding: 4px 8px; margin: 0; }
.sec-h { font-family: var(--px); text-transform: uppercase; font-size: clamp(30px, 8.5vw, 60px); line-height: 1; margin: 10px 0 8px; }
.lede { margin: 0 0 20px; max-width: 60ch; }
#store-grid .store-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
#store-grid .store-card .t { font-size: 11px; padding: 10px 10px 2px; }
#store-grid .store-card .r { padding: 2px 10px 10px; font-size: 20px; }
#store-grid .store-card .m img, #store-grid .store-card .m video { image-rendering: auto; }
.store-sheet img, .store-line img { image-rendering: auto; }

.roster { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ros { position: relative; background: var(--white); border: 3px solid var(--red); box-shadow: 4px 4px 0 var(--red); transition: transform .14s var(--ease), box-shadow .14s var(--ease); }
.ros:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--red); }
.ros img { width: 100%; height: auto; aspect-ratio: 1; image-rendering: auto; }
.ros-p { position: absolute; left: -3px; top: -3px; z-index: 1; font-family: var(--px); font-size: 10px; background: var(--red); color: var(--white); padding: 2px 5px; }
.ros-n { display: block; font-family: var(--px); text-transform: uppercase; font-size: 11px; line-height: 1.15; padding: 6px; min-height: 3.3em; border-top: 3px solid var(--red); }
.ros-tag { position: absolute; right: 4px; top: 4px; font-family: var(--px); text-transform: uppercase; font-size: 9px; background: var(--red); color: var(--white); padding: 2px 5px; }
.ros-lock { position: absolute; left: 50%; top: 30%; width: 36px; height: 28px; transform: translateX(-50%); background: var(--white); border: 4px solid var(--red); box-shadow: 3px 3px 0 var(--red); }
.ros-lock::before { content: ''; position: absolute; left: 3px; right: 3px; top: -20px; height: 18px; border: 4px solid var(--red); border-bottom: 0; }
.ros-lock::after { content: ''; position: absolute; left: 50%; top: 5px; width: 4px; height: 9px; background: var(--red); transform: translateX(-50%); }

/* ================= footer ================= */
.info { background: var(--white); border-top: 4px solid var(--red); }
.marquee { overflow: hidden; white-space: nowrap; background: var(--red); color: var(--white); font-family: var(--px); text-transform: uppercase; font-size: 20px; padding: 10px 0; }
.mq-in { display: inline-flex; animation: mq 22s linear infinite; will-change: transform; }
.mq-in span { padding-right: 0; }
@keyframes mq { to { transform: translateX(-50%); } }
.info-in { max-width: 1100px; margin: 0 auto; padding: 36px 16px 40px; display: grid; gap: 30px; }
.info-logo { width: min(320px, 82%); height: auto; image-rendering: auto; margin-bottom: 10px; }
.info-txt > p { margin: 0 0 12px; }
.facts { margin: 0; }
.facts div { display: grid; grid-template-columns: 74px 1fr; gap: 10px; padding: 8px 0; border-bottom: 2px dashed var(--pink); }
.facts dt { font-family: var(--px); text-transform: uppercase; font-size: 12px; padding-top: 4px; }
.facts dd { margin: 0; }
.teaser { margin: 0; }
.teaser video { width: 100%; max-width: 340px; aspect-ratio: 9 / 16; object-fit: cover; border: 4px solid var(--red); box-shadow: 8px 8px 0 var(--red); background: var(--checker); }
.teaser figcaption { font-family: var(--px); text-transform: uppercase; font-size: 12px; margin-top: 14px; }

/* ================= dock (persistent mobile CTA) ================= */
.dock { position: fixed; z-index: 85; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 10px; padding: 9px 12px calc(9px + env(safe-area-inset-bottom)); background: var(--white); border-top: 4px solid var(--red); }
.dock-when { margin-right: auto; font-family: var(--px); text-transform: uppercase; font-size: 13px; line-height: 1.1; }
.dock-when span { display: block; font-size: 11px; }
.dock .btn-px { font-size: 14px; padding: 12px 18px; box-shadow: 3px 3px 0 var(--red-deep); }
.dock #store-cart-btn { position: static; display: inline-flex; gap: 8px; align-items: center; background: var(--white); color: var(--red); border: 3px solid var(--red); padding: 9px 14px; box-shadow: 3px 3px 0 var(--red); }
.dock #store-cart-btn .n { background: var(--red); color: var(--white); padding: 0 6px; }

@keyframes blink { 50% { opacity: 0; } }

/* ================= short phones: keep cards compact ================= */
@media (max-height: 760px) {
  .drive-on .card p:not(.cp-tag):not(.passing) { font-size: 18px; }
  .drive-on .strip img { width: 28px; height: 28px; }
  .drive-on .card-vid video { width: 80px; }
  .drive-on .card-vid { grid-template-columns: 80px 1fr; }
  .drive-on .title { padding: 16px 14px; }
  .drive-on .title h1 img { width: min(100%, 260px); }
}

/* ================= larger screens ================= */
@media (min-width: 700px) {
  .roster { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  #store-grid .store-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #store-grid .store-card .t { font-size: 13px; }
}
@media (min-width: 900px) {
  :root { --hud-h: 160px; }
  .hud b { font-size: 34px; }
  .hud-c b { font-size: 56px; }
  .lbl, #h-gear { font-size: 14px; }
  .stage-name { font-size: 13px; }
  .rpm { width: 174px; height: 17px; }
  #h-rpm { background: repeating-linear-gradient(90deg, var(--red) 0 10px, transparent 10px 12px); }
  .drive-on .cps { left: 28px; right: auto; width: 410px; }
  .drive-on .title { left: 50%; right: auto; width: 520px; transform: translate(-50%, -50%); }
  .drive-on .title.gone { transform: translate(-50%, -50%) scale(.85); }
  .pop { top: 36%; }
  .finish { padding-bottom: 80px; }
  .finish .wrap { grid-template-columns: 1.05fr 1fr; column-gap: 40px; grid-template-areas: 'head head' 'front results' 'front entry' 'where entry'; align-items: start; }
  .roster { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .info-in { grid-template-columns: 1.3fr .7fr; align-items: start; }
  .dock { left: auto; right: 24px; bottom: 24px; border: 4px solid var(--red); box-shadow: 8px 8px 0 var(--red); padding: 10px 12px; }
  .dock-when { margin-right: 8px; }
  body { padding-bottom: 0; }
}

/* finish card stays compact so the Shift Arcade storefront owns the screen */
.drive-on .cp-fin .card { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 8px 14px; }
.drive-on .cp-fin .cp-tag, .drive-on .cp-fin p { display: none; }
.drive-on .cp-fin .cp-h { font-size: 22px; margin: 0; }
.drive-on .cp-fin .cp-act { margin: 0; }
