/* About: boards and panels. Owned by the About service section agent (About page 100x work, 2026-09-24).

   Round 2 (2026-09-24), after the user called round 1 cluttered: its lanes stepped down the page in a
   staircase (each logo and name sat wherever its first post began), and a hover laid a tinted band
   across every lane, dimmed the rest and opened a corner card that repeated the row's own words.
   Now:
   - Every lane opens with the same column, the organisation's logo over its name, so the page reads
     top to bottom. Only the bars step right, which is the one thing that should: time.
   - At rest a lane is its bars, each with its role and years. Nothing else.
   - Hover (or focus) slides one white plate behind the lane, deepens the bar being read and lets its
     one extra fact from his CV surface in the lane's own empty years. Nothing dims, nothing covers,
     nothing moves under the pointer. Along a lane with three posts, the pointer reads them in turn.
   - Below 1200px the lanes stack as blocks, and the extra facts show in full (no hover on touch).

   Logos: official files, drawn as masks in palette ink, tinted film blue when their lane is picked
   (tools/about-100x/service/logos.py). The FDA's name and logo policy bars its logo from private
   sites, so its slot carries the letters FDA set in the site's own type, not the agency's mark. */

.about-service {
  --about-service-ease: cubic-bezier(0.28, 0.11, 0.32, 1);
  --about-service-bar: 10px;
  --about-service-id: 13.5rem;
  --about-service-pad: 1.25rem;
}
.about-service-title { max-width: 22ch; }
.about-service-chart { position: relative; margin-top: clamp(2.5rem, 4.5vw, 3.75rem); }
.about-service-lanes {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---------- a lane: identity, then its run of years ---------- */
.about-service-lane {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--about-service-id) minmax(0, 1fr);
  column-gap: 2.25rem;
  align-items: center;
  padding: 1.35rem var(--about-service-pad);
}
.about-service-id { display: grid; gap: 0.7rem; align-content: center; justify-items: start; }
.about-service-org {
  text-wrap: balance;
  font-size: 1.08rem;
  line-height: 1.22;
  letter-spacing: -0.005em;
  color: var(--ink);
}

/* Logos: a mask of the official file, painted in a palette token, in one slot height */
.about-service-logo {
  --h: 40px;
  display: block;
  height: var(--h);
  aspect-ratio: var(--ar);
  background-color: var(--ink);
  -webkit-mask: var(--logo) left center / contain no-repeat;
  mask: var(--logo) left center / contain no-repeat;
  transition: background-color 0.45s var(--about-service-ease), translate 0.55s var(--about-service-ease);
}
.about-service-logo--aospine { --logo: url(../../images/about/service/ao-spine.svg); --ar: 222.38 / 199.38; --h: 46px; }
.about-service-logo--ao { --logo: url(../../images/about/service/ao-foundation.svg); --ar: 222.38 / 118.88; --h: 30px; }
.about-service-logo--csrs { --logo: url(../../images/about/service/csrs.webp); --ar: 429 / 240; --h: 42px; }
.about-service-logo--wsoa { --logo: url(../../images/about/service/wsoa.webp); --ar: 254 / 47; --h: 24px; }
/* the FDA's slot: its initials in the site's type (not the agency's logo, which it bars) */
.about-service-logo--fda {
  height: auto;
  aspect-ratio: auto;
  background: none;
  -webkit-mask: none;
  mask: none;
  font-family: var(--label);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--ink);
  transition: color 0.45s var(--about-service-ease), translate 0.55s var(--about-service-ease);
}

/* ---------- the track: 29 equal years, 1998 to today, shared by every lane ---------- */
.about-service-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(29, minmax(0, 1fr));
  align-items: start;
}
/* the run of years, drawn faintly under the bars, so the five lanes read as one ruled ledger */
.about-service-track::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--about-service-bar) / 2 - 1px);
  height: 2px;
  border-radius: 2px;
  background: rgba(10, 13, 18, 0.07);
}

/* A post: its bar, then its role and years beneath, in the columns up to the lane's next post.
   The post itself is not positioned, so its note can stand anywhere on the lane's track. */
.about-service-post {
  grid-column: var(--gc);
  grid-row: 1;
  padding-right: 1rem;
  cursor: default;
  outline: none;
}
.about-service-post:focus-visible .about-service-role {
  text-decoration: underline 2px var(--accent);
  text-underline-offset: 4px;
}
.about-service-bar {
  position: relative;
  display: block;
  width: calc((var(--to) - var(--from)) / var(--cols) * 100%);
  height: var(--about-service-bar);
  margin-bottom: 0.8rem;
  border-radius: 3px;
  background: var(--accent);
  transform-origin: left center;
  transition: background-color 0.45s var(--about-service-ease), transform 0.45s var(--about-service-ease),
    box-shadow 0.45s var(--about-service-ease);
}
/* still serving: the bar runs on to today and fades out, it has no end */
.about-service-post--open .about-service-bar {
  -webkit-mask: linear-gradient(90deg, #000 70%, transparent);
  mask: linear-gradient(90deg, #000 70%, transparent);
}
.about-service-role {
  display: block;
  font-family: var(--label);
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.3;
  color: var(--ink);
  transition: color 0.45s var(--about-service-ease);
}
.about-service-years {
  display: block;
  margin-top: 0.1rem;
  font-family: var(--label);
  font-weight: 500;
  font-size: 0.92rem;
  line-height: 1.35;
  color: var(--muted);
  font-variant-numeric: tabular-nums lining-nums;
}

/* ---------- the plate: one white tile that glides to the lane being read ---------- */
.about-service-plate {
  position: absolute;
  z-index: 0;
  left: 0;
  right: 0;
  top: 0;
  height: 0;
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 1px 2px rgba(10, 13, 18, 0.04), 0 10px 28px rgba(10, 13, 18, 0.07);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.5s var(--about-service-ease), height 0.5s var(--about-service-ease),
    opacity 0.35s var(--about-service-ease);
}
.about-service-plate.is-snap { transition: opacity 0.35s var(--about-service-ease); }
.about-service-chart.is-focus .about-service-plate { opacity: 1; }

/* ---------- wide: the chart ---------- */
@media (min-width: 1200px) {
  /* the extra fact stands in the lane's own empty years: after the posts, or before them when the
     lane starts late. It is the only thing a hover adds. */
  .about-service-note {
    position: absolute;
    top: calc(var(--about-service-bar) + 0.8rem);
    left: calc((var(--nf) - 1998) / 29 * 100%);
    width: calc((var(--nt) - var(--nf)) / 29 * 100%);
    max-width: 26rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--ink-2);
    opacity: 0;
    filter: blur(5px);
    translate: 0 4px;
    pointer-events: none;
    transition: opacity 0.3s var(--about-service-ease), filter 0.35s var(--about-service-ease),
      translate 0.45s var(--about-service-ease);
  }
  .about-service-post--lead .about-service-note { left: auto; right: calc((2027 - var(--nt)) / 29 * 100%); text-align: right; }
  .about-service-chart.is-focus .about-service-post.is-active .about-service-note {
    opacity: 1;
    filter: blur(0);
    translate: 0 0;
    transition-delay: 0.08s;
  }
  .about-service-chart.is-focus .about-service-post.is-active .about-service-bar {
    background: var(--accent-deep);
    transform: scaleY(1.3);
    box-shadow: 0 5px 14px rgba(27, 70, 100, 0.28);
  }
  .about-service-chart.is-focus .about-service-post.is-active .about-service-role { color: var(--accent-deep); }
  .about-service-chart.is-focus .is-lane .about-service-logo { background-color: var(--accent); translate: 3px 0; }
  .about-service-chart.is-focus .is-lane .about-service-logo--fda { color: var(--accent); background: none; }
}

/* ---------- entrance, once: the bars grow in the order he took the posts ---------- */
.js .about-service-chart:not(.is-in) .about-service-bar { transform: scaleX(0); }
.js .about-service-chart:not(.is-in) .about-service-lane { opacity: 0; translate: 0 12px; }
.about-service-chart.is-in:not(.is-ready) .about-service-bar {
  transition: transform 1.1s var(--about-service-ease);
  transition-delay: calc((var(--from) - 1998) * 42ms + 180ms);
}
.about-service-chart.is-in:not(.is-ready) .about-service-lane {
  transition: opacity 0.7s var(--about-service-ease), translate 0.8s var(--about-service-ease);
  transition-delay: calc((var(--lf) - 1998) * 42ms);
}

/* ---------- below 1200px: one block per organisation, every fact in view ---------- */
@media (max-width: 1199px) {
  .about-service-lanes { max-width: 46rem; }
  .about-service-plate { display: none; }
  .about-service-lane {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 1rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--line);
  }
  .about-service-lane:last-child { border-bottom: 1px solid var(--line); }
  .about-service-id { grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 0.9rem; }
  .about-service-org { max-width: none; font-size: 1.1rem; }
  .about-service-logo--aospine { --h: 40px; }
  .about-service-logo--ao { --h: 24px; }
  .about-service-logo--csrs { --h: 32px; }
  .about-service-logo--wsoa { --h: 20px; }
  .about-service-logo--fda { font-size: 1.5rem; }
  .about-service-track { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 1.1rem; }
  .about-service-track::before { display: none; }
  .about-service-post {
    grid-column: 1;
    grid-row: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 1rem;
    padding: 0;
  }
  /* each post on its own run of 1998 to today, so where it falls still reads */
  .about-service-post::before {
    content: '';
    grid-row: 2;
    grid-column: 1 / -1;
    align-self: center;
    height: 2px;
    border-radius: 2px;
    background: var(--mist-2);
  }
  .about-service-role { grid-row: 1; grid-column: 1; }
  .about-service-years { grid-row: 1; grid-column: 2; margin: 0; text-align: right; }
  .about-service-bar {
    grid-row: 2;
    grid-column: 1 / -1;
    width: calc((var(--to) - var(--from)) / 29 * 100%);
    height: 8px;
    margin: 0.55rem 0 0.55rem calc((var(--from) - 1998) / 29 * 100%);
  }
  .about-service-note {
    display: block;
    grid-row: 3;
    grid-column: 1 / -1;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--muted);
  }
}

@media (prefers-reduced-motion: reduce) {
  .about-service-lane, .about-service-logo, .about-service-bar, .about-service-role, .about-service-note,
  .about-service-plate { transition: none !important; }
  .js .about-service-chart:not(.is-in) .about-service-bar { transform: none; }
  .js .about-service-chart:not(.is-in) .about-service-lane { opacity: 1; translate: none; }
}
