:root {
  color-scheme: light;
  --paper: #f7f0e3;
  --paper-strong: #fffaf0;
  --ink: #25201a;
  --muted: #766d60;
  --line: #d8cbb7;
  --red: #b3312d;
  --red-dark: #7f2322;
  --gold: #d99a2b;
  --green: #2f8065;
  --blue: #2f6f9f;
  --shadow: 0 22px 70px rgba(62, 47, 28, 0.18);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  font-family: "Atkinson Hyperlegible", system-ui, sans-serif;
  background:
    linear-gradient(90deg, rgba(179, 49, 45, 0.09) 1px, transparent 1px),
    linear-gradient(0deg, rgba(179, 49, 45, 0.07) 1px, transparent 1px),
    var(--paper);
  background-size: 44px 44px;
  overflow-x: hidden;
}

button,
a {
  font: inherit;
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(390px, 42vw) minmax(0, 1fr);
  min-height: 100vh;
}

.planner {
  display: grid;
  align-content: start;
  gap: clamp(1.2rem, 2vw, 1.8rem);
  padding: clamp(1.1rem, 3vw, 3rem);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.96), rgba(247, 240, 227, 0.95)),
    var(--paper);
  border-right: 1px solid var(--line);
  box-shadow: 18px 0 70px rgba(55, 39, 23, 0.12);
  z-index: 2;
}

.intro {
  display: grid;
  gap: 1rem;
  padding-top: clamp(0.4rem, 2vh, 1.2rem);
}

.eyebrow {
  width: fit-content;
  margin: 0;
  padding: 0.4rem 0.55rem;
  color: var(--red-dark);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
  border: 1px solid color-mix(in srgb, var(--red), transparent 55%);
  background: rgba(255, 250, 240, 0.78);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 11ch;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(3rem, 5.2vw, 5.4rem);
  font-weight: 800;
  line-height: 0.9;
}

.lede {
  max-width: 42rem;
  color: #4d453b;
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  line-height: 1.55;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.quick-stats span {
  min-width: 0;
  padding: 0.8rem 0.75rem;
  color: #5d5245;
  font-size: 0.82rem;
  line-height: 1.25;
  border-top: 2px solid var(--line);
  background: rgba(255, 250, 240, 0.54);
}

.quick-stats strong {
  display: block;
  color: var(--ink);
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.filter {
  min-height: 42px;
  padding: 0 0.85rem;
  color: var(--ink);
  font-weight: 700;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.76);
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.filter:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--red), var(--line) 25%);
}

.filter:focus-visible,
.meeting-card:focus-visible,
.directions:focus-visible {
  outline: 3px solid rgba(47, 111, 159, 0.45);
  outline-offset: 3px;
}

.filter.is-active {
  color: var(--paper-strong);
  border-color: var(--red);
  background: var(--red);
}

.meeting-list {
  display: grid;
  gap: 0.85rem;
}

.list-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.list-header h2 {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  line-height: 1;
}

.list-header span {
  color: var(--muted);
  font-size: 0.9rem;
}

.meetings {
  display: grid;
  gap: 0.55rem;
}

.meeting-card {
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr);
  gap: 0.85rem;
  width: 100%;
  padding: 0.8rem;
  color: inherit;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 240, 0.84);
  box-shadow: 0 8px 24px rgba(61, 44, 24, 0.06);
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.meeting-card:hover,
.meeting-card.is-selected {
  transform: translateY(-2px);
  border-color: var(--day-color);
  background: var(--paper-strong);
  box-shadow: 0 14px 34px rgba(61, 44, 24, 0.12);
}

.date-block {
  display: grid;
  place-items: center;
  min-height: 4rem;
  color: var(--paper-strong);
  border-radius: 6px;
  background: var(--day-color);
}

.date-block span:first-child {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.date-block span:last-child {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1;
}

.meeting-copy {
  display: grid;
  min-width: 0;
  gap: 0.3rem;
}

.meeting-copy h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
}

.venue {
  color: #51483c;
  font-size: 0.9rem;
  line-height: 1.3;
}

.address {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.2rem;
}

.badge {
  padding: 0.24rem 0.45rem;
  color: var(--day-color);
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid color-mix(in srgb, var(--day-color), transparent 52%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--day-color), transparent 91%);
}

.directions {
  color: var(--red-dark);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

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

.map-stage {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  background: #d8d4c7;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.map-note {
  position: absolute;
  right: clamp(1rem, 2vw, 2rem);
  bottom: clamp(1rem, 2vw, 2rem);
  display: flex;
  align-items: center;
  gap: 0.55rem;
  max-width: min(22rem, calc(100% - 2rem));
  padding: 0.8rem 0.95rem;
  color: var(--ink);
  font-size: 0.9rem;
  border: 1px solid rgba(37, 32, 26, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 250, 240, 0.9);
  box-shadow: var(--shadow);
  z-index: 500;
}

.map-schedule {
  position: absolute;
  top: clamp(1rem, 2vw, 2rem);
  left: clamp(1rem, 2vw, 2rem);
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  max-width: min(29rem, calc(100% - 6.5rem));
  z-index: 500;
  pointer-events: none;
}

.map-schedule span {
  padding: 0.46rem 0.6rem;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid color-mix(in srgb, var(--day-color), transparent 58%);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.9);
  box-shadow: 0 10px 26px rgba(37, 32, 26, 0.1);
}

.map-schedule strong {
  color: var(--day-color);
}

.pulse {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 8px rgba(47, 128, 101, 0.13);
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  color: var(--ink);
  border-radius: 8px;
  background: var(--paper-strong);
}

.leaflet-popup-content {
  width: 15rem;
  margin: 0.9rem;
  font-family: "Atkinson Hyperlegible", system-ui, sans-serif;
}

.popup-day {
  color: var(--red-dark);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.popup-title {
  margin: 0.2rem 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.1rem;
  line-height: 1.1;
}

.popup-text {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.pin {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--paper-strong);
  font-size: 0.72rem;
  font-weight: 700;
  border: 3px solid var(--paper-strong);
  border-radius: 50% 50% 50% 8px;
  background: var(--marker-color);
  box-shadow: 0 10px 22px rgba(37, 32, 26, 0.28);
  transform: rotate(-45deg);
}

.pin span {
  transform: rotate(45deg);
}

.leaflet-marker-icon.is-dimmed {
  opacity: 0.28;
}

.source-note {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.source-note a {
  color: var(--red-dark);
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

@media (max-width: 980px) {
  .page-shell {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
      "intro"
      "controls"
      "map"
      "list";
    min-height: auto;
  }

  .planner {
    display: contents;
  }

  .intro {
    grid-area: intro;
    padding: 1.25rem 1rem 0;
  }

  .controls {
    grid-area: controls;
    padding: 0 1rem 1rem;
  }

  .meeting-list {
    grid-area: list;
    padding: 1rem;
  }

  h1 {
    max-width: 12ch;
  }

  .map-stage {
    grid-area: map;
    position: relative;
    min-height: auto;
  }

  #map {
    height: 68vh;
    min-height: 470px;
  }
}

@media (max-width: 640px) {
  .planner {
    padding: 1rem;
  }

  h1 {
    font-size: clamp(2.4rem, 13vw, 3.6rem);
    line-height: 0.94;
  }

  .quick-stats {
    grid-template-columns: 1fr;
  }

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

  .filter {
    padding: 0;
  }

  .list-header {
    align-items: start;
    flex-direction: column;
    gap: 0.3rem;
  }

  .meeting-card {
    grid-template-columns: 3.6rem minmax(0, 1fr);
    padding: 0.65rem;
  }

  .date-block {
    min-height: 3.7rem;
  }

  .map-note {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }

  .map-schedule {
    top: 1rem;
    left: 1rem;
    max-width: calc(100% - 2rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
