:root {
  --night: #0a1a33;
  --deep: #12305c;
  --ice: #eef5fc;
  --snow: #ffffff;
  --ink: #0a1a33;
  --muted: #4d6283;
  --line: #d3e1f0;
  --accent: #ff5a1f;
  --accent-ink: #ffffff;
  --green: #1e9e5a;
  --blue: #1f6feb;
  --black: #0a1a33;
  --slope-w: clamp(56px, 10vw, 140px);
  --radius: 18px;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'Inter', system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ice);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
}

h1,
h2,
h3 {
  font-family: var(--display);
  line-height: 1.05;
  margin: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 50;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 16px;
  border-radius: 999px;
}
.skip:focus {
  top: 16px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Slope panel ---------- */

.slope {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--slope-w);
  z-index: 10;
  background: linear-gradient(180deg, #ffffff 0%, #e3eefa 100%);
  border-left: 1px solid var(--line);
  overflow: hidden;
}

.slope__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.slope__trail {
  fill: none;
  stroke: #c9daec;
  stroke-width: 14px;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.slope__tracks {
  fill: none;
  stroke: var(--deep);
  stroke-width: 2px;
  stroke-dasharray: 2 4;
  vector-effect: non-scaling-stroke;
  opacity: 0.55;
}

.gate {
  position: absolute;
  width: 14px;
  height: 22px;
  margin: -22px 0 0 -7px;
  border-left: 3px solid var(--accent);
  transition: border-color 0.3s;
}
.gate::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 11px;
  height: 9px;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  transition: background 0.3s;
}
.gate.is-cleared {
  border-color: var(--green);
}
.gate.is-cleared::after {
  background: var(--green);
}

.skier {
  position: absolute;
  left: 50%;
  top: 4%;
  z-index: 2;
  transform: translate(-50%, -70%);
  transition: left 0.12s linear, top 0.12s linear;
  pointer-events: none;
}
.skier__body {
  display: block;
  font-size: clamp(26px, 3.4vw, 40px);
  transform: rotate(var(--lean, 0deg));
  transition: transform 0.25s ease-out;
  filter: drop-shadow(0 4px 4px rgb(10 26 51 / 0.25));
}

/* ---------- HUD ---------- */

.hud {
  position: fixed;
  top: 16px;
  right: calc(var(--slope-w) + 16px);
  z-index: 20;
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgb(10 26 51 / 0.88);
  backdrop-filter: blur(8px);
  color: var(--snow);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.hud > span {
  padding: 6px 12px;
  border-radius: 999px;
}
.hud__gates {
  background: var(--accent);
}

/* ---------- Layout ---------- */

.hero,
main,
.footer {
  margin-right: var(--slope-w);
}

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 120px 6vw 200px;
  background: radial-gradient(120% 80% at 20% 0%, #24518f 0%, var(--deep) 40%, var(--night) 100%);
  color: var(--snow);
  overflow: hidden;
  outline: none;
}

.hero__mountains {
  position: absolute;
  inset: auto 0 0 0;
  width: 100%;
  height: 46%;
}
.hero__mountains .m3 {
  fill: #2a4f82;
}
.hero__mountains .m2 {
  fill: #c3d6ec;
}
.hero__mountains .m1 {
  fill: var(--ice);
}

.hero__inner {
  position: relative;
  max-width: 900px;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 20px;
  padding: 6px 14px;
  border: 1px solid rgb(255 255 255 / 0.3);
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: 0.04em;
}

.hero h1 {
  font-size: clamp(72px, 15vw, 200px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.88;
}

.hero__lede {
  max-width: 34ch;
  margin: 28px 0 36px;
  font-size: clamp(18px, 2.2vw, 24px);
  color: #d6e4f7;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 2px solid transparent;
  font: 600 16px/1 var(--body);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn--light {
  background: var(--snow);
  color: var(--night);
}
.btn--accent {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn--ghost {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

main {
  padding: 0 6vw;
}

.section {
  max-width: 1100px;
  padding: 120px 0 40px;
}

.gate-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.gate-label::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid currentColor;
  transition: background 0.3s;
}
.section.is-cleared .gate-label {
  color: var(--green);
}
.section.is-cleared .gate-label::before {
  background: currentColor;
}

.section h2 {
  font-size: clamp(44px, 7vw, 96px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.section__intro {
  max-width: 60ch;
  color: var(--muted);
  font-size: 19px;
  margin: 0 0 28px;
}

/* About */
.about {
  display: grid;
  gap: 32px;
}
.about__big {
  margin: 0;
  max-width: 30ch;
  font-family: var(--display);
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 500;
  line-height: 1.25;
}

/* Trail map */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  padding: 9px 18px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: var(--snow);
  color: var(--ink);
  font: 600 15px/1 var(--body);
  cursor: pointer;
}
.chip[aria-pressed='true'] {
  background: var(--night);
  border-color: var(--night);
  color: var(--snow);
}
.search {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.search input {
  min-width: 0;
  width: 240px;
  max-width: 100%;
  padding: 11px 16px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: var(--snow);
  font: 16px var(--body);
  color: var(--ink);
}
.result-count {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
}

.runs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}
.run {
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: var(--snow);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  border-top: 6px solid var(--diff);
}
.run--green {
  --diff: var(--green);
}
.run--blue {
  --diff: var(--blue);
}
.run--black {
  --diff: var(--black);
}
.run__top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 12px;
}
.run__badge {
  color: var(--diff);
  font-weight: 600;
}
.run__when {
  color: var(--muted);
}
.run h3 {
  font-size: 26px;
  font-weight: 800;
}
.run__org {
  margin: 4px 0 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}
.run p {
  margin-top: 0;
}
.run__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: auto 0 0;
  padding: 0;
  list-style: none;
}
.run__tags li {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--ice);
  font-size: 13px;
  color: var(--deep);
}
.empty {
  grid-column: 1 / -1;
  padding: 48px 24px;
  text-align: center;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 18px;
}

/* Podium */
.podium {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.podium li {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 24px;
  background: var(--night);
  color: var(--snow);
  border-radius: var(--radius);
}
.podium__place {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
}
.podium h3 {
  font-size: 20px;
  margin-bottom: 6px;
}
.podium p {
  margin: 0;
  color: #b8cbe6;
  font-size: 15px;
}

/* Lodge */
.lodge {
  padding-bottom: 120px;
}
.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.finish {
  margin-top: 48px;
  padding: 28px;
  border-radius: var(--radius);
  background: var(--snow);
  border: 2px solid var(--green);
  max-width: 520px;
}
.finish[hidden] {
  display: none;
}
.finish__title {
  margin: 0;
  font-family: var(--display);
  font-size: 32px;
  font-weight: 800;
}

.footer {
  padding: 32px 6vw;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

/* ---------- Phones ---------- */

@media (max-width: 700px) {
  :root {
    --slope-w: 44px;
  }
  body {
    font-size: 16px;
  }
  main,
  .hero {
    padding-left: 16px;
    padding-right: 16px;
  }
  .hero {
    padding-top: 96px;
  }
  .footer {
    padding-left: 16px;
    padding-right: 16px;
  }
  .gate {
    width: 10px;
    height: 16px;
    margin: -16px 0 0 -5px;
  }
  .skier__body {
    font-size: 22px;
  }
  .hud {
    top: 12px;
    font-size: 13px;
  }
  .search input {
    width: 100%;
  }
  .runs {
    grid-template-columns: 1fr;
  }
  .section {
    padding-top: 80px;
  }
}

/* ---------- Reduced motion ---------- */

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