.cofounder-section,
.leadership-section,
.leadership-profile {
  scroll-margin-top: 120px;
}

.leadership-section > .section-head {
  display: block;
}

.leadership-section > .section-head h2 {
  max-width: 880px;
}

.leadership-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.leadership-grid > .leadership-profile:only-child {
  grid-column: 1 / -1;
}

.leadership-profile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(24px, 3vw, 38px);
  border: 1px solid rgba(220, 239, 255, 0.2);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(220, 239, 255, 0.12);
  -webkit-backdrop-filter: blur(8px) saturate(115%);
  backdrop-filter: blur(8px) saturate(115%);
}

.leadership-profile-heading {
  margin-bottom: 24px;
}

.leadership-profile .leadership-role {
  margin: 0 0 12px;
  color: #c6d8ff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.6;
  text-transform: uppercase;
}

.leadership-profile h3 {
  margin: 0;
  font-size: clamp(26px, 2.6vw, 36px);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.leadership-profile > p {
  font-size: 16px;
}

.leadership-profile > .text-link {
  align-self: flex-start;
  margin-top: auto;
  padding-top: 10px;
}

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

@media (max-width: 700px), (max-width: 950px) and (max-height: 500px) {
  #founder > .section-head,
  .cofounder-section > .section-head,
  .leadership-section > .section-head {
    grid-template-columns: 1fr;
    gap: 0;
    margin-bottom: 24px;
  }

  #founder > .body-split,
  .cofounder-section > .body-split {
    gap: 0;
    padding-bottom: 0;
  }

  #founder .body-split p,
  .cofounder-section .body-split p,
  .leadership-profile > p {
    font-size: 16px;
    line-height: 1.7;
  }

  .leadership-profile {
    padding: 24px 16px;
  }

  .leadership-profile-heading {
    margin-bottom: 20px;
  }

  .about-sections {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
  }

  .about-sections .text-link {
    display: flex;
    align-items: center;
    min-height: 44px;
  }

  .menu {
    min-width: 44px;
    min-height: 44px;
  }

  #story-transcript > summary {
    min-height: 44px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .footer .analytics-settings {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}

/* Respect iPhone display cutouts in portrait and compact landscape layouts. */
@media (max-width: 700px), (max-width: 950px) and (orientation: landscape) {
  .header > .nav-wrap,
  main > .wrap,
  .footer > .wrap {
    width: 92%;
    width: calc(100% - max(4vw, env(safe-area-inset-left)) - max(4vw, env(safe-area-inset-right)));
  }

  .footer {
    padding-bottom: 96px;
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .lead-chat {
    right: 16px;
    bottom: 16px;
    right: calc(16px + env(safe-area-inset-right));
    bottom: calc(16px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 32px);
    max-width: calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right));
  }

  .chat-panel {
    width: min(375px, calc(100vw - 32px));
    width: min(375px, calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)));
    max-height: calc(100vh - 114px);
    max-height: calc(100vh - 114px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-height: calc(100dvh - 114px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .analytics-choice {
    left: 12px;
    bottom: 80px;
    width: calc(100vw - 24px);
    left: calc(12px + env(safe-area-inset-left));
    bottom: calc(80px + env(safe-area-inset-bottom));
    width: calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right));
    max-height: calc(100vh - 104px);
    max-height: calc(100vh - 104px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-height: calc(100dvh - 104px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* A short landscape screen should not lose reading space to a pinned header. */
@media (max-width: 950px) and (max-height: 500px) {
  .header {
    position: relative;
  }

  #founder,
  .who-gallery,
  .cofounder-section,
  .leadership-section,
  .leadership-profile {
    scroll-margin-top: 24px;
  }
}

@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .leadership-profile {
    background: #162347;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media print {
  .leadership-grid {
    display: block;
  }

  .leadership-profile {
    display: block;
    break-inside: avoid;
    margin-bottom: 24px;
    border-color: #596377;
    background: white;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .leadership-profile .leadership-role,
  .leadership-profile h3,
  .leadership-profile > p,
  .leadership-profile > a {
    color: black;
    text-shadow: none;
  }
}
