:root {
  --ink: #1a1a1a;
  --muted: #7a7f87;
  --line: #1a1a1a;
  --bg: #ffffff;
  --card: #ffffff;
  --accent: #2e7d32;
  --shadow: 0 8px 30px rgba(20, 20, 20, 0.10);
  --radius: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

.poster {
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) clamp(18px, 4vw, 56px) 80px;
}

/* ---------- Masthead ---------- */
.masthead { text-align: center; margin-bottom: clamp(28px, 5vw, 52px); }

.title {
  font-weight: 300;
  font-size: clamp(2.4rem, 8.5vw, 5.6rem);
  letter-spacing: 0.06em;
  margin: 0;
  line-height: 1;
}

.subtitle {
  font-weight: 300;
  font-size: clamp(1rem, 3.2vw, 1.9rem);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  margin: 0.5em 0 0;
  color: var(--ink);
}

.progress {
  max-width: 340px;
  margin: clamp(20px, 4vw, 34px) auto 0;
}

.progress-bar {
  height: 6px;
  border-radius: 999px;
  background: #ececec;
  overflow: hidden;
}

.progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2e7d32, #1b998b);
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.progress-label {
  margin: 10px 0 0;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.progress-label strong { font-weight: 600; color: var(--ink); }

.log-btn {
  display: inline-block;
  margin-top: clamp(18px, 3.5vw, 26px);
  padding: 11px 26px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.86rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.log-btn:hover { background: var(--ink); color: #fff; transform: translateY(-1px); }

/* ---------- Grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(14px, 2.6vw, 30px) clamp(6px, 1.5vw, 16px);
}

.peak {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border: none;
  background: none;
  padding: 8px 2px 4px;
  cursor: pointer;
  font-family: inherit;
  border-radius: 10px;
  transition: transform 0.18s ease;
}
.peak:hover { transform: translateY(-3px); }
.peak:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.peak-tri { width: clamp(52px, 10vw, 84px); height: auto; display: block; }
.peak-tri polygon {
  fill: none;
  stroke: var(--line);
  stroke-width: 2.2;
  stroke-linejoin: round;
  transition: fill 0.4s ease;
}
.peak.done .peak-tri polygon { stroke-width: 1.4; }

.peak-name {
  margin-top: 10px;
  font-size: clamp(0.7rem, 1.6vw, 0.92rem);
  letter-spacing: 0.02em;
  color: var(--ink);
  line-height: 1.15;
}
.peak-elev {
  font-size: clamp(0.62rem, 1.4vw, 0.82rem);
  color: var(--muted);
  margin-top: 2px;
}

.peak-count {
  position: absolute;
  top: 2px;
  right: calc(50% - clamp(30px, 5.4vw, 46px));
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
}

.peak-check {
  position: absolute;
  bottom: 30%;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.92);
  pointer-events: none;
}

/* ---------- Colophon ---------- */
.colophon {
  margin-top: clamp(34px, 6vw, 60px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-top: 1px solid #eee;
  padding-top: 16px;
}
.colophon a { color: var(--muted); text-decoration: none; }
.colophon a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- Overlay / Sheet ---------- */
.overlay, .lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
@media (min-width: 720px) {
  .overlay { align-items: center; }
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 18, 20, 0.44);
  backdrop-filter: blur(2px);
  animation: fade 0.2s ease;
}

.sheet {
  position: relative;
  width: min(560px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  padding: 26px clamp(20px, 4vw, 32px) 34px;
  box-shadow: var(--shadow);
  animation: rise 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}
@media (min-width: 720px) {
  .sheet { border-radius: 20px; }
}

.sheet-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: none;
  background: none;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  border-radius: 50%;
}
.sheet-close:hover { background: #f2f2f2; color: var(--ink); }

.sheet-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-right: 40px;
}
.sheet-tri { width: 52px; height: 46px; flex: none; }
.sheet-tri polygon { stroke: var(--ink); stroke-width: 2.4; stroke-linejoin: round; }
.sheet-title { margin: 0; font-weight: 500; font-size: 1.55rem; letter-spacing: 0.02em; }
.sheet-elev { margin: 2px 0 0; color: var(--muted); font-size: 0.95rem; letter-spacing: 0.08em; }

.ascent {
  border: 1px solid #ececec;
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 14px;
}
.ascent-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.chip {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  flex: none;
}
.ascent-date { font-weight: 500; font-size: 1.02rem; letter-spacing: 0.02em; }
.ascent-color { color: var(--muted); font-size: 0.82rem; letter-spacing: 0.06em; }
.ascent-issue {
  margin-left: auto;
  font-size: 0.74rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.04em;
}
.ascent-issue:hover { color: var(--ink); text-decoration: underline; }

.ascent-companions {
  margin: 10px 0 0;
  font-size: 0.86rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.ascent-companions .trav {
  display: inline-block;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #fff;
  background: var(--muted);
  border-radius: 999px;
  padding: 2px 8px;
  margin-right: 7px;
  vertical-align: 1px;
}

.ascent-note { margin: 12px 0 0; font-size: 0.96rem; line-height: 1.5; color: #333; }

.strava {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  padding: 8px 15px;
  border-radius: 999px;
  background: #fc4c02;
  color: #fff;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.strava:hover { filter: brightness(1.06); }

.ascent .strava-embed-placeholder,
.ascent iframe {
  margin-top: 14px;
  max-width: 100%;
}
.ascent .strava-embed-placeholder + .strava { margin-top: 10px; }

.photos {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
}
.photos img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  cursor: zoom-in;
  background: #f0f0f0;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 8px 0 4px;
}
.empty p { margin: 0 0 18px; font-size: 1rem; }
.empty .log-btn { margin-top: 0; }

/* ---------- Lightbox ---------- */
.lightbox { z-index: 60; align-items: center; }
.lightbox img {
  position: relative;
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.lb-close { position: fixed; top: 18px; right: 22px; color: #fff; font-size: 2.4rem; }
.lb-close:hover { background: rgba(255,255,255,0.15); color: #fff; }

@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Responsive columns ---------- */
@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .peak-count { right: calc(50% - 30px); }
}
@media (max-width: 360px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
