/* the city page. always night: there is no light print of piwa. */

/* self hosted, latin subset, OFL. no third party origin. */
@font-face {
  font-family: "IBM Plex Mono"; src: url("/fonts/ibmplexmono-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono"; src: url("/fonts/ibmplexmono-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Serif"; src: url("/fonts/instrumentserif-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}

:root {
  --night: #05070f;
  --text: #e8e2d0;
  --muted: #8a8fa8;
  --light: #ffcf7a;
  --glass: rgba(8, 11, 24, .82);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: linear-gradient(#05070f, #111735 50%, #1d2650);
  color: var(--text);
  font: 14px/1.5 "IBM Plex Mono", ui-monospace, monospace;
  overflow: hidden;
}
a { color: inherit; }

#sky, #city { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#city { touch-action: pan-y; }
#city.pointer { cursor: pointer; }

header {
  position: fixed; top: 24px; left: 24px; right: 24px; z-index: 2;
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
}
.greet { font-family: "Instrument Serif", serif; font-style: italic; font-size: 28px; margin: 0; }

/* the plain list: what you get before the city loads, or without it. once the
   city is up it is only hidden from the eye, never from the document. */
#places {
  position: fixed; left: 24px; bottom: 56px; z-index: 2;
  list-style: none; margin: 0; padding: 0;
}
#places li { margin: 4px 0; }
#places .tp { font-family: "Instrument Serif", serif; font-style: italic; font-size: 18px; color: var(--light); margin-right: 8px; }
#places .en { color: var(--muted); }
.city-ready #places {
  clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap;
}

/* the card above the selected building */
#tip {
  position: fixed; z-index: 3; padding: 10px 14px; white-space: nowrap;
  background: var(--glass); border: 1px solid rgba(255, 207, 122, .25); border-radius: 6px;
  backdrop-filter: blur(6px);
  pointer-events: none; opacity: 0; transform: translateY(4px);
  transition: opacity .15s, transform .15s;
}
#tip.on { opacity: 1; transform: none; }
#tip .tp { font-family: "Instrument Serif", serif; font-style: italic; font-size: 22px; line-height: 1.1; color: var(--light); margin: 0; }
#tip .en { margin: 2px 0 0; font-size: 12px; }
#tip .out { margin: 4px 0 0; font-size: 11px; color: var(--muted); }

/* entering a building: the ui steps aside, then the night fades in */
#fade { position: fixed; inset: 0; z-index: 5; background: var(--night); opacity: 0; pointer-events: none; transition: opacity .35s; }
#fade.on { opacity: 1; }
.entering header, .entering #walk, .entering footer { opacity: 0; transition: opacity .3s; }

/* the walk bar: ← name → */
#walk {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 2;
  display: none; align-items: center; gap: 4px;
}
.city-ready #walk { display: flex; }
#walk button {
  font: inherit; font-size: 18px; color: var(--text); background: rgba(8, 11, 24, .6);
  border: 1px solid rgba(232, 226, 208, .2); border-radius: 50%; width: 40px; height: 40px; cursor: pointer;
}
/* the arrows are drawn, not typed: a font's glyph never sits in the middle */
#walk button { display: grid; place-items: center; padding: 0; }
#walk svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
#walk button:hover, #walk button:focus-visible { color: var(--light); border-color: var(--light); outline: none; }
#here { min-width: 150px; text-align: center; color: var(--muted); font-size: 12px; }

footer { position: fixed; right: 24px; bottom: 12px; z-index: 2; color: var(--muted); font-size: 11px; }

/* the 404 page */
.lost { position: fixed; inset: 0; display: grid; place-content: center; text-align: center; padding: 16px; }
.lost p { margin: 4px 0; color: var(--muted); }
.lost .greet { color: var(--text); margin-bottom: 12px; }
.lost a { color: var(--light); }

@media (prefers-reduced-motion: reduce) {
  #tip, #fade { transition: none; }
}

@media (max-width: 640px) {
  header { flex-direction: column; top: 16px; left: 16px; right: 16px; }
  #places { left: 16px; }
  #walk { bottom: 40px; }
  footer { right: 16px; }
}
