:root {
  color-scheme: light;
  font-family: Inter, ui-rounded, "SF Pro Rounded", "PingFang SC", "Microsoft YaHei", sans-serif;
  --ink: #173747;
  --paper: #fff9e9;
  --accent: #f24e42;
  --cycle-speed: 1.05s;
  --world-speed: 8s;
  --bounce-speed: .52s;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-width: 320px;
  min-height: 100%;
  overflow: hidden;
  background: #79cbe6;
  color: var(--ink);
}

body { min-height: 100svh; }

.app {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  isolation: isolate;
}

.control-input {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

#pace-slow:checked ~ .scene {
  --cycle-speed: 1.65s;
  --world-speed: 13s;
  --bounce-speed: .82s;
}

#pace-fast:checked ~ .scene {
  --cycle-speed: .58s;
  --world-speed: 4.4s;
  --bounce-speed: .29s;
}

.topbar {
  position: fixed;
  z-index: 20;
  inset: 28px 32px auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  pointer-events: none;
}

.brand,
.pace,
.bell,
.trip-card {
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  background: color-mix(in srgb, var(--paper) 76%, transparent);
  border: 1px solid rgba(255,255,255,.66);
  box-shadow: 0 12px 32px rgba(16,62,80,.13), inset 0 1px 0 rgba(255,255,255,.78);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 15px 8px 9px;
  border-radius: 18px;
}

.brand svg { width: 42px; height: 42px; }
.brand svg circle { fill: var(--ink); }
.brand svg path:first-of-type { fill: var(--paper); }
.brand svg path:last-of-type { fill: #f6b550; }
.brand span {
  font-size: .73rem;
  line-height: .91;
  font-weight: 950;
  letter-spacing: .07em;
}

.pace {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border-radius: 999px;
}

.pace-label {
  padding: 0 10px;
  font-size: .78rem;
  font-weight: 760;
  opacity: .62;
}

.pace label {
  cursor: pointer;
  min-width: 58px;
  padding: 10px 13px;
  border-radius: 999px;
  text-align: center;
  font-size: .84rem;
  font-weight: 800;
  transition: color .2s, background .2s, transform .2s;
}

.pace label:hover { transform: translateY(-1px); }

#pace-slow:checked ~ .topbar label[for="pace-slow"],
#pace-normal:checked ~ .topbar label[for="pace-normal"],
#pace-fast:checked ~ .topbar label[for="pace-fast"] {
  color: #fff;
  background: var(--ink);
}

.scene {
  position: relative;
  width: 100%;
  height: 100%;
  --cycle-speed: 1.05s;
  --world-speed: 8s;
  --bounce-speed: .52s;
}

.world {
  display: block;
  width: 100%;
  height: 100%;
  filter: saturate(1.04);
}

.intro {
  position: absolute;
  z-index: 10;
  top: clamp(118px, 16vh, 155px);
  left: clamp(24px, 6vw, 92px);
  pointer-events: none;
  color: var(--ink);
}

.intro p {
  margin: 0 0 12px;
  font-size: clamp(.72rem, 1.1vw, .9rem);
  letter-spacing: .17em;
  font-weight: 850;
}

.intro h1 {
  margin: 0;
  font-size: clamp(2.6rem, 6.7vw, 7rem);
  line-height: .84;
  letter-spacing: -.075em;
  font-weight: 950;
}

.intro em {
  color: var(--paper);
  font-style: normal;
  text-shadow: 0 5px 0 rgba(23,55,71,.15);
}

.bell {
  position: absolute;
  z-index: 15;
  right: 34px;
  top: 106px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px 9px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 850;
  transition: transform .2s ease, background .2s ease;
}

.bell:hover { transform: rotate(-3deg) scale(1.04); }
.bell svg { width: 30px; height: 30px; }
.bell path, .bell circle {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sound {
  position: absolute;
  z-index: 14;
  top: 178px;
  right: 42px;
  padding: 12px 17px;
  border-radius: 18px 4px 18px 18px;
  color: #fff;
  background: var(--accent);
  font-size: 1rem;
  font-weight: 900;
  opacity: 0;
  transform: translateY(-8px) rotate(4deg) scale(.8);
  transform-origin: top right;
  pointer-events: none;
}

#ring-bell:checked ~ .scene .sound {
  animation: pop .85s cubic-bezier(.2,.9,.2,1) both;
}

#ring-bell:checked ~ .scene .bell svg {
  animation: bell-ring .22s ease-in-out 4;
}

.trip-card {
  position: absolute;
  z-index: 12;
  left: 32px;
  bottom: 28px;
  display: grid;
  grid-template-columns: auto auto minmax(175px, 1fr);
  min-width: min(530px, calc(100% - 64px));
  padding: 12px 14px;
  border-radius: 23px;
}

.trip-card > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 53px;
  padding: 2px 19px;
  border-right: 1px solid rgba(23,55,71,.14);
}

.trip-card > div:first-child { padding-left: 8px; }
.trip-card > div:last-child { border: 0; }
.trip-card span {
  font-size: .72rem;
  font-weight: 760;
  opacity: .62;
}
.trip-card strong {
  margin-top: 3px;
  font-size: 1.38rem;
  line-height: 1;
  font-weight: 950;
}
.trip-card small { font-size: .68rem; letter-spacing: .02em; }

.trip-card .route {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.route span { opacity: 1; white-space: nowrap; }
.route svg { width: 62px; }
.route path { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

.rider {
  animation: rider-bob var(--bounce-speed) ease-in-out infinite alternate;
  transform-box: view-box;
  transform-origin: 660px 690px;
}

.wheel {
  animation: wheel-turn var(--cycle-speed) linear infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.pedal {
  animation: pedal-turn var(--cycle-speed) linear infinite;
  transform-box: view-box;
  transform-origin: 659px 697px;
}

.wing {
  animation: wing-sway calc(var(--cycle-speed) * 1.25) ease-in-out infinite alternate;
  transform-box: view-box;
  transform-origin: 610px 438px;
}

.scarf {
  animation: scarf-wave calc(var(--cycle-speed) * .7) ease-in-out infinite alternate;
  transform-box: view-box;
  transform-origin: 680px 330px;
}

.fish-tail {
  animation: fish-wiggle .45s ease-in-out infinite alternate;
  transform-box: view-box;
  transform-origin: 845px 553px;
}

.leg-front {
  animation: leg-front var(--cycle-speed) ease-in-out infinite;
  transform-box: view-box;
  transform-origin: 675px 531px;
}

.leg-back {
  animation: leg-back var(--cycle-speed) ease-in-out infinite;
  transform-box: view-box;
  transform-origin: 648px 531px;
}

.clouds { animation: cloud-drift calc(var(--world-speed) * 3.4) linear infinite; }
.horizon-move { animation: horizon-breathe 5s ease-in-out infinite alternate; }
.lane-line, .road-details { animation: road-rush var(--world-speed) linear infinite; }
.foreground-grass { animation: grass-sway 1.2s ease-in-out infinite alternate; transform-origin: bottom; }

@keyframes wheel-turn { to { transform: rotate(360deg); } }
@keyframes pedal-turn { to { transform: rotate(360deg); } }
@keyframes rider-bob {
  from { transform: translateY(0) rotate(-.2deg); }
  to { transform: translateY(-7px) rotate(.25deg); }
}
@keyframes wing-sway {
  from { transform: rotate(-5deg); }
  to { transform: rotate(8deg) translateY(-4px); }
}
@keyframes scarf-wave {
  from { transform: rotate(-2deg) skewX(0); }
  to { transform: rotate(4deg) skewX(-6deg); }
}
@keyframes fish-wiggle {
  from { transform: rotate(-2deg); }
  to { transform: rotate(3deg); }
}
@keyframes leg-front {
  0%,100% { transform: rotate(-11deg); }
  50% { transform: rotate(13deg); }
}
@keyframes leg-back {
  0%,100% { transform: rotate(13deg); }
  50% { transform: rotate(-11deg); }
}
@keyframes cloud-drift {
  from { transform: translateX(0); }
  to { transform: translateX(-1050px); }
}
@keyframes road-rush {
  from { transform: translateX(0); }
  to { transform: translateX(-450px); }
}
@keyframes horizon-breathe {
  from { transform: translateY(0); }
  to { transform: translateY(5px); }
}
@keyframes grass-sway {
  from { transform: skewX(-1deg); }
  to { transform: skewX(2deg); }
}
@keyframes pop {
  0% { opacity: 0; transform: translateY(-8px) rotate(4deg) scale(.8); }
  20%,78% { opacity: 1; transform: translateY(0) rotate(-2deg) scale(1); }
  100% { opacity: 0; transform: translateY(7px) rotate(-2deg) scale(.95); }
}
@keyframes bell-ring {
  0%,100% { transform: rotate(0); }
  50% { transform: rotate(16deg); }
}

@media (max-width: 760px) {
  .app { min-height: 520px; }
  .topbar { inset: 16px 16px auto; }
  .brand { border-radius: 15px; padding: 7px; }
  .brand svg { width: 36px; height: 36px; }
  .brand span, .pace-label { display: none; }
  .pace label { min-width: 0; padding: 9px 10px; font-size: .76rem; }
  .intro { top: 112px; left: 20px; }
  .intro h1 { font-size: clamp(2.45rem, 13vw, 4.2rem); }
  .bell { top: auto; right: 16px; bottom: 19px; }
  .bell span { display: none; }
  .bell { padding: 8px; }
  .sound { top: auto; right: 18px; bottom: 72px; }
  .trip-card {
    left: 16px;
    bottom: 18px;
    min-width: 0;
    width: calc(100% - 86px);
    grid-template-columns: 1fr 1fr;
    border-radius: 18px;
    padding: 9px 10px;
  }
  .trip-card > div { min-height: 45px; padding: 0 10px; }
  .trip-card strong { font-size: 1.15rem; }
  .trip-card .route { display: none; }
  .world { width: 140%; margin-left: -25%; }
}

@media (max-height: 670px) and (min-width: 761px) {
  .intro { top: 118px; }
  .intro h1 { font-size: 4.3rem; }
  .trip-card { bottom: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
