/* Climbing year in review, styled after thetopo.com: Roboto, the yellow
   primary, neutral greys, a dark top bar, small radii and uppercase
   micro-labels. Chart series keep their own validated palette; dark mode
   gets its own steps rather than an inverted light palette. */

:root {
  color-scheme: light;
  --page: #fafaf9;
  --surface: #ffffff;
  --surface-2: #f2f1f1;
  --ink: #171717;
  --ink-2: #404040;
  --muted: #737373;
  --grid: #e5e5e5;
  --axis: #d4d4d4;
  --border: #dcdbdb;
  --brand: #f0db0f;
  --brand-hover: #dec90b;
  --brand-ink: #171717;
  --bar: #272625;
  --bar-ink: #fafaf9;
  --up: #006300;
  --down: #b83232;
  --alert-bg: #fdeceb;
  --alert-ink: #8a2323;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 24px -12px rgba(0, 0, 0, 0.18);

  --style-redpoint: #2a78d6;
  --style-flash: #eb6834;
  --style-onsight: #1baf7a;
  --style-toprope: #eda100;
  --style-other: #8c8c8c;
  --series-routes: #2a78d6;
  --series-boulders: #eb6834;

  --heat-0: #ecebea;
  --heat-1: #b7d3f6;
  --heat-2: #6da7ec;
  --heat-3: #2a78d6;
  --heat-4: #184f95;

  --radius: 6px;
  --font: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #121212;
    --surface: #1d1c1b;
    --surface-2: #272625;
    --ink: #f5f5f5;
    --ink-2: #d4d4d4;
    --muted: #a3a3a3;
    --grid: #2f2e2d;
    --axis: #414040;
    --border: #353433;
    --bar: #0b0b0b;
    --up: #0ca30c;
    --down: #e66767;
    --alert-bg: #3a1717;
    --alert-ink: #f4b4b4;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
    --style-redpoint: #3987e5;
    --style-flash: #d95926;
    --style-onsight: #199e70;
    --style-toprope: #c98500;
    --series-routes: #3987e5;
    --series-boulders: #d95926;
    --heat-0: #272625;
    --heat-1: #184f95;
    --heat-2: #256abf;
    --heat-3: #3987e5;
    --heat-4: #86b6ef;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #121212;
  --surface: #1d1c1b;
  --surface-2: #272625;
  --ink: #f5f5f5;
  --ink-2: #d4d4d4;
  --muted: #a3a3a3;
  --grid: #2f2e2d;
  --axis: #414040;
  --border: #353433;
  --bar: #0b0b0b;
  --up: #0ca30c;
  --down: #e66767;
  --alert-bg: #3a1717;
  --alert-ink: #f4b4b4;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  --style-redpoint: #3987e5;
  --style-flash: #d95926;
  --style-onsight: #199e70;
  --style-toprope: #c98500;
  --series-routes: #3987e5;
  --series-boulders: #d95926;
  --heat-0: #272625;
  --heat-1: #184f95;
  --heat-2: #256abf;
  --heat-3: #3987e5;
  --heat-4: #86b6ef;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 48px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration-color: var(--axis); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.eyebrow {
  margin: 0 0 0.6rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 48px;
  padding: 0 16px;
  background: var(--bar);
  color: var(--bar-ink);
}
.topbar__brand { display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; font-size: 0.95rem; }
.topbar__mark { width: 22px; height: 22px; flex: none; }
.topbar__title { color: #a3a3a3; font-size: 0.85rem; font-weight: 400; text-transform: none; letter-spacing: 0; }
.topbar__spacer { flex: 1; }
.topbar__link { font-size: 0.75rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; text-decoration: none; color: var(--bar-ink); }
.topbar__cta { padding: 0.35rem 0.6rem; border-radius: 3px; background: var(--brand); color: var(--brand-ink); }
.topbar__cta:hover { background: var(--brand-hover); }
@media (max-width: 560px) { .topbar__title, .topbar__link:not(.topbar__cta) { display: none; } }

.flash {
  position: sticky;
  top: 48px;
  z-index: 20;
  padding: 0.85rem 1rem;
  background: var(--alert-bg);
  color: var(--alert-ink);
  text-align: center;
  font-weight: 500;
}

.credit { font-size: 0.8rem; color: var(--muted); text-align: center; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.25rem;
  border: 0;
  border-radius: 4px;
  background: var(--brand);
  color: var(--brand-ink);
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
}
.button:hover { background: var(--brand-hover); }
.button--ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--border); }
.button--ghost:hover { background: var(--surface-2); }

/* ---------- Photo backdrops ---------- */

.photo-backdrop {
  position: relative;
  background-color: var(--bar);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.photo-backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.5));
}
.photo-backdrop > * { position: relative; }

/* ---------- Start page ---------- */

.start {
  min-height: calc(100vh - 48px);
  display: flex;
  align-items: center;
  padding: 2rem 16px;
}
.start__inner { width: min(1140px, 100%); margin: 0 auto; }

.start__card {
  width: min(460px, 100%);
  padding: clamp(1.5rem, 4vw, 2rem);
  background: var(--surface);
  border-radius: 2px;
  box-shadow: var(--shadow);
}

.start__title { margin: 0 0 0.75rem; font-size: clamp(1.6rem, 5vw, 2rem); line-height: 1.15; font-weight: 700; }
.start__lede { margin: 0 0 1.5rem; color: var(--ink-2); font-size: 0.95rem; }
.start__hint { margin: 1.25rem 0 0; font-size: 0.85rem; color: var(--ink-2); }
.start .credit { text-align: left; color: rgba(255, 255, 255, 0.85); margin-top: 1rem; }
.start .credit a { color: #fff; }

.start__form { display: grid; gap: 1rem; }
.field { display: grid; gap: 0.3rem; }
.field label { font-size: 0.72rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.field small { color: var(--muted); font-size: 0.78rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.field input, .field select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--axis);
  border-radius: 3px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
}
.field input:focus, .field select:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--ink); }
.start__form .button { justify-self: end; margin-top: 0.25rem; }

/* ---------- Review slides ---------- */

.slide {
  min-height: calc(100vh - 48px);
  min-height: calc(100svh - 48px);
  display: flex;
  align-items: center;
  padding: 4rem 16px;
  background-color: var(--surface);
}
.slide:nth-of-type(even) { background-color: var(--page); }

.slide__inner {
  width: min(900px, 100%);
  min-width: 0;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.slide__inner--wide { width: min(1140px, 100%); }
.slide.is-visible .slide__inner { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .slide__inner { opacity: 1; transform: none; transition: none; }
}

.slide__title {
  margin: 0 0 1.75rem;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.01em;
  max-width: 26ch;
}
.slide__caption { margin: 1.5rem 0 0; color: var(--ink-2); }

.dots {
  position: fixed;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  gap: 9px;
  z-index: 10;
}
.dots__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--axis); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5); transition: transform 0.2s, background 0.2s; }
.dots__dot.is-active { background: var(--brand); transform: scale(1.4); box-shadow: 0 0 0 1px var(--ink); }
@media (max-width: 640px) { .dots { display: none; } }

/* Hero: full-bleed crag photo with a white card, like thetopo.com's front page */
.slide--hero { padding: 3rem 16px; background-color: var(--bar); }
.slide--hero .slide__inner { width: min(1140px, 100%); }
.hero-card {
  width: min(520px, 100%);
  padding: clamp(1.5rem, 4vw, 2.25rem);
  background: var(--surface);
  border-radius: 2px;
  box-shadow: var(--shadow);
}
.hero-year {
  margin: 0;
  font-size: clamp(4.5rem, 16vw, 8rem);
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: -0.04em;
}
.hero-year span { box-shadow: inset 0 -0.18em 0 var(--brand); }
.hero-year--words { font-size: clamp(3.25rem, 12vw, 5.5rem); }
.hero-line { margin: 1.25rem 0 0.4rem; font-size: clamp(1.15rem, 3vw, 1.5rem); line-height: 1.3; }
.hero-sub { margin: 0; color: var(--ink-2); font-size: 0.95rem; }
.scroll-cue { margin-top: 1.5rem; }

/* Stat tiles */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tile { display: flex; flex-direction: column; gap: 0.15rem; padding: 1.25rem; background: var(--surface); }
.tile__value { font-size: clamp(2rem, 5vw, 2.6rem); font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.tile__label { color: var(--ink-2); font-size: 0.9rem; }
.tile__note { color: var(--muted); font-size: 0.8rem; }
@media (max-width: 640px) { .tiles { grid-template-columns: repeat(2, 1fr); } }

.delta { font-size: 0.8rem; font-weight: 500; margin-top: 0.3rem; }
.delta--up { color: var(--up); }
.delta--down { color: var(--down); }
.delta--flat { color: var(--muted); }

/* Grade badge, thetopo-style: yellow chip with dark text */
.grade-badge { display: inline-block; padding: 0.1em 0.45em; border-radius: 3px; background: var(--brand); color: var(--brand-ink); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Hardest: photo cards */
.hardest { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.hardest__card { overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.hardest__photo { position: relative; aspect-ratio: 16 / 9; background: var(--surface-2) center / cover no-repeat; }
.hardest__photo .grade-badge { position: absolute; left: 1rem; bottom: -1.1rem; font-size: 2.2rem; padding: 0.15em 0.4em; box-shadow: var(--shadow); }
.hardest__body { padding: 1.75rem 1.25rem 1.25rem; }
.hardest__card--nophoto .hardest__body { padding-top: 1.25rem; }
.hardest__card--nophoto .grade-badge { font-size: 2.2rem; margin-bottom: 0.5rem; }
.hardest__kind { margin: 0; font-size: 0.72rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.hardest__name { margin: 0.35rem 0 0.2rem; font-size: 1.4rem; line-height: 1.2; font-weight: 700; }
.hardest__meta { margin: 0; color: var(--ink-2); font-size: 0.9rem; }
.hardest__compare { margin: 0.6rem 0 0; font-weight: 500; font-size: 0.9rem; color: var(--up); }
.ranklist { margin: 1.25rem 0 0; padding: 0.9rem 0 0 1.3rem; border-top: 1px solid var(--grid); display: grid; gap: 0.45rem; font-size: 0.92rem; }
.ranklist li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }
.ranklist__grade { display: inline-block; min-width: 3.2ch; font-weight: 700; font-variant-numeric: tabular-nums; }
.ranklist__meta { display: block; color: var(--muted); font-size: 0.8rem; }

/* Legend */
.legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; margin: -0.75rem 0 1.25rem; color: var(--ink-2); font-size: 0.85rem; }
.legend__item { display: inline-flex; align-items: center; gap: 0.4rem; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: none; }
.swatch--ghost { height: 0; border-top: 2px dashed var(--ink-2); border-radius: 0; }
.swatch--dot { border-radius: 50%; }

/* Grade pyramid: horizontal stacked bars, hardest grade on top */
.pyramids { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem 3rem; }
.pyramid { margin: 0; }
.pyramid figcaption, .ts figcaption { font-weight: 700; margin-bottom: 0.6rem; }
.pyramid figcaption .muted, .ts figcaption .muted { font-weight: 400; margin-left: 0.4rem; font-size: 0.85rem; }
.pyramid__row { display: grid; grid-template-columns: 3.5rem 1fr; align-items: center; gap: 0.6rem; min-height: 24px; }
.pyramid__grade { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; font-size: 0.88rem; }
.pyramid__track { display: flex; align-items: center; gap: 0.5rem; }
.pyramid__bar { display: flex; gap: 2px; height: 16px; transform-origin: left; transform: scaleX(0); transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); }
.slide.is-visible .pyramid__bar { transform: scaleX(1); }
.pyramid__seg { min-width: 2px; height: 100%; }
.pyramid__seg:first-child { border-radius: 4px 0 0 4px; }
.pyramid__seg:last-child { border-radius: 0 4px 4px 0; }
.pyramid__seg:only-child { border-radius: 4px; }
.pyramid__count { color: var(--muted); font-size: 0.78rem; font-variant-numeric: tabular-nums; }

/* Style stacked bar */
.stackbar { display: flex; gap: 2px; height: 48px; border-radius: var(--radius); overflow: hidden; }
.stackbar__seg { min-width: 3px; transition: filter 0.15s; }
.stackbar__seg:hover, .stackbar__seg:focus { filter: brightness(1.12); outline: none; }
.style-list { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.75rem 1.5rem; }
.style-list li { display: flex; align-items: center; gap: 0.6rem; }
.style-list__name { min-width: 5.5rem; }
.style-list__value { font-weight: 700; font-size: 1.2rem; font-variant-numeric: tabular-nums; }

/* Time series: grade-by-date lanes and the running total */
.ts { margin: 0 0 1.75rem; }
.ts__plot { position: relative; margin-left: 3rem; }
.ts__plot--lane { height: 150px; }
.ts__plot--total { height: 120px; }
.ts__svg { display: block; width: 100%; height: 100%; overflow: visible; }
.ts__yaxis span { position: absolute; left: -3rem; width: 2.6rem; transform: translateY(-50%); text-align: right; font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ts__xaxis { position: relative; height: 1.4rem; margin-left: 3rem; border-top: 1px solid var(--axis); }
.ts__xaxis span { position: absolute; top: 0.3rem; transform: translateX(-50%); font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.ts__grid { stroke: var(--grid); stroke-width: 1; }
.ts__dot { stroke-width: 8; stroke-linecap: round; stroke-opacity: 0.8; }
.ts__dot:hover { stroke-width: 13; stroke-opacity: 1; }
.ts__area { fill: var(--series-routes); fill-opacity: 0.12; }
.ts__line { fill: none; stroke: var(--series-routes); stroke-width: 2; stroke-linejoin: round; }
.ts__hit { stroke: transparent; stroke-width: 14; stroke-linecap: round; }
.ts__hit:hover { stroke: var(--series-routes); stroke-width: 9; }

/* Monthly columns */
.columns { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; height: 220px; align-items: end; border-bottom: 1px solid var(--axis); }
.columns__col { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; outline: none; }
.columns__col:hover .columns__stack, .columns__col:focus .columns__stack { filter: brightness(1.12); }
.columns__stack { width: min(100%, 36px); display: flex; flex-direction: column; gap: 2px; transform-origin: bottom; transform: scaleY(0); transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); }
.slide.is-visible .columns__stack { transform: scaleY(1); }
.columns__stack span { min-height: 2px; }
.columns__stack span:first-child { border-radius: 4px 4px 0 0; }
.columns__label { position: absolute; bottom: -1.6rem; font-size: 0.78rem; color: var(--muted); }
.columns__ghost { position: absolute; left: 50%; width: min(100%, 44px); transform: translate(-50%, 1px); border-top: 2px dashed var(--ink-2); z-index: 1; pointer-events: none; }
.columns + .slide__caption { margin-top: 3rem; }

.weekbars { display: grid; gap: 6px; margin-top: 1rem; max-width: 520px; }
.weekbars__row { display: grid; grid-template-columns: 2.5rem 1fr 2rem; align-items: center; gap: 0.6rem; outline: none; }
.weekbars__label { font-size: 0.85rem; color: var(--ink-2); }
.weekbars__track { height: 12px; }
.weekbars__bar { display: block; height: 100%; background: var(--series-routes); border-radius: 0 4px 4px 0; }
.weekbars__row:hover .weekbars__bar, .weekbars__row:focus .weekbars__bar { filter: brightness(1.12); }
.weekbars__count { font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Calendar heatmap: weeks are columns, Monday on top */
.calendar-scroll { overflow-x: auto; padding-bottom: 0.5rem; }
.calendar { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; min-width: 640px; }
.calendar__day { aspect-ratio: 1; border-radius: 2px; background: var(--heat-0); outline: none; }
.calendar__day--blank { background: transparent; }
.calendar__day[data-level="1"] { background: var(--heat-1); }
.calendar__day[data-level="2"] { background: var(--heat-2); }
.calendar__day[data-level="3"] { background: var(--heat-3); }
.calendar__day[data-level="4"] { background: var(--heat-4); }
.calendar__day[tabindex]:hover, .calendar__day[tabindex]:focus { box-shadow: 0 0 0 2px var(--ink); }
.heat-legend { display: flex; align-items: center; justify-content: flex-end; gap: 3px; margin-top: 0.6rem; font-size: 0.78rem; color: var(--muted); }
.heat-legend .calendar__day { width: 12px; }

/* All time: year by year */
.years { display: grid; }
.years__row { display: grid; grid-template-columns: 4rem minmax(0, 1fr) 3.5rem 3.5rem 5.5rem 5.5rem; align-items: center; gap: 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid var(--grid); }
.years__row--head { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.years__row--head span:nth-child(n+3) { text-align: right; }
.years__year { font-weight: 700; font-variant-numeric: tabular-nums; }
.years__bar { display: flex; align-items: center; gap: 0.5rem; outline: none; }
.years__bar span { display: block; height: 14px; background: var(--series-routes); border-radius: 0 4px 4px 0; }
.years__bar:hover span, .years__bar:focus span { filter: brightness(1.12); }
.years__bar b { font-size: 0.85rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.years__num { text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.years__grade { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.years__grade--up { color: var(--up); }
@media (max-width: 640px) {
  .years__row { grid-template-columns: 3rem minmax(0, 1fr) 4rem 4rem; }
  .years__row > :nth-child(3), .years__row > :nth-child(4) { display: none; }
}

/* Map */
.map-layout { display: grid; grid-template-columns: 1fr 280px; gap: 1.25rem; align-items: start; }
@media (max-width: 800px) { .map-layout { grid-template-columns: 1fr; } }
.map { height: min(62vh, 540px); min-height: 320px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); z-index: 0; }
.map.leaflet-container { font-family: var(--font); }
.map-tiles { filter: grayscale(0.85) contrast(0.9) brightness(1.03); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .map-tiles { filter: grayscale(1) invert(1) brightness(0.85) contrast(0.9); }
}
:root[data-theme="dark"] .map-tiles { filter: grayscale(1) invert(1) brightness(0.85) contrast(0.9); }
.map-tooltip.leaflet-tooltip { padding: 0; overflow: hidden; border-radius: 4px; font-family: var(--font); }
.map-tooltip__photo { display: block; width: 220px; height: 110px; object-fit: cover; }
.map-tooltip__body { padding: 0.5rem 0.65rem; }
.map-tooltip ul { margin: 0.35rem 0 0; padding-left: 1rem; }
.country-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; max-height: min(62vh, 540px); overflow-y: auto; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); }
.country-list li { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.75rem; background: var(--surface); }
.country-list__flag { font-size: 1.4rem; }
.country-list__name { flex: 1; display: grid; font-weight: 500; }
.country-list__name small { font-weight: 400; color: var(--muted); }
.country-list__value { font-weight: 700; font-variant-numeric: tabular-nums; }

/* Crags: photo rows */
.crags { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.crags__item { display: flex; align-items: center; gap: 1rem; padding: 0.6rem 1.1rem 0.6rem 0.6rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.crags__thumb { position: relative; width: 96px; height: 72px; flex: none; border-radius: 4px; background: var(--surface-2) center / cover no-repeat; }
.crags__rank { position: absolute; left: 6px; top: 6px; min-width: 1.6rem; padding: 0 0.3rem; border-radius: 3px; background: var(--brand); color: var(--brand-ink); font-size: 0.85rem; font-weight: 700; text-align: center; }
.crags__item:first-child .crags__thumb { width: 160px; height: 110px; }
.crags__item:first-child .crags__name { font-size: 1.35rem; }
.crags__body { flex: 1; display: grid; min-width: 0; gap: 0.15rem; }
.crags__name { font-weight: 700; font-size: 1.05rem; }
.crags__meta { color: var(--ink-2); font-size: 0.85rem; }
.crags__value { display: grid; text-align: right; font-weight: 700; font-size: 1.4rem; line-height: 1; }
.crags__value small { font-weight: 400; font-size: 0.72rem; color: var(--muted); }
@media (max-width: 560px) {
  .crags__thumb, .crags__item:first-child .crags__thumb { width: 72px; height: 60px; }
}

/* Favourites */
.favorites { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.favorite { overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.favorite__photo { aspect-ratio: 16 / 10; background: var(--surface-2) center / cover no-repeat; }
.favorite__body { padding: 0.9rem 1rem 1rem; }
.favorite h3 { margin: 0.3rem 0; font-size: 1.1rem; line-height: 1.2; }
.favorite p { margin: 0; color: var(--ink-2); font-size: 0.85rem; }
.stars { color: #c98500; letter-spacing: 0.1em; }

/* Year over year */
.yoy { display: grid; }
.yoy__row { display: grid; grid-template-columns: minmax(0, 1fr) 5.5rem 5.5rem 6.5rem; align-items: center; gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--grid); }
.yoy__row--head { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding-top: 0; }
.yoy__row--head span:not(:first-child) { text-align: right; }
.yoy__label { display: grid; gap: 0.35rem; font-weight: 500; }
.yoy__bars { display: grid; gap: 2px; max-width: 220px; }
.yoy__bars span { display: block; height: 5px; border-radius: 0 3px 3px 0; }
.yoy__value { text-align: right; font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.yoy__value--before { color: var(--muted); font-weight: 400; }
.yoy__change { text-align: right; font-size: 0.82rem; font-weight: 500; white-space: nowrap; }
.yoy__change--up { color: var(--up); }
.yoy__change--down { color: var(--down); }
.yoy__change--flat { color: var(--muted); }
@media (max-width: 560px) {
  .yoy__row { grid-template-columns: minmax(0, 1fr) 3.8rem 3.8rem 4.8rem; gap: 0.5rem; }
  .yoy__value { font-size: 1rem; }
  .yoy__change { font-size: 0.75rem; }
}

/* Wrap-up */
.slide--wrap { background-color: var(--bar) !important; }
.slide--wrap .slide__inner { text-align: center; }
.slide--wrap .slide__title { margin: 2rem auto 1.25rem; color: #fff; }
.slide--wrap .credit { color: rgba(255, 255, 255, 0.8); }
.slide--wrap .credit a { color: #fff; }
.summary {
  width: min(440px, 100%);
  margin: 0 auto;
  padding: 1.75rem;
  border-radius: 2px;
  background: var(--surface);
  box-shadow: var(--shadow);
  border-top: 6px solid var(--brand);
}
.summary__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; margin: 1rem 0; }
.summary__grid dt { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.summary__grid dd { margin: 0; font-size: 1.9rem; font-weight: 700; }
.summary__crag { margin: 0; color: var(--ink-2); }
.wrap-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; margin-bottom: 2rem; }

/* Tooltip */
.tooltip {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  max-width: min(360px, calc(100vw - 16px));
  padding: 0.4rem 0.6rem;
  border-radius: 3px;
  background: var(--bar);
  color: #fafaf9;
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity 0.1s;
}
.tooltip.is-visible { opacity: 1; }
[data-tip] { cursor: default; }

/* Very tall viewports (full-page screenshots): stack the slides naturally. */
@media (min-height: 2000px) {
  .slide, .start { min-height: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .pyramid__bar, .columns__stack { transform: none; transition: none; }
}
