:root {
  color-scheme: light;
  --font-sans: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Playfair Display", "Times New Roman", serif;
  --color-bg: #f3f1ea;
  --color-surface: rgba(255, 255, 255, 0.86);
  --color-text: #1f1a17;
  --color-muted: #5f564f;
  --color-accent: #0f766e;
  --shadow-soft: 0 24px 48px rgba(23, 20, 18, 0.18);
}

* {
  box-sizing: border-box;
}

.is-hidden {
  display: none !important;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

body.has-modal-open {
  overflow: hidden;
}

body.episode-modal-open {
  overflow: hidden;
}

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

a:hover,
a:focus-visible {
  text-decoration: underline;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem clamp(1.5rem, 4vw, 3rem);
  backdrop-filter: blur(18px);
  background: var(--color-surface);
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.08);
}

.topbar__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}

.brand__title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  letter-spacing: 0.04em;
}

.topbar__about {
  display: none;
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.2rem;
  background: rgba(15, 118, 110, 0.12);
  color: var(--color-accent);
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.topbar__about:hover,
.topbar__about:focus-visible {
  background: rgba(15, 118, 110, 0.18);
  transform: translateY(-1px);
}

.topbar__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  background: var(--color-accent);
  color: #fff;
  font-weight: 600;
  transition: transform 140ms ease, box-shadow 140ms ease;
  box-shadow: 0 12px 22px rgba(15, 118, 110, 0.25);
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
}

.topbar__cta:hover,
.topbar__cta:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 18px 30px rgba(15, 118, 110, 0.3);
  text-decoration: none;
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 2px;
}

.map-shell {
  position: relative;
  min-height: clamp(70vh, 82vh, 88vh);
  height: 100%;
}

.map-shell__map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 500px;
}

.map-shell__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: rgba(88, 150, 102, 0.26);
  mix-blend-mode: lighten;
}

.about-overlay {
  display: none;
}

.episode-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
}

.episode-modal[hidden] {
  display: none;
}

.episode-modal__content {
  position: relative;
  width: min(520px, 92vw);
  max-height: 88vh;
  overflow-y: auto;
  display: grid;
  gap: 1rem;
  padding: clamp(1.4rem, 6vw, 2rem);
  background: rgba(255, 255, 255, 0.96);
  border-radius: 26px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  box-shadow: 0 32px 52px rgba(15, 23, 42, 0.28);
}

.episode-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.8rem;
  height: 2.8rem;
  border: none;
  border-radius: 50%;
  background: rgba(31, 26, 23, 0.12);
  cursor: pointer;
}

.episode-modal__close::before,
.episode-modal__close::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 1.2rem;
  height: 2px;
  background: rgba(31, 26, 23, 0.75);
  transform-origin: center;
}

.episode-modal__close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.episode-modal__close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.episode-modal__close:focus-visible {
  outline: 2px solid rgba(15, 118, 110, 0.8);
  outline-offset: 2px;
}

.episode-modal__eyebrow {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(15, 118, 110, 0.75);
  font-weight: 600;
}

.episode-modal__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 5vw, 2.1rem);
}

.episode-modal__watch {
  display: grid;
  gap: 0.55rem;
}

.episode-modal__watch span {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(15, 118, 110, 0.72);
  font-weight: 600;
}

.episode-modal__links {
  display: grid;
  gap: 0.5rem;
}

.episode-modal__links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.3rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 118, 110, 0.25);
  background: rgba(15, 118, 110, 0.12);
  font-weight: 600;
  font-size: 1rem;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.episode-modal__links a:hover,
.episode-modal__links a:focus-visible {
  background: rgba(15, 118, 110, 0.2);
  border-color: rgba(15, 118, 110, 0.35);
  transform: translateY(-1px);
}

.episode-modal__address {
  margin: 0;
  display: grid;
  gap: 0.35rem;
  font-size: 0.95rem;
  color: rgba(31, 26, 23, 0.75);
}

.episode-modal__address span {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: rgba(15, 118, 110, 0.75);
  font-weight: 600;
}

.episode-modal__address a {
  font-weight: 600;
  color: var(--color-accent);
}

.episode-modal__summary {
  margin: 0;
  color: var(--color-muted);
  line-height: 1.6;
}

.map-shell__map .maplibregl-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  filter: none;
}

.map-shell__map .maplibregl-marker {
  z-index: 2;
}

.maplibregl-ctrl-top-left {
  top: clamp(1rem, 4vw, 2rem);
  left: clamp(1rem, 4vw, 2rem);
}

.maplibregl-ctrl-group {
  box-shadow: 0 12px 30px rgba(17, 24, 39, 0.18);
  border-radius: 12px;
  overflow: hidden;
}

.leaflet-container {
  font: inherit;
}

.episode-panel {
  position: absolute;
  z-index: 15;
  top: clamp(1.75rem, 6vw, 3.5rem);
  right: clamp(1.5rem, 6vw, 4rem);
  width: min(420px, 86vw);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  border-radius: 28px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(15, 118, 110, 0.15);
  display: grid;
  gap: clamp(1.25rem, 3vw, 1.9rem);
  padding: clamp(1.5rem, 4vw, 2.4rem);
}

.episode-panel__close {
  display: none;
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.4rem;
  height: 2.4rem;
  border: none;
  border-radius: 50%;
  background: rgba(31, 26, 23, 0.12);
  cursor: pointer;
}

.episode-panel__close::before,
.episode-panel__close::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 1.1rem;
  height: 2px;
  background: rgba(31, 26, 23, 0.72);
  transform-origin: center;
}

.episode-panel__close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.episode-panel__close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.episode-panel__close:focus-visible {
  outline: 2px solid rgba(15, 118, 110, 0.7);
  outline-offset: 2px;
}

.episode-panel__intro {
  display: grid;
  gap: 0.85rem;
}

.episode-panel__eyebrow {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(15, 118, 110, 0.7);
  font-weight: 600;
}

.episode-panel h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 2.8rem);
}

.episode-panel p {
  margin: 0;
  color: var(--color-muted);
  line-height: 1.7;
}

.episode-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.episode-panel__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 118, 110, 0.2);
  background: rgba(15, 118, 110, 0.1);
  font-weight: 600;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.episode-panel__link:hover,
.episode-panel__link:focus-visible {
  background: rgba(15, 118, 110, 0.18);
  border-color: rgba(15, 118, 110, 0.35);
  transform: translateY(-1px);
}

.footer {
  padding: 1.75rem clamp(1.5rem, 4vw, 3rem) 2.25rem;
  text-align: center;
  color: var(--color-muted);
  font-size: 0.85rem;
}

.episode-marker {
  background: transparent;
  border: none;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  padding: 0;
}

.episode-marker:focus-visible {
  outline: none;
}

.episode-marker span {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #0b9a6d;
  box-shadow: 0 0 0 8px rgba(11, 154, 109, 0.22);
  border: 2px solid #e5f5ef;
  position: relative;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.episode-marker:focus-visible span {
  outline: 2px solid #1f2937;
}

.episode-marker span::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
}

.episode-marker--active span {
  background: #047857;
  box-shadow: 0 0 0 10px rgba(4, 120, 87, 0.25);
  transform: scale(1.08);
}

@media (max-width: 640px) {
  .episode-marker span {
    width: 30px;
    height: 30px;
    box-shadow: 0 0 0 10px rgba(11, 154, 109, 0.3);
  }

  .episode-marker--active span {
    box-shadow: 0 0 0 12px rgba(4, 120, 87, 0.35);
    transform: scale(1.12);
  }
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.55);
  backdrop-filter: blur(4px);
}

.modal__dialog {
  position: relative;
  z-index: 1;
  width: min(500px, 92vw);
  min-width: min(320px, 92vw);
  max-width: 500px;
  max-height: 85vh;
  display: grid;
  gap: 1rem;
  padding: clamp(1.75rem, 4vw, 2.4rem);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 40px 60px rgba(17, 24, 39, 0.25);
  overflow-y: auto;
}

.modal__dialog h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 4vw, 2rem);
}

.modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.4rem;
  height: 2.4rem;
  border: none;
  border-radius: 50%;
  background: rgba(31, 26, 23, 0.12);
  cursor: pointer;
}

.modal__close:focus-visible {
  outline: 2px solid rgba(15, 118, 110, 0.8);
  outline-offset: 2px;
}

.modal__close::before,
.modal__close::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 1.1rem;
  height: 2px;
  background: rgba(31, 26, 23, 0.8);
  transform-origin: center;
}

.modal__close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.modal__close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.modal__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.modal__links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.35rem;
  border-radius: 999px;
  font-weight: 600;
  background: rgba(15, 118, 110, 0.1);
  border: 1px solid rgba(15, 118, 110, 0.2);
  transition: background 160ms ease, border-color 160ms ease;
}

.modal__links a:hover,
.modal__links a:focus-visible {
  background: rgba(15, 118, 110, 0.2);
  border-color: rgba(15, 118, 110, 0.4);
}

.maplibregl-popup.episode-popup__container .maplibregl-popup-content {
  padding: 1.2rem 1.2rem 1.25rem;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(15, 118, 110, 0.15);
  border-radius: 20px;
  box-shadow: 0 24px 32px rgba(17, 24, 39, 0.18);
  min-width: 220px;
}

.maplibregl-popup.episode-popup__container .maplibregl-popup-tip {
  display: none;
}

.maplibregl-popup {
  z-index: 5;
}

.episode-popup {
  display: grid;
  gap: 0.65rem;
  font-size: 0.9rem;
  color: var(--color-text);
}

.episode-popup__eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(15, 118, 110, 0.7);
  font-weight: 600;
}

.episode-popup__title {
  margin: 0;
  font-size: 1.05rem;
}

.episode-popup__summary {
  margin: 0;
  color: var(--color-muted);
  line-height: 1.5;
}

.episode-popup__watch {
  display: grid;
  gap: 0.35rem;
}

.episode-popup__links-label {
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(15, 118, 110, 0.7);
  font-weight: 600;
}

.episode-popup__links-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.episode-popup__links-grid a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  font-size: 0.78rem;
  background: rgba(15, 118, 110, 0.12);
  border: 1px solid rgba(15, 118, 110, 0.2);
}

.episode-popup__address {
  margin: 0;
  font-size: 0.82rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: baseline;
  color: rgba(31, 26, 23, 0.7);
}

.episode-popup__address span {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.68rem;
  color: rgba(15, 118, 110, 0.65);
  font-weight: 600;
}

.episode-popup__address a {
  font-weight: 500;
  color: rgba(15, 118, 110, 0.9);
}

@media (max-width: 1024px) {
  .episode-panel {
    right: clamp(1rem, 4vw, 2.5rem);
    width: min(380px, 82vw);
  }
}

@media (max-width: 900px) {
  .map-shell {
    display: grid;
    grid-template-rows: minmax(62vh, 1fr) auto;
    min-height: auto;
  }

  .map-shell__map {
    position: relative;
    width: 100%;
    height: 70vh;
    min-height: 500px;
  }

  .episode-panel {
    position: relative;
    top: auto;
    right: auto;
    margin: clamp(1.5rem, 6vw, 2.5rem);
  }
}

@media (max-width: 1024px) {
  .topbar__about {
    display: inline-flex;
    justify-content: center;
    align-items: center;
  }

  .about-overlay {
    display: none;
  }

  body.js .episode-panel {
    display: none;
    position: fixed;
    inset: clamp(10%, 11vw, 14%) clamp(6%, 7vw, 10%);
    width: auto;
    max-width: 520px;
    margin: 0;
    z-index: 45;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(15, 118, 110, 0.15);
    max-height: 80vh;
    border-radius: 28px;
    gap: 1.05rem;
  }

  body.js .episode-panel .episode-panel__intro {
    gap: 0.6rem;
  }

  body.js .episode-panel p {
    line-height: 1.55;
  }

  body.js .episode-panel .episode-panel__actions {
    gap: 0.5rem;
  }

  body.js .episode-panel .episode-panel__link {
    flex: 1 1 100%;
    justify-content: center;
  }

  body.js .episode-panel.is-visible {
    display: grid;
  }

  body.about-open .about-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
  }

  body.about-open {
    overflow: hidden;
  }

  .episode-panel__close {
    display: inline-flex;
    justify-content: center;
    align-items: center;
  }
}

@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
  }

  .topbar__actions {
    width: 100%;
  }

  .topbar__about {
    display: inline-flex;
    justify-content: center;
    flex: 1 1 auto;
  }

  .topbar__cta {
    width: 100%;
    align-self: stretch;
    justify-content: center;
  }

  .episode-panel {
    margin: clamp(1.15rem, 6vw, 1.75rem);
    padding: clamp(1.2rem, 6vw, 1.6rem);
  }
}

@media (max-width: 480px) {
  .brand__title {
    font-size: 1.3rem;
  }
}
