/* Isometric Ankara: a full-bleed drawn city under small smoked-glass controls. */

@font-face {
  font-family: "Lora Variable";
  src: url(../fonts/lora-latin-wght-normal.woff2) format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Lora Variable";
  src: url(../fonts/lora-latin-ext-wght-normal.woff2) format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url(../fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url(../fonts/ibm-plex-sans-latin-ext-400-normal.woff2) format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url(../fonts/ibm-plex-sans-latin-500-normal.woff2) format("woff2");
  font-weight: 500;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url(../fonts/ibm-plex-sans-latin-ext-500-normal.woff2) format("woff2");
  font-weight: 500;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url(../fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2");
  font-weight: 600;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url(../fonts/ibm-plex-sans-latin-ext-600-normal.woff2) format("woff2");
  font-weight: 600;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;
  --ground: #0c0c0e;
  --sky: #e9edf1;
  --ink: #ecebe8;
  --ink-2: rgba(236, 235, 232, 0.82);
  --ink-3: #a9a8a3;
  --glass: rgba(11, 11, 13, 0.7);
  --glass-strong: rgba(14, 14, 16, 0.86);
  --glass-blur: blur(22px) saturate(1.5);
  --edge: inset 0 0 0 0.5px rgba(255, 255, 255, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --edge-soft: inset 0 0 0 0.5px rgba(255, 255, 255, 0.09);
  --lift: 0 10px 30px rgba(0, 0, 0, 0.28), 0 2px 6px rgba(0, 0, 0, 0.18);
  --fill: rgba(236, 235, 232, 0.03);
  --fill-hover: rgba(236, 235, 232, 0.09);
  --fill-press: rgba(236, 235, 232, 0.14);
  --live: #5fd38a;
  --focus: rgba(236, 235, 232, 0.75);
  --ui: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --gap: 16px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--ground);
  color: var(--ink);
  font: 400 13px/1.5 var(--ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: rgba(236, 235, 232, 0.24); color: var(--ink); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
kbd {
  font: 500 11px/1 var(--ui);
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(236, 235, 232, 0.08);
  box-shadow: var(--edge-soft);
  color: var(--ink-2);
}
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ------------------------------------------------------------ map */

/* the map's own ground is the cloud deck, so a tile still loading reads as haze */
#map { position: fixed; inset: 0; background: var(--sky); }
#map .openseadragon-canvas { outline: none !important; }
#metro, #clouds, #overlay { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ------------------------------------------------------------ glass */

.ui-glass {
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--edge);
}
.ui-ibtn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--fill);
  box-shadow: var(--edge-soft);
  color: var(--ink);
  text-decoration: none;
  transition: background-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.ui-ibtn:hover, .ui-ibtn[aria-expanded="true"] { background: var(--fill-hover); }
.ui-ibtn:active { background: var(--fill-press); transform: scale(0.96); }

/* ------------------------------------------------------------ where you are */

.brand { position: fixed; top: var(--gap); left: var(--gap); pointer-events: none; }
.brand h1 { margin: 0; }
.here {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 8px 12px 8px 9px;
  border-radius: 999px;
  font: 400 12px/12px var(--ui);
  color: var(--ink-2);
  pointer-events: auto;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  max-width: calc(100vw - 2 * var(--gap));
}
.here .icon { width: 14px; height: 14px; color: var(--live); }
.here b { font-weight: 500; color: var(--ink); }
.here .alt { color: var(--ink-3); }
#here-text { overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------ toolbar */

.toolbar { position: fixed; top: var(--gap); right: var(--gap); display: flex; gap: 8px; align-items: flex-start; }
.search { position: relative; width: 260px; min-width: 0; }
.search-field { display: block; height: 40px; padding: 4px; border-radius: 999px; }
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 6px 0 10px;
  border-radius: 999px;
  background: var(--fill);
  box-shadow: var(--edge-soft);
  color: var(--ink-3);
  transition: background-color 160ms var(--ease-out);
}
.search-box:focus-within { background: rgba(236, 235, 232, 0.07); color: var(--ink-2); }
.search input {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 20px;
  border: 0;
  background: transparent;
  font: 400 13px/20px var(--ui);
  color: var(--ink);
  caret-color: var(--live);
  -webkit-appearance: none;
  appearance: none;
}
.search input::placeholder { color: var(--ink-2); opacity: 1; }
.search input::-webkit-search-cancel-button { display: none; }
.search input:focus-visible { outline: none; }
.search-box:has(input:focus-visible) { box-shadow: var(--edge-soft), 0 0 0 2px var(--focus); }
.search-box:focus-within .hint { display: none; }
.clear { display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-3); }
.clear:hover { background: var(--fill-hover); color: var(--ink); }
.clear .icon { width: 15px; height: 15px; }

.results {
  position: absolute;
  top: 48px;
  right: 0;
  width: max(100%, 340px);
  max-height: min(440px, calc(100dvh - 140px));
  overflow: auto;
  padding: 6px;
  border-radius: 14px;
  background: var(--glass-strong);
  box-shadow: var(--edge), var(--lift);
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(236, 235, 232, 0.2) transparent;
}
.results .group { padding: 8px 10px 4px; font: 500 11px/1.2 var(--ui); color: var(--ink-3); }
.result {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 2px 8px;
  width: 100%;
  padding: 7px 10px 7px 6px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
}
.result[aria-selected="true"], .result:hover { background: var(--fill-hover); }
.result .glyph { grid-row: span 2; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: rgba(236, 235, 232, 0.06); color: var(--ink-2); }
.result .glyph .icon { width: 15px; height: 15px; }
.result .name { font: 500 13px/1.3 var(--ui); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result .name mark { background: none; color: inherit; text-decoration: underline; text-decoration-color: rgba(236, 235, 232, 0.45); text-underline-offset: 3px; }
.result .meta { font: 400 12px/1.3 var(--ui); color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results .empty { padding: 14px 12px; color: var(--ink-3); }

.ui-cluster { display: flex; align-items: center; gap: 6px; height: 40px; padding: 4px; border-radius: 999px; }
.sep { width: 1px; height: 16px; margin: 0 3px; background: rgba(236, 235, 232, 0.14); }
.share-button {
  width: auto;
  gap: 6px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  display: inline-flex;
  font: 500 13px/1 var(--ui);
}
.share-button .icon { width: 16px; height: 16px; }

/* ------------------------------------------------------------ panels */

.panel {
  position: fixed;
  top: 64px;
  right: var(--gap);
  width: 320px;
  max-height: calc(100dvh - 180px);
  overflow: auto;
  padding: 14px 16px 16px;
  border-radius: 14px;
  background: var(--glass-strong);
  box-shadow: var(--edge), var(--lift);
  transform-origin: top right;
  animation: panel-in 240ms var(--ease-out);
}
.panel[hidden] { display: none; }
@keyframes panel-in { from { opacity: 0; transform: translateY(-6px) scale(0.98); } }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin: 0 -6px 8px 0; }
.panel h2 { margin: 0; font: 600 14px/1.3 var(--ui); }
.panel .close { width: 28px; height: 28px; background: transparent; box-shadow: none; }
.panel .close:hover { background: var(--fill-hover); }
.panel .close .icon { width: 16px; height: 16px; }
.panel p { margin: 0 0 10px; color: var(--ink-2); line-height: 1.55; }
.panel .credits { font-size: 12px; color: var(--ink-3); }
.panel .credits a { color: var(--ink-2); text-underline-offset: 3px; text-decoration-color: rgba(236, 235, 232, 0.3); }
.panel .credits a:hover { color: var(--ink); text-decoration-color: currentColor; }
.more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
}
.more::after { content: ""; width: 7px; height: 7px; border-top: 1.6px solid currentColor; border-right: 1.6px solid currentColor; transform: rotate(45deg); }
.more:hover { text-decoration: underline; text-underline-offset: 3px; }

.keys { display: grid; margin: 12px 0 14px; border-top: 1px solid rgba(236, 235, 232, 0.07); }
.keys div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid rgba(236, 235, 232, 0.07); }
.keys dt { color: var(--ink); font-weight: 500; }
.keys dd { margin: 0; color: var(--ink-3); text-align: right; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; color: var(--ink-2); }
.row + .row { border-top: 1px solid rgba(236, 235, 232, 0.07); }
.segmented { display: inline-flex; gap: 2px; }
.segmented button { height: 26px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-3); font-weight: 500; }
.segmented button[aria-checked="true"] { background: rgba(236, 235, 232, 0.14); color: var(--ink); }
.switch { cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { position: relative; width: 36px; height: 22px; border-radius: 999px; background: rgba(236, 235, 232, 0.14); transition: background-color 200ms var(--ease-out); }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); transition: transform 220ms var(--ease-out); }
.switch input:checked + .track { background: var(--live); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { outline: 2px solid var(--focus); outline-offset: 2px; }

.action {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
}
.action:hover { background: var(--fill-hover); }
.action:active { background: var(--fill-press); }
.action[aria-busy="true"] { opacity: 0.6; cursor: progress; }
.action > .icon { width: 32px; height: 32px; padding: 7px; border-radius: 10px; background: var(--fill); box-shadow: var(--edge-soft); }
.action b { display: block; font-weight: 500; color: var(--ink); }
.action small { display: block; font-size: 12px; color: var(--ink-3); }

/* ------------------------------------------------------------ dock */

.dock-wrap {
  position: fixed;
  left: 50%;
  bottom: var(--gap);
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
}
.dock { width: 544px; height: 68px; padding: 4px; border-radius: 14px; overflow: hidden; }
.dock-track { display: flex; gap: 4px; height: 60px; transition: transform 520ms var(--ease-out); }
.dock-card {
  position: relative;
  flex: none;
  width: 104px;
  height: 60px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #1a1a1d center / cover no-repeat;
  box-shadow: var(--edge-soft);
  text-align: left;
}
.dock-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8, 8, 10, 0.78) 0%, rgba(8, 8, 10, 0.12) 58%, transparent 100%);
  transition: opacity 200ms var(--ease-out);
}
.dock-card span {
  position: absolute;
  left: 7px;
  right: 6px;
  bottom: 5px;
  font: 500 11px/1.2 var(--ui);
  color: var(--ink);
  text-shadow: 0 1px 2px rgba(12, 12, 14, 0.5);
}
.dock-card:hover::before { opacity: 0.7; }
.dock-card[aria-current="true"] { box-shadow: inset 0 0 0 1.5px rgba(236, 235, 232, 0.9); }
.dock-card:focus-visible { outline-offset: -2px; }
.dock-arrow { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 999px; color: var(--ink); }
.dock-arrow:hover { background: rgba(28, 28, 32, 0.72); }
.dock-arrow:disabled { opacity: 0.35; cursor: default; }

/* ------------------------------------------------------------ minimap */

/* no frame: the city's own silhouette, lifted off the map by its shadow */
.minimap { position: fixed; right: var(--gap); bottom: var(--gap); }
#minimap {
  display: block;
  width: 150px;
  height: 70px;
  cursor: pointer;
  touch-action: none;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.32)) drop-shadow(0 4px 10px rgba(0, 0, 0, 0.26));
}

/* ------------------------------------------------------------ toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 100px;
  margin: 0;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--edge), var(--lift);
  font-weight: 500;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 220ms var(--ease-out), transform 260ms var(--ease-out);
  pointer-events: none;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------ small screens */

@media (max-width: 760px) {
  :root { --gap: 12px; }
  .here { max-width: calc(100vw - 2 * var(--gap) - 128px); }
  #minimap { width: 116px; height: 54px; }
  .toolbar { top: auto; bottom: calc(var(--gap) + env(safe-area-inset-bottom)); left: var(--gap); right: var(--gap); }
  .search { flex: 1; width: auto; }
  .search .hint { display: none; }
  .results { top: auto; bottom: 48px; left: 0; right: 0; width: auto; max-height: min(60dvh, 420px); }
  .share-button { width: 32px; padding: 0; }
  .share-button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .panel { top: auto; bottom: calc(64px + env(safe-area-inset-bottom)); left: var(--gap); right: var(--gap); width: auto; transform-origin: bottom center; }
  .dock-wrap { display: none; }
  .minimap { top: var(--gap); bottom: auto; }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
}
@media (max-width: 1000px) and (min-width: 761px) {
  .dock { width: 436px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
