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


:root {
  --bg: #f5f3ee;
  --panel: #ffffff;

  --ink: #0e1013;
  --ink-soft: #1e2328;
  --ink-muted: #363b42;
  --ink-subtle: #555b63;

  --border-subtle: #d8d5cb;
  --border-strong: #b8b3a6;

  --accent-plum: #6a3c46;
  --accent-plum-dark: #4f2a33;
  --accent-moss: #343a33;
  --accent-moss-soft: #474f45;
  --accent-petrol: #284854;
  --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.08);
  --cool-hover: #f0ede8;
  --cool-detail: #f4f2ef;
  --cool-border: #d5d0c8;
}


/* ========== */
/* base       */
/* ========== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  background-color: #ffffff;
}

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.heading-serif {
  font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
}

.small-caps-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-subtle);
}


/* ========== */
/* navbar    */
/* ========== */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.10);
}

.site-nav-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-nav-title-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.site-nav-title {
  font-family: "DM Sans", system-ui, sans-serif;
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.site-nav-title-link:hover .site-nav-title {
  color: var(--ink-soft);
}

.site-nav-links {
  display: flex;
  gap: 18px;
  font-size: 15px;
}

.site-nav-links a {
  position: relative;
  padding: 4px 0;
  text-decoration: none;
  color: var(--ink-muted);
  font-weight: 400;
  transition: color 150ms ease;
}

.site-nav-links a:hover {
  color: var(--ink);
}

.site-nav-links a.active {
  color: var(--ink);
  font-weight: 500;
  border-bottom: 1.5px solid var(--accent-plum);
  padding-bottom: 2px;
}


/* ========== */
/* hero       */
/* ========== */

.hero-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px 80px;
}

.hero-shell {
  width: 100%;
  max-width: 1120px;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(260px, 2fr);
  gap: 48px;
  align-items: center;
}

.hero-card {
  max-width: 560px;
  width: 100%;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.hero-title {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 48px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 20px;
  color: var(--ink);
}

.hero-subtitle {
  margin: 0 0 12px;
  font-size: 19px;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 540px;
  font-weight: 400;
}

.hero-subtitle-secondary {
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-muted);
  max-width: 540px;
}

.hero-button-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
}

.hero-cta {
  padding: 10px 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1.5px solid var(--accent-plum);
  transition: color 150ms ease, border-color 150ms ease;
}

.hero-cta:hover {
  color: var(--accent-plum);
  border-color: var(--accent-plum-dark);
}

.hero-cta:active {
  color: var(--accent-plum-dark);
}

.hero-visual {
  position: relative;
  border-radius: 6px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.hero-visual-map-ghost {
  position: relative;
  width: 100%;
  padding-bottom: 80%;
  border-radius: 6px;
  overflow: hidden;
  background-color: #f7f7f7;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.hero-visual-caption {
  margin-top: 10px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--ink-subtle);
}


/* ========== */
/* map layout */
/* ========== */

.map-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(380px, 1fr);
  gap: 26px;
  padding: 28px 24px 36px;
  max-width: 1300px;
  margin: 0 auto;
}

.map-shell {
  display: flex;
}

.mapbox-container {
  position: relative;
  flex: 1;
  min-height: 540px;
  background: #f8f6f1;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  outline: 1px solid rgba(0, 0, 0, 0.03);
}

/* map loading placeholder */

.map-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 20%, #f5f3ee, #f0ece2);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-subtle);
}

.map-placeholder::before {
  content: "";
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  border-top-color: var(--accent-plum);
  margin-right: 14px;
  animation: spin 950ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* mapbox chrome */

.mapboxgl-ctrl-attrib,
.mapboxgl-ctrl-logo {
  font-size: 9px !important;
  color: var(--ink-muted) !important;
}

.mapboxgl-popup {
  max-width: 240px !important;
}

.mapboxgl-popup-content {
  max-width: 280px !important;
}

.map-toggle,
.map-legend-pill {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.map-toggle-active,
.map-legend-pill-active {
  border-color: var(--accent-plum);
  color: var(--accent-plum);
}

.mapbox-container .map-legend {
  display: none !important;
}

.mapbox-container.motif-selected .map-legend {
  display: block !important;
}

/* hide map layer fills when no motif selected */
.mapbox-container .mapboxgl-canvas {
  filter: none;
  opacity: 0.95;
}

.mapbox-container.motif-selected .mapboxgl-canvas {
  filter: none;
  opacity: 1;
}

.side-panel {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 16px 18px;
  max-height: calc(100vh - 108px);
  overflow-y: auto;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.side-panel-control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 1rem;
  gap: 12px;
}

.side-panel-title-row {
  margin: 0;
  line-height: 1.1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 1.5rem;
  gap: 12px;
}

.view-toggle {
  display: flex;
  gap: 0.2rem;
  background: transparent;
  padding: 0.2rem;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  margin-top: 2px;
}

.toggle-btn {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.toggle-btn.active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  border-color: var(--border-strong);
}

.side-panel-header {
  margin-bottom: 18px;
}

/* hide header content until motif is selected */
.side-panel.no-motif-selected .side-panel-header {
  display: none;
}

.side-title {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  margin: 0 0 4px;
  font-size: 16px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-plum);
}

.side-subtitle {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.side-note {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--ink-soft);
}

/* back link */

.panel-back-link {
    padding: 7px 14px !important;
    border-radius: 18px !important;
    border: 1px solid var(--accent-plum) !important;
    background: var(--accent-plum) !important;
    color: #fdfaf7 !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    letter-spacing: 0.14em !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    cursor: pointer !important;
    transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease !important;
}

.panel-back-link:hover {
  background: var(--accent-plum-dark) !important;
  transform: translateY(-0.5px) !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12) !important;
}

.panel-back-link:active {
  transform: translateY(0) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08) !important;
}

/* section headings */

.side-section-title {
  margin: 18px 0 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-plum);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
}

.side-section-subtitle {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--ink-muted);
}

/* motif list cards */

.dashed-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dashed-card {
  position: relative;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition:
    background 160ms ease,
    border-color 160ms ease;
}

<<<<<<< HEAD
.dashed-card-dot {
  flex-shrink: 0;
  margin-top: 3px;
}

=======
>>>>>>> c0d51f7854999da56aaf8aed96a6ba4a337f5d16
.dashed-card:hover {
  background: var(--cool-hover);
  border-color: var(--border-strong);
  box-shadow: none;
  transform: none;
}

.dashed-card-title {
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}

.dashed-card-meta {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-subtle);
}

/* detail cards */

.profile-card {
  margin-top: 16px;
  border-radius: 6px;
  padding: 12px 14px 14px;
  font-size: 13px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  box-shadow: none;
}

.profile-title {
  margin: 0 0 7px;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-plum);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
}


.profile-card.profile-card--insight {
  border-left: 3px solid var(--accent-plum);
  padding-left: 11px;
}

.profile-body p {
  margin: 0 0 8px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.profile-body p strong {
  color: var(--ink);
}


.inset-note {
  border-radius: 5px;
  padding: 7px 9px;
  margin: 8px 0;
  font-size: 12px;
  line-height: 1.6;
  border: 1px dashed var(--border-subtle);
  background: #f8f5ef;
  color: var(--ink-soft);
}


.methodology-note {
  margin-top: 32px;
  padding: 12px 14px;
  background: #ffffff;
  border-left: 3px solid var(--accent-plum);
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.methodology-note a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  transition: color 150ms ease;
}

.methodology-note a:hover {
  color: var(--accent-plum);
}

.methodology-note strong {
  color: var(--accent-plum);
  font-weight: 600;
  letter-spacing: 0.02em;
}


/* ========== */
/* Methodology page */
/* ========== */

.page-main {
  flex: 1;
  padding: 72px 24px 96px;
  display: flex;
  justify-content: center;
}

.page-inner {
  max-width: 640px;
  width: 100%;
  background: transparent;
  padding: 0;
}

.page-title {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 16px;
  color: var(--ink);
}

.page-subtitle {
  margin: 0 0 40px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.page-section-title {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 36px 0 10px;
  color: var(--ink);
}

.page-text {
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink-soft);
  margin: 0 0 14px;
}

.page-text strong {
  color: var(--ink);
  font-weight: 500;
}

.page-text a {
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 2px;
  transition: color 150ms ease;
}

.page-text a:hover {
  color: var(--ink);
}

.page-list {
  margin: 0 0 16px 20px;
  padding: 0;
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink-soft);
}

.page-list li {
  margin-bottom: 10px;
}

.page-list li strong {
  color: var(--ink);
  font-weight: 500;
}

.page-list a {
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 2px;
  transition: color 150ms ease;
}

.page-list a:hover {
  color: var(--ink);
}

.page-list code {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  background: #f5f5f5;
  padding: 2px 5px;
  border-radius: 3px;
  color: var(--ink-muted);
}

.page-footnote {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 13px;
  color: var(--ink-subtle);
  line-height: 1.6;
}

/* ========== */
/* micro-label */
/* ========== */

.meta-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-subtle);
}

/* ========== */
/* tooltips */
/* ========== */

#tooltip rect {
  fill: rgba(20, 20, 20, 0.88) !important;
  stroke: rgba(255, 255, 255, 0.15) !important;
  stroke-width: 0.5 !important;
}

#tooltip text {
  fill: #fff !important;
  font-size: 14px !important;
  letter-spacing: -0.01em !important;
  font-family: 'IBM Plex Mono', monospace !important;
}

/* Tooltip styling */
.tooltip-content {
  color: #fff;
  font-size: 14px;
  letter-spacing: -0.01em;
  font-family: 'IBM Plex Mono', monospace;
  line-height: 1.4;
  max-width: 240px;
  word-wrap: break-word;
  white-space: normal;
}

.tooltip-bg {
  rx: 4;
  ry: 4;
  fill: rgba(20, 20, 20, 0.88);
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 0.5;
}

/* choropleth legend title styling */
.choropleth-legend-title {
  font-size: 12px;
  font-weight: bold;
  fill: #343a33;
}


/* ========== */
/* responsive */
/* ========== */

@media (max-width: 1120px) {
  .hero-shell {
    grid-template-columns: minmax(0, 1.2fr);
    max-width: 880px;
  }

  .hero-card {
    max-width: none;
  }

  .hero-visual {
    display: none;
  }

  .map-main {
    grid-template-columns: minmax(0, 1.3fr) minmax(360px, 1fr);
  }
}

@media (max-width: 960px) {
  .site-nav {
    padding-inline: 18px;
  }

  .hero-main {
    padding: 60px 16px 72px;
  }

  .hero-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .hero-card {
    padding-inline: 26px;
  }

  .hero-title {
    font-size: 34px;
  }

  .hero-subtitle {
    font-size: 22px;
  }

  .map-main {
    grid-template-columns: minmax(0, 1fr);
    padding: 20px 16px 32px;
  }

  .side-panel {
    max-height: none;
  }

  .page-main {
    padding: 48px 16px 64px;
  }

  .page-inner {
    padding: 28px 22px 26px;
  }

.map-shell .mapboxgl-canvas-container svg,
.mapboxgl-canvas-container svg {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.hidden {
  display: none;
}

}

@media (max-width: 640px) {
  .site-nav {
    padding-inline: 14px;
  }

  .site-nav-links {
    gap: 12px;
    font-size: 13px;
  }

  .hero-main {
    padding: 48px 14px 60px;
  }

  .hero-card {
    padding: 24px 20px 26px;
  }

  .hero-title {
    font-size: 26px;
    letter-spacing: 0.06em;
  }

  .hero-subtitle {
    font-size: 18px;
    line-height: 1.6;
  }

  .hero-subtitle-secondary {
    font-size: 14px;
  }

  .hero-button-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .map-main {
    padding-inline: 12px;
  }

  .mapbox-container {
    min-height: 380px;
  }

  .side-panel {
    padding: 14px 14px 16px;
  }

  .page-inner {
    padding: 24px 16px 24px;
  }
}

/* ========== */
/* responsive */
/* ========== */

@media (max-width: 900px) {
  .site-shell {
    padding: 0 12px 24px;
  }

  .site-nav {
    padding: 10px 16px;
  }

  .map-main {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px 0 24px;
  }

  .mapbox-container {
    min-height: 420px;
  }

  .side-panel {
    max-height: none;
  }

  .hero-main {
    padding: 48px 12px 64px;
  }

  .hero-card {
    padding: 28px 20px 24px;
  }

  .page-inner {
    padding: 24px 16px 32px;
  }
}


.motif-tags,
.correlation-insights,
.motif-tag {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.6;
  background: transparent;
  padding: 0;
  color: var(--ink);
}

#motif-detail .motif-section + .motif-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}