:root {
  color-scheme: light;
  --ink: #123d4d;
  --ink-deep: #092c3a;
  --sea: #2cb9c8;
  --sun: #ffcc70;
  --coral: #f26b52;
  --glass: rgba(245, 253, 251, 0.78);
  --glass-strong: rgba(249, 255, 253, 0.9);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #75d8e7;
}

body { color: var(--ink); }

button, input { font: inherit; }

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

#experience, #scene {
  position: fixed;
  inset: 0;
}

#scene canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

#scene canvas:active { cursor: grabbing; }

.masthead {
  position: fixed;
  z-index: 4;
  top: max(24px, env(safe-area-inset-top));
  left: max(24px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 13px;
  pointer-events: none;
  filter: drop-shadow(0 10px 24px rgba(7, 52, 67, .13));
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: var(--ink);
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}

.brand-mark span {
  position: absolute;
  width: 23px;
  height: 18px;
  left: 11px;
  top: 15px;
  background: #f5a248;
  border-radius: 46% 46% 50% 50%;
}

.brand-mark span::before,
.brand-mark span::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 10px;
  top: -5px;
  background: #f5a248;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.brand-mark span::before { left: 1px; transform: rotate(-12deg); }
.brand-mark span::after { right: 1px; transform: rotate(12deg); }

.brand-mark i {
  position: absolute;
  width: 35px;
  height: 7px;
  left: 6px;
  bottom: 7px;
  border-bottom: 2px solid #61d5dc;
  border-radius: 50%;
}

.eyebrow {
  margin: 0 0 2px;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: .15em;
  color: rgba(11, 57, 72, .72);
}

h1 {
  margin: 0;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  line-height: 1.05;
  letter-spacing: -.04em;
  color: var(--ink-deep);
}

.ride-card {
  position: fixed;
  z-index: 4;
  top: max(24px, env(safe-area-inset-top));
  right: max(24px, env(safe-area-inset-right));
  width: 174px;
  padding: 15px 16px 13px;
  border: 1px solid rgba(255,255,255,.66);
  border-radius: 19px;
  background: var(--glass);
  box-shadow: 0 16px 50px rgba(8, 62, 75, .16);
  backdrop-filter: blur(16px) saturate(1.2);
}

.ride-card__top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 5px rgba(242,107,82,.14);
  animation: pulse 2s ease-in-out infinite;
}

.speed-readout {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 8px 0 5px;
}

.speed-readout strong {
  font-size: 2.45rem;
  line-height: 1;
  letter-spacing: -.07em;
  color: var(--ink-deep);
}

.speed-readout span { font-size: 13px; font-weight: 800; }

.breeze {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(18,61,77,.12);
  font-size: 12px;
}

.breeze span { opacity: .62; }
.breeze b { font-weight: 750; }

.hint {
  position: fixed;
  z-index: 4;
  left: max(24px, env(safe-area-inset-left));
  bottom: max(30px, calc(env(safe-area-inset-bottom) + 18px));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 10px 11px;
  border-radius: 999px;
  color: rgba(255,255,255,.9);
  background: rgba(8,43,57,.57);
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(10px);
  font-size: 13px;
  font-weight: 650;
  pointer-events: none;
  transition: opacity .5s ease, transform .5s ease;
}

.hint.is-hidden { opacity: 0; transform: translateY(8px); }

.mouse-icon {
  width: 18px;
  height: 23px;
  border: 2px solid currentColor;
  border-radius: 10px;
  position: relative;
}

.mouse-icon::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 4px;
  width: 2px;
  height: 5px;
  border-radius: 2px;
  background: currentColor;
}

.controls {
  position: fixed;
  z-index: 5;
  left: 50%;
  bottom: max(24px, calc(env(safe-area-inset-bottom) + 12px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px;
  border: 1px solid rgba(255,255,255,.62);
  border-radius: 19px;
  background: var(--glass-strong);
  box-shadow: 0 18px 52px rgba(8, 52, 66, .2);
  backdrop-filter: blur(18px) saturate(1.25);
}

.control-button {
  height: 45px;
  min-width: 116px;
  padding: 0 15px;
  border: 0;
  border-radius: 13px;
  color: var(--ink);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}

.control-button:hover { background: rgba(18,61,77,.08); }
.control-button:active { transform: scale(.97); }

.control-button.primary {
  min-width: 98px;
  color: white;
  background: var(--ink);
}

.control-button.primary:hover { background: #1a5669; }

.pause-icon {
  width: 13px;
  height: 14px;
  border-left: 4px solid currentColor;
  border-right: 4px solid currentColor;
}

.control-button[aria-pressed="true"] .pause-icon {
  width: 0;
  height: 0;
  border-left: 11px solid currentColor;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-right: 0;
}

.camera-icon {
  width: 18px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 4px;
  position: relative;
}

.camera-icon::before {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  left: 4px;
  top: 2px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.camera-icon::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 3px;
  left: 3px;
  top: -5px;
  border-radius: 2px 2px 0 0;
  background: currentColor;
}

.speed-control {
  min-width: 182px;
  padding: 0 13px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 800;
}

.speed-control input {
  width: 110px;
  height: 18px;
  accent-color: var(--coral);
  cursor: pointer;
}

.corner-note {
  position: fixed;
  z-index: 3;
  right: max(28px, env(safe-area-inset-right));
  bottom: max(34px, calc(env(safe-area-inset-bottom) + 22px));
  color: rgba(255,255,255,.75);
  text-shadow: 0 1px 10px rgba(0,35,47,.5);
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}

.loading {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 15px;
  color: var(--ink);
  background: linear-gradient(165deg, #dff8ee, #75d8e7 64%, #3cbacb);
  transition: opacity .6s ease, visibility .6s ease;
}

.loading.is-hidden { opacity: 0; visibility: hidden; }
.loading p { margin: 0; font-size: 14px; font-weight: 800; letter-spacing: .05em; }

.loading-cat {
  width: 58px;
  height: 58px;
  border-radius: 19px;
  background: var(--ink);
  position: relative;
  box-shadow: 0 15px 38px rgba(9,53,67,.22);
  animation: bob 1.15s ease-in-out infinite;
}

.loading-cat span {
  position: absolute;
  width: 30px;
  height: 23px;
  left: 14px;
  top: 20px;
  border-radius: 45%;
  background: #f5a248;
}

.loading-cat span::before,
.loading-cat span::after {
  content: "";
  position: absolute;
  top: -7px;
  width: 11px;
  height: 12px;
  background: #f5a248;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.loading-cat span::before { left: 1px; }
.loading-cat span::after { right: 1px; }

.error-panel {
  position: fixed;
  z-index: 30;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(88vw, 420px);
  padding: 24px;
  border-radius: 20px;
  text-align: center;
  background: white;
  box-shadow: 0 24px 70px rgba(8,52,66,.3);
}

.error-panel strong { font-size: 1.2rem; }
.error-panel p { margin: 8px 0 0; font-size: 16px; line-height: 1.6; }

@keyframes pulse { 50% { transform: scale(.82); opacity: .7; } }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-2deg); } }

@media (max-width: 720px) {
  .masthead { top: max(17px, env(safe-area-inset-top)); left: max(16px, env(safe-area-inset-left)); }
  .brand-mark { width: 42px; height: 42px; border-radius: 13px; }
  .brand-mark span { left: 10px; top: 14px; transform: scale(.9); }
  .ride-card { top: max(16px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right)); width: 132px; padding: 12px 13px 10px; }
  .ride-card__top { font-size: 12px; }
  .speed-readout { margin: 7px 0 4px; }
  .speed-readout strong { font-size: 2rem; }
  .breeze { display: none; }
  .controls { width: calc(100% - 24px); bottom: max(12px, env(safe-area-inset-bottom)); justify-content: space-between; border-radius: 17px; }
  .control-button { min-width: 0; padding: 0 12px; flex: 0 0 auto; }
  .control-button.primary { min-width: 82px; }
  .speed-control { min-width: 0; padding: 0 5px; gap: 7px; flex: 1; }
  .speed-control input { width: 100%; min-width: 70px; }
  .corner-note { display: none; }
  .hint { left: 50%; bottom: 88px; transform: translateX(-50%); white-space: nowrap; }
  .hint.is-hidden { transform: translate(-50%, 8px); }
}

@media (max-width: 440px) {
  .eyebrow { display: none; }
  h1 { font-size: 1.24rem; }
  .brand-mark { width: 38px; height: 38px; }
  .brand-mark span { left: 8px; top: 12px; }
  .ride-card { width: auto; min-width: 98px; }
  .ride-card__top span:last-child { display: none; }
  .speed-readout { justify-content: flex-end; margin: 0; }
  .control-button { padding: 0 10px; }
  .control-button span:last-child { display: none; }
  .control-button.primary { min-width: 48px; }
  .speed-control span { display: none; }
  .hint { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .live-dot, .loading-cat { animation: none; }
  .control-button, .hint, .loading { transition-duration: .01ms; }
}

