/* Desktop sections: fit the content, not just the section background. */
@media(min-width:701px){
  .projects-section{height:100svh;min-height:0}
  .projects-section .section-topline{flex-shrink:0}
  .projects-section .project-carousel{display:grid;grid-template-rows:minmax(0,1fr) auto;min-height:0}
  .projects-section .project-track{display:grid;grid-auto-flow:column;grid-auto-columns:calc((100% - 20px)/2);grid-template-rows:minmax(0,1fr) auto auto;column-gap:20px;row-gap:0;min-height:0}
  .projects-section .project-card{display:grid;grid-template-rows:subgrid;grid-row:1/-1;min-width:0;min-height:0}
  .projects-section .project-visual{width:100%;height:100%;min-height:0;max-height:none;aspect-ratio:auto}
}
@media(min-width:701px) and (max-height:760px){
  :root{--section-space:clamp(16px,3svh,24px);--body:clamp(16px,2.7svh,18px);--large:clamp(22px,3.8svh,28px);--huge:clamp(42px,8svh,60px)}
  .screen{min-height:0}
  .values .split-intro{grid-template-columns:minmax(110px,1fr) minmax(0,2fr)}
  .values .body-copy{line-height:1.4}
  .values .split-intro .pill{margin-top:12px}
  .values>h2{margin:clamp(12px,2.5svh,20px) 0}
  .value-grid{gap:14px}
  .value-card{--value-title-size:var(--body);--value-padding-top:18px;--value-icon-height:32px;--value-title-gap:12px;padding-inline:16px;border-radius:22px}
  .value-card>img,.value-card>picture>img{width:34px;object-fit:contain;object-position:left}
  .value-card>picture{flex-shrink:0}
  .value-card h3{font-size:var(--body);line-height:1.25}
  .value-card p{padding-top:12px;line-height:1.2}
  .numbers{grid-template-columns:minmax(110px,1fr) minmax(0,2fr)}
  .statistics{grid-template-columns:1fr;gap:14px;margin-top:20px;align-content:space-evenly}
  .statistics dd{margin-bottom:10px}
  .section-topline{margin-bottom:20px}
  .projects-section .project-card h3{font-size:var(--large);margin-top:14px}
  .projects-section .project-meta{margin-top:6px}
  .carousel-controls{margin-top:12px}
  .geography{gap:16px;justify-content:flex-start}
  .center-heading{padding-top:var(--section-space)}
  .center-heading h2{margin:15px auto}
  .help{display:flex;flex-direction:column;align-items:center;gap:20px;padding-bottom:var(--section-space)}
  .help-symbol{position:static;transform:none;min-height:0;flex:1;width:min(240px,45%);height:0;scale:.8;object-fit:contain}
}

@media(min-width:701px) and (max-height:500px){
  :root{--small:14px;--section-space:12px}
  .values .split-intro{grid-template-columns:90px minmax(0,1fr)}
  .values .split-intro .pill{margin-top:8px;min-height:32px;padding-block:7px}
  .values>h2{margin-block:10px}
  .value-card{--value-padding-top:12px;--value-icon-height:26px;--value-title-gap:8px;padding-inline:14px;border-radius:18px}
  .value-card>img,.value-card>picture>img{width:28px}
  .value-card p{padding-top:12px}
  .numbers{grid-template-columns:1fr;gap:16px}
  .numbers-content{flex:1}
  .statistics{grid-template-columns:repeat(3,minmax(0,1fr));margin-top:25px;align-content:center}
}

@media(min-width:701px) and (max-height:400px){
  .values>h2{margin-block:5px}
  .value-card{--value-title-size:var(--small);--value-padding-top:8px;--value-icon-height:20px;--value-title-offset:var(--value-padding-top);display:grid;grid-template-columns:20px minmax(0,1fr);grid-template-rows:auto 1fr;gap:6px;padding-inline:10px}
  .value-card>img,.value-card>picture>img{width:20px}
  .value-card h3{font-size:var(--small);line-height:1.35;margin:0}
  .value-card p{grid-column:1/-1;padding-top:2px;line-height:1.2}
}

@media (min-width:701px) {
  .geography {
    /* Keep the map's vertical position and center the title in the room above it. */
    --map-title-space: calc(var(--large) * 1.35 + clamp(12px, 2vh, 24px));
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) var(--map-title-space) auto minmax(0, 1fr);
    height: 100svh;
    padding-block: 0;
    gap: 0;
  }
  .geography > h2 { grid-area: 1 / 1 / 3; }
  .geography .map-viewport { grid-area: 3 / 1; }
  .world-map {
    width: min(1200px, 100%, calc((100svh - 2 * var(--section-space) - var(--map-title-space)) * 1200 / 708));
    max-height: none;
    margin: 0 auto;
  }
}

/* The card row uses the space left by the intro and heading. */
@media (min-width: 701px) {
  .values {
    --values-heading-gap: clamp(8px, 2.5svh, 28px);
    height: 100svh;
    padding-block: clamp(12px, 3.5svh, 44px);
  }

  .values > h2 {
    margin-block: var(--values-heading-gap);
  }

  .value-grid {
    display: flex;
    flex: 1;
    align-items: flex-start;
    container-type: size;
    min-height: 190px;
    --value-card-gap: 20px;
    gap: var(--value-card-gap);
  }

  .value-grid > .value-card {
    flex: none;
    width: min(calc((100% - 3 * var(--value-card-gap)) / 4), 100cqh);
  }
}

/* Move the cards down only when the row has height to spare. */
@media (min-width: 941px) {
  .values { container-type: inline-size; justify-content: center; }

  .values::before {
    content: "";
    order: 1;
    flex: 1 0 0;
    max-height: calc(120px - var(--values-heading-gap));
  }

  .values > h2 { order: 2; }

  .values .value-grid {
    order: 3;
    flex: 0 1 calc((100cqw - 3 * var(--value-card-gap)) / 4);
  }
}

@media (min-width: 941px) and (min-height: 800px) {
  .values > h2,
  .values .value-grid {
    translate: 0 -15px;
  }
}

@media (701px <= width <= 940px) {
  .values .split-intro {
    grid-template-columns: minmax(90px, 1fr) minmax(0, 3fr);
  }

  .value-grid {
    --value-card-gap: 14px;
  }
}

@media (701px <= width <= 940px) and (min-height: 840px) {
  .value-grid {
    display: grid;
    align-content: start;
    grid-template-columns: repeat(2, minmax(0, 230px));
    min-height: 374px;
  }

  .value-grid > .value-card {
    width: min(100%, calc((100cqh - var(--value-card-gap)) / 2));
    justify-self: center;
  }
}

@media (701px <= width <= 940px) and (max-height: 839px) {
  .value-grid {
    overflow-x: auto;
    scroll-snap-type: x proximity;
    justify-content: safe center;
    scrollbar-width: thin;
    scrollbar-color: #57aabf transparent;
  }

  .value-grid > .value-card {
    width: min(200px, calc(100cqh - 12px));
    scroll-snap-align: start;
  }
}

@media (min-width: 701px) and (max-height: 540px) {
  .values { padding-block: 8px; }
  .values .body-copy { font-size: 14px; line-height: 1.35; }
  .values .split-intro {
    grid-template-columns: max-content repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 14px;
  }
  .values .split-intro > div, .values-intro-copy { display: contents; }
  .values-about-title { grid-area: 1 / 1; }
  .values .split-intro .body-copy { grid-area: 1 / 2; }
  .values .split-intro .values-intro-more { grid-area: 1 / 3; }
  .values .split-intro .pill { grid-area: 1 / 1; justify-self: start; margin-top: calc(var(--large) * 1.35 + 8px); }
  .values-intro-more { margin-top: 0; }
}

@media (min-width: 701px) and (max-height: 400px) {
  .values { --values-heading-gap: 5px; }
  .values .body-copy { font-size: 13px; line-height: 1.3; }
  .value-grid { min-height: 0; }
}
