/* IsoMap London — night control room */

:root {
  --ink: #0e1217;
  --panel: rgba(16, 21, 27, 0.88);
  --panel-edge: rgba(83, 226, 177, 0.14);
  --text: #e8efec;
  --text-dim: #93a39d;
  --text-faint: #5c6b66;
  --teal: #35e2b1;
  --teal-deep: #0b9a72;
  --gold: #ffc94d;
  --night: #8f7bff;
  --radius: 14px;
  --font-ui: "Hanken Grotesk", sans-serif;
  --font-display: "Bricolage Grotesque", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; background: var(--ink); overflow: hidden; }
body { font-family: var(--font-ui); color: var(--text); }

#map { position: absolute; inset: 0; }
#map canvas { outline: none; }

/* ---------- wordmark ---------- */
.wordmark {
  position: absolute; top: 18px; left: 20px; z-index: 20;
  pointer-events: none; user-select: none;
  animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.wordmark h1 {
  font-family: var(--font-display);
  font-size: 30px; font-weight: 800; letter-spacing: 0.02em;
  color: var(--text); line-height: 1;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.7);
}
.wordmark h1 span { color: var(--teal); font-weight: 300; }
.wordmark .sub {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-dim); margin-top: 5px;
}

/* ---------- control panel ---------- */
.panel {
  position: absolute; top: 92px; left: 20px; z-index: 20;
  width: 288px; padding: 16px 16px 12px;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.55);
  animation: rise 0.7s 0.08s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.block { margin-bottom: 14px; }
.block:last-child { margin-bottom: 0; }
.blocklabel {
  display: block;
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 7px;
}

.dest-row { display: flex; gap: 6px; }
select {
  flex: 1; appearance: none;
  background: rgba(255, 255, 255, 0.05) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='6'%3E%3Cpath d='M1 1l3.5 3.5L8 1' stroke='%2393a39d' fill='none' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 11px center;
  border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 9px;
  color: var(--text); font-family: var(--font-ui); font-size: 13.5px; font-weight: 600;
  padding: 8px 26px 8px 11px; cursor: pointer;
}
select:focus { outline: 1px solid var(--teal-deep); }

button.ghost {
  width: 34px; border: 1px dashed rgba(255, 255, 255, 0.18); border-radius: 9px;
  background: none; color: var(--text-dim); font-size: 17px; cursor: pointer;
  transition: all 0.15s;
}
button.ghost:hover { color: var(--gold); border-color: var(--gold); }

.chips { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.chip {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255, 201, 77, 0.07);
  border: 1px solid rgba(255, 201, 77, 0.25);
  border-radius: 9px; padding: 6px 8px 6px 10px;
  font-size: 12.5px;
}
.chip .nm { font-weight: 700; color: var(--gold); white-space: nowrap; }
.chip input[type="range"] { flex: 1; accent-color: var(--gold); height: 3px; }
.chip .bud { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); width: 44px; text-align: right; }
.chip .rm { background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 14px; }
.chip .rm:hover { color: #ff7d6b; }

/* segmented controls */
.seg { display: flex; gap: 3px; background: rgba(255, 255, 255, 0.04); border-radius: 9px; padding: 3px; margin-bottom: 6px; }
.seg:last-child { margin-bottom: 0; }
.seg button {
  flex: 1; border: none; border-radius: 7px; padding: 6px 2px;
  background: none; color: var(--text-dim);
  font-family: var(--font-ui); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.14s; white-space: nowrap;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--teal); color: #06211a; box-shadow: 0 2px 10px rgba(53, 226, 177, 0.35); }
.seg button.night.on { background: var(--night); color: #120b2e; box-shadow: 0 2px 10px rgba(143, 123, 255, 0.4); }
.timeblock.disabled { opacity: 0.35; pointer-events: none; filter: saturate(0.4); }

.rangebar input[type="range"] { width: 100%; accent-color: var(--teal); margin-top: 2px; }
.mono { font-family: var(--font-mono); color: var(--teal); }

.amenities { display: flex; flex-wrap: wrap; gap: 5px; }
.amenities button {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 20px;
  background: none; color: var(--text-dim);
  font-family: var(--font-ui); font-size: 11.5px; font-weight: 600;
  padding: 4px 10px 4px 8px; cursor: pointer; transition: all 0.15s;
}
.amenities button::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--c); opacity: 0.45; transition: opacity 0.15s;
}
.amenities button:hover { color: var(--text); border-color: var(--c); }
.amenities button.on {
  color: var(--text); border-color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, transparent);
}
.amenities button.on::before { opacity: 1; box-shadow: 0 0 8px var(--c); }

.note {
  font-size: 11px; line-height: 1.45; color: var(--text-faint);
  border-top: 1px solid rgba(255, 255, 255, 0.07); padding-top: 9px; margin-top: 12px;
}
.note b { color: var(--text-dim); }

/* ---------- legend ---------- */
.legend {
  position: absolute; left: 20px; bottom: 34px; z-index: 20;
  display: flex; align-items: flex-end; gap: 0;
  background: var(--panel); border: 1px solid var(--panel-edge);
  border-radius: 10px; padding: 9px 12px 7px;
  backdrop-filter: blur(14px);
  animation: rise 0.7s 0.16s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.legend .cell { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.legend .sw { width: 26px; height: 10px; }
.legend .cell:first-child .sw { border-radius: 3px 0 0 3px; }
.legend .cell:last-child .sw { border-radius: 0 3px 3px 0; }
.legend .tick { font-family: var(--font-mono); font-size: 9px; color: var(--text-faint); }
.legend .cell.dimmed { opacity: 0.22; }
.legend .cell:hover .tick { color: var(--text); }

/* ---------- drawer ---------- */
.drawer {
  position: absolute; top: 18px; right: 18px; z-index: 25;
  width: 300px; max-height: calc(100% - 90px); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--panel-edge);
  border-radius: var(--radius); padding: 16px;
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.55);
}
.drawer-close {
  position: absolute; top: 8px; right: 10px;
  background: none; border: none; color: var(--text-faint);
  font-size: 18px; cursor: pointer;
}
.drawer-close:hover { color: var(--text); }
.drawer h2 { font-family: var(--font-display); font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.drawer .coords { font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); margin-bottom: 12px; }
.modes-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.modes-table td { padding: 5px 0; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.modes-table td:last-child { text-align: right; font-family: var(--font-mono); font-weight: 600; color: var(--teal); }
.modes-table tr.best td:last-child { color: var(--gold); }
.modes-table td .tag { font-size: 10px; color: var(--text-faint); margin-left: 5px; }
.modes-table td .via { font-size: 10.5px; color: var(--text-faint); margin-top: 1px; }
.itin { border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 10px; }
.itin h3 { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 8px; }
.leg-row { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; padding: 3px 0; }
.leg-row .lmode { font-family: var(--font-mono); font-size: 10px; font-weight: 600; color: var(--ink); background: var(--teal); border-radius: 4px; padding: 1px 5px; min-width: 44px; text-align: center; }
.leg-row .lmode.WALK { background: var(--text-dim); }
.leg-row .lmode.BUS { background: #ff8b6b; }
.leg-row .lmode.RAIL { background: #7cc7ff; }
.leg-row .lmode.SUBWAY { background: var(--night); color: #fff; }
.leg-row .ldetail { flex: 1; color: var(--text-dim); }
.leg-row .ltime { font-family: var(--font-mono); font-size: 11px; color: var(--text); }
.itin .offline { font-size: 11.5px; color: var(--text-faint); font-style: italic; }

/* ---------- attribution ---------- */
.attrib {
  position: absolute; right: 8px; bottom: 4px; z-index: 15;
  font-size: 9px; color: rgba(255, 255, 255, 0.34);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  max-width: 60vw; text-align: right;
}

/* maplibre chrome */
.maplibregl-ctrl-attrib { display: none; }
.maplibregl-popup-content {
  background: var(--panel); color: var(--text); border-radius: 10px;
  font-family: var(--font-ui); border: 1px solid var(--panel-edge);
  backdrop-filter: blur(10px);
}
.maplibregl-popup-tip { border-top-color: var(--panel) !important; }
.am-pop { font-size: 12px; line-height: 1.5; max-width: 240px; }
.am-pop .blurb { color: var(--text-dim); font-style: italic; }
.am-pop a { color: var(--teal); }
.am-pop .poptype {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-faint);
}

@media (max-width: 720px) {
  .panel { width: calc(100vw - 40px); top: auto; bottom: 84px; max-height: 46vh; overflow-y: auto; }
  .legend { bottom: 18px; left: 20px; transform: scale(0.9); transform-origin: bottom left; }
  .drawer { width: calc(100vw - 36px); }
}
