/* ==========================================================================
   Success stories (archive)
   Shared pieces (empty state, track) live in content-shared.css; breadcrumb, filter
   chips, pager, arrow link and card effects are canonical components.
   Index: hero · search · proof metrics · photo cluster · filter bar
          · section head · story grid · story card · photo badges · pager · CTA
   ========================================================================== */

/* ---- Hero ---------------------------------------------------------------- */
.archive-hero {
  position: relative;
  isolation: isolate;
  overflow: clip;
  padding-block: var(--sp-8) var(--sp-10);
  background: var(--surface);
}
.archive-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle 17rem at 100% 12%, color-mix(in srgb, var(--sky) 26%, transparent), transparent),
    radial-gradient(circle 15rem at 0 100%, color-mix(in srgb, var(--amber) 14%, transparent), transparent);
}
.archive-hero__inner { display: flex; flex-direction: column; gap: var(--sp-6); }
.archive-hero__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}
.archive-hero__proof {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1) .375rem;
  padding: var(--sp-1) var(--sp-4);
  font-size: var(--fs-11);
  font-weight: 700;
  line-height: 1.45;
  color: var(--navy);
  background: var(--gray);
  border-radius: var(--r-16);
  box-shadow: var(--sh-xs);
}
.archive-hero__proof-dot {
  width: var(--sp-2);
  height: var(--sp-2);
  border-radius: 50%;
  background: var(--amber);
}
.archive-hero__proof-net { color: var(--text); }

.archive-hero__row { display: grid; gap: var(--sp-8); align-items: center; }
.archive-hero__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-3);
  min-width: 0;
}
.archive-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: var(--sp-1) var(--sp-4);
  font-size: var(--fs-11);
  font-weight: 700;
  line-height: 1.45;
  color: var(--navy);
  background: color-mix(in srgb, var(--navy) 10%, transparent);
  border-radius: var(--r-full);
}
.archive-hero__eyebrow .icon { font-size: .875rem; color: var(--burgundy); }
.archive-hero__title {
  font-size: clamp(1.625rem, 1.1rem + 2vw, 2.1875rem);
  font-weight: 700;
  line-height: 1.5;
  color: var(--ink);
}
.archive-hero__mark {
  color: var(--burgundy);
  text-decoration: underline color-mix(in srgb, var(--amber) 70%, transparent) 3px;
  text-underline-offset: .28em;
}
.archive-hero__lead {
  font-size: var(--fs-16);
  line-height: 1.625;
  color: var(--text);
  text-wrap: pretty;
}
@media (prefers-reduced-motion: no-preference) {
  .archive-hero__text > * { animation: rise-in var(--t-slow) var(--ease) both; }
  .archive-hero__text > :nth-child(2) { animation-delay: 120ms; }
  .archive-hero__text > :nth-child(3) { animation-delay: 240ms; }
  .archive-hero__text > :nth-child(4) { animation-delay: 360ms; }
  .archive-hero__text > :nth-child(5) { animation-delay: 480ms; }
  .archive-hero__text > :nth-child(n + 6) { animation-delay: 600ms; }
}

/* ---- Search --------------------------------------------------------------- */
.stories-search {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  width: 100%;
  max-width: 36rem;
  padding-block-start: var(--sp-2);
}
.stories-search__field { flex: 1 1 14rem; }
.stories-search__input {
  min-height: 3rem;
  background: var(--gray);
  border-color: transparent;
  border-radius: var(--r-8);
  box-shadow: var(--sh-xs);
}
.stories-search__input::-webkit-search-cancel-button { appearance: none; }
.stories-search__submit { flex: 0 0 auto; font-size: var(--fs-14); border-radius: var(--r-8); }

/* ---- Proof metrics: three tiles in one row, also on phones ------------------- */
.proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 10rem));
  gap: var(--sp-3);
  width: 100%;
  padding-block-start: var(--sp-4);
}
.proof__item {
  --proof: var(--burgundy);
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  padding: var(--sp-2);
  text-align: center;
  background: var(--page);
  border-radius: var(--r-8);
  box-shadow: var(--sh-xs);
}
.proof__item--navy { --proof: var(--navy); }
.proof__item--amber { --proof: var(--amber-ink); }
.proof__value {
  font-size: var(--fs-20);
  font-weight: 800;
  line-height: 1.5;
  color: var(--proof);
}
.proof__label {
  font-size: var(--fs-11);
  font-weight: 700;
  line-height: 1.45;
  color: var(--text);
}
@media (max-width: 29.9375rem) {
  .proof { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
  .proof__label { font-size: var(--fs-12); }
}

/* ---- Photo cluster (decorative collage: positions are % of its own box) ---- */
.cluster-photos {
  position: relative;
  width: min(100%, 30.625rem);
  aspect-ratio: 490 / 440;
  margin-inline: auto;
}
.cluster-photos::before {
  content: "";
  position: absolute;
  inset-block-start: 17.3%;
  inset-inline-end: 20.6%;
  width: 58.8%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--gray);
  box-shadow: inset 0 2px 4px color-mix(in srgb, var(--ink) 5%, transparent);
}
.cluster-photos__item {
  position: absolute;
  aspect-ratio: 1;
  padding: var(--sp-1);
  background: var(--surface);
  border-radius: 50%;
  box-shadow: var(--sh-md);
}
/* a photo that fails to load shows a neutral ground, not alt text and a broken icon */
.cluster-photos__item.is-broken { background: var(--sand-strong); }
.cluster-photos__item.is-broken img { visibility: hidden; }
.cluster-photos__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.cluster-photos__item--a {
  inset-block-start: 0;
  inset-inline-end: 53.5%;
  width: 35.9%;
  box-shadow: var(--sh-lg);
}
.cluster-photos__item--b { inset-block-start: 2%; inset-inline-end: 6.5%; width: 29.4%; }
.cluster-photos__item--c {
  inset-block-start: 60.9%;
  inset-inline-end: 64.9%;
  width: 32.7%;
  padding: .375rem;
  box-shadow: var(--sh-xl);
}
.cluster-photos__item--d {
  inset-block-start: 65.2%;
  inset-inline-end: 10.2%;
  width: 26.1%;
  box-shadow: var(--sh-sm);
}
.cluster-photos__tag {
  position: absolute;
  inset-block-end: 2%;
  inset-inline-start: 4%;
  padding: .125rem var(--sp-2);
  font-size: var(--fs-11);
  font-weight: 700;
  line-height: 1.5;
  color: var(--text-on-dark);
  white-space: nowrap;
  background: var(--navy);
  border-radius: var(--r-full);
  box-shadow: var(--sh-sm);
}
.cluster-photos__tag--burgundy { background: var(--burgundy); }
.cluster-photos__tag--amber { color: var(--ink); background: var(--amber); }
.cluster-photos__tag--top { inset-block: 3% auto; inset-inline: auto 3%; }
.cluster-photos__stamp {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  translate: calc(var(--dir) * -50%) -50%;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-2);
  font-size: var(--fs-11);
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink);
  white-space: nowrap;
  background: var(--surface);
  border-radius: var(--r-full);
  box-shadow: var(--sh-md);
}
.cluster-photos__stamp .icon { font-size: 1.0625rem; color: var(--amber); }

/* ---- Filter bar ------------------------------------------------------------ */
.stories-filter {
  position: relative;
  z-index: 1;
  padding-block: var(--sp-2);
  background: var(--surface);
  box-shadow: var(--sh-xs);
}
.stories-filter__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-4);
}
.stories-filter__chips { justify-content: flex-start; gap: var(--sp-1); }
/* tablets and phones: the chips keep one scrolling row instead of wrapping into orphans */
@media (max-width: 64rem) {
  .stories-filter__chips {
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: thin;
    padding-block-end: var(--sp-1);
  }
  .stories-filter__chips > * { flex: none; }
}

.stories-sort {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--fs-12);
  color: var(--text);
}
.stories-sort .icon { font-size: .875rem; }
.stories-sort__select {
  width: auto;
  min-height: 2.25rem;
  padding-block: var(--sp-1);
  padding-inline: var(--sp-3) 2rem;
  background-color: var(--page);
  border: 0;
  border-radius: var(--r-6);
  background-size: .75rem;
}
@media (min-width: 48.0625rem) {
  .stories-sort__select { font-size: var(--fs-12); }
}
@media (max-width: 48rem) {
  .stories-sort__select { min-height: 2.75rem; }
}

/* ---- Stories section + head ------------------------------------------------ */
.stories { padding-block: var(--sp-10); background: var(--gray); }
.stories__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4) var(--sp-8);
  margin-block-end: var(--sp-10);
  padding-block-end: var(--sp-4);
  border-block-end: 1px solid var(--line);
}
.stories__heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .375rem;
}
.stories__eyebrow {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1) .375rem;
  padding: var(--sp-1) var(--sp-4);
  font-size: var(--fs-11);
  font-weight: 700;
  line-height: 1.45;
  color: var(--navy);
  background: var(--gray);
  border: 1px solid var(--line);
  border-radius: var(--r-16);
  box-shadow: var(--sh-xs);
}
.stories__eyebrow .icon { font-size: .9375rem; color: var(--burgundy); }
.stories__eyebrow-accent { color: var(--burgundy); }
.stories__eyebrow-dot {
  width: var(--sp-1);
  height: var(--sp-1);
  border-radius: 50%;
  background: var(--text-muted);
}
.stories__title {
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.025em;
  color: var(--ink);
  text-wrap: balance;
}
.stories__title-mark { color: var(--burgundy); box-shadow: inset 0 -3px 0 var(--amber); }
.stories__lead {
  flex: 1 1 20rem;
  max-width: 32rem;
  font-size: var(--fs-14);
  line-height: 1.65;
  color: var(--text);
}

/* ---- Story grid: 1 column → the design's 6-column masonry ------------------ */
.story-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-6); }
.story-grid__item { display: flex; min-width: 0; }
.story-grid__item > .story { flex: 1; min-width: 0; }
/* items that wait for the next lazy batch stay out of the grid */

/* ---- Story card -------------------------------------------------------------- */
.story {
  --story-pad: var(--sp-4);
  border-color: var(--line);
  border-radius: var(--r-16);
  box-shadow: var(--sh-sm);
}
.story__media {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 20rem;
  aspect-ratio: auto;
  color: var(--text-on-dark);
  background: var(--navy);
}
.story__media img { position: absolute; inset: 0; object-position: 50% 34%; }
.story__badges, .story__corner {
  position: absolute;
  inset-block-start: var(--sp-4);
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  max-width: 62%;
}
.story__badges { inset-inline-start: var(--sp-4); }
.story__corner { inset-inline-end: var(--sp-4); justify-content: flex-end; max-width: 36%; }
.story__caption {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-16) var(--story-pad) var(--story-pad);
  background: linear-gradient(to top, var(--navy), color-mix(in srgb, var(--navy) 85%, transparent) 50%, transparent);
}
/* captions are 12px on phones, 11px from 640px */
.story__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-12);
  font-weight: 700;
  line-height: 1.45;
  color: var(--amber);
}
.story__spec, .story__glass, .story__cohort { display: inline-flex; align-items: center; gap: var(--sp-1); }
.story__meta .icon { font-size: .8125rem; }
.story__glass {
  padding: .125rem .625rem;
  color: var(--text-on-dark);
  background: color-mix(in srgb, var(--surface) 20%, transparent);
  border-radius: var(--r-full);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.story__cohort {
  padding: .125rem .625rem;
  background: color-mix(in srgb, var(--amber) 20%, transparent);
  border: 1px solid var(--amber-line);
  border-radius: var(--r-full);
}
.story__title {
  font-size: var(--fs-16);
  font-weight: 700;
  line-height: 1.56;
  text-wrap: pretty;
  text-shadow: 0 1px 1px color-mix(in srgb, var(--ink) 5%, transparent);
}
.story__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--story-pad) var(--story-pad);
}
.story__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-block-start: auto;
  padding-block-start: var(--sp-2);
  border-block-start: 1px solid var(--line);
}
.story__chip {
  padding: .125rem var(--sp-2);
  font-size: var(--fs-12);
  line-height: 1.45;
  color: var(--text);
  background: var(--gray);
  border-radius: var(--r-4);
}
.story__more { font-size: .8125rem; min-height: 1.5rem; }
.story__fact {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--fs-12);
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink);
}
.story__fact-value {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-1) var(--sp-2);
  color: var(--navy);
  background: var(--gray);
  border: 1px solid var(--line);
  border-radius: var(--r-6);
}
.story__fact-value--burgundy { color: var(--burgundy); }
.story__fact-dot {
  width: .375rem;
  height: .375rem;
  border-radius: 50%;
  background: var(--burgundy);
}
.story__fact-dot--amber { background: var(--amber); }
.story__cta { font-size: var(--fs-12); box-shadow: var(--sh-xs); }
.story__cta .icon { font-size: .75rem; }
/* the featured cards: larger title, roomier text */
.story--lead { box-shadow: var(--sh-md); }
.story--lead .story__title { font-size: clamp(1.125rem, 1rem + .6vw, var(--fs-22)); line-height: 1.5; }

/* ---- Badges on photos -------------------------------------------------------- */
.photo-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  min-height: 1.5rem;
  padding: .1875rem var(--sp-3);
  font-size: var(--fs-11);
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink);
  white-space: nowrap;
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 40%, transparent);
  border-radius: var(--r-full);
  box-shadow: var(--sh-sm);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.photo-badge .icon { font-size: .8125rem; color: var(--burgundy); }
.photo-badge .photo-badge__icon--amber { color: var(--amber); }
.photo-badge .photo-badge__icon--navy { color: var(--navy); }
.photo-badge__dot {
  width: .375rem;
  height: .375rem;
  border-radius: 50%;
  background: var(--amber);
}
.photo-badge--navy-text { color: var(--navy); }
.photo-badge--navy, .photo-badge--burgundy, .photo-badge--bronze {
  color: var(--text-on-dark);
  border-color: color-mix(in srgb, var(--surface) 20%, transparent);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.photo-badge--navy { background: color-mix(in srgb, var(--navy) 92%, transparent); }
.photo-badge--burgundy { background: var(--burgundy); }
.photo-badge--bronze { background: var(--amber-ink); }
.photo-badge--amber {
  background: var(--amber);
  border-color: color-mix(in srgb, var(--surface) 30%, transparent);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.photo-badge--amber .icon { color: var(--ink); }
.photo-badge--square { padding-inline: .625rem; border-radius: var(--r-6); }

/* ---- Pager (canonical .pager--pill) -------------------------------------------- */
.stories .pager { margin-block-start: var(--sp-10); }

/* ---- Closing CTA ----------------------------------------------------------------- */
.stories-cta {
  padding-block: var(--sp-10);
  background: var(--page);
  border-block-start: 1px solid var(--line);
}
.stories-cta__card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
  padding: var(--sp-6);
  background: var(--surface);
  border-radius: var(--r-16);
  box-shadow: var(--sh-xs);
}
.stories-cta__body {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  flex: 1 1 24rem;
  min-width: 0;
}
.stories-cta__icon { border-radius: var(--r-12); }
.stories-cta__icon .icon { font-size: var(--fs-28); }
.stories-cta__text {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  min-width: 0;
  max-width: 37rem;
}
.stories-cta__title {
  font-size: var(--fs-20);
  font-weight: 700;
  line-height: 1.5;
  color: var(--ink);
}
.stories-cta__lead { font-size: var(--fs-14); line-height: 1.7; color: var(--text); }
.stories-cta__actions { display: flex; flex-wrap: wrap; gap: var(--sp-4); }
.stories-cta__btn {
  flex: 1 1 auto;
  min-height: 2.75rem;
  padding: var(--sp-3) var(--sp-6);
  font-size: var(--fs-14);
  border-radius: var(--r-8);
}
.stories-cta__btn--quiet { --btn-bg: var(--gray); --btn-fg: var(--navy); box-shadow: none; }

/* ---- ≥ 640px ------------------------------------------------------------------------ */
@media (min-width: 40rem) {
  .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .story-grid__item--wide { grid-column: 1 / -1; }
  .story--lead { --story-pad: var(--sp-6); }
  .story--lead .story__body { padding-block-start: var(--sp-6); gap: var(--sp-6); }
  .story--lead .story__media { min-height: 24rem; }
  .story__meta, .story__chip, .story__fact { font-size: var(--fs-11); }
  .story__more { font-size: var(--fs-11); }
  .story__cta { min-height: 2.125rem; padding: var(--sp-2) var(--sp-4); }
  .stories-cta__card { padding: var(--sp-10); }
}

/* ---- ≥ 1024px: text beside the photo cluster; masonry rows 4+2 / 2+4 / 3+3 ---------- */
@media (min-width: 64rem) {
  .archive-hero { padding-block: var(--sp-10); }
  .archive-hero__row { grid-template-columns: minmax(0, 1fr) minmax(0, 27rem); gap: var(--sp-8); }
  .cluster-photos { margin-inline: 0; }
  .story-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-flow: dense; }
  .story-grid__item--wide { grid-column: span 4; }
  .story-grid__item--narrow { grid-column: span 2; }
  .story-grid__item--half { grid-column: span 3; }
  .story--lead .story__media { min-height: 26.25rem; }
  .story--tall .story__media { min-height: 26.875rem; }
}

/* ---- Motion ---------------------------------------------------------------------
   The proof figures stay centred while they count. Story cards fall in one after another
   with alternating tilts (the shared "drop" reveal). The avatars of the hero collage pop in
   after the text, with a small overshoot. */
.proof__value .count { justify-items: center; }
.story-grid__item:nth-of-type(odd) { --drop-tilt: -2.5deg; }
.story-grid__item:nth-of-type(even) { --drop-tilt: 2.5deg; }
@media (prefers-reduced-motion: no-preference) {
  .cluster-photos__item,
  .cluster-photos__stamp { animation: cluster-pop var(--t-slow) var(--ease-drop) both; }
  .cluster-photos__item--a { animation-delay: 240ms; }
  .cluster-photos__item--b { animation-delay: 360ms; }
  .cluster-photos__item--c { animation-delay: 480ms; }
  .cluster-photos__item--d { animation-delay: 600ms; }
  .cluster-photos__stamp { animation: cluster-fade var(--t-slow) var(--ease) 720ms both; }
}
@keyframes cluster-pop {
  from { opacity: 0; scale: .7; }
}
@keyframes cluster-fade {
  from { opacity: 0; filter: blur(4px); }
}

/* ---- LTR (English) --------------------------------------------------------
   i-arrow-left is drawn for RTL; mirror it so "forward" points to the right. */
[dir="ltr"] .icon:not(.icon--back):has(> use[href="#i-arrow-left"]) { scale: -1 1; }
/* breadcrumb separator is drawn for RTL (points left); turn it to point right */
[dir="ltr"] .crumbs__item + .crumbs__item::before { rotate: -45deg; }
