/* Self-hosted Montserrat (variable, weights 100–900), no external request */
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/montserrat-latin.woff2") format("woff2");
}

:root {
  --bg: #ffffff;
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-muted: #86868b;
  --hairline: rgba(0, 0, 0, 0.1);
  --border: #d6d6db;
  --card-bg: #f5f5f7;
  --radius: 20px;
  --maxw: 1120px;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --font: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--hairline);
}

.nav__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.nav__links {
  display: flex;
  gap: 28px;
}

.nav__links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color 0.2s var(--ease);
}

.nav__links a:hover,
.nav__links a[aria-current="page"] {
  color: var(--text-primary);
}

/* ---------- Page headings (one consistent style across all pages) ---------- */
.hero__lede,
.about-intro__headline,
.cy-bio__headline,
.project__title,
.page-title {
  font-weight: 600;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.03;
  letter-spacing: -0.02em;
}

.page-title {
  margin: 0 0 44px;
}

/* ---------- Hero (home page only) ---------- */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 88px 22px 56px;
}

.hero__lede {
  margin: 0 0 20px;
}

.hero__text {
  margin: 0;
  max-width: 34rem;
  font-size: 1.15rem;
  line-height: 1.65;
  color: #33333a;
}

/* ---------- Work grid ---------- */
.work {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 64px 22px 96px;
}

/* On the home page the hero already provides the top spacing */
.hero + .work {
  padding-top: 0;
}

/* Grouped project categories, each a horizontal-scroll rail of cards */
.cat {
  margin-top: 36px;
}
.cat:first-child {
  margin-top: 0;
}
.cat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.cat__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.cat__nav {
  display: flex;
  gap: 10px;
  flex: none;
}
.cat__rail {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  /* vertical room so the hover grow / shadow isn't clipped by overflow */
  padding: 10px 2px 20px;
  scrollbar-width: none;
}
.cat__rail::-webkit-scrollbar {
  display: none;
}
/* ~4 cards across with a peek of the next; trim reveals the peek */
.cat__rail .card {
  flex: 0 0 calc((100% - 60px) / 4 - 18px);
}

.card {
  display: block;
}

/* Organization sits below the card and stays visible; the title is the
   hover-revealed overlay on the image itself. */
.card__org {
  display: block;
  margin-top: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card-bg);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
  will-change: transform;
}

.card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 20px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #fff;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.72) 0%,
    rgba(0, 0, 0, 0.35) 55%,
    rgba(0, 0, 0, 0) 100%
  );
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

.card__title {
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

/* hover / focus reveal */
.card:hover .card__media,
.card:focus-visible .card__media {
  transform: scale(1.03);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.13);
}

.card:hover .card__caption,
.card:focus-visible .card__caption {
  opacity: 1;
  transform: translateY(0);
}

.card:focus-visible {
  outline: none;
}

.fallback {
  color: var(--text-secondary);
  grid-column: 1 / -1;
}

/* ---------- Footer ---------- */
.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 32px 22px 48px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  border-top: 0.5px solid var(--hairline);
}

/* ---------- Project detail ---------- */
.project {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
}

.project__header {
  padding: 64px 0 0;
}

.project__back {
  display: inline-block;
  margin-bottom: 28px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color 0.2s var(--ease);
}

.project__back:hover {
  color: var(--text-primary);
}

.project__eyebrow {
  margin: 0 0 10px;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.project__title {
  margin: 0;
  max-width: 900px;
}

/* Interleaved text + image flow: text, image image, text, image image … */
.proj-flow {
  padding-top: 28px;
}
.proj-flow > *:first-child {
  margin-top: 0;
}

/* Text sits in a readable column, leaving white space on the right (desktop) */
.proj-text {
  max-width: 680px;
  margin-top: 48px;
}
.proj-text p {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.65;
  color: #33333a;
}

/* Shared figure styling */
.proj-flow figure {
  margin: 0;
  min-width: 0;
}
.proj-flow figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  background: var(--card-bg);
}
.proj-flow figcaption {
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.45;
}

/* Matched-height row: flex-grow is set per cell = aspect ratio, so every
   image in the row renders at the same height and the row fills the width. */
.proj-row {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  margin-top: 32px;
}
.proj-cell {
  flex-grow: 1; /* overridden inline with the image aspect ratio */
  flex-shrink: 1;
  flex-basis: 0;
}

/* Single-image blocks at varying widths */
.proj-single {
  margin-top: 32px;
}
.proj-single--large figure {
  max-width: 820px;
  margin: 0 auto;
}
.proj-single--single figure {
  max-width: 640px;
}

/* Text beside a tall image on the right */
.proj-aside {
  display: grid;
  grid-template-columns: 1fr 0.72fr;
  gap: 44px;
  align-items: start;
  margin-top: 48px;
}
.proj-aside__text p {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.65;
  color: #33333a;
}

/* "More projects" horizontal-scroll rail at the bottom of a project page */
.more {
  max-width: var(--maxw);
  margin: 88px auto 0;
  padding: 56px 22px 96px;
  border-top: 0.5px solid var(--hairline);
}

.more__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.more__head h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.more__nav {
  display: flex;
  gap: 10px;
  flex: none;
}

.more__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0.5px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease),
    opacity 0.2s var(--ease);
}

.more__arrow:hover:not(:disabled) {
  background: var(--card-bg);
  border-color: var(--text-muted);
}

.more__arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

/* 2 rows x 6 columns per "page", scrolling horizontally for the rest */
.more-rail {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(2, auto);
  grid-auto-columns: calc((100% - 80px) / 6);
  gap: 28px 16px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.more-rail::-webkit-scrollbar {
  display: none;
}

.rail-card {
  display: block;
}

/* Matches the grid card: title overlays the image on hover, organization
   stays visible below. */
.rail-card__media {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-bg);
  transition: transform 0.3s var(--ease);
}

.rail-card__img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.rail-card:hover .rail-card__media,
.rail-card:focus-visible .rail-card__media {
  transform: scale(1.03);
}

.rail-card__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 14px 12px;
  color: #fff;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.72) 0%,
    rgba(0, 0, 0, 0.35) 55%,
    rgba(0, 0, 0, 0) 100%
  );
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.rail-card:hover .rail-card__caption,
.rail-card:focus-visible .rail-card__caption {
  opacity: 1;
  transform: translateY(0);
}

.rail-card:focus-visible {
  outline: none;
}

.rail-card__title {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.005em;
}

.rail-card__org {
  display: block;
  margin-top: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ---------- About ---------- */
.about {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
}

.about-intro {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 64px;
  align-items: center;
  padding: 72px 0 88px;
}

.about-intro__headline {
  margin: 0 0 28px;
}

.about-intro__text p {
  margin: 0 0 20px;
  max-width: 30rem;
  font-size: 1.15rem;
  line-height: 1.65;
  color: #33333a;
}

.about-intro__text p:last-child {
  margin-bottom: 0;
}

.about-intro__photo img {
  display: block;
  width: 100%;
  border-radius: 20px;
  background: var(--card-bg);
}

/* Two-column labeled section: label left, content right */
.about-section {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
  padding: 64px 0;
  border-top: 0.5px solid var(--hairline);
}

.about-section__label {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.about-section__body {
  max-width: 720px;
}

/* ---------- Timeline (About page) ----------
   Centre rail with a logo marker per entry; cards alternate sides on desktop
   and collapse to a single left-rail column on narrow screens. */
.timeline {
  padding: 64px 0 24px;
  border-top: 0.5px solid var(--hairline);
  /* the reveal transform slides items in from the side — clip it so it can
     never widen the page (clip, not hidden: no new scroll container) */
  overflow-x: clip;
}

.tl {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* The rail itself, plus a fill that tracks scroll progress */
.tl__line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background: var(--border);
  border-radius: 1px;
}
.tl__line-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--text-primary);
  transform: scaleY(0);
  transform-origin: top;
  border-radius: 1px;
}

.tl__item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 64px 1fr;
  align-items: start;
  column-gap: 28px;
  padding-bottom: 56px;
}
.tl__item:last-child {
  padding-bottom: 0;
}

/* Marker sits in the middle column, centred on the rail */
.tl__marker {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto;
  border-radius: 50%;
  background: #fff;
  border: 0.5px solid var(--hairline);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}
.tl__marker img {
  width: 74%;
  height: 74%;
  object-fit: contain;
}

/* Logos whose artwork already reads as a badge fill the bubble edge to edge
   instead of sitting inset with padding around them. */
.tl__marker--fill img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Alternating sides: card and date swap columns */
.tl__item--left .tl__card,
.tl__item--right .tl__date {
  grid-column: 1;
  grid-row: 1;
  text-align: right;
}
.tl__item--left .tl__date,
.tl__item--right .tl__card {
  grid-column: 3;
  grid-row: 1;
  text-align: left;
}

/* On right-aligned cards the list shrink-wraps so it sits against the rail,
   while the bullet text itself stays left-aligned and readable. */
.tl__item--left .tl__bullets {
  display: inline-block;
  max-width: 100%;
  text-align: left;
}

.tl__date {
  margin: 0;
  padding-top: 14px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.tl__card {
  padding-top: 6px;
}

.tl__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.tl__org {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.5;
}

.tl__bullets {
  margin: 14px 0 0;
  padding-left: 20px;
}
.tl__bullets li {
  margin-bottom: 8px;
  color: #45454c;
  font-size: 0.98rem;
  line-height: 1.55;
}
.tl__bullets li:last-child {
  margin-bottom: 0;
}

/* Scroll reveal: entries slide in from their own side */
.tl__item {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.tl__item--left {
  transform: translate(-28px, 24px);
}
.tl__item--right {
  transform: translate(28px, 24px);
}
.tl__item.is-visible {
  opacity: 1;
  transform: translate(0, 0);
}

@media (prefers-reduced-motion: reduce) {
  .tl__item {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .tl__line-fill {
    display: none;
  }
}

/* Resume section (About page) */
.resume-download {
  display: inline-block;
  padding: 13px 28px;
  background: var(--text-primary);
  border-radius: 999px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  transition: opacity 0.2s var(--ease);
}
.resume-download:hover {
  opacity: 0.85;
}
.resume-preview {
  display: block;
  width: 100%;
  max-width: 640px;
  margin-top: 28px;
  border-radius: 12px;
  border: 0.5px solid var(--hairline);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
}

/* Standard contact strip (bottom of every page, injected by footer.js):
   compact, centered email + social icons, no heading. */
.contact {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 22px;
  border-top: 0.5px solid var(--hairline);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.contact__email {
  display: inline-block;
  color: var(--text-secondary);
  font-size: 0.95rem;
  transition: color 0.2s var(--ease);
}
.contact__email:hover {
  color: var(--text-primary);
}
.contact__socials {
  display: flex;
  gap: 14px;
  margin-top: 14px;
}
.contact__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: var(--text-primary);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.contact__icon:hover {
  opacity: 0.6;
  transform: translateY(-2px);
}
.contact__icon svg {
  width: 20px;
  height: 20px;
  display: block;
}
.contact__copyright {
  margin: 20px 0 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* ---------- Cycling ---------- */
.cycling {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
}

/* 1. Bio + two photos */
.cy-bio {
  display: grid;
  grid-template-columns: 1fr 0.85fr;
  gap: 56px;
  align-items: center;
  padding: 72px 0 84px;
}
.cy-bio__headline {
  margin: 0 0 24px;
}
.cy-bio__text p {
  margin: 0 0 20px;
  font-size: 1.1rem;
  line-height: 1.65;
  color: #33333a;
}
.cy-bio__text p:last-child {
  margin-bottom: 0;
}
.cy-bio__details {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
}
.cy-bio__details li {
  padding: 7px 0;
  color: var(--text-secondary);
  font-size: 0.98rem;
  border-top: 0.5px solid var(--hairline);
}
.cy-bio__photos {
  display: grid;
  gap: 18px;
}
.cy-bio__photos img {
  width: 100%;
  border-radius: 18px;
  background: var(--card-bg);
  display: block;
}

/* Shared labeled section (matches About) */
.cy-section {
  padding: 60px 0;
  border-top: 0.5px solid var(--hairline);
}
.cy-section__label {
  margin: 0 0 32px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* 2. Career highlights next to the Instagram grid */
.cy-highlights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}
.hl-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.hl {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 0.5px solid var(--hairline);
}
.hl:first-child {
  border-top: 0.5px solid var(--hairline);
}
.hl__place {
  flex: 0 0 40px;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.hl__race {
  color: #33333a;
  font-size: 1.02rem;
}
.ig-block {
  display: flex;
  flex-direction: column;
}
.ig-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.ig-grid__item {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 12px;
  background: var(--card-bg);
}
.ig-grid__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}
.ig-grid__item:hover img {
  transform: scale(1.05);
}
.ig-follow {
  align-self: flex-start;
  margin-top: 18px;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 500;
}
.ig-follow:hover {
  color: var(--text-secondary);
}

/* 3. Schedule */
.sch-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sch {
  display: grid;
  grid-template-columns: 130px 1fr 1fr;
  gap: 24px;
  padding: 14px 0;
  border-bottom: 0.5px solid var(--hairline);
}
.sch:first-child {
  border-top: 0.5px solid var(--hairline);
}
.sch__date {
  color: var(--text-secondary);
  font-size: 0.95rem;
}
.sch__event {
  font-weight: 500;
}
.sch__loc {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* 4. Results by season (collapsible) */
.seasons {
  border-top: 0.5px solid var(--hairline);
}
.season {
  border-bottom: 0.5px solid var(--hairline);
}
.season__summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 0;
  cursor: pointer;
  list-style: none;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.season__summary::-webkit-details-marker {
  display: none;
}
.season__summary::after {
  content: "+";
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--text-secondary);
}
.season[open] .season__summary::after {
  content: "–";
}
.season__count {
  margin-left: auto;
  margin-right: 20px;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-muted);
}
.res-list {
  list-style: none;
  margin: 0;
  padding: 0 0 20px;
}
.res {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 20px;
  align-items: baseline;
  padding: 11px 0;
  border-top: 0.5px solid var(--hairline);
}
.res__place {
  color: var(--text-secondary);
}
.res__race {
  color: #33333a;
}
.res__date {
  color: var(--text-muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

/* 5. Team */
/* Team + sponsor logos (combined row) */
.sponsors {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 28px;
}
.sponsor {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 88px;
  min-width: 140px;
  padding: 18px 28px;
  border: 0.5px solid var(--border);
  border-radius: 16px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.sponsor:hover {
  border-color: var(--text-muted);
  background: var(--card-bg);
}
.sponsor img {
  max-height: 100%;
  max-width: 180px;
  object-fit: contain;
}

/* Result / ranking links below the results */
.cy-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 4px 0 8px;
}
.pill-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 22px;
  border: 0.5px solid var(--border);
  border-radius: 999px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}

/* Optional wordmark sitting to the left of the button label. These are wide
   lockups, so height is set per logo (from the JSON) and width follows the
   aspect ratio — a fixed square box would shrink them to a few pixels tall. */
.pill-link__logo {
  width: auto;
  height: 13px;
  flex: none;
}
.pill-link:hover {
  background: var(--card-bg);
  border-color: var(--text-muted);
}

/* ---------- Skeleton loading placeholders ----------
   Shown while the page's JSON is still in flight, so the layout is visible
   immediately instead of a blank column. */
.skel {
  background: var(--card-bg);
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.65) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 200% 100%;
  background-repeat: no-repeat;
  border-radius: 8px;
  animation: skel-shimmer 1.35s ease-in-out infinite;
}
@keyframes skel-shimmer {
  from {
    background-position: -120% 0;
  }
  to {
    background-position: 220% 0;
  }
}
.skel-line {
  height: 13px;
  margin-bottom: 10px;
}
.skel-title {
  height: 30px;
  width: 46%;
  margin-bottom: 22px;
  border-radius: 10px;
}
.skel-card {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
}
.skel-row {
  display: flex;
  gap: 20px;
  padding: 10px 2px 20px;
}
.skel-row > * {
  flex: 0 0 calc((100% - 60px) / 4 - 18px);
}
.skel-media {
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  margin-top: 32px;
}
@media (prefers-reduced-motion: reduce) {
  .skel {
    animation: none;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  /* Tablet: ~3 cards across with a peek */
  .cat__rail .card,
  .skel-row > * {
    flex: 0 0 calc((100% - 40px) / 3 - 16px);
  }
  .about-section {
    grid-template-columns: 150px 1fr;
    gap: 32px;
  }
  /* Tablet and below: rail moves to the left, everything stacks beside it.
     `left` matches half the marker column so the two stay concentric. */
  .tl__line {
    left: 28px;
  }
  .tl__item {
    grid-template-columns: 56px 1fr;
    column-gap: 20px;
    padding-bottom: 44px;
  }
  .tl__marker {
    grid-column: 1;
    grid-row: 1;
    width: 56px;
    height: 56px;
  }
  .tl__item--left .tl__card,
  .tl__item--right .tl__card,
  .tl__item--left .tl__date,
  .tl__item--right .tl__date {
    grid-column: 2;
    text-align: left;
  }
  .tl__item--left .tl__date,
  .tl__item--right .tl__date {
    grid-row: 1;
    padding-top: 4px;
  }
  .tl__item--left .tl__card,
  .tl__item--right .tl__card {
    grid-row: 2;
    padding-top: 8px;
  }
  /* Rail is left-aligned here, so reveal vertically only — a sideways slide
     would push against the viewport edge on narrow screens */
  .tl__item--left,
  .tl__item--right {
    transform: translateY(20px);
  }
  .cy-highlights {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  /* Tablet: fewer, wider rail columns than the 6-up desktop layout */
  .more-rail {
    grid-auto-columns: calc((100% - 48px) / 3.3);
  }
}

@media (max-width: 560px) {
  .nav__inner {
    padding: 0 18px;
  }
  .nav__links {
    gap: 20px;
  }
  .hero {
    padding: 56px 18px 40px;
  }
  .work {
    padding: 44px 18px 72px;
  }
  /* Phone: ~2 cards across with a peek */
  .cat {
    margin-top: 28px;
  }
  .cat__title {
    font-size: 1.3rem;
  }
  .cat__rail .card,
  .skel-row > * {
    flex: 0 0 calc((100% - 20px) / 2 - 16px);
  }
  .project {
    padding: 0 18px;
  }
  .project__header {
    padding-top: 44px;
  }
  .proj-flow {
    padding-top: 20px;
  }
  .proj-text,
  .proj-aside__text {
    max-width: 100%;
    margin-top: 36px;
  }
  .proj-text p,
  .proj-aside__text p {
    font-size: 1.05rem;
  }
  .proj-aside__text {
    margin-top: 0;
  }
  /* Stack rows, asides, and constrained singles full-width on phones */
  .proj-row,
  .proj-aside {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 24px;
  }
  .proj-cell {
    flex-basis: auto;
  }
  .proj-single {
    margin-top: 24px;
  }
  .proj-single--large figure,
  .proj-single--single figure {
    max-width: 100%;
  }
  .more {
    margin-top: 64px;
    padding: 48px 18px 72px;
  }
  .more__head {
    margin-bottom: 20px;
  }
  .more__arrow {
    width: 36px;
    height: 36px;
  }
  /* Show ~2 columns per row with a peek of the next, so it reads as
     scrollable without needing the arrow buttons. */
  .more-rail {
    grid-auto-columns: calc((100% - 16px) / 2.3);
    gap: 20px 12px;
  }
  .about {
    padding: 0 18px;
  }
  .about-intro {
    grid-template-columns: 1fr;
    gap: 36px;
    padding: 44px 0 56px;
  }
  /* Show the photo above the bio on phones */
  .about-intro__photo {
    order: -1;
    max-width: 320px;
  }
  .about-section {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 44px 0;
  }
  /* Phone: tighter rail and smaller markers */
  .timeline {
    padding: 44px 0 16px;
  }
  .tl__line {
    left: 21px;
  }
  .tl__item {
    grid-template-columns: 42px 1fr;
    column-gap: 16px;
    padding-bottom: 36px;
  }
  .tl__marker {
    width: 42px;
    height: 42px;
  }
  .tl__title {
    font-size: 1.1rem;
  }
  .tl__org,
  .tl__bullets li {
    font-size: 0.93rem;
  }
  .contact {
    padding: 64px 18px 32px;
  }
  .contact__copyright {
    margin-top: 44px;
  }
  .cycling {
    padding: 0 18px;
  }
  .cy-bio {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 44px 0 56px;
  }
  .cy-bio__photos {
    grid-template-columns: 1fr 1fr;
  }
  .cy-section {
    padding: 44px 0;
  }
  /* Stack schedule rows; hide the separate location column (kept in event) */
  .sch {
    grid-template-columns: 96px 1fr;
    gap: 6px 16px;
  }
  .sch__loc {
    grid-column: 2;
    font-size: 0.85rem;
  }
  .res {
    grid-template-columns: 44px 1fr;
    gap: 4px 14px;
  }
  .res__date {
    grid-column: 2;
  }
  .ig-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .season__count {
    margin-right: 12px;
  }
  .sponsor {
    height: 72px;
    min-width: 110px;
    padding: 14px 20px;
  }
  /* On touch screens there is no hover, so keep captions visible. */
  .card__caption {
    opacity: 1;
    transform: none;
  }
}

/* Touch devices (no hover): always show the caption so titles are readable. */
@media (hover: none) {
  .card__caption {
    opacity: 1;
    transform: none;
  }
}
