@font-face {
  font-family: "Overpass";
  src: url("fonts/overpass-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --granite: #d8dee0;
  --granite-deep: #c3ccd0;
  --ink: #15303d;
  --ink-soft: #46606c;
  --sign: #f8c800;
  --sign-deep: #e3b600;
  --blaze: #d52b1e;
  --white: #fff;
  --gutter: clamp(16px, 4vw, 56px);
  --bar: 64px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--granite);
  color: var(--ink);
  font-family: "Overpass", "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.45;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--blaze); outline-offset: 3px; }

/* Overview */
.hero {
  padding: clamp(32px, 4vw, 56px) var(--gutter) clamp(28px, 3vw, 40px);
  max-width: 1240px;
}
h1 {
  margin: 0;
  font-size: clamp(36px, 4.6vw, 68px);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.hero p {
  max-width: 40em;
  margin: 16px 0 0;
  font-size: clamp(17px, 1.4vw, 20px);
  color: var(--ink-soft);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr));
  gap: clamp(36px, 4vw, 56px) clamp(24px, 3vw, 44px);
  padding: 0 var(--gutter);
}

.tile { position: relative; min-width: 0; }
.shots { position: relative; padding-right: 13%; padding-bottom: 7%; }
.shot { display: block; overflow: hidden; background: var(--white); }
.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: object-position 3.5s ease-in-out;
}
.shot:hover img, .shot:focus-visible img { object-position: bottom; }
.shot-desktop { aspect-ratio: 16 / 10.5; }
.shot-mobile {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 25%;
  aspect-ratio: 9 / 18.5;
  border: 4px solid var(--ink);
  border-radius: 14px;
}

/* The trail sign: name on the left, screen count where a real sign shows walking time */
.sign {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  background: var(--sign);
  color: var(--ink);
  font-weight: 800;
  line-height: 1.1;
  text-decoration: none;
}
.sign-right { padding: 8px 40px 6px 16px; clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 50%, calc(100% - 26px) 100%, 0 100%); }
.sign-left { padding: 8px 16px 6px 40px; clip-path: polygon(26px 0, 100% 0, 100% 100%, 26px 100%, 0 50%); }
.sign:hover { background: var(--sign-deep); }
.sign:focus-visible { outline: none; background: var(--ink); color: var(--sign); }
.sign small { font-size: 15px; font-weight: 600; text-align: right; white-space: nowrap; }
.tile .sign { margin-top: 12px; font-size: 22px; width: 100%; }

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  padding: clamp(48px, 6vw, 72px) var(--gutter) 32px;
  font-size: 16px;
  color: var(--ink-soft);
}
.host {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.host:hover { color: var(--ink); }
.noscript { padding: var(--gutter); }

/* Viewer */
.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--bar);
  padding: 0 var(--gutter);
  background: var(--granite);
  border-bottom: 1px solid var(--granite-deep);
}
.back { font-weight: 700; text-underline-offset: 4px; white-space: nowrap; }
.signs { display: flex; gap: 8px; min-width: 0; }
.signs .sign { min-height: 44px; font-size: 18px; min-width: 0; }
.signs .sign span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.layout {
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);
  gap: clamp(24px, 3vw, 48px);
  padding: 0 var(--gutter);
}
.rail {
  position: sticky;
  top: var(--bar);
  align-self: start;
  max-height: calc(100vh - var(--bar));
  max-height: calc(100dvh - var(--bar));
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--granite-deep) transparent;
  padding: 24px 6px 24px 4px;
}
.rail h2 { margin: 0 0 8px; font-size: 16px; font-weight: 800; }
.rail ol { list-style: none; margin: 0 0 24px; padding: 0; }
.rail a {
  display: block;
  padding: 6px 0 6px 12px;
  border-left: 6px solid transparent;
  font-size: 15px;
  line-height: 1.2;
  text-decoration: none;
}
.rail a img { width: 100%; height: 76px; object-fit: cover; object-position: top; margin-bottom: 5px; background: var(--white); }
.rail a[aria-current="true"] {
  font-weight: 800;
  border-image: linear-gradient(var(--white) 33.3%, var(--blaze) 33.3% 66.6%, var(--white) 66.6%) 1;
}

.stage { padding: 24px 0 0; min-width: 0; }
.stage h1 { font-size: clamp(34px, 4vw, 52px); }
.stage h1:focus { outline: none; }
.stage h2 { margin: 56px 0 0; font-size: 28px; font-weight: 800; }
.stage h1 + h2 { margin-top: 12px; }
.screen { margin: 28px 0 0; scroll-margin-top: calc(var(--bar) + 16px); }
.screen figcaption { margin-bottom: 8px; font-weight: 700; }
.screen img { width: 100%; height: auto; background: var(--white); }
.desktop-list { max-width: 1280px; }
.mobile-list { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 32px; }
.mobile-list .screen { width: min(100%, 340px); }

@media (max-width: 760px) {
  body { font-size: 17px; }
  .layout { display: block; }
  .rail {
    top: var(--bar);
    z-index: 4;
    display: flex;
    gap: 12px;
    max-height: none;
    margin: 0 calc(var(--gutter) * -1);
    padding: 8px var(--gutter);
    overflow-x: auto;
    scrollbar-width: none;
    background: var(--granite);
    border-bottom: 1px solid var(--granite-deep);
  }
  .rail h2 { display: none; }
  .rail ol { display: flex; gap: 12px; margin: 0; }
  .rail li { flex: none; }
  .rail a { width: 112px; padding: 0 0 4px; border-left: 0; border-bottom: 5px solid transparent; font-size: 13px; }
  .rail a img { height: 52px; }
  .rail a[aria-current="true"] { border-image: none; border-bottom-color: var(--blaze); }
  .screen { scroll-margin-top: calc(var(--bar) + 112px); }
  .signs #prev { display: none; }
  .tile .sign { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .shot img { transition: none; }
}
