/* Tuna Bus — a Tokyo bus stop at night: the departures board for navigation, the bus wrapped as a tuna nigiri, the
   loop map, the kitchen belt game, a tour ticket with a fare-board stub, the chart out of a bus window, a plate counter
   and the back of the bus. Fonts: Mochiy Pop One (display), Zen Maru Gothic (text), Rampart One (the big title). */
@font-face { font-family: "Mochiy Pop One"; src: url("../assets/fonts/Mochiy-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Zen Maru Gothic"; src: url("../assets/fonts/ZenMaru-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Zen Maru Gothic"; src: url("../assets/fonts/ZenMaru-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Zen Maru Gothic"; src: url("../assets/fonts/ZenMaru-900.woff2") format("woff2"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Rampart One"; src: url("../assets/fonts/Rampart-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --navy: #1A2440; --navy2: #22305A; --tuna: #C8283C; --tuna2: #A81D31; --fat: #F3A3A8; --rice: #FFFDF5; --cream: #F7E9C9; --gold: #F6C445;
  --ink: #1B1B24; --glass: #BFE3F2; --wasabi: #7CB342; --blue: #3B6FD8; --grey: #6A6F7D;
  --pop: "Mochiy Pop One", "Zen Maru Gothic", system-ui, sans-serif; --sans: "Zen Maru Gothic", system-ui, -apple-system, "Segoe UI", sans-serif; --big: "Rampart One", "Mochiy Pop One", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 400 18px/1.6 var(--sans); }
a { color: var(--tuna); }
img { max-width: 100%; }
.jp { font-family: var(--pop); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.go { font: 400 18px var(--pop); background: var(--tuna); color: #fff; border: 3px solid var(--ink); border-radius: 14px; padding: 9px 22px; cursor: pointer; box-shadow: 0 5px 0 var(--ink); }
.go:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.go.small { font-size: 15px; padding: 6px 14px; box-shadow: 0 4px 0 var(--ink); }
section { max-width: 1240px; margin: 0 auto; padding: 84px 28px 40px; }
section > * { min-width: 0; }
.sec-h { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.dep { margin: 0; font: 400 22px var(--pop); background: var(--navy); color: var(--gold); padding: 4px 14px; border-radius: 10px; }
.sec-h h2 { margin: 0; font: 400 clamp(36px, 5vw, 60px)/1.05 var(--pop); color: var(--navy); }
.bk { margin-left: auto; font-weight: 700; font-size: 15px; }
.lede { max-width: 72ch; margin: 0 0 22px; font-size: 19px; }

/* ---------------------------------------------------------------- 1. the stop */
.stop { position: relative; overflow: hidden; background: linear-gradient(180deg, #121A33 0%, var(--navy) 45%, #2B3B6E 100%); color: var(--rice); }
.sky { position: absolute; inset: 0; pointer-events: none; }
.sky::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(#fff 1px, transparent 1.5px), radial-gradient(#fff 1px, transparent 1.5px); background-size: 140px 120px, 190px 170px; background-position: 20px 30px, 90px 70px; opacity: .35; }
.skyline { position: absolute; left: 0; right: 0; bottom: 280px; height: 230px; background: #121A33; clip-path: polygon(0 100%, 0 60%, 4% 60%, 4% 40%, 9% 40%, 9% 55%, 13% 55%, 13% 30%, 18% 30%, 18% 62%, 24% 62%, 24% 48%, 28% 48%, 28% 70%, 34% 70%, 34% 35%, 36% 35%, 36% 20%, 38% 20%, 38% 35%, 40% 35%, 40% 66%, 46% 66%, 46% 52%, 52% 52%, 52% 74%, 58% 74%, 58% 42%, 63% 42%, 63% 58%, 68% 58%, 69.5% 30%, 71% 4%, 72.5% 30%, 74% 58%, 78% 58%, 78% 46%, 84% 46%, 84% 64%, 90% 64%, 90% 38%, 95% 38%, 95% 56%, 100% 56%, 100% 100%); }
.st-in { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 54px 28px 0; display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 30px; align-items: start; }
.st-k { margin: 0 0 10px; font-size: 16px; font-weight: 700; color: var(--gold); letter-spacing: .04em; }
.stop h1 { margin: 0; font: 400 clamp(80px, 12vw, 176px)/.9 var(--big); color: var(--rice); }
.stop h1 span { color: var(--gold); }
.st-sub { max-width: 58ch; font-size: 19px; margin: 18px 0 0; color: #DCE3F5; }
.st-toro { width: 230px; justify-self: end; animation: bob 2.4s ease-in-out infinite; }
.st-toro svg { width: 100%; height: auto; display: block; }
@keyframes bob { 50% { transform: translateY(-10px) rotate(-3deg); } }
.road { position: relative; z-index: 1; height: 430px; margin-top: 0; background: linear-gradient(180deg, transparent 0 360px, #2E2E3A 360px 430px); }
.road::after { content: ""; position: absolute; left: 0; right: 0; top: 392px; height: 6px; background: repeating-linear-gradient(90deg, var(--gold) 0 60px, transparent 60px 110px); }
.bus-drive { position: absolute; left: 50%; bottom: 40px; width: min(860px, 92vw); transform: translateX(-50%); animation: arrive 1.6s cubic-bezier(.2, .8, .3, 1) both; }
.bus-drive svg { width: 100%; height: auto; display: block; }
.bus-drive .belt-plates { animation: belt 1.8s linear infinite; }
@keyframes arrive { from { transform: translateX(-160%); } to { transform: translateX(-50%); } }
@keyframes belt { from { transform: translateX(0); } to { transform: translateX(120px); } }
.timetable { position: relative; z-index: 2; max-width: 1180px; margin: 0 auto 34px; background: var(--rice); color: var(--ink); border-radius: 14px; border: 4px solid var(--ink); box-shadow: 0 8px 0 rgba(0,0,0,.35); overflow: hidden; }
.tt-h { margin: 0; background: var(--blue); color: #fff; font: 400 20px var(--pop); padding: 8px 18px; display: flex; align-items: center; gap: 10px; }
.tt-h .jp { margin-left: auto; font-size: 16px; opacity: .85; }
.tt-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px rgba(255,255,255,.4); }
.timetable ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.timetable li + li { border-left: 2px dashed #C9CED8; }
.timetable a { display: flex; flex-direction: column; padding: 10px 16px 12px; text-decoration: none; color: var(--ink); }
.timetable a:hover { background: #FFF1C2; }
.timetable b { font: 400 30px/1.1 var(--pop); color: var(--tuna); font-variant-numeric: tabular-nums; }
.timetable span { font-weight: 700; font-size: 16px; }

/* ---------------------------------------------------------------- 2. the loop */
.loop-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, .6fr); gap: 26px; align-items: center; }
#map { width: 100%; height: auto; display: block; border-radius: 24px; border: 5px solid var(--ink); }
.mstop { cursor: pointer; }
.mstop circle { transition: fill .2s; }
.mstop.on circle { fill: var(--gold); }
.mstop:focus-visible { outline: none; }
.mstop:focus-visible circle { stroke: var(--gold); stroke-width: 7; }
.stopcard { background: var(--rice); border: 4px solid var(--ink); border-radius: 18px; padding: 18px 20px; box-shadow: 8px 8px 0 var(--navy); }
.stopcard p { margin: 0 0 10px; }
.sc-n { font-size: 14px; font-weight: 700; color: var(--grey); text-transform: uppercase; letter-spacing: .1em; }
.sc-t { font: 400 26px/1.2 var(--pop); color: var(--navy); }
.sc-t .jp { font-size: 18px; color: var(--tuna); }

/* ---------------------------------------------------------------- 3. belt duty */
.cab { background: var(--navy); color: var(--rice); border-radius: 30px; padding: 18px; border: 5px solid var(--ink); }
.cab-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.cab-time, .cab-score { margin: 0; display: flex; align-items: baseline; gap: 8px; background: var(--rice); color: var(--ink); border-radius: 12px; padding: 4px 14px; border: 3px solid var(--ink); }
.cab-time span, .cab-score span { font: 400 30px var(--pop); color: var(--tuna); font-variant-numeric: tabular-nums; }
.cab-time small, .cab-score small { font-size: 13px; color: var(--grey); }
.cab-msg { margin: 0; flex: 1 1 280px; font-weight: 700; font-size: 18px; min-height: 1.6em; }
#belt { width: 100%; height: auto; display: block; border-radius: 18px; border: 4px solid var(--ink); background: var(--cream); touch-action: manipulation; }
.cab-ctl { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 14px; margin-top: 14px; align-items: stretch; }
.plates { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.plates button { background: var(--rice); border: 3px solid var(--ink); border-radius: 16px; padding: 6px 4px 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; font: 700 14px var(--sans); color: var(--ink); box-shadow: 0 4px 0 #0D1428; }
.plates button:active { transform: translateY(3px); box-shadow: 0 1px 0 #0D1428; }
.plates svg { width: 64px; height: auto; }
.brace { font: 400 16px/1.15 var(--pop); background: var(--gold); color: var(--ink); border: 4px solid var(--ink); border-radius: 50%; aspect-ratio: 1; cursor: pointer; box-shadow: 0 6px 0 #0D1428; touch-action: none; user-select: none; -webkit-user-select: none; }
.brace b { font-weight: 400; font-size: 24px; }
.brace.on { background: var(--wasabi); transform: translateY(4px); box-shadow: 0 2px 0 #0D1428; }
.cab-bot { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.cab-stats { margin: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; flex: 1 1 520px; }
.cab-stats div { background: var(--navy2); border-radius: 12px; padding: 6px 10px; }
.cab-stats dt { font-size: 12px; color: #AEB8D6; text-transform: uppercase; letter-spacing: .08em; }
.cab-stats dd { margin: 0; font: 400 22px var(--pop); color: var(--gold); }
.cab-help { margin: 12px 0 0; font-size: 15px; color: #AEB8D6; }

/* ---------------------------------------------------------------- 4. the ticket */
.tk-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, .5fr); gap: 26px; align-items: start; }
.tix { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); background: var(--rice); border: 4px solid var(--ink); border-radius: 18px; position: relative; box-shadow: 0 10px 0 var(--navy); }
.tix::before, .tix::after { content: ""; position: absolute; left: calc(62.5% - 16px); width: 32px; height: 32px; border-radius: 50%; background: var(--cream); border: 4px solid var(--ink); }
.tix::before { top: -18px; } .tix::after { bottom: -18px; }
.tx-main { padding: 22px 26px; border-right: 4px dashed var(--ink); min-width: 0; background: linear-gradient(90deg, var(--tuna) 0 14px, transparent 14px); }
.tx-k { margin: 0; font-size: 14px; font-weight: 700; color: var(--grey); text-transform: uppercase; letter-spacing: .1em; }
.tx-t { margin: 4px 0 0; font: 400 clamp(40px, 5vw, 60px)/1 var(--pop); color: var(--tuna); }
.tx-n { margin: 2px 0 14px; font-weight: 700; font-size: 18px; }
.tx-l { margin: 0; font-size: 13px; font-weight: 700; color: var(--grey); text-transform: uppercase; letter-spacing: .1em; }
.tx-ca { display: block; font-size: 15px; word-break: break-all; margin: 4px 0 12px; background: #F2EEE2; padding: 8px 10px; border-radius: 8px; }
.tx-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.tx-ok { font-weight: 700; color: var(--wasabi); }
.tx-terms { margin: 16px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tx-terms div { border-top: 3px solid var(--ink); padding-top: 4px; }
.tx-terms dt { font-size: 12px; font-weight: 700; color: var(--grey); text-transform: uppercase; letter-spacing: .08em; }
.tx-terms dd { margin: 0; font: 400 18px var(--pop); word-break: break-all; }
.tx-stub { padding: 22px 22px; min-width: 0; }
.stub-k { margin: 0 0 6px; font: 400 18px var(--pop); color: var(--navy); }
.fares { list-style: none; margin: 0; padding: 0; }
.fares li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 2px dotted #C9CED8; font-size: 16px; }
.fares b { font: 400 17px var(--pop); color: var(--tuna); }
.fares b.up { color: var(--wasabi); } .fares b.down { color: var(--tuna2); }
.fares sub { font-size: .6em; }
.stub-at { margin: 10px 0 0; font-size: 13px; color: var(--grey); }
.boarding { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.boarding a { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); background: var(--rice); border: 3px solid var(--ink); border-radius: 999px; padding: 6px 18px 6px 6px; font-weight: 700; box-shadow: 0 4px 0 var(--navy); }
.boarding a:hover { background: #FFF1C2; }
.boarding img { width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--tuna); background: #fff; object-fit: cover; }
.window { margin: 46px auto 0; max-width: 1080px; background: var(--tuna); border-radius: 46px; padding: 18px 22px 16px; border: 5px solid var(--ink); }
.w-sign { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 auto 12px; width: max-content; max-width: 100%; background: var(--ink); color: var(--gold); font: 400 15px var(--pop); padding: 6px 16px; border-radius: 10px; box-shadow: 0 0 18px rgba(246,196,69,.5); }
.belt-ico { width: 22px; height: 14px; border: 3px solid var(--gold); border-radius: 4px; position: relative; }
.belt-ico::after { content: ""; position: absolute; left: 6px; top: -7px; width: 4px; height: 22px; background: var(--gold); transform: rotate(35deg); }
.w-glass { position: relative; height: 520px; border-radius: 34px; overflow: hidden; border: 12px solid #2E2E3A; box-shadow: inset 0 0 0 3px #555, 0 0 0 4px var(--ink); background: #0F1424; }
.w-glass iframe { width: 100%; height: 100%; border: 0; display: block; }
.w-wait { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #C9CED8; font: 400 18px var(--pop); background: #0F1424; transition: opacity .4s; }
.w-wait.off { opacity: 0; pointer-events: none; }
.window figcaption { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: #fff; font-weight: 700; margin-top: 10px; font-size: 15px; }
.window figcaption a { color: var(--gold); }

/* ---------------------------------------------------------------- 5. the plates */
.menu-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.counter { background: var(--rice); border: 4px solid var(--ink); border-radius: 22px; padding: 20px 22px; }
.ct-h { margin: 0 0 12px; font: 400 22px var(--pop); color: var(--navy); }
.ct-seat { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.ct-seat button { font: 700 15px var(--sans); border: 3px solid var(--ink); background: #fff; border-radius: 999px; padding: 5px 14px; cursor: pointer; color: var(--ink); }
.ct-seat button[aria-pressed=true] { background: var(--navy); color: var(--gold); }
.ct-n { display: block; font-weight: 700; }
.ct-n input { width: 100%; accent-color: var(--tuna); }
.ct-out { font-size: 18px; margin: 10px 0; }
.ct-out b { font: 400 26px var(--pop); color: var(--tuna); }
.ct-out small { display: block; color: var(--grey); font-size: 14px; }
.stack { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; justify-content: center; min-height: 90px; padding-top: 30px; }
.tower { display: flex; flex-direction: column-reverse; align-items: center; }
.tower span { display: block; width: 74px; margin-top: -30px; transform: translateX(calc(sin(var(--i) * 1rad) * 4px)); }
.stack svg { width: 100%; height: auto; display: block; }
.facts { background: #5B3A22; color: #FFF6E8; border-radius: 22px; padding: 20px 24px; border: 4px solid var(--ink); box-shadow: inset 0 0 0 6px #6E482B; }
.fx-h { margin: 0 0 8px; font: 400 22px var(--pop); color: var(--gold); }
.facts ul { margin: 0; padding-left: 20px; }
.facts li { margin-bottom: 8px; }
.facts b { color: var(--gold); }

/* ---------------------------------------------------------------- 6. the back of the bus */
.terminus { margin-top: 70px; background: #2E2E3A; padding: 40px 20px 30px; }
.rear { max-width: 760px; margin: 0 auto; background: var(--tuna); border: 6px solid var(--ink); border-radius: 50px 50px 30px 30px; padding: 26px 28px 34px; position: relative; text-align: center; color: #fff; }
.rear-win { height: 120px; border-radius: 26px; background: linear-gradient(160deg, var(--glass), #8CC6DE); border: 6px solid var(--ink); display: flex; align-items: center; justify-content: center; }
.rear-win .jp { font-size: 34px; color: var(--navy); }
.plate-no { display: inline-flex; gap: 14px; align-items: baseline; margin: 22px 0 18px; background: #fff; color: var(--ink); border: 4px solid var(--ink); border-radius: 10px; padding: 6px 22px; font: 400 26px var(--pop); }
.plate-no b { font-weight: 400; color: var(--blue); font-size: 22px; }
.stopbtns { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px 20px; justify-content: center; }
.stopbtns a { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; text-decoration: none; background: rgba(0,0,0,.18); border-radius: 999px; padding: 4px 16px 4px 4px; }
.stopbtns i { width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #FF8A8A, #E3262E 60%); border: 4px solid #FFD54F; box-shadow: 0 3px 0 var(--ink); }
.stopbtns a:hover i { background: radial-gradient(circle at 40% 35%, #FFE08A, #F6C445 60%); }
.rear-lights span { position: absolute; bottom: 30px; width: 26px; height: 60px; border-radius: 10px; background: #FF4A4A; border: 4px solid var(--ink); box-shadow: 0 0 16px rgba(255,74,74,.6); }
.rear-lights span:first-child { left: 22px; } .rear-lights span:last-child { right: 22px; }
.term-small { max-width: 820px; margin: 26px auto 0; text-align: center; color: #C9CED8; font-size: 14px; }

/* ---------------------------------------------------------------- small screens */
@media (max-width: 1000px) {
  .st-in { grid-template-columns: minmax(0, 1fr) 160px; }
  .st-toro { width: 150px; }
  .timetable ol { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .timetable li + li { border-left: 0; }
  .timetable li { border-top: 2px dashed #C9CED8; }
  .loop-grid, .tk-row, .menu-grid { grid-template-columns: minmax(0, 1fr); }
  .cab-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .w-glass { height: 440px; }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  section { padding: 64px 16px 30px; }
  .st-in { padding: 36px 16px 0; grid-template-columns: minmax(0, 1fr); }
  .st-toro { position: absolute; right: 12px; top: 14px; width: 92px; }
  .st-k { padding-right: 100px; }
  .road { height: 230px; background: linear-gradient(180deg, transparent 0 180px, #2E2E3A 180px 230px); }
  .road::after { top: 204px; }
  .bus-drive { bottom: 22px; }
  .skyline { bottom: 150px; height: 160px; }
  .timetable { margin: 0 12px 24px; }
  .timetable b { font-size: 24px; }
  .tix { grid-template-columns: minmax(0, 1fr); }
  .tix::before, .tix::after { display: none; }
  .tx-main { border-right: 0; border-bottom: 4px dashed var(--ink); padding: 18px 16px 18px 26px; }
  .cab { padding: 10px; border-radius: 20px; }
  .cab-ctl { grid-template-columns: minmax(0, 1fr); }
  .plates { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .plates button { padding: 4px 0; font-size: 11px; }
  .plates svg { width: 44px; }
  .brace { aspect-ratio: auto; border-radius: 16px; padding: 12px; }
  .cab-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .w-glass { height: 400px; border-width: 8px; border-radius: 24px; }
  .window { padding: 12px; border-radius: 30px; }
  .bk { margin-left: 0; width: 100%; }
  .rear { padding: 20px 14px 30px; }
  .rear-lights span { width: 14px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .st-toro, .bus-drive, .bus-drive .belt-plates { animation: none; }
  .bus-drive { transform: translateX(-50%); }
  .mstop circle, .w-wait { transition: none; }
}
