@font-face { font-family: 'Plex Sans'; src: url('fonts/IBMPlexSans-Regular.ttf'); font-weight: 400; font-display: swap }
@font-face { font-family: 'Plex Sans'; src: url('fonts/IBMPlexSans-Medium.ttf'); font-weight: 500; font-display: swap }
@font-face { font-family: 'Plex Sans'; src: url('fonts/IBMPlexSans-SemiBold.ttf'); font-weight: 600; font-display: swap }
@font-face { font-family: 'Plex Condensed'; src: url('fonts/IBMPlexSansCondensed-Medium.ttf'); font-weight: 500; font-display: swap }
@font-face { font-family: 'Plex Condensed'; src: url('fonts/IBMPlexSansCondensed-SemiBold.ttf'); font-weight: 600; font-display: swap }
@font-face { font-family: 'Plex Mono'; src: url('fonts/IBMPlexMono-Regular.ttf'); font-display: swap }

:root {
  --bg: #131415;
  --raised: #1b1c1e;
  --line: #2b2d30;
  --text: #f1f0eb;
  --text-2: #a3a39d;
  --text-3: #6f706c;
  --accent: #f2c12e;
  --tunnel: #e7e5dd;
  --bridge: #7d868c;
  --gutter: 32px;
}
* { box-sizing: border-box }
[hidden] { display: none !important }
html { -webkit-text-size-adjust: 100% }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 17px/1.5 'Plex Sans', system-ui, sans-serif; -webkit-font-smoothing: antialiased }
a { color: inherit }
button { font: inherit; color: inherit }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }

.bar { display: flex; align-items: center; gap: 28px; height: 56px; padding: 0 var(--gutter); border-bottom: 1px solid var(--line); background: var(--bg); position: relative; z-index: 5 }
.bar .mark { font: 600 20px/1 'Plex Condensed'; letter-spacing: .01em; text-decoration: none; margin-right: auto; display: flex; align-items: center; gap: 10px }
.bar .mark img { display: block; border-radius: 6px }
.bar .lang { height: 34px; padding: 0 6px; background: var(--bg); color: var(--text-2); border: 1px solid var(--line); font: 500 15px 'Plex Sans'; cursor: pointer }
.bar .lang:hover { color: var(--text); border-color: var(--text-3) }
.bar .store { display: block; line-height: 0 }
.bar .store img { display: block }
.bar nav { display: flex; gap: 24px }
.bar nav a { text-decoration: none; color: var(--text-2); font-size: 15px }
.bar nav a[aria-current] { color: var(--text) }

h1, h2, h3 { font-family: 'Plex Condensed'; font-weight: 600; margin: 0; letter-spacing: -.005em }
.muted { color: var(--text-2) }
.small { font-size: 13px; color: var(--text-3) }
.mono { font-family: 'Plex Mono'; font-size: 13px; letter-spacing: .02em }
.link { color: var(--accent); text-decoration: none; font-weight: 500 }
.link:hover { text-decoration: underline }

.row { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; cursor: pointer }
.row.has-icon { grid-template-columns: 24px 1fr auto; column-gap: 12px }
.row.has-icon .kind-icon { grid-row: 1 / span 2; align-self: center; color: var(--text-2) }
.row.has-icon .row-sub { grid-column: 2 }
.row.has-icon .row-side { grid-column: 3 }
.kind-icon { display: inline-block; vertical-align: -5px; color: var(--text-2); flex: none }
.scheme { display: block; width: 100%; height: auto }
a.lb { cursor: zoom-in }
.slides { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--bg); color: var(--text) }
.slides[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto }
.slides::backdrop { background: var(--bg) }
.sl-top, .sl-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px var(--gutter); font-size: 15px; color: var(--text-2) }
.sl-n { font: 600 20px 'Plex Condensed'; color: var(--text); font-variant-numeric: tabular-nums }
.sl-x { background: none; border: 1px solid var(--line); height: 40px; padding: 0 16px; font-size: 15px; cursor: pointer }
.sl-stage { position: relative; min-height: 0; display: grid; place-items: center; padding: 0 var(--gutter) }
.sl-stage img { max-width: 100%; max-height: 100%; min-height: 0; object-fit: contain; display: block }
.sl-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; background: var(--bg); border: 1px solid var(--line); font-size: 20px; cursor: pointer }
.sl-nav:hover, .sl-x:hover { border-color: var(--text-3) }
.sl-prev { left: var(--gutter) } .sl-next { right: var(--gutter) }
.sl-credit { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.sl-orig { flex: none; padding: 10px 16px; border: 1px solid var(--text-3); color: var(--text); text-decoration: none; font-weight: 500 }
.sl-orig:hover { border-color: var(--text) }
@media (max-width: 720px) { .sl-bottom { flex-direction: column; align-items: stretch; gap: 10px } .sl-orig { text-align: center } .sl-credit { white-space: normal } .sl-stage { padding: 0 } .sl-prev { left: 8px } .sl-next { right: 8px } }
.drawing { margin: 0; position: relative }
.drawing.probing svg { cursor: crosshair; touch-action: pan-y }
.drawing.probing svg:focus-visible { outline-offset: -2px }
.drawing .fig { transition: opacity .15s }
.drawing.live .fig { opacity: 0 }
.probe-box { position: absolute; top: 0; display: flex; gap: 18px; padding: 6px 10px; background: var(--bg); border: 1px solid var(--line); font-size: 13px; color: var(--text-2); white-space: nowrap; pointer-events: none }
.probe-box span { display: flex; flex-direction: column-reverse }
.probe-box b { font: 600 20px/1.15 'Plex Condensed'; color: var(--text); font-variant-numeric: tabular-nums }
@media (max-width: 720px) { .probe-box { gap: 12px; padding: 5px 8px } .probe-box b { font-size: 17px } }
.drawing .ends { display: flex; justify-content: space-between; gap: 8px; padding: 8px 24px 0; font-size: 13px; color: var(--text-2); white-space: nowrap }
.row:hover .row-name { text-decoration: underline; text-decoration-color: var(--text-3) }
.row-name { font-size: 17px; font-weight: 500; overflow: hidden; text-overflow: ellipsis }
.row-sub { font-size: 15px; color: var(--text-2); grid-column: 1 }
.row-side { grid-row: 1 / span 2; grid-column: 2; align-self: center; color: var(--text-3); font-size: 15px; font-variant-numeric: tabular-nums }

.maplibregl-ctrl-attrib { background: rgba(19, 20, 21, .8) !important; color: var(--text-3) !important; font-size: 11px }
.maplibregl-ctrl-attrib a { color: var(--text-2) !important }
.maplibregl-ctrl-group { background: var(--raised) !important; border: 1px solid var(--line); box-shadow: none !important }
.maplibregl-ctrl-group button { width: 36px; height: 36px }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line) !important }
.maplibregl-ctrl-icon { filter: invert(.9) }

@media (max-width: 720px) {
  :root { --gutter: 16px }
  .bar { gap: 16px }
  .bar nav { gap: 16px }
  .bar .mark span { display: none }
  .bar nav a span { display: none }
  .bar { gap: 12px }
  .bar nav { gap: 14px }
  .bar { padding: 0 12px; gap: 10px }
  .bar .store img { width: 78px; height: 26px }
  .bar .lang { height: 28px; padding: 0 1px; font-size: 13px }
  .bar nav { gap: 10px }
  .bar nav a { font-size: 14px }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important } }
