/* ============================================================
   Pitstop — same warm "boarding-pass cartography" system as Wayfinder
   ============================================================ */
/* Main font */
@font-face {
  font-family: "Hobsky";
  src: url("../assets/fonts/Hobsky.otf") format("opentype");
  font-weight: 400 800;
  font-display: swap;
}
/* Secondary font */
@font-face {
  font-family: "Dx Figgle";
  src: url("../assets/fonts/DxFiggle.otf") format("opentype");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  /* Bold yellow + black */
  --paper: #fbec5d;           /* lighter yellow page */
  --paper-2: #fef7ae;         /* pale-yellow input surface */
  --side-bg: #fbec5d;         /* yellow sidebar */
  --surface: #ffffff;         /* white cards */
  --ink: #161310;             /* near-black text/outline */
  --ink-soft: #4d473a;
  --ink-faint: #7a6f57;
  --line: #e7d77a;            /* subtle yellow-tan border */
  --outline: #161310;         /* bold black outline */
  --line-soft: #f3e892;
  --brand: #161310;           /* black is the primary */
  --brand-deep: #000000;
  --brand-soft: #fef3a8;      /* pale-yellow hover */
  --teal: #161310;
  --teal-deep: #161310;
  --sun: #fbec5d;             /* yellow accent */
  --cherry: #161310;
  --ring: 0 0 0 4px rgba(22, 19, 16, 0.25);
  --shadow-sm: 0 2px 0 rgba(22, 19, 16, 0.16);
  --shadow: 3px 4px 0 rgba(22, 19, 16, 0.2);
  --shadow-pop: 4px 5px 0 var(--ink);   /* sticker pop */
  --shadow-lg: 0 26px 60px -24px rgba(22, 19, 16, 0.5);
  --font-display: "Hobsky", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Dx Figgle", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Dx Figgle", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* atmosphere */
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: 0.5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
}
.blob { position: fixed; z-index: 0; border-radius: 50%; filter: blur(80px); pointer-events: none; opacity: 0.5; }
.blob-1 { width: 480px; height: 480px; top: -160px; left: -120px; background: radial-gradient(circle, rgba(22,19,16,0.07), transparent 70%); }
.blob-2 { width: 520px; height: 520px; bottom: -200px; left: 180px; background: radial-gradient(circle, rgba(22,19,16,0.06), transparent 70%); }

.app { position: relative; z-index: 2; display: flex; height: 100vh; height: 100dvh; }

/* sidebar */
.sidebar { width: 470px; min-width: 470px; height: 100%; display: flex; flex-direction: column; background: var(--side-bg); border-right: 1px solid var(--line); }
.brand { position: relative; display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 15px; padding: 28px 20px 18px; }
.brand-mark { width: 88px; height: 88px; display: grid; place-items: center; flex-shrink: 0; cursor: pointer; }
.brand-mark .logo-blob, .map-placeholder-icon .logo-blob { display: block; width: 100%; height: 100%; color: var(--ink); overflow: visible; }
.brand-mark .logo-blob { transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1); }
.brand-mark:hover .logo-blob { transform: scale(1.07) rotate(-3deg); }
.brand-text h1 { margin: 0; font-family: var(--font-display); font-size: 62px; font-weight: 700; letter-spacing: 0.01em; line-height: 0.9; white-space: nowrap; }
.brand-stamp { margin-left: auto; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; color: #fff; background: var(--cherry); border: 2px solid var(--outline); border-radius: 8px; padding: 5px 9px; transform: rotate(4deg); box-shadow: 2px 2px 0 var(--outline); }

/* form */
.form { padding: 6px 28px 16px; }
.fields { position: relative; background: var(--surface); border: 2.5px solid var(--outline); border-radius: 20px; padding: 14px; box-shadow: var(--shadow-pop); display: flex; flex-direction: column; gap: 10px; }
.field { position: relative; }
.field-label { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-a { background: var(--ink); box-shadow: 0 0 0 3px rgba(22,19,16,0.14); }
.dot-b { background: var(--sun); box-shadow: 0 0 0 3px rgba(22,19,16,0.14); }
.dot-c { background: var(--ink); box-shadow: 0 0 0 3px rgba(22,19,16,0.14); }

input[type="text"] {
  width: 100%; border: 1.5px solid var(--line); background: var(--paper-2); color: var(--ink);
  border-radius: 13px; padding: 13px 15px; font-family: var(--font-body); font-size: 16px; font-weight: 700;
  outline: none; transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
input[type="text"]::placeholder { color: var(--ink-faint); font-weight: 600; }
input[type="text"]:focus { border-color: var(--brand); background: #fff; box-shadow: var(--ring); }
.field-sub { margin: 5px 0 0; padding: 0 3px; font-size: 12px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field-sub:empty { display: none; }

.swap { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); z-index: 10; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 2.5px solid var(--outline); background: var(--sun); color: var(--outline); cursor: pointer; box-shadow: 2px 2px 0 var(--outline); transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1); }
.swap:hover { border-color: var(--brand); color: var(--brand); }
.swap:active { transform: translateY(-50%) rotate(180deg) scale(0.92); }
.swap svg { width: 16px; height: 16px; }

.suggestions { position: absolute; z-index: 30; top: calc(100% + 8px); left: 0; width: 100%; margin: 0; padding: 6px; list-style: none; max-height: 280px; overflow: auto; background: #fff; border: 1.5px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); }
.suggestions li button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 10px 12px; border: none; background: transparent; color: var(--ink); text-align: left; cursor: pointer; border-radius: 11px; font-family: var(--font-body); }
.suggestions li button:hover, .suggestions li button.active { background: var(--brand-soft); }
.s-name { font-size: 14.5px; font-weight: 700; }
.s-label { font-size: 12px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.s-loading { padding: 12px; font-size: 14px; font-weight: 600; color: var(--ink-soft); }

/* want + chips */
.want { margin-top: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.chip { font-family: var(--font-body); font-size: 13px; font-weight: 700; padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-soft); cursor: pointer; transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.15s; }
.chip:hover { border-color: var(--brand); color: var(--brand-deep); transform: translateY(-1px); }

/* modes */
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 16px; padding: 6px; border-radius: 16px; background: var(--ink); border: 2.5px solid var(--outline); }
.mode { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 2px solid transparent; background: transparent; color: var(--paper); padding: 11px 6px; border-radius: 11px; font-family: var(--font-display); font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background 0.18s, color 0.18s; }
.mode-icons { display: flex; align-items: center; gap: 7px; }
.mode svg { width: 20px; height: 20px; }
.mode.active { background: var(--sun); color: var(--ink); }
.mode-hint { margin: 9px 2px 0; font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft); }

.cta { margin-top: 16px; width: 100%; border: 2.5px solid var(--outline); border-radius: 16px; padding: 15px; font-family: var(--font-display); font-size: 19px; font-weight: 700; color: var(--sun); background: var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 9px; box-shadow: var(--shadow-pop); transition: transform 0.14s, box-shadow 0.14s; }
.cta:hover:not(:disabled) { transform: translate(-2px, -2px); box-shadow: 6px 7px 0 var(--outline); }
.cta:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--outline); }
.cta:disabled { background: #d8cf9a; color: #8a8259; box-shadow: 2px 2px 0 rgba(22,19,16,0.3); border-color: rgba(22,19,16,0.4); cursor: not-allowed; }
.cta-icon { width: 18px; height: 18px; }
.cta .spinner { width: 17px; height: 17px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,0.4); border-top-color: #fff; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* results */
.results { flex: 1; overflow-y: auto; padding: 4px 28px 20px; }
.results-head { display: flex; align-items: baseline; justify-content: space-between; margin: 6px 2px 12px; }
.results-head h2 { margin: 0; font-family: var(--font-display); font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.results-head .count { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); }

.empty { margin-top: 26px; text-align: center; }
.empty-art { color: var(--brand); margin: 0 auto 14px; max-width: 220px; }
.empty-art svg { width: 100%; height: auto; }
.empty-pin-a { fill: var(--brand); } .empty-pin-b { fill: var(--teal); } .empty-pin-c { fill: var(--sun); }
.empty-route { color: var(--ink-faint); animation: dash 22s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -260; } }
.empty-title { margin: 0 0 6px; font-family: var(--font-display); font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.empty-sub { margin: 0 auto; max-width: 320px; font-size: 14px; font-weight: 600; line-height: 1.55; color: var(--ink-soft); }

.notice { margin-bottom: 12px; border-radius: 12px; padding: 9px 13px; font-size: 12.5px; font-weight: 600; border: 1.5px dashed #e7b870; background: #fdf3e0; color: #9a6a12; }
.error { border-radius: 14px; border: 1.5px solid #f0b4a6; background: #fdeae4; padding: 12px 15px; font-size: 14px; font-weight: 600; color: #b23a1c; margin-bottom: 12px; }

.cards { display: flex; flex-direction: column; gap: 12px; }

.card { position: relative; width: 100%; background: var(--surface); border: 2.5px solid var(--outline); border-radius: 16px; padding: 15px 16px; text-align: left; cursor: pointer; box-shadow: var(--shadow); transition: transform 0.16s, box-shadow 0.16s; animation: fadeup 0.45s cubic-bezier(0.16,1,0.3,1) both; }
.card:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-pop); }
.card.selected { background: #fff5ea; box-shadow: var(--shadow-pop); transform: translate(-1px, -1px); }
@keyframes fadeup { from { opacity: 0; transform: translateY(10px); } }

/* Organic "blob" wobble: gentle squash/stretch + skew + rotate so the logo
   feels alive and gelatinous. Slow by default; speeds up on hover. */
@keyframes blobJelly {
  0%, 100% { transform: scale(1, 1) rotate(0deg) skew(0deg, 0deg) translateY(0); }
  20% { transform: scale(1.06, 0.95) rotate(3deg) skew(-2deg, 1deg) translateY(-2px); }
  40% { transform: scale(0.96, 1.05) rotate(-2deg) skew(2deg, -1deg) translateY(1px); }
  60% { transform: scale(1.05, 0.97) rotate(2.5deg) skew(-1deg, 1deg) translateY(-1px); }
  80% { transform: scale(0.98, 1.03) rotate(-3deg) skew(1deg, -1deg) translateY(1px); }
}

.card-top { display: flex; align-items: center; gap: 10px; }
.place-rank { flex-shrink: 0; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 13px; color: #fff; background: var(--brand); border: 2px solid var(--outline); }
.card-label { font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: -0.01em; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place-tag { flex-shrink: 0; font-family: var(--font-mono); font-size: 9.5px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; transform: rotate(2deg); border: 2px solid var(--outline); }
.place-tag.near { color: var(--sun); background: var(--ink); }
.place-tag.detour { color: var(--sun); background: var(--ink); }

.place-meta { margin-top: 9px; display: flex; flex-wrap: wrap; align-items: center; gap: 5px 9px; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-soft); }
.place-cat { color: var(--ink); font-weight: 500; }
.place-dot { color: var(--ink-faint); }

.place-actions { margin-top: 12px; display: flex; gap: 8px; }
.place-link { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 11px; font-family: var(--font-display); font-size: 15px; font-weight: 600; text-decoration: none; color: var(--sun); background: var(--ink); border: 2px solid var(--outline); box-shadow: 2px 2px 0 var(--outline); transition: transform 0.13s, box-shadow 0.13s; }
.place-link:hover { transform: translate(-1px,-1px); box-shadow: 3px 3px 0 var(--outline); }
.place-link:active { transform: translate(1px,1px); box-shadow: 1px 1px 0 var(--outline); }
.place-link.ghost { color: var(--brand-deep); background: var(--paper-2); }
.place-link.ghost:hover { background: var(--brand-soft); }
.place-link svg { width: 13px; height: 13px; }

.side-foot { padding: 14px 28px; border-top: 1.5px solid var(--line); display: flex; justify-content: center; }
.side-foot a { font-family: var(--font-body); font-size: 14px; font-weight: 700; color: var(--ink); text-decoration: none; border-bottom: 2px solid transparent; padding-bottom: 1px; transition: border-color 0.15s; }
.side-foot a:hover { border-bottom-color: var(--ink); }

/* map */
.map-wrap { position: relative; flex: 1; height: 100%; }
#map { position: absolute; inset: 0; height: 100%; width: 100%; background: #eaf0ee; }
.map-placeholder { position: absolute; inset: 0; display: grid; place-items: center; z-index: 500; pointer-events: none; background: radial-gradient(circle at 50% 40%, rgba(245,243,238,0.45), rgba(245,243,238,0.88)); }
.map-placeholder.hidden { display: none; }
.map-placeholder-card { text-align: center; background: var(--paper); border: 2.5px solid var(--outline); border-radius: 22px; padding: 30px 36px; box-shadow: var(--shadow-pop); }
.map-placeholder-icon { width: 104px; height: 104px; display: grid; place-items: center; margin: 0 auto 8px; }
.map-placeholder-title { margin: 0 0 4px; font-family: var(--font-display); font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.map-placeholder-sub { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink-soft); }

.leaflet-container { background: #eaf0ee; font-family: var(--font-body); }
.leaflet-control-attribution { background: rgba(255,255,255,0.82) !important; color: #8a7a64 !important; font-size: 10px !important; }
.leaflet-control-attribution a { color: var(--brand-deep) !important; }
.poi-marker { background: var(--brand); color: #fff; width: 34px; height: 34px; border-radius: 50% 50% 50% 5px; transform: rotate(45deg); border: 2.5px solid var(--outline); box-shadow: 2px 3px 0 rgba(42,26,13,0.35); display: grid; place-items: center; transition: transform 0.15s; }
.poi-marker span { transform: rotate(-45deg); display: grid; place-items: center; }
.poi-marker svg { width: 17px; height: 17px; }
.poi-marker.active { background: #ffffff; color: var(--ink); transform: rotate(45deg) scale(1.28); z-index: 1000; }

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #dcc8a9; border-radius: 999px; border: 2px solid var(--side-bg); }
::-webkit-scrollbar-thumb:hover { background: #cbb189; }

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

@media (max-width: 940px) {
  body { overflow: auto; }
  .app { flex-direction: column; height: auto; min-height: 100dvh; }
  .sidebar { width: 100%; min-width: 0; height: auto; order: 2; }
  .map-wrap { height: 46vh; min-height: 320px; order: 1; }
  .results { overflow: visible; }
}

/* ---------- Everything is Fimaro → ALL CAPS (except what you type) ---------- */
body {
  text-transform: uppercase;
}
/* Form controls don't inherit text-transform, so set buttons explicitly. */
button {
  text-transform: uppercase;
}
input,
select,
textarea,
.leaflet-control-attribution {
  text-transform: none;
}
/* A little tracking so the display headings/buttons read well in caps. */
.brand-text h1,
.mode,
.cta,
.results-head h2,
.empty-title,
.place-rank,
.card-label,
.place-link,
.map-placeholder-title {
  letter-spacing: 0.02em;
}
