/* Owned by S6. Achievements: a swipe row by default, a pinned sideways gallery on tall desktop screens (class is-pinned, written by js/achievements.js). */
.achv {
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --ease-back: cubic-bezier(.34, 1.56, .64, 1);
  --t-fast: 200ms;
  --t-mid: 450ms;
  --t-slow: 700ms;
  --stagger: 55ms;
}

/* Swipe row (base: also scripts off, short laptops, tablets, phones) */
.achv__viewport {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: max(var(--gutter), calc((100% - var(--content)) / 2));
  scrollbar-width: thin;
  margin: 0 calc(-1 * var(--gutter)) -28px;
}
ol.achv__track {
  position: relative;
  display: flex;
  gap: 20px;
  width: max-content;
  padding: 24px max(var(--gutter), calc((100vw - var(--content)) / 2)) 56px;
  counter-reset: achv;
}

/* Card */
.achv__card {
  flex: none;
  scroll-snap-align: start;
  width: 340px;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  padding: 32px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--hair);
  transition: transform 500ms var(--ease), box-shadow 500ms var(--ease);
}
.achv__card::before {
  counter-increment: achv;
  content: counter(achv, decimal-leading-zero) " / 10";
  font: 500 11px / 1 var(--font-mono);
  letter-spacing: .14em;
  color: var(--mute-text);
  margin-bottom: 24px;
}
.achv__card.is-centre {
  transform: translateY(-16px);
  box-shadow: var(--hair), inset 0 2px 0 var(--accent), var(--shadow), 0 36px 60px -40px color-mix(in srgb, var(--accent) 34%, transparent);
}
.achv__figure {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 .25em;
  font: 500 clamp(3.5rem, 5.5vw, 5.5rem) / .95 var(--font-display);
  letter-spacing: -.02em;
  font-variant-numeric: lining-nums tabular-nums;
}
/* One figure size for every non-award card, sized so the widest figure ("~234,000") fits the card.
   The container is the figure, not the card: containment on the card would restart the card counter. */
.achv__card:not(.achv__card--award) .achv__figure {
  container-type: inline-size;
  --fig: min(clamp(3.5rem, 5.5vw, 5.5rem), 22cqi);
}
.achv__card:not(.achv__card--award) .achv__num { font-size: var(--fig); letter-spacing: -.02em; }
.achv__card:not(.achv__card--award) .achv__unit { font-size: calc(var(--fig) * .42); }
.achv__unit {
  font: italic 400 .42em / 1 var(--font-display);
  letter-spacing: -.01em;
  color: var(--em);
}
.achv__label {
  margin-top: 18px;
  font-size: 1.125rem;
  line-height: 1.4;
  font-weight: 500;
  color: var(--ink-2);
}
.achv__context {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font: 500 11px / 1.5 var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mute-text);
}
.achv__card--award {
  background: var(--accent);
  color: var(--accent-ink);
}
.achv__card--award::before { color: color-mix(in srgb, var(--accent-ink) 90%, var(--accent)); }
.achv__card--award .achv__figure {
  font-size: clamp(2rem, 3vw, 2.75rem);
  line-height: 1.02;
  letter-spacing: -.02em;
}
.achv__card--award .achv__label,
.achv__card--award .achv__context { color: color-mix(in srgb, var(--accent-ink) 86%, var(--accent)); }
.achv__card--award .achv__context { border-top-color: color-mix(in srgb, var(--accent-ink) 26%, transparent); }

/* Pinned gallery (tall desktop screens only) */
html.js .achv.is-pinned {
  padding: 0;
  height: calc(100svh + var(--achv-run, 0px));
}
html.js .is-pinned .achv__pin {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 112px 0 48px;
  overflow: clip;
}
html.js .is-pinned .sec-head {
  width: 100%;
  max-width: calc(var(--content) + 2 * var(--gutter));
  padding: 0 var(--gutter);
  margin: 0 auto 40px;
}
html.js .is-pinned .achv__viewport {
  overflow-x: clip;
  overflow-y: visible;
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 0;
  margin: 0;
  scroll-snap-type: none;
}
html.js .is-pinned .achv__track {
  gap: 24px;
  height: 100%;
  align-items: center;
  padding: 24px max(var(--gutter), calc((100vw - var(--content)) / 2));
  will-change: transform;
}
html.js .is-pinned .achv__card {
  width: 360px;
  height: min(420px, 100%);
  min-height: 0;
}
/* Short desktop windows: the same pinned gallery, with tighter spacing so the cards fit */
@media (max-height: 699.98px) {
  html.js .is-pinned .achv__pin { padding: 84px 0 16px; }
  html.js .is-pinned .sec-head { margin-bottom: 12px; }
  html.js .is-pinned .sec-head h2 { font-size: clamp(2rem, 7svh, 3rem); }
  html.js .is-pinned .achv__track { padding-block: 16px; }
  html.js .is-pinned .achv__card { padding: 24px; }
  html.js .is-pinned .achv__card::before { margin-bottom: 14px; }
  html.js .is-pinned .achv__card.is-centre { transform: translateY(-8px); }
  html.js .is-pinned .achv__label { margin-top: 10px; font-size: 1rem; }
  html.js .is-pinned .achv__card:not(.achv__card--award) .achv__figure { --fig: min(clamp(2.75rem, 9svh, 4rem), 22cqi); }
}

@media (min-width: 700px) and (max-width: 1023.98px) {
  .achv__card { width: 300px; min-height: 340px; }
}
@media (max-width: 699.98px) {
  ol.achv__track { gap: 14px; }
  .achv__card { width: min(78vw, 300px); min-height: 320px; padding: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .achv__card { transition: none; }
}
