:root {
  color-scheme: light;
  --ink: #16211d;
  --muted: #5a655f;
  --paper: #f6f4ee;
  --panel: #ffffff;
  --line: #d9d5ca;
  --forest: #183b31;
  --moss: #7f9a57;
  --clay: #b15f3e;
  --stone: #6c716f;
  --sky: #d8e7ea;
  --shadow: 0 18px 45px rgba(28, 35, 31, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

.hero {
  position: relative;
  min-height: 76vh;
  display: grid;
  align-items: end;
  background:
    linear-gradient(90deg, rgba(18, 28, 24, 0.83), rgba(18, 28, 24, 0.4) 48%, rgba(18, 28, 24, 0.15)),
    url("assets/new-england-bouldering.png") center / cover no-repeat;
  color: #fffaf0;
  overflow: hidden;
}

.hero__shade {
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(0deg, rgba(18, 28, 24, 0.7), rgba(18, 28, 24, 0));
  pointer-events: none;
}

.topbar {
  position: absolute;
  top: 22px;
  right: clamp(18px, 5vw, 64px);
  display: flex;
  gap: 8px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(16, 24, 21, 0.38);
  backdrop-filter: blur(12px);
}

.topbar a {
  min-width: 74px;
  padding: 9px 12px;
  border-radius: 6px;
  color: #fffaf0;
  text-align: center;
  text-decoration: none;
  font-size: 0.92rem;
}

.topbar a:hover {
  background: rgba(255, 255, 255, 0.14);
}

.hero__content {
  position: relative;
  width: min(760px, calc(100% - 36px));
  margin: 0 auto;
  padding: 132px 0 44px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--clay);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #f0c47b;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(2.55rem, 8vw, 5.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero__copy {
  max-width: 600px;
  margin: 22px 0 0;
  color: rgba(255, 250, 240, 0.86);
  font-size: clamp(1rem, 2.4vw, 1.22rem);
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 560px;
  margin-top: 28px;
}

.hero__stats div {
  min-height: 86px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(16, 24, 21, 0.38);
  backdrop-filter: blur(12px);
}

.hero__stats strong {
  display: block;
  font-size: 1.7rem;
  line-height: 1;
}

.hero__stats span {
  display: block;
  margin-top: 8px;
  color: rgba(255, 250, 240, 0.74);
  font-size: 0.9rem;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.controls {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: -28px 0 34px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.control-group label {
  display: block;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.overview {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(320px, 1fr);
  gap: 28px;
  align-items: center;
  margin: 38px 0 58px;
}

.map-card {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 76% 18%, rgba(216, 231, 234, 0.96), rgba(216, 231, 234, 0) 26%),
    linear-gradient(135deg, #eef1e7, #d8dfd2 54%, #b9c8b0);
}

.map-card__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.3) 1px, transparent 1px);
  background-size: 42px 42px;
}

.map-dot {
  position: absolute;
  max-width: 116px;
  padding: 7px 9px 7px 22px;
  border: 1px solid rgba(22, 33, 29, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 24px rgba(28, 35, 31, 0.12);
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.05;
}

.map-dot::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--clay);
  transform: translateY(-50%);
}

.map-dot--home {
  left: 50%;
  top: 35%;
  background: var(--forest);
  color: #fff;
}

.map-dot--home::before {
  background: #f0c47b;
}

.map-dot--rocky { left: 68%; top: 20%; }
.map-dot--tivnan { left: 60%; top: 58%; }
.map-dot--tatnuck { left: 25%; top: 48%; }
.map-dot--gods { left: 31%; top: 67%; }
.map-dot--douglas { left: 48%; top: 83%; }
.map-dot--rockhouse { left: 73%; top: 75%; }
.map-dot--hammond { left: 84%; top: 47%; }
.map-dot--lincoln { left: 67%; top: 91%; }
.map-dot--lynn { left: 86%; top: 28%; }
.map-dot--farley { left: 10%; top: 24%; }

.plan-copy h2,
.section-heading h2,
.sources h2,
.gear h2 {
  margin: 0;
  font-size: clamp(1.85rem, 4vw, 3.1rem);
  line-height: 1.06;
}

.plan-copy p,
.sources p,
.gear p {
  max-width: 650px;
  color: var(--muted);
  font-size: 1.02rem;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.result-count {
  min-width: 120px;
  color: var(--muted);
  text-align: right;
  font-weight: 800;
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.route-card {
  display: flex;
  flex-direction: column;
  min-height: 408px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 20px rgba(28, 35, 31, 0.06);
}

.route-card__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.route-card h3 {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.1;
}

.drive {
  flex: 0 0 auto;
  min-width: 70px;
  padding-top: 2px;
  color: var(--clay);
  text-align: right;
  font-weight: 900;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.pill {
  padding: 5px 8px;
  border-radius: 999px;
  background: #edf1e8;
  color: #31443a;
  font-size: 0.78rem;
  font-weight: 800;
}

.route-card p {
  margin: 0 0 14px;
  color: var(--muted);
}

.problems {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.problems li {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-height: 34px;
  color: var(--ink);
}

.grade {
  display: inline-flex;
  justify-content: center;
  min-width: 46px;
  padding: 4px 7px;
  border-radius: 6px;
  background: var(--forest);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
}

.grade--warmup {
  background: var(--moss);
}

.grade--project {
  background: var(--clay);
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.button {
  flex: 1 1 0;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
}

.button--light {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.button svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 34px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.gear {
  margin: 62px 0 12px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.gear-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.gear-grid article {
  min-height: 176px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.gear-grid h3 {
  margin: 0 0 8px;
  font-size: 1.12rem;
}

.gear-grid p {
  margin: 0;
}

.gear-grid a {
  color: var(--forest);
  font-weight: 900;
}

.sources {
  margin: 62px 0 46px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.sources ul {
  columns: 2;
  padding-left: 18px;
}

.sources li {
  margin: 0 0 8px;
  break-inside: avoid;
}

@media (max-width: 880px) {
  .hero {
    min-height: 82vh;
  }

  .topbar {
    left: 18px;
    right: 18px;
    justify-content: center;
  }

  .hero__stats,
  .controls,
  .overview,
  .route-grid,
  .gear-grid {
    grid-template-columns: 1fr;
  }

  .controls {
    position: relative;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .result-count {
    text-align: left;
  }

  .sources ul {
    columns: 1;
  }
}

@media (max-width: 540px) {
  main {
    width: min(100% - 22px, 1180px);
  }

  .hero__content {
    width: calc(100% - 28px);
    padding-bottom: 30px;
  }

  .hero__stats div,
  .route-card {
    min-height: 0;
  }

  .card-actions {
    flex-direction: column;
  }

  .map-dot {
    max-width: 96px;
    font-size: 0.7rem;
  }
}
