/* Humusinitiative Oberland – main stylesheet (no build step) */
@layer reset, tokens, base, layout, components, utilities, print;

/* ------------------------------------------------------------------ */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: none; text-size-adjust: none; }
  img, svg, video, iframe { display: block; max-width: 100%; }
  img { height: auto; }
  input, button, textarea, select { font: inherit; color: inherit; }
  :is(ul, ol)[role="list"] { list-style: none; padding: 0; }
}

/* ------------------------------------------------------------------ */
@layer tokens {
  :root {
    color-scheme: light dark;

    /* Palette – greens from the original gradient, soil browns, warm neutrals */
    --green-600: #16a34a;
    --green-500: #10b981;
    --green-800: #14532d;
    --soil-700: #5b4030;
    --soil-500: #8a6448;
    --soil-200: #e8dccd;

    --color-bg:        light-dark(#f7f4ee, #1b1a17);
    --color-surface:   light-dark(#ffffff, #26241f);
    --color-surface-2: light-dark(#efe8dc, #312e27);
    --color-text:      light-dark(#24211c, #ece7de);
    --color-muted:     light-dark(#5f584d, #b5ad9f);
    --color-border:    light-dark(#ddd3c4, #423e35);
    --color-accent:    light-dark(#13733a, #4ade80); /* ≥4.5:1 on all light surfaces */
    --color-accent-strong: light-dark(var(--green-800), #86efac);
    --color-on-accent: light-dark(#ffffff, #0f2417);
    --color-earth:     light-dark(var(--soil-700), #d6b896);
    --color-alert:     light-dark(#b42318, #ff8a80);
    --color-focus:     light-dark(#1d4ed8, #93c5fd);

    --hero-gradient: linear-gradient(120deg,
      color-mix(in oklab, var(--green-600) 92%, black) 0%,
      color-mix(in oklab, var(--green-500) 70%, transparent) 70%);

    /* Typography – system stacks, no web fonts */
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;

    --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.92rem);
    --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
    --step-1:  clamp(1.2rem, 1.12rem + 0.4vw, 1.45rem);
    --step-2:  clamp(1.44rem, 1.3rem + 0.7vw, 1.9rem);
    --step-3:  clamp(1.73rem, 1.5rem + 1.15vw, 2.5rem);
    --step-4:  clamp(2.07rem, 1.7rem + 1.9vw, 3.4rem);

    /* Space */
    --space-2xs: 0.25rem;
    --space-xs:  0.5rem;
    --space-s:   clamp(0.75rem, 0.7rem + 0.25vw, 1rem);
    --space-m:   clamp(1.125rem, 1rem + 0.6vw, 1.5rem);
    --space-l:   clamp(1.5rem, 1.3rem + 1vw, 2.25rem);
    --space-xl:  clamp(2.25rem, 1.9rem + 1.75vw, 3.5rem);
    --space-2xl: clamp(3rem, 2.4rem + 3vw, 5.5rem);

    --radius: 0;   /* square cards and media */
    --radius-l: 0;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 4px 16px -4px rgb(0 0 0 / 0.12);

    --wrapper-max: 75rem;
    --measure: 68ch;
  }
}

/* ------------------------------------------------------------------ */
@layer base {
  html {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 100%;
    line-height: 1.6;
    scroll-padding-top: var(--space-l);
    hanging-punctuation: first last;
  }

  @media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
  }

  body {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    font-size: var(--step-0);
    background: var(--color-bg);
  }

  main { flex: 1; padding-block-end: var(--space-2xl); }
  main:focus { outline: none; }

  h1, h2, h3, h4 {
    line-height: 1.15;
    font-weight: 700;
    text-wrap: balance;
    color: var(--color-text);
  }
  h1 { font-size: var(--step-4); }
  h2 { font-size: var(--step-3); }
  h3 { font-size: var(--step-1); }
  h4 { font-size: var(--step-0); }

  p, li, dd, figcaption { text-wrap: pretty; }

  a {
    color: var(--color-accent);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;

    &:hover { color: var(--color-accent-strong); text-decoration-thickness: 0.14em; }
  }

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

  :target { scroll-margin-block-start: var(--space-xl); }

  data:empty { display: none; } /* microformat values only */

  hr { border: 0; border-block-start: 1px solid var(--color-border); }

  code {
    font-size: 0.9em;
    padding: 0.1em 0.35em;
    background: var(--color-surface-2);
    border-radius: 0.25rem;
    overflow-wrap: anywhere;
  }

  blockquote {
    font-family: var(--font-serif);
    font-size: var(--step-2);
    line-height: 1.2;
    color: var(--color-earth);
    border-inline-start: 0.25rem solid var(--color-accent);
    padding-inline-start: var(--space-m);

    & em { font-style: normal; }
    & footer {
      margin-block-start: var(--space-xs);
      font-family: var(--font-sans);
      font-size: var(--step--1);
      color: var(--color-muted);
      &::before { content: "— "; }
    }
  }

  /* Forms (e.g. newsletter embeds placed in content) */
  label { display: block; font-weight: 600; margin-block-end: var(--space-2xs); }
  input:not([type="checkbox"], [type="radio"], [type="submit"], [type="hidden"]),
  textarea, select {
    width: 100%;
    max-width: 32rem;
    padding: 0.6em 0.75em;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    margin-block-end: var(--space-s);
  }
  input[type="submit"], button[type="submit"] {
    padding: 0.7em 1.4em;
    background: var(--color-accent);
    color: var(--color-on-accent);
    border: 0;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
  }

  table { border-collapse: collapse; width: 100%; }
  th, td { padding: var(--space-xs); border-block-end: 1px solid var(--color-border); text-align: start; }
}

/* ------------------------------------------------------------------ */
@layer layout {
  .wrapper {
    width: min(100% - 2 * var(--space-m), var(--wrapper-max));
    margin-inline: auto;
  }

  .flow > * + * { margin-block-start: var(--flow-space, 1em); }

  .prose {
    max-width: var(--measure);

    & h2, & h3 { --flow-space: 1.6em; }
    & ul, & ol { padding-inline-start: 1.25em; }
    & li + li { margin-block-start: 0.35em; }
  }
  .wrapper.prose { margin-inline: auto; }
  main > .wrapper:first-child,
  main > .prose:first-child { margin-block-start: var(--space-xl); }

  .section { margin-block-start: var(--space-2xl); }

  .section__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-xs) var(--space-m);
    margin-block-end: var(--space-l);
  }

  /* Kirby layout field: 12-column grid, columns span via --span */
  .layout {
    display: grid;
    gap: var(--space-l);
    margin-block-start: var(--space-xl);

    @media (width >= 48rem) {
      grid-template-columns: repeat(12, minmax(0, 1fr));
      & > .layout__column { grid-column: span var(--span, 12); }
    }
  }

  .layout.highlight {
    padding: var(--space-xl) var(--space-l);
    background: var(--color-surface-2);
    border-radius: var(--radius-l);
  }

  /* Layout row styles selectable in the Panel */
  .layout.cards > .layout__column {
    padding: var(--space-l) var(--space-m) var(--space-m);
    background: var(--color-surface);
    box-shadow: var(--shadow);

    & h2, & h3 { font-size: var(--step-1); }
  }

  /* Compact person profile: small photo + bio (two text columns on wide screens) */
  .layout.profile {
    grid-template-columns: 5rem minmax(0, 1fr);
    align-items: start;
    gap: var(--space-s) var(--space-m);
    padding: var(--space-m);
    margin-block-start: var(--space-s);
    background: var(--color-surface);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow);

    & > .layout__column { grid-column: auto; }
    & .block-image img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); }
    & h2, & h3 { font-size: var(--step-1); }
    & .layout__column:last-child { --flow-space: 0.6em; font-size: var(--step--1); line-height: 1.55; }
    & ul { padding-inline-start: 1.1em; break-inside: avoid; }
    & li + li { margin-block-start: 0.15em; }

    @media (width >= 48rem) {
      grid-template-columns: 9rem minmax(0, 1fr);
      gap: var(--space-l);
    }

    @media (width >= 64rem) {
      & .layout__column:last-child {
        columns: 2 20rem;
        column-gap: var(--space-l);

        & > :is(h2, h3) { column-span: all; margin-block-end: 0.4em; }
        & > :is(h2, h3) + * { margin-block-start: 0; }
      }
    }
  }


  .layout.logos {
    gap: var(--space-s);
    margin-block-start: var(--space-s);

    & > .layout__column {
      display: grid;
      align-content: start;
      justify-items: center;
      gap: var(--space-xs);
      padding: var(--space-m);
      background: var(--color-surface);
      border: 1px solid var(--color-border);
      border-radius: var(--radius);
      text-align: center;
    }
    & figure { margin: 0; }
    & img {
      height: 4rem; /* fixed height: SVG logos without intrinsic size would collapse with width:auto */
      width: auto;
      max-width: 100%;
      object-fit: contain;
      padding: var(--space-2xs);
      background: #fff; /* logos are made for light backgrounds */
      border-radius: var(--radius);
    }
    & :is(h2, h3, h4) { font-size: var(--step--1); font-weight: 600; }
  }

  .card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
    gap: var(--space-m);

    & > li { display: grid; }
  }
}

/* ------------------------------------------------------------------ */
@layer components {
  /* Skip link */
  .skip-link {
    position: absolute;
    inset-inline-start: var(--space-s);
    inset-block-start: var(--space-s);
    z-index: 100;
    padding: var(--space-xs) var(--space-s);
    background: var(--color-surface);
    color: var(--color-text);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    translate: 0 -200%;

    &:focus { translate: 0 0; }
  }

  /* Header bar */
  .site-header { background: var(--color-surface); }

  .site-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-s) var(--space-l);
    padding-block: var(--space-s);
  }

  .site-brand {
    display: grid;
    color: var(--color-text);
    text-decoration: none;
    line-height: 1.2;

    &:hover { color: var(--color-text); }
  }
  .site-brand__title { font-size: var(--step-1); font-weight: 800; letter-spacing: -0.01em; }
  .site-brand__byline { font-size: var(--step--1); color: var(--color-muted); }

  .site-nav {
    & ul {
      display: flex;
      flex-wrap: wrap;
      gap: var(--space-2xs) var(--space-s);
    }

    & a {
      display: block;
      padding: var(--space-xs) var(--space-2xs);
      color: var(--color-text);
      font-weight: 600;
      text-decoration: none;

      &:hover { color: var(--color-accent); text-decoration: underline; }
      &[aria-current] {
        color: var(--color-accent);
        text-decoration: underline;
        text-decoration-thickness: 0.15em;
      }
    }
  }

  .site-nav__toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-s);
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
  }

  /* JS enhances the nav into a disclosure on small screens only */
  @media (width < 48rem) {
    .site-nav.is-enhanced { width: 100%; }
    .site-nav.is-enhanced:has([aria-expanded="false"]) ul { display: none; }
    .site-nav.is-enhanced ul {
      flex-direction: column;
      padding-block: var(--space-xs);
    }
  }
  @media (width >= 48rem) {
    .site-nav__toggle { display: none; }
  }
  .site-nav:not(.is-enhanced) .site-nav__toggle { display: none; }

  /* Hero */
  .hero {
    position: relative;
    isolation: isolate;
    display: grid;
    color: #fff;
    background: var(--green-600);
    padding-block: var(--space-l) calc(var(--space-l) + 2.5vw);
    overflow: hidden;

    &::before {
      content: "";
      position: absolute;
      inset: 0;
      z-index: -1;
      /* dark scrim keeps white text ≥4.5:1 even over bright photos */
      background: linear-gradient(rgb(0 0 0 / 0.4) 0 0), var(--hero-gradient);
    }

    & a { color: inherit; }
  }
  .site-header--home .hero {
    padding-block: var(--space-xl) calc(var(--space-xl) + 3vw);
    min-height: min(45vh, 24rem);
    align-content: center;
  }

  .hero__image {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .hero__content {
    display: grid;
    gap: var(--space-s);
    max-width: min(100% - 2 * var(--space-m), 52rem);
    text-shadow: 0 1px 12px rgb(0 0 0 / 0.25);
  }
  .site-header--home .hero__content { text-align: center; justify-items: center; }

  .hero__kicker { font-weight: 600; font-size: var(--step-0); opacity: 0.95; }
  .hero__title { color: inherit; hyphens: auto; overflow-wrap: break-word; }
  .site-header:not(.site-header--home) .hero__title { font-size: var(--step-3); }
  .hero__teaser { font-size: var(--step-1); font-weight: 500; max-width: 46rem; }

  .hero__wave {
    position: absolute;
    inset-inline: 0;
    inset-block-end: -1px;
    width: 100%;
    height: clamp(1.5rem, 4vw, 3.5rem);
    color: var(--color-bg);
  }

  .lead {
    font-size: var(--step-1);
    max-width: var(--measure);
    margin-block-start: var(--space-xl);
    color: var(--color-earth);
  }

  /* Buttons */
  .button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 0.7em 1.2em;
    background: var(--color-accent);
    color: var(--color-on-accent);
    border: 2px solid var(--color-accent);
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none;
    line-height: 1.2;

    &:hover { background: var(--color-accent-strong); border-color: var(--color-accent-strong); color: var(--color-on-accent); }
  }
  .button--small { padding: 0.45em 0.9em; font-size: var(--step--1); }
  .ics-link { margin-block-start: var(--space-xs); }
  .button--secondary {
    background: transparent;
    color: var(--color-accent);

    &:hover { background: var(--color-surface-2); color: var(--color-accent-strong); }
  }


  /* Event & article cards */
  .event-card,
  .article-card {
    container-type: inline-size;
    position: relative;
    display: grid;
    grid-template-rows: auto 1fr;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-l);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: border-color 0.2s;

    &:has(a:hover) { border-color: var(--color-accent); }
    &:focus-within { border-color: var(--color-accent); }

    & > img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }

    /* Whole card clickable, link stays the accessible name */
    & h2 a::after, & h3 a::after { content: ""; position: absolute; inset: 0; }
  }

  .event-card__body,
  .article-card__body {
    display: grid;
    align-content: start;
    gap: var(--space-xs);
    padding: var(--space-m);
  }

  .event-card__title,
  .article-card h2,
  .article-card h3 {
    font-size: var(--step-1);

    & a { color: var(--color-text); text-decoration: none; }
    & a:hover { text-decoration: underline; }
  }

  .event-card__date,
  .article-card__date {
    font-size: var(--step--1);
    font-weight: 700;
    color: var(--color-earth);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .event-card__meta,
  .event-card__summary { color: var(--color-muted); font-size: var(--step--1); }

  .event-card--highlight { border-color: var(--color-accent); border-width: 2px; }
  .event-card--cancelled .event-card__title a { text-decoration: line-through; }

  @container (width >= 34rem) {
    .event-card:not(.event-card--compact):has(> img) {
      grid-template-columns: 2fr 3fr;
      grid-template-rows: auto;
      & > img { height: 100%; aspect-ratio: auto; }
    }
  }

  .event-card--compact {
    grid-template-rows: auto;
    box-shadow: none;
    border-radius: var(--radius);

    & .event-card__body {
      grid-template-columns: minmax(7.5rem, auto) 1fr;
      align-items: baseline;
      gap: var(--space-2xs) var(--space-s);
      padding: var(--space-s);
    }
    & .event-card__date { grid-row: span 3; display: grid; align-content: start; }
    & .event-card__time { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--color-muted); }
    & .event-card__title { font-size: var(--step-0); font-weight: 600; }
    & :is(.badge, .event-card__meta) { grid-column: 2; }

    @container (width < 26rem) {
      & .event-card__body { grid-template-columns: 1fr; }
      & .event-card__date { grid-row: auto; grid-auto-flow: column; justify-content: start; gap: var(--space-xs); }
      & :is(.badge, .event-card__meta) { grid-column: 1; }
    }
  }

  .badge {
    justify-self: start;
    display: inline-block;
    padding: 0.15em 0.6em;
    border-radius: 999px;
    font-size: var(--step--1);
    font-weight: 700;
    background: var(--color-surface-2);
    color: var(--color-earth);
  }
  .badge--cancelled { background: var(--color-alert); color: var(--color-surface); }

  /* Archive */
  .archive details {
    border-block-end: 1px solid var(--color-border);

    &[open] summary { margin-block-end: var(--space-s); }
  }
  .archive summary {
    padding-block: var(--space-s);
    font-size: var(--step-1);
    font-weight: 700;
    cursor: pointer;
  }
  .archive__count { color: var(--color-muted); font-weight: 400; font-size: var(--step-0); }
  .archive__list { display: grid; gap: var(--space-xs); padding-block-end: var(--space-m); }

  /* Event detail page */
  .event { margin-block-start: var(--space-xl); }

  .event__layout {
    display: grid;
    gap: var(--space-xl);
    margin-block-start: var(--space-l);

    @media (width >= 60rem) {
      grid-template-columns: minmax(0, 1fr) 22rem;
      align-items: start;
    }
  }
  .event__aside {
    display: grid;
    gap: var(--space-m);
    padding: var(--space-m);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow);

    @media (width >= 60rem) {
      position: sticky;
      inset-block-start: var(--space-m);
      grid-row: 1;
      grid-column: 2;
    }
  }
  .event-facts {
    display: grid;
    gap: var(--space-s);

    & dt {
      font-size: var(--step--1);
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      color: var(--color-earth);
    }
    & dd { font-weight: 500; display: grid; justify-items: start; gap: var(--space-2xs); }
    & dd .badge { margin-inline-start: 0; }
  }
  .event-actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); }

  .notice {
    padding: var(--space-s) var(--space-m);
    background: var(--color-surface-2);
    border-inline-start: 4px solid var(--color-earth);
    border-radius: var(--radius);
  }
  .notice--alert { border-color: var(--color-alert); }

  .empty, .hint { color: var(--color-muted); }
  .hint { font-size: var(--step--1); margin-block-start: var(--space-s); overflow-wrap: anywhere; }

  .article-meta { color: var(--color-muted); font-size: var(--step--1); }

  /* Blocks */
  .block-image {
    & img { border-radius: var(--radius); }
    &.block-image--crop img { aspect-ratio: var(--ratio); object-fit: cover; width: 100%; }
  }
  figcaption { font-size: var(--step--1); color: var(--color-muted); margin-block-start: var(--space-xs); }

  .block-gallery ul {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr));
    gap: var(--space-xs);

    & img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); }
  }

  .video-block :is(iframe, video) {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: var(--radius);
  }

  /* Partners */
  .partner-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
    gap: var(--space-l);
  }
  .partner {
    display: grid;
    gap: var(--space-m);
    align-items: start;
  }
  .partner:has(> .partner-logo) { grid-template-columns: 7rem 1fr; }
  .partner-logo {
    display: grid;
    place-items: center;
    min-height: 5rem;
    padding: var(--space-xs);
    background: #fff; /* logos are made for light backgrounds */
    color: #24211c;
    border-radius: var(--radius);
    text-align: center;
    font-weight: 700;
    font-size: var(--step--1);
    text-decoration: none;

    & img { height: 4rem; width: auto; max-width: 100%; object-fit: contain; }
  }

  .logo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr));
    gap: var(--space-s);
    margin-block: var(--space-m);
  }

  /* Footer */
  .site-footer {
    margin-block-start: auto;
    background: var(--color-surface-2);
    color: var(--color-text);
    font-size: var(--step--1);
    padding-block: var(--space-xl) calc(var(--space-xl) + 3rem); /* room for the privacy notice */
  }
  .footer-partners {
    padding-block-end: var(--space-l);
    margin-block-end: var(--space-l);
    border-block-end: 1px solid var(--color-border);
  }
  .footer-main {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
    gap: var(--space-l);

    & ul { display: grid; gap: var(--space-2xs); }
  }
  .footer-logo { height: 2.5rem; width: auto; margin-block-end: var(--space-xs); }

  .eyebrow {
    font-size: var(--step--1);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-earth);
    margin-block-end: var(--space-xs);
  }

  /* Privacy notice (same behaviour as schaufelundgabel.de) */
  .privacy-notice {
    position: fixed;
    inset-inline: 0;
    inset-block-end: 0;
    z-index: 50;
    display: flex;
    align-items: start;
    gap: var(--space-s);
    padding: var(--space-xs) var(--space-s) var(--space-xs) var(--space-m);
    background: var(--color-surface);
    color: var(--color-muted);
    font-size: var(--step--1);
    box-shadow: 0 -4px 16px -4px rgb(0 0 0 / 0.2);

    & p { flex: 1; max-width: 70rem; margin-inline: auto; }
    &.hidden { display: none; }
  }
  #privacy-button {
    flex: none;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    background: var(--color-surface-2);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
  }

  /* Team ("Wer wir sind") */
  .team {
    margin-block-start: var(--space-2xl);
    padding-block: var(--space-2xl);
    background:
      radial-gradient(60rem 30rem at 100% 0%, color-mix(in oklab, var(--color-accent) 10%, transparent), transparent 70%),
      var(--color-surface-2);
  }
  main:has(> .team:last-child) { padding-block-end: 0; }

  .team__header {
    display: grid;
    gap: var(--space-m) var(--space-xl);
    align-items: end;
    margin-block-end: var(--space-xl);

    @media (width >= 60rem) { grid-template-columns: 2fr 3fr; }
    & h2 { font-size: var(--step-3); }
  }
  .team__intro { font-size: var(--step-1); color: var(--color-earth); }

  .team__subtitle {
    display: flex;
    align-items: center;
    gap: var(--space-s);
    margin-block: var(--space-2xl) var(--space-m);
    font-size: var(--step-1);

    &::after { content: ""; flex: 1; height: 1px; background: var(--color-border); }
  }

  /* Principles */
  /* Flex so an incomplete last row is centered (e.g. 5 cards → 3 + 2) */
  .values {
    --columns: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-m);
    padding: 0;

    @media (width >= 40rem) { --columns: 2; }
    @media (width >= 64rem) { --columns: 3; }

    & > li { flex: 0 1 calc((100% - (var(--columns) - 1) * var(--space-m)) / var(--columns)); }
  }
  .value-card {
    display: grid;
    align-content: start;
    gap: var(--space-xs);
    padding: var(--space-l) var(--space-m) var(--space-m);
    background: var(--color-surface);
    box-shadow: var(--shadow);

    & h3 { font-size: var(--step-1); }
    & p { color: var(--color-muted); }
  }
  .value-card__number {
    font-size: var(--step-2);
    font-weight: 800;
    line-height: 1;
    color: color-mix(in oklab, var(--color-accent) 45%, transparent);
    font-variant-numeric: tabular-nums;
  }

  /* People */
  /* Flex instead of grid so an incomplete last row is centered (e.g. 5 people → 3 + 2) */
  .people {
    --columns: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-m);

    @media (width >= 40rem) { --columns: 2; }
    @media (width >= 64rem) { --columns: 3; }

    & > li { flex: 0 1 calc((100% - (var(--columns) - 1) * var(--space-m)) / var(--columns)); }
  }
  .person-card {
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    overflow: hidden;
    box-shadow: var(--shadow);
  }
  .person-card__photo {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    object-position: 50% 25%;
  }
  .person-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    padding: var(--space-m);
  }
  .person-card__role {
    font-size: var(--step--1);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-earth);
  }
  .person-card__name { font-size: var(--step-1); }
  .person-card__text { color: var(--color-muted); font-size: var(--step--1); line-height: 1.55; }
  .person-card .tags { margin-block-start: auto; padding-block-start: var(--space-xs); }
  .person-card__link {
    padding-block-start: var(--space-xs);
    border-block-start: 1px solid var(--color-border);
    font-size: var(--step--1);
    font-weight: 600;
  }

  .tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs);
    font-size: 0.8rem;

    & li {
      padding: 0.15em 0.65em;
      background: color-mix(in oklab, var(--color-accent) 12%, var(--color-surface));
      color: var(--color-accent-strong);
      border-radius: 999px;
      font-weight: 600;
    }
  }

  /* Supporting organizations */
  .org-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
    gap: var(--space-m);
  }
  .org-card {
    display: flex;
    align-items: center;
    gap: var(--space-m);
    padding: var(--space-m) var(--space-l);
    background: var(--color-surface);
    box-shadow: var(--shadow);

    & img { height: 3rem; width: auto; flex: none; }
    & h4 { font-size: var(--step-0); }
    & p { color: var(--color-muted); font-size: var(--step--1); }
    & a { font-size: var(--step--1); font-weight: 600; }
  }

  /* Newsletter block (Mailcoach) */
  .newsletter {
    display: grid;
    gap: var(--space-s);
    padding: var(--space-l);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow);

    & h2 { font-size: var(--step-2); }
  }
  .newsletter__form { display: grid; gap: var(--space-2xs); }
  .newsletter__row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);

    & input[type="email"] { flex: 1 1 16rem; max-width: none; margin: 0; }
    & input[type="submit"] { flex: 0 0 auto; }
  }
  .newsletter__legal { font-size: var(--step--1); color: var(--color-muted); margin-block-start: var(--space-xs); }

  /* Click-to-load video */
  .video-embed { margin: 0; }
  .video-embed__frame {
    position: relative;
    display: grid;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--green-800), var(--soil-700));
    color: #fff;

    & > * { grid-area: 1 / 1; }
    & iframe { width: 100%; height: 100%; border: 0; }
  }
  .video-embed__poster { width: 100%; height: 100%; object-fit: cover; }
  .video-embed__play {
    position: relative;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: var(--space-xs);
    padding: var(--space-m);
    color: #fff;
    text-align: center;
    text-decoration: none;
    background: linear-gradient(to top, rgb(0 0 0 / 0.65), rgb(0 0 0 / 0.1) 60%);

    & svg { color: var(--green-600); transition: transform 0.2s, color 0.2s; filter: drop-shadow(0 4px 12px rgb(0 0 0 / 0.35)); }
    &:hover { color: #fff; }
    &:hover svg, &:focus-visible svg { transform: scale(1.08); color: #dc2626; }
    &:focus-visible { outline-offset: -6px; outline-color: #fff; }
  }
  .video-embed__label { font-weight: 700; font-size: var(--step-0); text-shadow: 0 1px 8px rgb(0 0 0 / 0.5); max-width: 36ch; }
  .video-embed__notice {
    align-self: end;
    position: relative;
    padding: var(--space-2xs) var(--space-s);
    font-size: 0.75rem;
    color: rgb(255 255 255 / 0.85);
    pointer-events: none;

    & a { color: inherit; pointer-events: auto; }
  }
  .video-embed__frame.is-loaded > :not(iframe) { display: none; }

  .video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr));
    gap: var(--space-l);
  }
  .video-card {
    display: grid;
    align-content: start;
    background: var(--color-surface);
    border-radius: var(--radius-l);
    overflow: hidden;
    box-shadow: var(--shadow);

    & .video-embed__frame { border-radius: 0; }
  }
  .video-card__body {
    display: grid;
    gap: var(--space-2xs);
    padding: var(--space-m);

    & h3 { font-size: var(--step-1); }
    & p:not(.video-card__source) { color: var(--color-muted); font-size: var(--step--1); }
  }
  .video-card__source { font-size: var(--step--1); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-earth); }

  /* Press reports */
  .report-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-l);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: border-color 0.2s;

    &:has(a:hover), &:focus-within { border-color: var(--color-accent); }
    & > img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
    & h3 { font-size: var(--step-1); }
    & h3 a { color: var(--color-text); text-decoration: none; }
    & h3 a::after { content: ""; position: absolute; inset: 0; }
    & h3 a:hover { text-decoration: underline; }
  }
  .report-card__body { flex: 1; display: flex; flex-direction: column; gap: var(--space-xs); padding: var(--space-m); }
  .report-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); font-size: var(--step--1); color: var(--color-muted); }
  .report-card__excerpt { color: var(--color-muted); font-size: var(--step--1); }
  .report-card__more { margin-block-start: auto; padding-block-start: var(--space-xs); font-weight: 700; font-size: var(--step--1); color: var(--color-accent); }

  .press-service__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
    gap: var(--space-m);
  }
  .press-box {
    display: grid;
    align-content: start;
    gap: var(--space-s);
    padding: var(--space-l);
    background: var(--color-surface-2);
    border-radius: var(--radius-l);

    & ul { display: grid; gap: var(--space-s); }
  }
  .download-list li { display: grid; }
  .download-list small { color: var(--color-muted); }

  /* History timeline */
  .timeline {
    --dot: 1rem;
    position: relative;
    display: grid;
    gap: var(--space-l);
    padding-inline-start: calc(var(--dot) + var(--space-m));

    &::before {
      content: "";
      position: absolute;
      inset-block: 0.4rem 0;
      inset-inline-start: calc(var(--dot) / 2 - 1px);
      width: 2px;
      background: linear-gradient(var(--color-accent), var(--color-earth));
    }
  }
  .timeline__item {
    position: relative;
    display: grid;
    gap: var(--space-xs);

    &::before {
      content: "";
      position: absolute;
      inset-block-start: 0.35rem;
      inset-inline-start: calc(-1 * (var(--dot) + var(--space-m)));
      width: var(--dot);
      height: var(--dot);
      border-radius: 50%;
      background: var(--color-surface);
      border: 3px solid var(--color-accent);
    }

    @media (width >= 48rem) {
      grid-template-columns: 9rem 1fr;
      gap: var(--space-m);
    }
  }
  .timeline__year { font-size: var(--step-1); font-weight: 800; color: var(--color-earth); line-height: 1.2; }
  .timeline__card {
    container-type: inline-size;
    display: grid;
    gap: var(--space-m);
    padding: var(--space-m);
    background: var(--color-surface);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow);

    & h3 { font-size: var(--step-1); }
    & img { width: 100%; border-radius: var(--radius); aspect-ratio: 3 / 2; object-fit: cover; }
  }
  @container (width >= 34rem) {
    .timeline__card--image { grid-template-columns: 12rem 1fr; align-items: start; }
  }

  /* FAQ */
  .faq { display: grid; gap: var(--space-s); margin-block-start: var(--space-l); }
  .faq__item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow);

    &[open] { border-color: var(--color-accent); }
  }
  .faq__item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-s);
    padding: var(--space-m);
    cursor: pointer;
    list-style: none;

    &::-webkit-details-marker { display: none; }
    &::after {
      content: "+";
      flex: none;
      display: grid;
      place-items: center;
      width: 2rem;
      height: 2rem;
      border-radius: 50%;
      background: var(--color-surface-2);
      color: var(--color-accent-strong);
      font-size: 1.4rem;
      font-weight: 700;
      line-height: 1;
    }
  }
  .faq__item[open] summary::after { content: "–"; }
  .faq__question { font-size: var(--step-1); }
  .faq__answer { padding: 0 var(--space-m) var(--space-m); color: var(--color-text); }

  .pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--space-s);
    margin-block-start: var(--space-xl);
  }
}

/* ------------------------------------------------------------------ */
@layer utilities {
  .visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

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

/* ------------------------------------------------------------------ */
@layer print {
  @media print {
    :root { color-scheme: light; }
    body { font-size: 11pt; background: #fff; color: #000; }

    .site-nav, .skip-link, .hero__image, .hero__wave, .privacy-notice,
    .event-actions, .ics-link, .section__head .button, .footer-partners { display: none !important; }

    .site-header, .hero, .hero::before { background: none !important; color: #000; }
    .hero { padding-block: 0 1rem; min-height: 0 !important; }
    .hero__content { text-shadow: none; text-align: start !important; justify-items: start !important; }

    .event-card, .article-card, .event__aside {
      box-shadow: none;
      break-inside: avoid;
      border-color: #999;
    }
    .event__layout { display: block; }

    .prose a[href^="http"]::after,
    .event-facts a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; overflow-wrap: anywhere; }

    .site-footer { padding-block: 1rem 0; background: none; }
    details { display: block; }
    .video-embed__play, .video-embed__notice { display: none; }
    details > :not(summary) { display: block !important; }
  }
}
