/* ==========================================================================
   Striped Goat Foundation - stripedgoatfoundation.com
   Palette: Umber #3B2A20 | Kraft #8B5E3C | Ochre #C98A2D | Olive #6B7A4F
            Ivory #F5EFE4 | Parchment #EAE0CE
   Type:    Fraunces (display) / Archivo (body)
   ========================================================================== */

:root {
  --umber: #3b2a20;
  --umber-deep: #2e2016;
  --kraft: #8b5e3c;
  --ochre: #c98a2d;
  --ochre-bright: #e0a23e;
  --olive: #6b7a4f;
  --olive-deep: #55633e;
  --ivory: #f5efe4;
  --parchment: #eae0ce;
  --ink: #2e2318;
  --ink-soft: #5c4d3d;
  --line: #d9cbb2;

  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Archivo", "Segoe UI", sans-serif;

  --stripe-band: repeating-linear-gradient(
    90deg,
    var(--ochre) 0 18px,
    var(--umber) 18px 42px,
    var(--olive) 42px 56px,
    var(--kraft) 56px 88px,
    var(--parchment) 88px 94px
  );

  --shadow-card: 0 1px 2px rgba(46, 32, 22, 0.06), 0 10px 30px -12px rgba(46, 32, 22, 0.18);
  --radius: 14px;
  --wrap: 1160px;
}

/* ---------- Reset & base ---------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 560;
  line-height: 1.14;
  color: var(--umber);
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1.1em;
}

a {
  color: var(--kraft);
  text-decoration-color: rgba(201, 138, 45, 0.5);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--ochre);
}

:focus-visible {
  outline: 3px solid var(--ochre);
  outline-offset: 3px;
  border-radius: 3px;
}

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

/* Hidden utility class */
.hidden {
  display: none !important;
}

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

.stripe-band {
  height: 12px;
  background: var(--stripe-band);
}

.stripe-band--thick {
  height: 18px;
}

/* Eyebrow labels */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ochre);
  margin-bottom: 1.1rem;
}

.eyebrow::before {
  content: "";
  width: 34px;
  height: 8px;
  background: var(--stripe-band);
  background-size: 94px 8px;
  border-radius: 2px;
}

.on-dark .eyebrow {
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1;
  padding: 0.95rem 1.6rem;
  border-radius: 999px;
  border: 2px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn--primary {
  background: var(--ochre);
  color: var(--umber-deep);
}

.btn--primary:hover {
  background: var(--ochre-bright);
  color: var(--umber-deep);
}

.btn--ghost {
  border-color: rgba(245, 239, 228, 0.45);
  color: var(--ivory);
}

.btn--ghost:hover {
  border-color: var(--ochre-bright);
  color: var(--ochre-bright);
}

.btn--outline {
  border-color: var(--umber);
  color: var(--umber);
}

.btn--outline:hover {
  background: var(--umber);
  color: var(--ivory);
}

.arrow {
  display: inline-block;
  transition: transform 0.18s ease;
}

.btn:hover .arrow,
.text-link:hover .arrow {
  transform: translateX(4px);
}

.text-link {
  font-weight: 600;
  color: var(--kraft);
  text-decoration: none;
  border-bottom: 2px solid rgba(201, 138, 45, 0.45);
  padding-bottom: 2px;
}

.text-link:hover {
  color: var(--ochre);
  border-bottom-color: var(--ochre);
}

/* ---------- Navigation ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: transparent;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 0.9rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ivory);
}

.brand__mark {
  width: 40px;
  height: 40px;
  flex: none;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.05;
}

.brand__the {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.9;
}

.brand__lead {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.brand__name small {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.95;
  margin-top: 1px;
}

/* Nav lockup: logo + name on top row, tagline spanning below */
.site-nav .brand {
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
}

.brand__lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}

.brand__tag {
  display: block;
  width: 100%;
  text-align: center;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.54rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  margin-top: 2px;
  opacity: 0.85;
}

/* White branding in the nav */
.site-nav .brand__name,
.site-nav .brand__the,
.site-nav .brand__lead,
.site-nav .brand__name small,
.site-nav .brand__tag {
  color: #fff;
  transition: color 0.25s ease;
}

/* Darken branding when the nav switches to its light scrolled state */
.site-nav.scrolled .brand__name,
.site-nav.scrolled .brand__the,
.site-nav.scrolled .brand__lead,
.site-nav.scrolled .brand__name small,
.site-nav.scrolled .brand__tag {
  color: var(--umber);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a:not(.btn) {
  font-size: 0.94rem;
  font-weight: 500;
  color: rgba(245, 239, 228, 0.88);
  text-decoration: none;
}

.nav-links a:not(.btn):hover {
  color: var(--ochre-bright);
}

.nav-links .btn {
  padding: 0.62rem 1.15rem;
  font-size: 0.88rem;
}

.site-nav.scrolled {
  background: rgba(245, 239, 228, 0.96);
  box-shadow: 0 1px 0 var(--line), 0 12px 30px -18px rgba(46, 32, 22, 0.35);
  backdrop-filter: blur(8px);
}

.site-nav.scrolled .brand,
.site-nav.scrolled .nav-links a:not(.btn) {
  color: var(--umber);
}

.site-nav.scrolled .nav-links a:not(.btn):hover {
  color: var(--ochre);
}

.site-nav.scrolled .btn--ghost {
  border-color: var(--umber);
  color: var(--umber);
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 0.4rem;
  cursor: pointer;
  color: var(--ivory);
}

.site-nav.scrolled .nav-toggle {
  color: var(--umber);
}

.nav-toggle svg {
  width: 26px;
  height: 26px;
}

@media (max-width: 900px) {
  .nav-toggle {
    display: block;
  }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--umber-deep);
    padding: 0.5rem 0 1rem;
    display: none;
    box-shadow: 0 24px 40px -18px rgba(0, 0, 0, 0.5);
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links li {
    padding: 0.55rem clamp(1.25rem, 4vw, 2.5rem);
  }
  .nav-links a:not(.btn) {
    color: var(--ivory) !important;
    font-size: 1.05rem;
  }
  .site-nav.scrolled .nav-links a:not(.btn) {
    color: var(--ivory);
  }
}

/* ---------- Hero (jumbo) ---------- */

.hero {
  position: relative;
  background:
    radial-gradient(1100px 520px at 82% -10%, rgba(201, 138, 45, 0.16), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(107, 122, 79, 0.18), transparent 55%),
    var(--umber-deep);
  color: var(--ivory);
  margin-top: -96px; /* sit behind the sticky nav */
  padding-top: 96px;
  overflow: hidden;
  box-shadow: inset 0 0 200px rgba(0, 0, 0, 0.9), inset 0 0 120px rgba(0, 0, 0, 0.8);
}

.hero__inner {
  position: relative;
  min-height: min(92vh, 860px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: clamp(6rem, 12vh, 9rem) clamp(4.5rem, 9vh, 7rem);
}

.hero__watermark {
  position: absolute;
  right: -4%;
  bottom: -12%;
  width: min(46vw, 560px);
  opacity: 0.07;
  pointer-events: none;
}

.hero h1 {
  color: #fff;
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  font-weight: 480;
  max-width: 15ch;
  margin-bottom: 0.5em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7), 0 4px 16px rgba(0, 0, 0, 0.5);
}

.hero h1 em {
  font-style: italic;
  color: var(--ochre-bright);
}

.hero__lede {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  max-width: 56ch;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 2.2rem;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.4);
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.hero__origin {
  margin-top: clamp(2.5rem, 6vh, 4rem);
  padding-top: 1.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  max-width: 64ch;
  font-size: 0.98rem;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hero .btn--ghost {
  background-color: white;
  border-color: white;
  color: #000;
}

.hero .btn--ghost:hover {
  background-color: rgba(245, 239, 228, 0.95);
  border-color: rgba(245, 239, 228, 0.95);
  color: #000;
}

/* Page hero (inner pages) */

.page-hero {
  position: relative;
  background:
    radial-gradient(900px 420px at 85% -20%, rgba(201, 138, 45, 0.18), transparent 60%),
    var(--umber-deep);
  color: var(--ivory);
  margin-top: -96px;
  padding-top: 96px;
  overflow: hidden;
}

.page-hero__inner {
  position: relative;
  padding-block: clamp(5.5rem, 12vh, 8rem) clamp(3.5rem, 7vh, 5.5rem);
}

.page-hero h1 {
  color: var(--ivory);
  font-size: clamp(2.2rem, 4.6vw, 3.6rem);
  font-weight: 500;
  max-width: 20ch;
}

.page-hero__sub {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  color: var(--ochre-bright);
  margin-bottom: 1rem;
}

.page-hero__lede {
  max-width: 62ch;
  color: rgba(245, 239, 228, 0.82);
  font-size: 1.08rem;
}

.page-hero .hero__watermark {
  width: min(38vw, 420px);
  bottom: -22%;
}

/* Hero stats row (metrics framework) */

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.5rem, 5vw, 4rem);
  margin-top: 2.4rem;
}

.hero-stats__item .num {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 500;
  color: var(--ochre-bright);
  line-height: 1;
}

.hero-stats__item .label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(245, 239, 228, 0.65);
  margin-top: 0.45rem;
}

.hero-stats__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Animated icons for hero stats */

.hero-stats__icon {
  width: 48px;
  height: 48px;
  margin-bottom: 0.8rem;
  color: var(--ochre-bright);
  opacity: 0;
  transition: opacity 400ms ease-out, transform 400ms ease-out;
}

.hero-stats__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-stats__icon.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@keyframes iconFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Metric type distribution chart */

.metric-distribution-chart {
  margin: 2rem 0 2.4rem;
  padding: 1.8rem;
  background: rgba(245, 239, 228, 0.2);
  border-radius: var(--radius);
  border: 1px solid rgba(245, 239, 228, 0.3);
}

.chart-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ochre-bright);
  margin: 0 0 1.2rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.distribution-bar {
  width: 100%;
  height: auto;
  display: block;
  max-width: 100%;
}

.chart-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.2rem;
  margin-top: 1.6rem;
  padding-top: 1.6rem;
  border-top: 1px solid rgba(245, 239, 228, 0.3);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.92rem;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  flex-shrink: 0;
}

.legend-label {
  color: rgba(245, 239, 228, 0.85);
  line-height: 1.3;
}

.legend-label strong {
  color: var(--ochre-bright);
  font-weight: 600;
}

@media (max-width: 768px) {
  .distribution-bar {
    max-width: 100%;
  }

  .metric-distribution-chart {
    padding: 1.4rem;
  }

  .chart-title {
    font-size: 0.88rem;
  }

  .chart-legend {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(4rem, 9vw, 7rem);
}

.section--parchment {
  background: var(--parchment);
}

.section--dark {
  background:
    radial-gradient(900px 500px at 90% 0%, rgba(201, 138, 45, 0.14), transparent 55%),
    var(--umber);
  color: rgba(245, 239, 228, 0.88);
}

.section--dark h2,
.section--dark h3 {
  color: var(--ivory);
}

.section-head {
  max-width: 760px;
  margin-bottom: clamp(2.2rem, 5vw, 3.5rem);
}

.section-head h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
}

.section-head .kicker {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--kraft);
  margin-top: -0.4rem;
}

.section--dark .section-head .kicker {
  color: var(--ochre-bright);
}

.section-head p.lede {
  font-size: 1.1rem;
  color: var(--ink-soft);
}

.section--dark .section-head p.lede {
  color: rgba(245, 239, 228, 0.78);
}

/* Intro strip */

.intro-strip {
  background: var(--parchment);
  border-block: 1px solid var(--line);
}

.intro-strip .wrap {
  padding-block: clamp(2.2rem, 5vw, 3.2rem);
}

.intro-strip p {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  font-weight: 420;
  line-height: 1.5;
  color: var(--umber);
  max-width: 30em;
  margin: 0 auto;
  text-align: center;
}

/* Story (two column) */

.story-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.story-grid .drop p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-size: 3.4em;
  font-weight: 500;
  float: left;
  line-height: 0.82;
  padding: 0.08em 0.12em 0 0;
  color: var(--kraft);
}

.stripe-callout {
  position: sticky;
  top: 110px;
  background: var(--umber);
  color: rgba(245, 239, 228, 0.88);
  border-radius: var(--radius);
  padding: 2rem 2rem 2.4rem;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.stripe-callout::before {
  content: "";
  display: block;
  height: 10px;
  background: var(--stripe-band);
  border-radius: 4px;
  margin-bottom: 1.5rem;
}

.stripe-callout p {
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.45;
  color: var(--ivory);
  margin: 0;
}

.stripe-callout p strong {
  color: var(--ochre-bright);
  font-weight: 600;
}

@media (max-width: 860px) {
  .story-grid {
    grid-template-columns: 1fr;
  }
  .stripe-callout {
    position: static;
  }
}

/* ---------- Card grids ---------- */

.card-grid {
  display: grid;
  gap: 1.4rem;
}

.card-grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.card-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 980px) {
  .card-grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .card-grid--2,
  .card-grid--3 {
    grid-template-columns: 1fr;
  }
}

/* ---------- Photo Gallery ---------- */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  grid-auto-rows: auto;
  gap: 0.5rem 0;
  justify-items: center;
  align-items: center;
  padding: 1.5rem 0;
}

.photo-item {
  margin: 0;
  line-height: 0;
  position: relative;
  z-index: 1;
}

.photo-item img {
  display: block;
  width: 100%;
  height: auto;
  border: 15px solid #fff;
  border-radius: 2px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 2vw, 2rem);
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(20, 14, 9, 0.94);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.open {
  display: flex;
  opacity: 1;
}

.lightbox__stage {
  margin: 0;
  max-width: min(90vw, 1000px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

.lightbox__img {
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
  border: 12px solid #fff;
  border-radius: 2px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}

.lightbox__counter {
  color: rgba(245, 239, 228, 0.85);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}

.lightbox__nav,
.lightbox__close {
  background: rgba(245, 239, 228, 0.12);
  border: 1px solid rgba(245, 239, 228, 0.3);
  color: var(--ivory);
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.lightbox__nav {
  width: clamp(44px, 6vw, 58px);
  height: clamp(44px, 6vw, 58px);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  flex-shrink: 0;
}

.lightbox__nav:hover,
.lightbox__close:hover {
  background: var(--ochre-bright);
  border-color: var(--ochre-bright);
  color: #2e2016;
}

.lightbox__close {
  position: absolute;
  top: clamp(1rem, 3vw, 2rem);
  right: clamp(1rem, 3vw, 2rem);
  width: 48px;
  height: 48px;
  font-size: 2rem;
  line-height: 1;
}

@media (max-width: 640px) {
  .lightbox__nav--prev {
    position: absolute;
    left: 0.75rem;
  }
  .lightbox__nav--next {
    position: absolute;
    right: 0.75rem;
  }
}

/* Scattered "thrown on a surface" placement */
.photo-item:nth-child(1)  { transform: rotate(-5deg)  translate(12px, 8px);   z-index: 3; }
.photo-item:nth-child(2)  { transform: rotate(3deg)   translate(-18px, -6px); z-index: 2; }
.photo-item:nth-child(3)  { transform: rotate(-2deg)  translate(20px, 14px);  z-index: 4; }
.photo-item:nth-child(4)  { transform: rotate(4deg)   translate(-10px, -12px); z-index: 2; }
.photo-item:nth-child(5)  { transform: rotate(-6deg)  translate(16px, 6px);   z-index: 5; }
.photo-item:nth-child(6)  { transform: rotate(2deg)   translate(-22px, 12px); z-index: 3; }
.photo-item:nth-child(7)  { transform: rotate(5deg)   translate(10px, -10px); z-index: 2; }
.photo-item:nth-child(8)  { transform: rotate(-3deg)  translate(-14px, 8px);  z-index: 4; }
.photo-item:nth-child(9)  { transform: rotate(6deg)   translate(18px, -6px);  z-index: 3; }
.photo-item:nth-child(10) { transform: rotate(-4deg)  translate(-20px, 10px); z-index: 5; }
.photo-item:nth-child(11) { transform: rotate(3deg)   translate(14px, -14px); z-index: 2; }
.photo-item:nth-child(12) { transform: rotate(-5deg)  translate(-12px, 6px);  z-index: 4; }

.section--dark {
  background: var(--umber-deep);
  color: var(--ivory);
}

.card {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem 1.7rem;
  box-shadow: var(--shadow-card);
}

.card h3 {
  font-size: 1.28rem;
  margin-bottom: 0.5rem;
}

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

.card--dark {
  background: rgba(245, 239, 228, 0.06);
  border-color: rgba(245, 239, 228, 0.15);
}

.card--dark h3 {
  color: var(--ivory);
}

.card--dark p,
.card--dark li {
  color: rgba(245, 239, 228, 0.85);
}

.card--tick {
  position: relative;
  padding-top: 2.1rem;
}

.card--tick::before {
  content: "";
  position: absolute;
  top: 0;
  left: 1.7rem;
  width: 44px;
  height: 9px;
  background: var(--stripe-band);
  background-size: 94px 9px;
  border-radius: 0 0 4px 4px;
}

/* Value rows (What we believe) */

.value-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.value-row {
  display: grid;
  grid-template-columns: minmax(200px, 320px) 1fr;
  gap: clamp(1rem, 4vw, 3rem);
  padding-block: 1.9rem;
  border-bottom: 1px solid var(--line);
}

.value-row h3 {
  font-size: 1.35rem;
  margin: 0;
}

.value-row p {
  margin: 0;
  color: var(--ink-soft);
}

@media (max-width: 680px) {
  .value-row {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
}

/* Numbered process steps (real sequences only) */

.steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.3rem;
  counter-reset: step;
}

@media (max-width: 768px) {
  .steps {
    grid-template-columns: 1fr;
  }
}

.step {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.4rem;
  box-shadow: var(--shadow-card);
}

.section--dark .step,
.on-dark .step {
  background: rgba(245, 239, 228, 0.06);
  border-color: rgba(245, 239, 228, 0.14);
  color: rgba(245, 239, 228, 0.82);
}

.step__num {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ochre);
  display: inline-block;
  border-bottom: 3px solid var(--ochre);
  padding-bottom: 0.15rem;
  margin-bottom: 0.9rem;
}

.step h3 {
  font-size: 1.12rem;
  margin-bottom: 0.4rem;
}

.section--dark .step h3 {
  color: var(--ivory);
}

.step p {
  font-size: 0.94rem;
  margin: 0;
  color: var(--ink-soft);
}

.section--dark .step p {
  color: rgba(245, 239, 228, 0.72);
}

/* ---------- Quotes / voices ---------- */

.voices-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}

@media (max-width: 900px) {
  .voices-grid {
    grid-template-columns: 1fr;
  }
}

.voice {
  background: rgba(245, 239, 228, 0.07);
  border: 1px solid rgba(245, 239, 228, 0.15);
  border-radius: var(--radius);
  padding: 1.9rem 1.7rem;
  margin: 0;
}

.voice p {
  font-family: var(--font-display);
  font-size: 1.22rem;
  line-height: 1.5;
  color: var(--ivory);
  margin-bottom: 1.2rem;
}

.voice p::before {
  content: "\201C";
  color: var(--ochre-bright);
  margin-right: 0.1em;
}

.voice p::after {
  content: "\201D";
  color: var(--ochre-bright);
}

.voice cite {
  font-style: normal;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245, 239, 228, 0.62);
}

/* Big pull-quote */

.pull-quote {
  border-left: 5px solid var(--ochre);
  background: var(--parchment);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.8rem 2rem;
  margin: 0 0 1.5rem;
}

.pull-quote p {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.5;
  color: var(--umber);
  margin-bottom: 0.8rem;
}

.pull-quote cite {
  font-style: normal;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--kraft);
}

.section--dark .pull-quote {
  background: rgba(245, 239, 228, 0.06);
  border-left-color: var(--ochre-bright);
}

.section--dark .pull-quote p {
  color: var(--ivory);
}

.section--dark .pull-quote cite {
  color: var(--ochre-bright);
}

/* ---------- Metric cards (framework pages) ---------- */

.metric-category {
  padding-block: clamp(2.4rem, 5vw, 3.6rem);
  border-top: 1px solid var(--line);
}

.metric-category:first-of-type {
  border-top: 0;
}

.metric-category__head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.6rem;
}

.metric-category__head h3 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  margin: 0;
}

.metric-category__head .count {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--kraft);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.3rem;
}

.metric-card {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.6rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.metric-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
}

.metric-card h4 {
  font-size: 1.14rem;
  margin: 0;
}

.badge {
  flex: none;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}

.badge--quant {
  background: rgba(107, 122, 79, 0.16);
  color: var(--olive-deep);
}

.badge--qual {
  background: rgba(139, 94, 60, 0.16);
  color: var(--kraft);
}

.badge--fin {
  background: rgba(201, 138, 45, 0.2);
  color: #96660f;
}

.badge--comp {
  background: rgba(59, 42, 32, 0.12);
  color: var(--umber);
}

.metric-card > p {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin: 0;
}

.metric-card__calc {
  background: var(--parchment);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  font-size: 0.87rem;
  color: var(--umber);
}

.metric-card__calc .label {
  display: block;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--kraft);
  margin-bottom: 0.35rem;
}

.metric-card__meta {
  margin-top: auto;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--line);
  font-size: 0.8rem;
  color: var(--ink-soft);
  display: grid;
  gap: 0.25rem;
}

.metric-card__meta strong {
  color: var(--umber);
  font-weight: 600;
}

.metric-card__illustration {
  width: 120px;
  height: 100px;
  margin-bottom: 1.2rem;
  opacity: 0.9;
}

/* Example blocks (shared value page) */

.metric-card__example {
  background: rgba(107, 122, 79, 0.1);
  border-left: 3px solid var(--olive);
  border-radius: 0 10px 10px 0;
  padding: 0.9rem 1rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.metric-card__example .label {
  display: block;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--olive-deep);
  margin-bottom: 0.35rem;
}

/* Pillars (shared value page) */

.pillar-diagram-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2rem 0 3rem;
  padding: 1.5rem;
  background: rgba(234, 224, 206, 0.3);
  border-radius: var(--radius);
}

.pillar-diagram {
  width: 100%;
  max-width: 400px;
  height: auto;
  display: block;
}

/* Pillar Cards with Interactive Toggle */

.pillar-card {
  padding-block: clamp(2.6rem, 6vw, 4rem);
  border-top: 1px solid var(--line);
}

.pillar-card__header {
  margin-bottom: 0;
}

.pillar-card__top {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
  max-width: 900px;
}

.pillar-card__icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.pillar-card__top > div {
  flex: 1;
}

.pillar-card__top h3 {
  font-size: clamp(1.5rem, 2.8vw, 2.1rem);
  margin-bottom: 0.4rem;
}

.pillar-card__summary {
  color: var(--ink-soft);
  margin: 0;
  font-size: 0.95rem;
  display: block;
}

.pillar-card.expanded .pillar-card__summary {
  display: none;
}

.pillar-card__toggle {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform 0.3s ease;
  color: var(--umber);
  flex-shrink: 0;
  margin-top: 0.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.pillar-card__toggle:hover {
  background: rgba(201, 138, 45, 0.1);
  color: var(--ochre);
}

.pillar-card__toggle.active {
  transform: rotate(180deg);
}

.pillar-card__toggle:focus-visible {
  outline: 2px solid var(--ochre);
  outline-offset: 2px;
}

.pillar-card__content {
  display: block;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px);
  transition: max-height 300ms cubic-bezier(0.68, 0.55, 0.265, 1.55),
              opacity 300ms cubic-bezier(0.68, 0.55, 0.265, 1.55),
              transform 300ms cubic-bezier(0.68, 0.55, 0.265, 1.55),
              margin-top 300ms cubic-bezier(0.68, 0.55, 0.265, 1.55);
  opacity: 0;
  margin-top: 0;
}

.pillar-card__content.visible {
  max-height: 3000px;
  opacity: 1;
  transform: translateY(0);
  margin-top: 1.8rem;
}

.pillar-card__description {
  color: var(--ink-soft);
  margin-bottom: 1.6rem;
}

.pillar-card.expanded .pillar-card__description {
  display: block;
}

.pillar-card:not(.expanded) .pillar-card__description {
  display: none;
}

/* Keep old class names for backwards compatibility if needed */
.pillar {
  padding-block: clamp(2.6rem, 6vw, 4rem);
  border-top: 1px solid var(--line);
}

.pillar__head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.2rem 1.6rem;
  align-items: start;
  margin-bottom: 1.8rem;
  max-width: 900px;
}

.pillar__index {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ivory);
  background: var(--umber);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  margin-top: 0.35rem;
  white-space: nowrap;
}

.pillar__head h3 {
  font-size: clamp(1.5rem, 2.8vw, 2.1rem);
  margin-bottom: 0.4rem;
}

.pillar__head .pillar-lede {
  color: var(--ink-soft);
  margin: 0;
}

@media (max-width: 680px) {
  .pillar__head {
    grid-template-columns: 1fr;
  }
  .pillar__index {
    justify-self: start;
    margin-top: 0;
  }

  .pillar-card__top {
    flex-direction: column;
  }

  .pillar-card__toggle {
    align-self: flex-start;
    margin-top: 0;
  }
}

/* ---------- Partner alignment cards ---------- */

.partner-card h3 {
  font-size: 1.2rem;
}

.partner-card ul {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.partner-card li {
  position: relative;
  padding-left: 1.2rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--umber);
}

.partner-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 9px;
  height: 9px;
  background: var(--ochre);
  transform: rotate(45deg);
}

/* Compact metric lists (metrics framework at-a-glance) */

.metric-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.metric-list li {
  border-bottom: 1px dashed var(--line);
  padding-bottom: 0.75rem;
  font-size: 0.93rem;
  color: var(--ink-soft);
}

.metric-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.metric-list .m-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.8rem;
  margin-bottom: 0.2rem;
}

.metric-list .m-name {
  font-weight: 600;
  color: var(--umber);
}

/* Standard summary cards */

.standard-card h3 {
  font-size: 1.08rem;
  margin-bottom: 0.3rem;
}

.standard-card .domain {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--olive-deep);
  margin-bottom: 0.7rem;
}

.standard-card p {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 0;
}

/* ---------- Standards table ---------- */

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf8;
  box-shadow: var(--shadow-card);
}

table.standards {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 760px;
}

table.standards th,
table.standards td {
  text-align: left;
  vertical-align: top;
  padding: 0.95rem 1.1rem;
  border-bottom: 1px solid var(--line);
}

table.standards th {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--kraft);
  background: var(--parchment);
}

table.standards tr:last-child td {
  border-bottom: 0;
}

table.standards td:first-child {
  font-weight: 600;
  color: var(--umber);
}

table.standards td:last-child {
  color: var(--ink-soft);
  font-size: 0.87rem;
}

/* ---------- Frameworks trio (landing) ---------- */

.framework-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem 1.8rem 1.8rem;
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: var(--ink);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.framework-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 9px;
  background: var(--stripe-band);
}

.framework-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 2px 4px rgba(46, 32, 22, 0.08), 0 22px 44px -16px rgba(46, 32, 22, 0.3);
  color: var(--ink);
}

.framework-card .doc-type {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--olive-deep);
}

.framework-card h3 {
  font-size: 1.4rem;
  margin: 0;
}

.framework-card p {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin: 0;
}

.framework-card .text-link {
  margin-top: auto;
  align-self: flex-start;
  padding-top: 0.8rem;
}

/* ---------- Get involved ---------- */

.involve-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.involve-card .text-link {
  margin-top: auto;
  align-self: flex-start;
  padding-top: 0.6rem;
}

/* ---------- CTA band ---------- */

.cta-band {
  background:
    radial-gradient(700px 400px at 15% 120%, rgba(107, 122, 79, 0.25), transparent 60%),
    var(--umber);
  color: var(--ivory);
  text-align: center;
}

.cta-band .wrap {
  padding-block: clamp(4rem, 9vw, 6.5rem);
  max-width: 820px;
}

.cta-band h2 {
  color: var(--ivory);
  font-size: clamp(1.9rem, 3.8vw, 3rem);
}

.cta-band p {
  color: rgba(245, 239, 228, 0.8);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

/* ---------- Footer (jumbo) ---------- */

.site-footer {
  background: var(--umber-deep);
  color: rgba(245, 239, 228, 0.75);
}

.site-footer a {
  color: rgba(245, 239, 228, 0.75);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ochre-bright);
}

.footer-main {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(140px, 1fr));
  gap: clamp(2rem, 5vw, 4rem);
  padding-block: clamp(3.5rem, 8vw, 5.5rem) clamp(2.5rem, 5vw, 3.5rem);
}

@media (max-width: 980px) {
  .footer-main {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .footer-main {
    grid-template-columns: 1fr;
  }
}

.footer-brand .brand {
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  margin-bottom: 1.2rem;
}

.footer-brand .brand__mark {
  width: 48px;
  height: 48px;
}

.footer-brand .brand__name,
.footer-brand .brand__the,
.footer-brand .brand__lead,
.footer-brand .brand__name small,
.footer-brand .brand__tag {
  color: var(--ivory);
}

.footer-brand .brand__tag {
  text-align: left;
}

.footer-tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.35rem;
  color: var(--ochre-bright);
  margin-bottom: 0.6rem;
}

.footer-mission {
  font-size: 0.95rem;
  max-width: 34ch;
}

.footer-col h4 {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(245, 239, 228, 0.5);
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
  font-size: 0.95rem;
}

.footer-bottom {
  border-top: 1px solid rgba(245, 239, 228, 0.12);
  padding-block: 1.4rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.8rem;
  font-size: 0.85rem;
  color: rgba(245, 239, 228, 0.5);
}

/* ---------- Utilities ---------- */

.note {
  font-size: 0.88rem;
  color: var(--ink-soft);
  background: var(--parchment);
  border-left: 4px solid var(--kraft);
  border-radius: 0 10px 10px 0;
  padding: 1.1rem 1.3rem;
}

.section--dark .note {
  background: rgba(245, 239, 228, 0.06);
  color: rgba(245, 239, 228, 0.75);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
}

@media (max-width: 820px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}

.back-to-top {
  position: fixed;
  right: 1.4rem;
  bottom: 1.4rem;
  z-index: 40;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 0;
  background: var(--umber);
  color: var(--ivory);
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 10px 24px -8px rgba(46, 32, 22, 0.5);
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  transform: translateY(-3px);
  background: var(--ochre);
  color: var(--umber-deep);
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 100;
  background: var(--ochre);
  color: var(--umber-deep);
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* ==========================================================================
   Card, Filter & Chart Animations
   ========================================================================== */

/* ---------- Keyframe animations ---------- */

@keyframes cardExpand {
  from {
    max-height: 0;
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    max-height: 1000px;
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardCollapse {
  from {
    max-height: 1000px;
    opacity: 1;
    transform: translateY(0);
  }
  to {
    max-height: 0;
    opacity: 0;
    transform: translateY(-10px);
  }
}

@keyframes toggleRotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(180deg);
  }
}

@keyframes lineHighlight {
  from {
    stroke-opacity: 0.3;
  }
  to {
    stroke-opacity: 1;
  }
}

@keyframes barChartGrowth {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

@keyframes fadeTrans {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes filterFade {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.95);
  }
}

@keyframes barSlideIn {
  from {
    opacity: 0;
    width: 0;
  }
  to {
    opacity: 1;
    width: inherit;
  }
}

@keyframes chartFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ---------- Card animation states ---------- */

.metric-card {
  overflow: hidden;
  transition: box-shadow 150ms ease-in-out, border-color 150ms ease-in-out;
}

.metric-card.expanded {
  box-shadow: 0 2px 4px rgba(46, 32, 22, 0.08), 0 22px 44px -16px rgba(46, 32, 22, 0.3);
}

.metric-card__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  padding: 0.4rem;
  cursor: pointer;
  color: var(--kraft);
  transition: transform 300ms cubic-bezier(0.68, 0.55, 0.265, 1.55), color 150ms ease-in-out;
}

.metric-card__toggle:hover {
  color: var(--ochre);
}

.metric-card__toggle.active {
  transform: rotate(180deg);
}

.metric-card__content {
  display: block;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px);
  transition: max-height 300ms cubic-bezier(0.68, 0.55, 0.265, 1.55),
              opacity 300ms cubic-bezier(0.68, 0.55, 0.265, 1.55),
              transform 300ms cubic-bezier(0.68, 0.55, 0.265, 1.55);
}

.metric-card__content.visible {
  max-height: 1000px;
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Filter bar animations ---------- */

.filter-bar {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1.6rem;
  flex-wrap: wrap;
  transition: opacity 200ms ease-out;
}

.filter-bar__button {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1rem 0.55rem 0.7rem;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 200ms ease-out;
}

.filter-bar__icon {
  width: 24px;
  height: 24px;
  flex: none;
  color: var(--ink-soft);
  transition: color 200ms ease-out;
}

.filter-bar__button:hover {
  border-color: var(--kraft);
  color: var(--kraft);
}

.filter-bar__button:hover .filter-bar__icon {
  color: var(--kraft);
}

.filter-bar__button.active {
  background: var(--ochre);
  border-color: var(--ochre);
  color: var(--umber-deep);
  font-weight: 600;
}

.filter-bar__button.active .filter-bar__icon {
  color: var(--umber-deep);
}

/* Hidden filter cards fade out with scale */
.metric-card[hidden] {
  animation: filterFade 200ms ease-out forwards;
}

/* ---------- Metric chart ---------- */

.metric-chart {
  margin-bottom: 2.4rem;
  padding: 1.8rem;
  background: rgba(234, 224, 206, 0.4);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.metric-chart__title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--umber);
  margin-bottom: 1.6rem;
}

.metric-chart__svg {
  width: 100%;
  height: auto;
  max-height: 280px;
}

.metric-chart__bar-group {
  opacity: 0;
  animation: chartFadeIn 600ms ease-out forwards;
}

.metric-chart__bar-group:nth-child(1) { animation-delay: 0ms; }
.metric-chart__bar-group:nth-child(2) { animation-delay: 60ms; }
.metric-chart__bar-group:nth-child(3) { animation-delay: 120ms; }
.metric-chart__bar-group:nth-child(4) { animation-delay: 180ms; }
.metric-chart__bar-group:nth-child(5) { animation-delay: 240ms; }
.metric-chart__bar-group:nth-child(6) { animation-delay: 300ms; }
.metric-chart__bar-group:nth-child(7) { animation-delay: 360ms; }
.metric-chart__bar-group:nth-child(8) { animation-delay: 420ms; }
.metric-chart__bar-group:nth-child(9) { animation-delay: 480ms; }

.metric-chart__bar {
  transition: fill 200ms ease-out;
  opacity: 0;
  animation: barSlideIn 800ms ease-out forwards;
}

.metric-chart__bar-group:nth-child(1) .metric-chart__bar { animation-delay: 0ms; }
.metric-chart__bar-group:nth-child(2) .metric-chart__bar { animation-delay: 60ms; }
.metric-chart__bar-group:nth-child(3) .metric-chart__bar { animation-delay: 120ms; }
.metric-chart__bar-group:nth-child(4) .metric-chart__bar { animation-delay: 180ms; }
.metric-chart__bar-group:nth-child(5) .metric-chart__bar { animation-delay: 240ms; }
.metric-chart__bar-group:nth-child(6) .metric-chart__bar { animation-delay: 300ms; }
.metric-chart__bar-group:nth-child(7) .metric-chart__bar { animation-delay: 360ms; }
.metric-chart__bar-group:nth-child(8) .metric-chart__bar { animation-delay: 420ms; }
.metric-chart__bar-group:nth-child(9) .metric-chart__bar { animation-delay: 480ms; }

/* ---------- Pillar diagram interactions ---------- */

.connection-line.line-active {
  opacity: 1 !important;
  animation: lineHighlight 300ms ease-out;
}

/* ---------- Chart animations ---------- */

.metric-chart__bar {
  position: relative;
  width: 0%;
  animation: barChartGrowth 800ms ease-out forwards;
  transition: width 150ms ease-out, background 150ms ease-in-out;
}

.metric-chart__bar:nth-child(1) {
  animation-delay: 0ms;
}

.metric-chart__bar:nth-child(2) {
  animation-delay: 100ms;
}

.metric-chart__bar:nth-child(3) {
  animation-delay: 200ms;
}

.metric-chart__bar:nth-child(4) {
  animation-delay: 300ms;
}

.metric-chart__bar:nth-child(5) {
  animation-delay: 400ms;
}

/* SVG line animations */
svg.metric-line line {
  stroke-opacity: 0.3;
  animation: lineHighlight 1200ms ease-in-out forwards;
  animation-delay: 200ms;
}

/* Badge fade-in */
.badge {
  animation: fadeTrans 150ms ease-in-out forwards;
}

.badge:nth-of-type(1) {
  animation-delay: 0ms;
}

.badge:nth-of-type(2) {
  animation-delay: 75ms;
}

/* ---------- Responsive adjustments ---------- */

/* Desktop (1024px and above) */
@media (min-width: 1024px) {
  .filter-bar {
    margin-bottom: 2rem;
  }

  .metric-chart__bar {
    animation-duration: 800ms;
  }
}

/* Tablet (768px to 1023px) */
@media (max-width: 1023px) {
  .metric-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
  }

  .metric-card {
    padding: 1.4rem 1.2rem;
  }

  .filter-bar {
    gap: 0.6rem;
    margin-bottom: 1.4rem;
  }

  .filter-bar__button {
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
  }

  .metric-chart__bar {
    animation-duration: 600ms;
  }
}

/* Mobile (below 768px) */
@media (max-width: 767px) {
  .metric-grid {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .metric-card {
    padding: 1.2rem 1rem;
  }

  .metric-card h4 {
    font-size: 1rem;
  }

  .metric-card > p {
    font-size: 0.9rem;
  }

  .filter-bar {
    gap: 0.5rem;
    margin-bottom: 1.2rem;
  }

  .filter-bar__button {
    padding: 0.5rem 0.9rem;
    font-size: 0.8rem;
  }

  .metric-chart__bar {
    animation-duration: 500ms;
  }

  svg.metric-line line {
    animation-duration: 900ms;
  }
}

/* ---------- prefers-reduced-motion compliance ---------- */

@media (prefers-reduced-motion: reduce) {
  @keyframes cardExpand {
    from {
      max-height: 0;
      opacity: 0;
    }
    to {
      max-height: 1000px;
      opacity: 1;
    }
  }

  @keyframes cardCollapse {
    from {
      max-height: 1000px;
      opacity: 1;
    }
    to {
      max-height: 0;
      opacity: 0;
    }
  }

  @keyframes toggleRotate {
    from {
      transform: rotate(0deg);
    }
    to {
      transform: rotate(180deg);
    }
  }

  @keyframes lineHighlight {
    from {
      stroke-opacity: 0.3;
    }
    to {
      stroke-opacity: 1;
    }
  }

  @keyframes barChartGrowth {
    from {
      width: 0%;
    }
    to {
      width: 100%;
    }
  }

  @keyframes fadeTrans {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  @keyframes filterFade {
    from {
      opacity: 1;
      transform: scale(1);
    }
    to {
      opacity: 0;
      transform: scale(0.95);
    }
  }

  .metric-card__toggle,
  .metric-card__content,
  .pillar-card__toggle,
  .pillar-card__content,
  .filter-bar,
  .filter-bar__button,
  .metric-chart__bar,
  .badge,
  svg.metric-line line {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}
