:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --surface-3: #0f172a;
  --text: #0f172a;
  --muted: #475569;
  --border: rgba(15, 23, 42, 0.12);
  --brand: #0f172a;
  --brand-contrast: #ffffff;
  --accent: #0ea5e9;
  --radius: 18px;
  --radius-lg: 26px;
  --shadow: 0 18px 55px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 10px 24px rgba(15, 23, 42, 0.06);
  --container: 1120px;
  --hb-scroll-offset: 112px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--hb-scroll-offset);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(900px 500px at 50% -120px, rgba(14, 165, 233, 0.14), transparent 65%),
    linear-gradient(#f8fafc, #ffffff);
}

/* Anchor offset for sticky header */
section[id],
div[id],
h1[id],
h2[id],
h3[id] {
  scroll-margin-top: var(--hb-scroll-offset);
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Heroes: no hover underline (keep clean CTAs) */
.hb-hero a,
.hb-hero a:hover {
  text-decoration: none !important;
}

/* Truncation helpers */
.hb-fade-truncate {
  display: inline-block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 86%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 0%, #000 86%, transparent 100%);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* Layout */

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

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: 10px;
  transform: translateY(-120%);
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  z-index: 1000;
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  background: var(--surface-3);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.875rem;
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
}

.topbar__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.topbar__links a {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.topbar__links a:hover {
  background: rgba(255, 255, 255, 0.14);
  text-decoration: none;
}

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand__mark {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  color: var(--brand-contrast);
  font-weight: 750;
  letter-spacing: -0.02em;
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand__name {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand__sub {
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--muted);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
}

.nav a {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 14px;
  text-decoration: none;
}

.nav a:hover {
  background: var(--surface-2);
  text-decoration: none;
  color: var(--text);
}

.header__right {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

/* Leaflet */
[data-leaflet-map] {
  width: 100%;
  min-height: 18rem;
  z-index: 1;
  border-radius: inherit;
}

.leaflet-popup-content-wrapper {
  border-radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.hb-map-muted .leaflet-tile {
  filter: grayscale(1) saturate(0) contrast(1.05) brightness(1.06);
}

.leaflet-interactive.hb-marker {
  filter: drop-shadow(0 6px 10px rgba(15, 23, 42, 0.28));
}

.leaflet-control-zoom.leaflet-bar {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}

.leaflet-control-zoom a {
  border: 0 !important;
  border-radius: 9999px !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12) !important;
}

.leaflet-touch .leaflet-control-zoom a {
  line-height: 32px;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.search__input {
  flex: 1;
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.9);
}

.search__input:focus {
  outline: none;
  border-color: rgba(14, 165, 233, 0.55);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.14);
}

.main {
  flex: 1;
  padding: 26px 0 56px;
}

.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer__inner {
  padding: 38px 0 24px;
}

.footer__grid {
  display: grid;
  gap: 18px;
}

.footer__title {
  font-weight: 650;
  letter-spacing: -0.01em;
}

.footer__text {
  margin-top: 10px;
  color: var(--muted);
  max-width: 52ch;
  line-height: 1.55;
}

.footer__links {
  margin-top: 10px;
  display: grid;
  gap: 8px;
  color: var(--muted);
}

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

.footer__bottom {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Components */

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 650;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
}

.button:hover {
  text-decoration: none;
}

.button--primary {
  background: var(--brand);
  color: var(--brand-contrast);
  box-shadow: var(--shadow-sm);
}

.button--primary:hover {
  background: #111c33;
}

.button--outline {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.92);
}

.button--outline:hover {
  background: var(--surface-2);
}

.button--sm {
  padding: 8px 12px;
  border-radius: 12px;
  font-weight: 650;
  font-size: 0.92rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card--link:hover {
  box-shadow: var(--shadow);
  border-color: rgba(15, 23, 42, 0.18);
  text-decoration: none;
}

.card__body {
  padding: 18px;
}

.card__media {
  height: 160px;
}

.card__media--sm {
  height: 120px;
}

.card__media--lg {
  height: 220px;
}

.card__kicker {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--muted);
}

.card__title {
  margin-top: 6px;
  font-size: 1.05rem;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.card__text {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.55;
}

.card__meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.media {
  background-image: linear-gradient(135deg, rgba(15, 23, 42, 0.16), rgba(15, 23, 42, 0)),
    var(--media-image, none);
  background-size: cover;
  background-position: center;
}

.hero {
  display: grid;
  gap: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.hero__content {
  padding: 22px;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 650;
  font-size: 0.82rem;
}

.hero__eyebrow-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.16);
}

.hero__title {
  margin: 14px 0 0;
  font-size: clamp(1.7rem, 3.2vw, 2.6rem);
  font-family: "Playfair Display", ui-serif, Georgia, serif;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hero__lead {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 62ch;
}

.hero__actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero__tags {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero__media {
  min-height: 240px;
}

.section {
  margin-top: 34px;
}

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.section__title {
  margin: 0;
  font-size: 1.25rem;
  font-family: "Playfair Display", ui-serif, Georgia, serif;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.section__lead {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
  max-width: 72ch;
}

.section__action a {
  color: var(--muted);
  font-weight: 650;
}

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

.grid {
  display: grid;
  gap: 14px;
}

.grid--2 {
  grid-template-columns: 1fr;
}

.grid--3 {
  grid-template-columns: 1fr;
}

.grid--4 {
  grid-template-columns: 1fr;
}

.pill {
  padding: 12px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.04);
}

.pill:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.pill__title {
  font-weight: 650;
}

.pill__meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list__row {
  padding: 14px 16px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.list__row:first-child {
  border-top: 0;
}

.list__title {
  font-weight: 650;
}

.list__sub {
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.95rem;
}

.list__meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.item {
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.item__head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.item__logo {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid rgba(15, 23, 42, 0.12);
  object-fit: contain;
}

.item__title {
  font-weight: 650;
  line-height: 1.25;
}

.item__meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.item__actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.92rem;
}

.item__actions a {
  font-weight: 650;
  text-decoration: none;
}

.item__actions a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.item__actions a.item__link--muted {
  font-weight: 650;
  color: var(--muted);
}

.breadcrumbs {
  color: var(--muted);
  font-size: 0.95rem;
}

.breadcrumbs a {
  color: inherit;
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--text);
  text-decoration: underline;
}

.layout-2col {
  margin-top: 18px;
  display: grid;
  gap: 18px;
}

.prose {
  color: var(--text);
  line-height: 1.75;
}

.prose h1,
.prose h2,
.prose h3 {
  margin-top: 1.4em;
  margin-bottom: 0.4em;
  font-family: "Playfair Display", ui-serif, Georgia, serif;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.prose h2 {
  font-size: 1.75em;
}

.prose h3 {
  font-size: 1.5em;
  margin-bottom: 0.8em;
  letter-spacing: 0;
}

.prose p {
  margin: 0.9em 0;
  color: rgba(15, 23, 42, 0.92);
}

.prose a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose blockquote {
  margin: 1.2em 0;
  padding: 0.9em 1em;
  background: var(--surface-2);
  border-left: 4px solid rgba(14, 165, 233, 0.55);
  border-radius: 14px;
}

.prose ul,
.prose ol {
  margin: 0.9em 0 0.9em 1.4em;
}

.prose li {
  margin: 0.35em 0;
}

/* Responsive */

@media (min-width: 640px) {
  .hero__content {
    padding: 28px;
  }

  .grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 820px) {
  .header__inner {
    grid-template-columns: auto 1fr auto;
    align-items: center;
  }

  .header__right {
    justify-content: flex-end;
    width: 360px;
  }

  .hero {
    grid-template-columns: 1.1fr 0.9fr;
  }

  .hero__media {
    min-height: auto;
  }
}

@media (min-width: 900px) {
  .grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .layout-2col {
    grid-template-columns: 2fr 1fr;
    align-items: start;
  }

  .footer__grid {
    grid-template-columns: 2fr 1fr 1fr;
    align-items: start;
  }
}
