:root {
  color-scheme: light;
  --ink: #393a32;
  --accent: #943f32;
  --line: #6e6a594d;
  --paper: #eee9dd;
  font-family: 'PingFang SC', 'Hiragino Sans GB', system-ui, sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}
main {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 370px;
  background: radial-gradient(ellipse at 63% 32%, #f6f3e9, #dad5c7);
}
#map {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: ew-resize;
}
header,
nav,
footer {
  position: absolute;
  z-index: 1;
}
header {
  top: max(5.5%, env(safe-area-inset-top));
  left: clamp(24px, 5vw, 86px);
  pointer-events: none;
}
h1 {
  margin: 0;
  font-family: 'Songti SC', 'STSong', 'Noto Serif CJK SC', Georgia, serif;
  font-weight: 500;
  font-size: clamp(42px, 5.2vw, 84px);
  letter-spacing: 0.12em;
  line-height: 1.1;
}
html[lang='en'] h1 {
  letter-spacing: -0.06em;
  max-width: 6.7em;
}
header p {
  font-size: 13px;
  margin: 0.9em 0 0;
  color: #514f43;
  letter-spacing: 0.08em;
}
nav {
  right: clamp(16px, 4vw, 76px);
  top: max(4.5%, env(safe-area-inset-top));
  display: flex;
  align-items: center;
}
button,
a,
input {
  accent-color: var(--accent);
  font: inherit;
  color: inherit;
}
button,
a {
  background: transparent;
  border: 0;
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-underline-offset: 4px;
}
nav button {
  font-size: 21px;
}
nav a {
  font-size: 12px;
  margin-left: 8px;
}
button:hover,
a:hover {
  color: var(--accent);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
#map:focus-visible {
  outline-offset: -4px;
}
footer {
  bottom: max(4%, env(safe-area-inset-bottom));
  left: clamp(24px, 5vw, 86px);
  right: clamp(24px, 5vw, 86px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  pointer-events: none;
}
.cartouche {
  white-space: nowrap;
  font:
    12px/1.7 'Songti SC',
    Georgia,
    serif;
  letter-spacing: 0.07em;
  border-left: 2px solid var(--accent);
  padding-left: 9px;
  text-shadow: 0 1px 3px #f9f6ee;
}
.controls {
  display: grid;
  grid-template-columns: auto minmax(70px, 130px) auto;
  align-items: center;
  column-gap: 14px;
  border-block: 1px solid var(--line);
  background: #f0ecdfdf;
  backdrop-filter: blur(6px);
  padding: 0 12px;
  pointer-events: auto;
}
.controls label {
  font-size: 12px;
  white-space: nowrap;
}
.controls output {
  font:
    11px ui-monospace,
    monospace;
  margin-left: 6px;
  color: var(--accent);
}
input {
  margin: 0;
  width: 100%;
  height: 44px;
  cursor: ew-resize;
}
#ride {
  font-size: 12px;
  white-space: nowrap;
  border-left: 1px solid var(--line);
  padding-left: 12px;
}
#fallback {
  position: absolute;
  inset: 26% 10% 25%;
  background: center/contain no-repeat url(../media/cover.webp);
  text-align: center;
  padding-top: 4px;
}
@media (max-width: 650px) {
  header {
    top: max(4%, env(safe-area-inset-top));
  }
  header p {
    font-size: 12px;
  }
  nav {
    top: max(3.5%, env(safe-area-inset-top));
    right: 12px;
  }
  nav a {
    margin: 0;
  }
  footer {
    align-items: stretch;
    flex-direction: column-reverse;
    gap: 12px;
  }
  .controls {
    grid-template-columns: auto 1fr auto;
  }
  .cartouche {
    align-self: flex-start;
    font-size: 11px;
  }
  html[lang='en'] h1 {
    font-size: 38px;
    line-height: 1;
    max-width: min(5.4em, calc(100vw - 186px));
  }
}
@media (max-height: 480px) {
  header {
    top: 12px;
  }
  h1 {
    font-size: 35px;
  }
  header p {
    margin-top: 4px;
  }
  footer {
    bottom: 9px;
  }
  nav {
    top: 8px;
  }
}
.onboard header,
.onboard nav,
.onboard .cartouche {
  background: #eee9dfee;
  box-shadow: 0 0 18px 9px #eee9dfbf;
}
nav button[hidden] {
  display: none;
}
.cartouche.pinned {
  position: fixed;
  top: 0;
  left: 0;
  transform-origin: left center;
  font-size: 11px;
  letter-spacing: 0.045em;
  line-height: 1.2;
}
