/* About page (#4631). All type and color come from the design-system tokens in main.css :root. */

#about-page {
  /* Height the sticky section-nav bar takes out of the viewport, which an in-page jump has to clear on top of the
     navbar. Declared here rather than on .about-toc because the sections that read it are the nav's siblings, not
     its descendants. The rail form covers no headings, so it zeroes this out. */
  --about-toc-height: 48px;

  font: var(--text-body-regular);
  color: var(--color-neutral-900);
}

#about-page a:not(.button-ps) {
  color: var(--color-link-200);
}

/* The `hidden` attribute must always win, even over author display rules like the pub cards' grid or the
   show-all button's inline-flex. */
#about-page [hidden] {
  display: none !important;
}

.about-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Alternating full-bleed section bands. */
.about-band {
  padding: 56px 0;
}

/* Jumping to a section must clear the fixed navbar, plus the section nav when it's the bar sitting under it. */
#about-page section[id] {
  scroll-margin-top: calc(var(--navbar-height) + var(--test-banner-height, 0px) + var(--about-toc-height) + 12px);
}

.about-band--tint {
  background-color: var(--color-neutral-100);
}

.about-band h2 {
  font: var(--text-h2-bold);
  color: var(--color-asphalt-500);
  margin: 0 0 12px;
}

.about-band p {
  margin: 0 0 12px;
}

.about-section-intro {
  font: var(--text-subtitle-regular);
  line-height: 1.5;
  max-width: 760px;
}

/* Hero */
.about-hero {
  background-color: var(--color-asphalt-500);
  color: var(--color-neutral-white);
  padding-top: 88px;
}

.about-hero-title {
  font: var(--text-h1-xl-bold);
  font-size: clamp(40px, 7vw, 76px);
  line-height: 1.05;
  max-width: 800px;
  margin: 0 0 28px;
}

.about-hero-accent {
  color: var(--color-label-curb-ramp);
}

.about-hero-subtitle {
  font: var(--text-subtitle-regular);
  line-height: 1.5;
  max-width: 640px;
  margin: 0 0 16px;
  color: var(--color-asphalt-100);
}

.about-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 28px;
}

/* Decorative sidewalk strip along the hero's bottom edge: concrete band + expansion joints, with label-type
   markers "dropped" on it. */
.about-hero-sidewalk {
  display: flex;
  justify-content: space-evenly;
  align-items: flex-start;
  height: 88px;
  margin-top: 56px;
  background-color: var(--color-neutral-500);
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0 216px,
    var(--color-neutral-600) 216px 220px
  );
}

.about-hero-pin {
  width: 52px;
  height: 52px;
  margin-top: -20px;
  filter: drop-shadow(0 2px 4px rgb(0 0 0 / 35%));
}

.about-hero-pin:nth-child(even) {
  margin-top: 12px;
}

/* Stats band */
.about-stats {
  padding: 40px 0;
  border-bottom: 1px solid var(--color-neutral-200);
}

.about-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 28px 20px;
}

.about-stat-number {
  display: block;
  font: var(--text-h3-bold);
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.1;
  color: var(--color-asphalt-500);
}

.about-stat-label {
  display: block;
  margin-top: 6px;
  font: var(--text-small-medium);
  color: var(--color-neutral-700);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* How it works */
.about-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  list-style: none;
  padding: 0;
  margin: 36px 0 20px;
}

.about-step-icon {
  width: 64px;
  height: 64px;
}

.about-step-icon--chip {
  background-color: var(--color-neutral-100);
  border-radius: 50%;
  padding: 15px;
}

/* Column layout so each step's button can sit on a shared baseline (margin-top: auto) despite uneven body copy. */
.about-step {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.about-step h3 {
  font: var(--text-title-bold);
  color: var(--color-asphalt-500);
  margin: 16px 0 8px;
}

.about-step p {
  margin: 0 0 20px;
}

.about-step-cta {
  margin-top: auto;
}

/* Impact story cards */
.about-impact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 32px 0 24px;
}

.about-impact-card {
  background-color: var(--color-neutral-white);
  border: 1px solid var(--color-neutral-200);
  border-radius: 16px;
  padding: 24px;
}

.about-impact-card h3 {
  font: var(--text-subtitle-bold);
  color: var(--color-asphalt-500);
  margin: 0 0 8px;
}

.about-impact-card p {
  margin: 0;
}

/* History timeline */
.about-timeline {
  list-style: none;
  padding: 0;
  margin: 36px 0 0;
  max-width: 820px;
}

.about-timeline li {
  position: relative;
  padding-left: 140px;
  padding-bottom: 32px;
}

.about-timeline li:last-child {
  padding-bottom: 0;
}

/* Connecting line between this entry's dot and the next entry's. */
.about-timeline li:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 113px;
  top: 10px;
  bottom: -10px;
  width: 2px;
  background-color: var(--color-neutral-300);
}

.about-timeline li::after {
  content: "";
  position: absolute;
  left: 108px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--color-label-curb-ramp);
}

.about-timeline-year {
  position: absolute;
  left: 0;
  top: 0;
  width: 92px;
  text-align: right;
  font: var(--text-title-bold);
  color: var(--color-asphalt-500);
}

.about-timeline li p {
  margin: 0;
}

/* Team */
.about-team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 28px 20px;
  list-style: none;
  padding: 0;
  margin: 24px 0 36px;
}

.about-team-member {
  text-align: center;
}

.about-team-photo {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  object-fit: cover;
}

.about-team-name {
  display: block;
  margin-top: 12px;
  font: var(--text-body-bold);
}

#about-page .about-team-member a {
  color: var(--color-neutral-900);
  text-decoration: none;
}

#about-page .about-team-member a:hover .about-team-name,
#about-page .about-team-member a:focus-visible .about-team-name {
  color: var(--color-link-200);
  text-decoration: underline;
}

/* Project role, position, and institution each get their own line under the name. */
.about-team-role,
.about-team-title,
.about-team-affiliation {
  display: block;
  font: var(--text-small-regular);
  color: var(--color-neutral-700);
}

/* The name lives inside the card's link, so the first span the card itself owns is the first of these lines —
   whichever one that is, since a member's row may supply any subset of the three. */
.about-team-member > span:first-of-type {
  margin-top: 2px;
}

#about-team-live h3 {
  font: var(--text-h3-bold);
  color: var(--color-asphalt-500);
  margin: 28px 0 8px;
}

/* Past leadership: wider cards (≤4 per row at full width) so each has room for a contribution blurb. */
.about-team-grid--past {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.about-team-blurb {
  display: block;
  margin-top: 8px;
  font: var(--text-small-regular);
  color: var(--color-neutral-700);
  text-align: left;
}

.about-team-contributors-intro {
  max-width: 760px;
}

/* All-contributor roll call: compact name columns, like a paper's acknowledgments section. Each entry is a name plus
   a credential ("Marcus Amalachandran, High School Student, HMJHS"), so cap the column count by a minimum width and
   let narrow viewports drop to fewer columns rather than squeezing every entry onto three lines. */
.about-team-all {
  columns: 260px 3;
  column-gap: 48px;
  list-style: none;
  padding: 0;
  margin: 16px 0 24px;
  font: var(--text-small-regular);
}

.about-team-all li {
  break-inside: avoid;
  margin-bottom: 8px;
}

/* The name carries the weight so a reader can scan for a person past the lighter credential that trails it. */
.about-team-all a {
  font: var(--text-small-bold);
}

.about-team-credential {
  color: var(--color-neutral-700);
  white-space: nowrap;
}

.about-team-contributors {
  font: var(--text-small-regular);
  color: var(--color-neutral-700);
}

/* Publications: compact divider-separated rows in the style of the Makeability Lab publications list. */
.about-pubs-list {
  display: grid;
  margin: 24px 0 20px;
  border-bottom: 1px solid var(--color-neutral-200);
}

/* Out-specifies `.about-band p`, whose `margin: 0 0 12px` shorthand would otherwise zero this top margin. */
#about-page .about-pubs-fallback {
  margin-top: 28px;
}

.about-pub {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 20px;
  align-items: start;
  padding: 18px 0;
  border-top: 1px solid var(--color-neutral-200);
}

/* The text column owns its own vertical rhythm via one gap, so the rows inside carry no margins of their own. This
   has to out-specify `.about-band p`, whose 12px bottom margin would otherwise stack on top of the gap. */
.about-pub > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.about-pub > div p {
  margin: 0;
}

.about-pub-thumb {
  display: block;
  width: 112px;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--color-neutral-300);
  box-shadow: 0 2px 6px rgb(0 0 0 / 12%);
}

.about-pub h3 {
  font: var(--text-body-bold);
  line-height: 1.3;
  margin: 0;
}

#about-page .about-pub h3 a {
  color: var(--color-neutral-900);
}

#about-page .about-pub h3 a:hover,
#about-page .about-pub h3 a:focus-visible {
  color: var(--color-link-200);
}

.about-pub-authors,
.about-pub-venue {
  font: var(--text-small-regular);
  line-height: 1.4;
  color: var(--color-neutral-700);
  margin: 0;
}

.about-pub-venue {
  font-style: italic;
}

.about-pub-award {
  font: var(--text-small-bold);
  color: var(--color-orange-600);
}

.about-pub > div .about-pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

/* Link pills, matching the Makeability Lab publication list. */
#about-page .about-pub-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border: 1px solid var(--color-neutral-200);
  border-radius: 999px;
  background-color: var(--color-neutral-white);
  font: var(--text-small-medium);
  color: var(--color-neutral-900);
  text-decoration: none;
}

#about-page .about-pub-link:hover,
#about-page .about-pub-link:focus-visible {
  background-color: var(--color-neutral-100);
  color: var(--color-link-200);
}

.about-pub-link-icon {
  width: 12px;
  height: 12px;
}

/* "How to cite": the formatted citation and its BibTeX, each with a copy button. */
.about-cite {
  margin-top: 36px;
  max-width: 860px;
}

.about-cite h3 {
  font: var(--text-title-bold);
  color: var(--color-asphalt-500);
  margin: 0 0 12px;
}

.about-cite-block + .about-cite-block {
  margin-top: 16px;
}

.about-cite-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.about-cite-label {
  font: var(--text-small-medium);
  color: var(--color-neutral-700);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.about-cite-copy {
  padding: 2px 12px;
  border: 1px solid var(--color-neutral-300);
  border-radius: 999px;
  background-color: var(--color-neutral-white);
  font: var(--text-small-medium);
  color: var(--color-neutral-900);
  cursor: pointer;
}

.about-cite-copy:hover,
.about-cite-copy:focus-visible {
  background-color: var(--color-neutral-100);
  color: var(--color-link-200);
}

#about-page .about-cite-text,
.about-cite-code {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--color-neutral-200);
  border-radius: 8px;
  background-color: var(--color-neutral-white);
  font: var(--text-small-regular);
  line-height: 1.5;
}

.about-cite-code {
  overflow-x: auto;
  font-family: var(--font-mono);
  white-space: pre;
}

/* Funders */
.about-grants {
  list-style: none;
  padding: 0;
  margin: 16px 0 8px;
  display: grid;
  gap: 8px;
  max-width: 820px;
}

/* Closing CTA band */
.about-cta-band {
  background-color: var(--color-asphalt-500);
  color: var(--color-neutral-white);
  padding: 64px 0;
  text-align: center;
}

.about-cta-band h2 {
  font: var(--text-h2-bold);
  color: var(--color-neutral-white);
  margin: 0 0 8px;
}

.about-cta-band .about-cta-row {
  justify-content: center;
  margin: 24px 0 28px;
}

.about-contact {
  max-width: 640px;
  margin: 0 auto;
  color: var(--color-asphalt-100);
}

#about-page .about-contact a {
  color: var(--color-banana-400);
}

/* In-page section nav.
   Two forms of the same list. Below the rail breakpoint it's a chip bar that sticks under the navbar once the hero
   scrolls past — `sticky` rather than `fixed` so it only occupies the viewport for the part of the page it indexes,
   and so it can't cover the hero. */
.about-toc {
  position: sticky;
  top: calc(var(--navbar-height) + var(--test-banner-height, 0px));
  z-index: 2;
  background-color: var(--color-neutral-white);
  border-bottom: 1px solid var(--color-neutral-200);
}

.about-toc-list {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0 auto;
  padding: 6px 20px;
  max-width: 1100px;
  overflow-x: auto;

  /* The bar is one line that scrolls sideways; a wrapped chip would push the page content down as sections change. */
  white-space: nowrap;
  scrollbar-width: none;
}

.about-toc-list::-webkit-scrollbar {
  display: none;
}

#about-page .about-toc-link {
  display: block;
  padding: 6px 12px;
  border-radius: 999px;
  font: var(--text-small-regular);
  color: var(--color-neutral-700);
  text-decoration: none;
}

#about-page .about-toc-link:hover {
  background-color: var(--color-neutral-100);
  color: var(--color-link-200);
}

#about-page .about-toc-link--active {
  background-color: var(--color-neutral-100);
  color: var(--color-asphalt-500);
  font: var(--text-small-bold);
}

/* Rail form: only once the gutter beside the 1100px content column can hold it without crowding the text. */
@media (width >= 1440px) {
  #about-page {
    --about-toc-height: 0px;
  }

  .about-toc {
    position: fixed;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    width: 150px;
    background-color: transparent;
    border-bottom: 0;
    transition: opacity 0.2s ease, visibility 0.2s;
  }

  /* Floating over the hero, the closing band, or the footer, the rail has no section to point at and its link color
     is unreadable against those dark full-bleed backgrounds. `visibility` as well as `opacity` so it also leaves the
     tab order while it's gone. */
  .about-toc--out-of-range {
    opacity: 0;
    visibility: hidden;
  }

  .about-toc-list {
    display: grid;
    gap: 2px;
    padding: 0;
    overflow-x: visible;
    white-space: normal;
  }

  /* A rail entry gets the room to wrap, so the heading can be read in full rather than truncated to fit a chip. */
  #about-page .about-toc-link {
    padding: 4px 10px;
    border-left: 2px solid var(--color-neutral-200);
    border-radius: 0;
  }

  #about-page .about-toc-link--active {
    background-color: transparent;
    border-left-color: var(--color-asphalt-500);
  }
}

/* A jump between sections of one long page reads as a loss of place when it's instant, so animate it — scoped to this
   page's document element, since scroll-behavior only takes effect on the element that actually scrolls. */
@media (prefers-reduced-motion: no-preference) {
  :root:has(#about-page) {
    scroll-behavior: smooth;
  }
}

/* Deployment map */
.about-map {
  height: min(60vh, 480px);
  margin: 24px 0 20px;
  border-radius: 8px;
  overflow: hidden;
  background-color: var(--color-neutral-100);
}

#about-page .about-where-links {
  margin: 0;
}

/* Responsive stacking */
@media (width <= 1000px) {
  .about-impact-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (width <= 760px) {
  .about-steps {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .about-impact-grid {
    grid-template-columns: 1fr;
  }

  .about-team-all {
    columns: 200px 2;
  }

  .about-timeline li {
    padding-left: 36px;
  }

  .about-timeline li:not(:last-child)::before {
    left: 9px;
  }

  .about-timeline li::after {
    left: 4px;
  }

  .about-timeline-year {
    position: static;
    display: block;
    width: auto;
    text-align: left;
    margin-bottom: 6px;
  }

  .about-pub {
    grid-template-columns: 72px 1fr;
    gap: 14px;
  }

  .about-pub-thumb {
    width: 72px;
  }
}
