/* Empire Records — editorial, clean. Pudding-adjacent. */

:root {
  --bg:        #f4efe2;   /* warm cream */
  --bg-2:      #ede7d4;   /* slightly darker for borders/dividers */
  --ink:       #0f1a3a;   /* deep navy */
  --ink-soft:  #4a4f66;   /* secondary text */
  --ink-mute:  #8a8c98;   /* tertiary */
  --accent:    #5b4af0;   /* punchy indigo */
  --accent-2:  #ec4d6a;   /* hot pink secondary, used sparingly */
  --hairline:  rgba(15, 26, 58, 0.10);

  --f-serif:  "Newsreader", "Source Serif Pro", Georgia, serif;
  --f-sans:   "Inter", system-ui, -apple-system, sans-serif;
  --f-mono:   "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-serif);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

::selection { background: var(--accent); color: #fff; }

/* ====================== APP SHELL ====================== */

.app {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--bg);
}

/* ====================== MASTHEAD ====================== */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 36px 18px;
  border-bottom: 1px solid var(--hairline);
  position: relative;
  z-index: 20;
  background: var(--bg);
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.wordmark h1 {
  margin: 0;
  font-family: var(--f-serif);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.015em;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
}
.wordmark .sub {
  font-family: var(--f-sans);
  font-size: 13px;
  color: var(--ink-mute);
}

.nav {
  display: flex;
  gap: 28px;
  align-items: center;
  font-family: var(--f-sans);
  font-size: 13px;
  color: var(--ink-soft);
}
.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  cursor: pointer;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--ink); border-bottom-color: var(--accent); }

/* ====================== MAIN ====================== */

.main {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

/* ====================== MAP PANE ====================== */

.map-pane {
  position: absolute;
  inset: 0;
  min-height: 0;
  min-width: 0;
  background: var(--bg);
  overflow: hidden;
}

.map-stage {
  position: absolute; inset: 0;
}

/* small caption in the corner of the map */
.map-caption {
  position: absolute;
  left: 36px; bottom: 28px;
  font-family: var(--f-sans);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 480px);
  background: rgba(244, 239, 226, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  z-index: 10;
  pointer-events: none;
}
.map-caption .dot {
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.map-caption strong {
  color: var(--ink);
  font-weight: 600;
}

/* ====================== STORY LIST (floating right rail) ====================== */

.list-pane {
  position: absolute;
  top: 20px;
  right: 20px;
  bottom: 20px;
  width: 400px;
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  background: rgba(244, 239, 226, 0.78);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  backdrop-filter: blur(18px) saturate(1.1);
  border: 1px solid rgba(15, 26, 58, 0.12);
  border-radius: 8px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5) inset,
    0 24px 60px -20px rgba(15, 26, 58, 0.22),
    0 4px 12px -4px rgba(15, 26, 58, 0.08);
  overflow: hidden;
  transition: transform .4s cubic-bezier(.22,.61,.36,1), opacity .25s ease;
  z-index: 10;
}
.list-pane.collapsed {
  transform: translateX(calc(100% - 44px));
}

.list-toggle {
  position: absolute;
  top: 14px;
  left: -1px;
  width: 26px;
  height: 36px;
  border: 1px solid rgba(15, 26, 58, 0.12);
  border-right: none;
  background: rgba(244, 239, 226, 0.78);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  backdrop-filter: blur(18px) saturate(1.1);
  border-radius: 6px 0 0 6px;
  transform: translateX(-100%);
  color: var(--ink-soft);
  font-family: var(--f-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, color .15s ease;
}
.list-toggle:hover { color: var(--ink); background: rgba(244, 239, 226, 0.95); }

.list-head {
  min-width: 0;
  padding: 16px 22px 12px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.list-head .title {
  font-family: var(--f-serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}
.list-head .count {
  font-family: var(--f-sans);
  font-size: 12px;
  color: var(--ink-mute);
  margin-left: 8px;
}

.scroll {
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-mute) transparent;
}
.scroll::-webkit-scrollbar { width: 6px; }
.scroll::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 3px; }

.story {
  display: block;
  min-width: 0;
  padding: 18px 22px;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
  position: relative;
  transition: background .15s ease;
}
.story:hover, .story.active {
  background: rgba(91, 74, 240, 0.07);
}

.story .kicker {
  font-family: var(--f-sans);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.story .kicker .tag {
  color: var(--accent);
  font-weight: 500;
}
.story .kicker .sep {
  width: 3px; height: 3px;
  background: var(--ink-mute);
  border-radius: 50%;
}

.story h3 {
  margin: 0 0 5px;
  font-family: var(--f-serif);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.18;
  letter-spacing: -0.012em;
  color: var(--ink);
  transition: color .15s ease;
  text-wrap: pretty;
  overflow-wrap: break-word;
}
.story:hover h3, .story.active h3 { color: var(--accent); }

.story .tagline {
  margin: 0;
  font-family: var(--f-serif);
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink-soft);
}

.story .story-link {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--f-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
  text-decoration: none;
}
.story .story-link:hover { color: var(--accent-2); }

/* pinned (BEC app) gets a subtle highlight */
.story.pinned {
  background: rgba(91, 74, 240, 0.05);
}
.story.pinned .kicker .tag {
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
}

/* ====================== RAT ====================== */

.rat {
  position: fixed;
  bottom: 22px;
  left: -120px;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
}
.rat.run {
  animation: scurry 7s linear forwards;
}
@keyframes scurry {
  0%   { transform: translateX(0); opacity: 0; }
  3%   { opacity: 1; }
  97%  { opacity: 1; }
  100% { transform: translateX(120vw); opacity: 0; }
}
.rat .legs { animation: scuttle .12s steps(2) infinite; transform-origin: center; }
@keyframes scuttle {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(1.2px); }
}

/* ====================== MAPBOX OVERRIDES ====================== */

.mapboxgl-map {
  font-family: var(--f-sans);
}
.mapboxgl-ctrl-attrib {
  font-size: 10px !important;
  background: rgba(244, 239, 226, 0.7) !important;
  backdrop-filter: blur(4px);
}
.mapboxgl-ctrl-attrib a { color: var(--ink-mute) !important; }
/* Hide default Mapbox logo — attribution link still shown */
.mapboxgl-ctrl-logo { display: none !important; }

/* responsive */
@media (max-width: 720px) {
  .list-pane { left: 12px; right: 12px; top: auto; bottom: 12px; width: auto; max-height: 60vh; }
  .map-caption { max-width: calc(100% - 72px); }
}
