@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&family=IBM+Plex+Serif:wght@300;400&family=Inter:wght@400;500;600;700&display=swap");

:root {
  --ink: #f1f5f9;
  --ink-dark: #0f172a;
  --paper: #060a13;
  --panel: #060a13;
  --muted: #94a3b8;
  --line: rgba(148, 163, 184, 0.18);
  --walk: #f1f5f9;
  --walk-dark: #0f172a;
  --tube: #3b82f6;
  --tube-soft: rgba(59, 130, 246, 0.12);
  --danger: #f87171;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --serif: "IBM Plex Serif", Georgia, serif;
  --mono: "IBM Plex Mono", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(390px, 0.84fr) minmax(540px, 1.4fr);
  width: 100%;
  height: 100%;
  min-height: 660px;
  background: var(--paper);
}

.panel {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 34px clamp(32px, 4vw, 64px) 24px;
  background:
    radial-gradient(circle at -10% 12%, rgba(199, 245, 74, 0.28), transparent 24%),
    var(--panel);
  box-shadow: 12px 0 50px rgba(16, 18, 13, 0.08);
}

.brand-row,
.brand,
.status-pill,
.map-topbar,
.base-card,
.locate-button,
.legend,
.legend-item,
.result-card,
.quick-picks,
footer {
  display: flex;
  align-items: center;
}

.brand-row {
  justify-content: space-between;
}

.brand {
  gap: 11px;
  color: var(--ink);
  font-family: "DM Mono", monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--walk);
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  letter-spacing: 0;
}

.status-pill {
  gap: 7px;
  color: #60625b;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
}

.status-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #70b118;
  box-shadow: 0 0 0 4px rgba(112, 177, 24, 0.13);
}

.intro {
  margin-top: clamp(44px, 7vh, 82px);
}

.eyebrow,
.result-kicker,
.base-card small {
  margin: 0;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.eyebrow {
  color: #767970;
}

h1 {
  margin: 17px 0 18px;
  font-size: clamp(38px, 4.2vw, 66px);
  font-weight: 600;
  letter-spacing: -0.058em;
  line-height: 0.99;
}

h1 span {
  color: var(--tube);
}

.intro-copy {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.search-wrap {
  position: relative;
  z-index: 500;
  margin-top: 32px;
}

.search {
  display: grid;
  grid-template-columns: 20px 1fr 42px;
  gap: 12px;
  align-items: center;
  padding: 7px 8px 7px 18px;
  border: 1px solid #d5d4cc;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 9px 26px rgba(26, 27, 22, 0.06);
  transition: 180ms ease;
}

.search:focus-within {
  border-color: #9b91d3;
  box-shadow: 0 0 0 4px rgba(124, 99, 255, 0.11), 0 9px 26px rgba(26, 27, 22, 0.06);
}

.search > svg,
.search-button svg,
.result-icon svg,
.locate-button svg,
.map-hint svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.search > svg {
  width: 19px;
  color: #787a73;
}

.search input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.search input::placeholder {
  color: #a0a199;
}

.search-button {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: var(--ink);
  color: white;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.search-button:hover {
  transform: translateX(2px);
  background: var(--tube);
}

.search-button svg {
  width: 19px;
  stroke-width: 2;
}

.suggestions {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  overflow: hidden;
  padding: 7px;
  border: 1px solid #d8d7ce;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 50px rgba(26, 27, 22, 0.15);
}

.suggestion {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 11px;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.suggestion:hover,
.suggestion:focus-visible {
  outline: none;
  background: #f1f0e9;
}

.suggestion-pin {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  background: #e8e5ff;
  color: #5942ca;
  font-size: 15px;
}

.suggestion strong,
.suggestion small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion strong {
  font-size: 12px;
}

.suggestion small {
  margin-top: 3px;
  color: #7c7e76;
  font-size: 10px;
}

.suggestions-message {
  padding: 12px;
  color: #777970;
  font-size: 12px;
}

.quick-picks {
  gap: 7px;
  overflow: hidden;
  margin-top: 11px;
  white-space: nowrap;
}

.quick-picks span {
  flex: 0 0 auto;
  color: #8a8c84;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.quick-picks button {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid #dfded6;
  border-radius: 100px;
  background: transparent;
  color: #696b64;
  font-size: 9px;
  cursor: pointer;
}

.quick-picks button:hover {
  border-color: #a59bcf;
  color: #4e3aae;
}

.result-card {
  position: relative;
  gap: 15px;
  min-height: 83px;
  margin-top: 18px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.64);
  transition: border-color 250ms ease, background 250ms ease, transform 250ms ease;
}

.result-card.has-result {
  animation: result-in 360ms ease;
}

.result-card.is-walk {
  border-color: #a7cd42;
  background: #f5ffd8;
}

.result-card.is-tube {
  border-color: #a99bff;
  background: #f1efff;
}

.result-card.is-outside {
  border-color: #e9a79f;
  background: #fff2ef;
}

.result-icon {
  display: grid;
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 12px;
  background: #eae9e2;
  color: #71736c;
}

.is-walk .result-icon {
  background: var(--walk);
  color: var(--walk-dark);
}

.is-tube .result-icon {
  background: var(--tube);
  color: white;
}

.is-outside .result-icon {
  background: var(--danger);
  color: white;
}

.result-icon svg {
  width: 24px;
}

.result-copy {
  min-width: 0;
}

.result-kicker {
  display: block;
  margin-bottom: 5px;
  color: #85877f;
  font-size: 8px;
}

.result-copy h2 {
  overflow: hidden;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-copy p {
  margin: 4px 0 0;
  color: #70726a;
  font-size: 11px;
}

.result-time {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 5px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.75);
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.legend {
  gap: 12px;
  margin-top: 16px;
}

.legend-item {
  flex: 1;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: opacity 160ms ease;
}

.legend-item:not(.is-active) {
  opacity: 0.35;
}

.legend-swatch {
  display: block;
  width: 11px;
  height: 34px;
  border-radius: 4px;
}

.legend-swatch.walk {
  background: var(--walk);
}

.legend-swatch.tube {
  background: var(--tube);
}

.legend-item strong,
.legend-item small {
  display: block;
}

.legend-item strong {
  font-size: 11px;
}

.legend-item small {
  margin-top: 2px;
  color: #8a8c84;
  font-size: 9px;
}

footer {
  gap: 9px;
  margin-top: auto;
  padding-top: 20px;
  color: #a1a29c;
  font-size: 8px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.map-stage {
  position: relative;
  z-index: 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #171915;
  contain: paint;
  isolation: isolate;
}

#map {
  position: absolute;
  inset: 0;
  z-index: 1;
  clip-path: inset(0);
  background:
    linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px),
    #181a17;
  background-size: 38px 38px;
}

.leaflet-control-attribution {
  padding: 3px 7px !important;
  border-radius: 8px 0 0 0;
  background: rgba(19, 20, 17, 0.7) !important;
  color: #a5a79e !important;
  font-size: 8px !important;
}

.leaflet-control-attribution a {
  color: #c8c9c2 !important;
}

.map-topbar {
  position: absolute;
  z-index: 400;
  top: 28px;
  right: 28px;
  left: 28px;
  justify-content: space-between;
  pointer-events: none;
}

.base-card,
.locate-button,
.map-hint,
.map-controls {
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(20, 21, 18, 0.88);
  color: white;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.base-card {
  gap: 12px;
  min-width: 185px;
  padding: 10px 14px;
  border-radius: 12px;
}

.base-pulse {
  position: relative;
  width: 11px;
  height: 11px;
  border: 2px solid #232a11;
  border-radius: 50%;
  background: var(--walk);
  box-shadow: 0 0 0 6px rgba(199, 245, 74, 0.14);
}

.base-card small,
.base-card strong {
  display: block;
}

.base-card small {
  margin-bottom: 2px;
  color: #92948c;
  font-size: 7px;
}

.base-card strong {
  max-width: 210px;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.locate-button {
  gap: 8px;
  padding: 10px 13px;
  border-radius: 10px;
  font-size: 10px;
  pointer-events: auto;
  cursor: pointer;
}

.locate-button:hover {
  border-color: rgba(199, 245, 74, 0.45);
  color: var(--walk);
}

.locate-button svg {
  width: 16px;
}

.map-hint {
  position: absolute;
  z-index: 400;
  bottom: 27px;
  left: 50%;
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 100px;
  color: #d2d3cc;
  font-size: 9px;
  transform: translateX(-50%);
  pointer-events: none;
}

.map-hint svg {
  width: 15px;
}

.map-controls {
  position: absolute;
  z-index: 400;
  right: 27px;
  bottom: 27px;
  overflow: hidden;
  border-radius: 11px;
}

.map-controls button {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 0;
  background: transparent;
  color: white;
  font-size: 18px;
  cursor: pointer;
}

.map-controls button + button {
  border-top: 1px solid rgba(255, 255, 255, 0.13);
}

.map-controls button:hover {
  background: rgba(255, 255, 255, 0.09);
}

.robbie-marker,
.place-marker {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 3px solid #171815;
  border-radius: 50% 50% 50% 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.34);
  color: #171815;
  font-size: 11px;
  font-weight: 800;
  transform: rotate(-45deg);
}

.robbie-marker span,
.place-marker span {
  transform: rotate(45deg);
}

.robbie-marker {
  background: var(--walk);
}

.place-marker {
  background: white;
}

.place-marker.walk {
  background: var(--walk);
}

.place-marker.tube {
  background: var(--tube);
  color: white;
}

.place-marker.outside {
  background: var(--danger);
  color: white;
}

.leaflet-tooltip.zone-label {
  padding: 5px 8px;
  border: 0;
  border-radius: 6px;
  background: rgba(20, 21, 18, 0.85);
  box-shadow: none;
  color: white;
  font-family: "DM Mono", monospace;
  font-size: 8px;
  letter-spacing: 0.08em;
}

.leaflet-tooltip.zone-label::before {
  display: none;
}

/* rjamould.com-inspired visual system */
.panel {
  overflow: hidden;
  border-right: 1px solid rgba(59, 130, 246, 0.16);
  background:
    radial-gradient(circle at 84% 9%, rgba(59, 130, 246, 0.1), transparent 27%),
    radial-gradient(circle at -15% 48%, rgba(59, 130, 246, 0.07), transparent 30%),
    var(--panel);
  box-shadow: 16px 0 60px rgba(0, 0, 0, 0.3);
}

.brand-row,
.intro,
.search-wrap,
.quick-picks,
.result-card,
.legend,
.panel footer {
  position: relative;
  z-index: 2;
}

.physics-field {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.physics-field span {
  position: absolute;
  color: rgba(59, 130, 246, 0.12);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 300;
  white-space: nowrap;
}

.physics-field span:nth-child(1) {
  top: 13%;
  right: 5%;
  transform: rotate(-3deg);
}

.physics-field span:nth-child(2) {
  top: 48%;
  left: -6%;
  transform: rotate(2deg);
}

.physics-field span:nth-child(3) {
  right: 7%;
  bottom: 5%;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.journey-wave {
  position: absolute;
  z-index: 1;
  top: 175px;
  left: -5%;
  width: 110%;
  height: 155px;
  overflow: visible;
  opacity: 0.24;
  pointer-events: none;
  filter: drop-shadow(0 0 7px rgba(59, 130, 246, 0.55));
}

.journey-wave path {
  fill: none;
  stroke: var(--tube);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.brand {
  color: rgba(248, 250, 252, 0.82);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.13em;
}

.brand-mark {
  display: block;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
}

.brand-mark::after {
  content: "/";
  margin-left: 11px;
  color: rgba(59, 130, 246, 0.58);
}

.status-pill {
  color: rgba(248, 250, 252, 0.45);
  font-family: var(--mono);
}

.status-pill i {
  background: var(--tube);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.13), 0 0 14px rgba(59, 130, 246, 0.5);
}

.intro {
  margin-top: clamp(52px, 7.5vh, 86px);
}

.eyebrow,
.result-kicker,
.base-card small,
.quick-picks span,
.result-time {
  font-family: var(--mono);
}

.eyebrow {
  color: rgba(96, 165, 250, 0.78);
  font-size: 9px;
}

h1 {
  margin: 15px 0 20px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(46px, 4.6vw, 72px);
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 0.94;
}

h1 span {
  color: var(--tube);
}

.intro-copy {
  color: rgba(148, 163, 184, 0.78);
  font-size: 13px;
}

.search {
  border-color: rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.78);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22);
}

.search:focus-within {
  border-color: rgba(59, 130, 246, 0.64);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 12px 36px rgba(0, 0, 0, 0.22);
}

.search > svg {
  color: rgba(148, 163, 184, 0.72);
}

.search input {
  color: var(--ink);
}

.search input::placeholder {
  color: rgba(148, 163, 184, 0.52);
}

.search-button {
  border-radius: 6px;
  background: var(--ink);
  color: var(--ink-dark);
}

.search-button:hover {
  background: var(--tube);
  color: white;
}

.suggestions {
  border-color: rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: rgba(9, 15, 28, 0.98);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
}

.suggestion {
  color: var(--ink);
}

.suggestion:hover,
.suggestion:focus-visible {
  background: rgba(59, 130, 246, 0.1);
}

.suggestion-pin {
  border-radius: 5px;
  background: rgba(59, 130, 246, 0.13);
  color: #60a5fa;
}

.suggestion small,
.suggestions-message {
  color: var(--muted);
}

.quick-picks span,
.quick-picks button {
  color: rgba(148, 163, 184, 0.6);
}

.quick-picks button {
  border-color: rgba(148, 163, 184, 0.17);
  border-radius: 999px;
}

.quick-picks button:hover {
  border-color: rgba(59, 130, 246, 0.55);
  color: #93c5fd;
}

.result-card {
  border-color: var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.62);
  color: var(--ink);
}

.result-card.is-walk {
  border-color: rgba(241, 245, 249, 0.38);
  background: rgba(241, 245, 249, 0.07);
}

.result-card.is-tube {
  border-color: rgba(59, 130, 246, 0.52);
  background: rgba(59, 130, 246, 0.1);
}

.result-card.is-outside {
  border-color: rgba(248, 113, 113, 0.42);
  background: rgba(248, 113, 113, 0.08);
}

.result-icon {
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.1);
  color: var(--muted);
}

.result-kicker,
.result-copy p,
.legend-item small {
  color: rgba(148, 163, 184, 0.7);
}

.result-time {
  background: rgba(6, 10, 19, 0.65);
  color: rgba(241, 245, 249, 0.8);
}

.legend-item {
  color: var(--ink);
}

.legend-swatch {
  width: 4px;
  border-radius: 99px;
}

.legend-swatch.walk {
  box-shadow: 0 0 14px rgba(241, 245, 249, 0.3);
}

.legend-swatch.tube {
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.55);
}

.panel footer {
  color: rgba(148, 163, 184, 0.38);
  font-family: var(--mono);
}

.map-stage,
#map {
  background-color: #060a13;
}

.map-stage::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  background: radial-gradient(circle at 52% 48%, transparent 42%, rgba(6, 10, 19, 0.28) 100%);
  content: "";
  pointer-events: none;
}

.base-card,
.locate-button,
.map-hint,
.map-controls {
  border-color: rgba(148, 163, 184, 0.17);
  border-radius: 7px;
  background: rgba(6, 10, 19, 0.9);
  color: var(--ink);
}

.base-pulse {
  border-color: var(--ink-dark);
  background: var(--tube);
  box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.12), 0 0 16px rgba(59, 130, 246, 0.45);
}

.base-card small {
  color: rgba(148, 163, 184, 0.58);
}

.locate-button:hover {
  border-color: rgba(59, 130, 246, 0.52);
  color: #93c5fd;
}

.map-hint {
  color: rgba(241, 245, 249, 0.72);
  font-family: var(--mono);
}

.robbie-marker,
.place-marker {
  border-color: #060a13;
  font-family: var(--mono);
}

.robbie-marker {
  box-shadow: 0 0 0 4px rgba(241, 245, 249, 0.12), 0 8px 20px rgba(0, 0, 0, 0.34);
}

.place-marker.tube {
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.16), 0 8px 20px rgba(0, 0, 0, 0.34);
}

.leaflet-tooltip.zone-label {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 4px;
  background: rgba(6, 10, 19, 0.9);
  font-family: var(--mono);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@keyframes result-in {
  0% { transform: translateY(5px); opacity: 0.7; }
  100% { transform: translateY(0); opacity: 1; }
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(520px, 66vh);
    height: auto;
    min-height: 100%;
  }

  .panel {
    padding: 25px 24px 23px;
  }

  .intro {
    margin-top: 42px;
  }

  h1 {
    font-size: clamp(42px, 11vw, 64px);
  }

  .legend {
    max-width: 420px;
  }

  footer {
    margin-top: 24px;
  }
}

@media (max-width: 540px) {
  .status-pill,
  .map-hint,
  .quick-picks span,
  footer span:nth-child(2),
  footer span:nth-child(3) {
    display: none;
  }

  .intro {
    margin-top: 38px;
  }

  .intro-copy {
    font-size: 13px;
  }

  .search-wrap {
    margin-top: 24px;
  }

  .quick-picks {
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .result-time {
    display: none !important;
  }

  .map-topbar {
    top: 17px;
    right: 16px;
    left: 16px;
  }

  .locate-button {
    width: 40px;
    height: 40px;
    justify-content: center;
    padding: 0;
    font-size: 0;
  }

  .map-controls {
    right: 16px;
    bottom: 16px;
  }
}

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