/* ============================================================
   MODAL — Team page
   Page-specific styles. Inherits the about-page layout system
   (.ab-* tokens) and adds the executive list rows + network block.
   ============================================================ */

/* ============================================================
   SECTION 2 — Executives (full-width rows, hairline-separated)
   ============================================================ */
.tm-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tm-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(280px, 36vw, 540px);
  grid-template-rows: auto auto;
  column-gap: clamp(2.5rem, 5vw, 5rem);
  row-gap: clamp(1rem, 2vw, 1.75rem);
  padding: clamp(3rem, 5vw, 5rem) 0;
  border-top: 1px solid rgba(var(--color-ink-rgb), 0.18);
  align-items: start;
}
.tm-row:last-child {
  border-bottom: 1px solid rgba(var(--color-ink-rgb), 0.18);
}

/* Left column rows — index/name/role on top, bio beneath. */
.tm-row-id  { grid-column: 1; grid-row: 1; }
.tm-row-bio { grid-column: 1; grid-row: 2; }

/* Right column — large headshot, sticky at the top of the row so
   it stays beside the exec's name + bio as the user scrolls through
   their copy. Anchored to align-self: start (was center) so the
   photo begins at the top of its grid cell; position: sticky with a
   nav-clearing top offset keeps it pinned until the row ends and
   the next executive's row scrolls in.
   2:3 portrait at 960x1440 source. */
.tm-row-photo {
  grid-column: 2;
  grid-row: 1 / -1;
  align-self: start;
  justify-self: end;
  position: sticky;
  top: clamp(6rem, 9vw, 8rem);
  margin: 0;
  width: 100%;
}
.tm-row-photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
  border-radius: 6px;
  user-select: none;
  -webkit-user-drag: none;
  background: rgba(var(--color-ink-rgb), 0.04);
}

/* Left text — index, name, role */
.tm-row-id {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.tm-index {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--color-green);
  margin: 0 0 0.4rem 0;
}
.tm-name {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(1.8rem, 2.8vw, 2.8rem);
  line-height: 1.1;
  letter-spacing: -0.018em;
  color: var(--color-ink);
  margin: 0;
  max-width: 22ch;
  text-wrap: balance;
}
.tm-role {
  font-family: var(--font-sans);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1rem, 1.15vw, 1.15rem);
  line-height: 1.4;
  color: var(--color-green);
  margin: 0;
}

/* Bio body — multi-paragraph CV-driven copy with rhythmic spacing. */
.tm-row-bio p {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: clamp(1rem, 1.15vw, 1.15rem);
  line-height: 1.65;
  color: rgba(var(--color-ink-rgb), 0.78);
  margin: 0 0 1.1em 0;
  max-width: 64ch;
}
.tm-row-bio > *:last-child {
  margin-bottom: 0;
}

/* Pull-quote — used for Richard's company aim. */
.tm-row-quote {
  font-family: var(--font-sans);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.1rem, 1.3vw, 1.3rem);
  line-height: 1.4;
  color: var(--color-ink);
  margin: 0.5rem 0 1.5rem 0;
  padding: 0 0 0 1.2rem;
  border-left: 2px solid var(--color-green);
  max-width: 56ch;
  text-wrap: balance;
}

/* Contact email — sits at the end of the bio, mono caps for the
   institutional spec-row treatment, and the email itself is a
   plain underlined link in brand green. */
.tm-row-contact {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  margin: 1.5rem 0 0 0 !important;
  padding-top: 1rem;
  border-top: 1px solid rgba(var(--color-ink-rgb), 0.12);
  font-family: var(--font-sans) !important;
  font-size: clamp(0.95rem, 1.05vw, 1.05rem) !important;
  line-height: 1.4 !important;
  color: rgba(var(--color-ink-rgb), 0.78);
  max-width: none !important;
}
.tm-row-contact-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(var(--color-ink-rgb), 0.55);
}
.tm-row-contact a {
  color: var(--color-green);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  transition: opacity .2s ease;
  word-break: break-word;
}
.tm-row-contact a:hover {
  opacity: 0.7;
}

/* ============================================================
   SECTION 3 — The Network
   ============================================================ */
.tm-network-body {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  max-width: 64ch;
}
.tm-network-body p {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: clamp(1.05rem, 1.2vw, 1.2rem);
  line-height: 1.65;
  color: rgba(var(--color-ink-rgb), 0.78);
  margin: 0;
}

/* ============================================================
   Responsive
   - <= 980px: drop to a single column. Order is photo first
     (so the face lands above the copy), then name/role, then bio.
     Photo capped so it doesn't dominate.
   ============================================================ */
@media (max-width: 980px) {
  .tm-row {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    row-gap: 1.5rem;
    padding: 2.5rem 0;
  }
  .tm-row-photo {
    grid-column: 1; grid-row: 1;
    justify-self: start;
    max-width: clamp(260px, 60vw, 380px);
    /* No sticky on mobile — photo sits in its single-column slot. */
    position: static;
  }
  .tm-row-id  { grid-column: 1; grid-row: 2; }
  .tm-row-bio { grid-column: 1; grid-row: 3; }
}

/* ============================================================
   Executive marquee — slow left-to-right portrait flow.
   Five cards, duplicated for a seamless infinite loop. Each card
   is an anchor that jumps to that person's bio row. Pause on hover
   so the user can actually read names; small lift + green accent
   on the hovered card. Sits between the section headline and the
   first exec row.
   ============================================================ */
.tm-banner {
  margin: clamp(2.5rem, 5vw, 4rem) 0 clamp(3rem, 5vw, 4rem);
  position: relative;
  /* Bleed slightly past the .ab-wrap content max so the marquee
     feels like a band crossing the section, not a contained widget. */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}
.tm-banner-mask {
  /* Edge-fade gradient mask: cards fade in from the left, out to
     the right. Tightened to 4%/96% so the visible band is wider —
     four big cards span ~92vw of viewport and the fifth card sits
     entirely inside the right-side fade. */
  overflow: hidden;
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0,
    rgba(0,0,0,1) 4%,
    rgba(0,0,0,1) 96%,
    transparent 100%
  );
          mask-image: linear-gradient(
    90deg,
    transparent 0,
    rgba(0,0,0,1) 4%,
    rgba(0,0,0,1) 96%,
    transparent 100%
  );
}
.tm-banner-track {
  display: flex;
  /* Card sizing is calibrated against this gap + the track padding
     below so that exactly four cards span the visible ~92vw band
     between the mask fades — the fifth card lands inside the
     right-side fade and reads as a hint, not a peek. */
  gap: clamp(1.1rem, 1.5vw, 1.7rem);
  padding: 1.5rem clamp(0.75rem, 2vw, 2rem);
  width: max-content;
  /* Position is driven by js/marquee.js (auto drift + drag-to-scrub).
     touch-action: pan-y lets a vertical swipe still scroll the page
     while horizontal drags scrub the strip. */
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform;
}
.tm-banner-track.is-grabbing { cursor: grabbing; }

/* ---------- Individual card ----------
   Portrait photo + stacked meta. Numeric prefix in mono for
   institutional rhythm. Hover lifts the card, brightens the photo,
   and flips accents to brand green. */
.tm-banner-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto 1fr;
  column-gap: 1rem;
  row-gap: 0;
  flex: 0 0 auto;
  /* Card width is tuned so 4 cards × W + 3 × gap fills ~92vw of
     the viewport — the visible band between the mask fades. On a
     1440px viewport this lands at W ≈ 324px (≈ 22.5vw), which
     gives the four cards real visual weight. The 5th card sits
     past 96vw and disappears into the right-side fade. */
  width: clamp(310px, 22.5vw, 450px);
  padding: 1.3rem 1.4rem 1.45rem;
  border-radius: var(--radius-card);
  background: rgba(var(--color-ink-rgb), 0.025);
  border: 1px solid rgba(var(--color-ink-rgb), 0.10);
  text-decoration: none;
  color: var(--color-ink);
  transition:
    transform 0.35s ease,
    background 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}
.tm-banner-card:hover {
  transform: translateY(-4px);
  background: rgba(var(--color-ink-rgb), 0.04);
  border-color: rgba(22, 112, 74, 0.55);
  /* Brand-green glow + the existing soft drop-shadow. */
  box-shadow:
    0 0 28px rgba(22, 112, 74, 0.32),
    0 14px 36px rgba(0, 0, 0, 0.10);
}
.tm-banner-card:focus-visible {
  outline: 2px solid var(--color-green);
  outline-offset: 4px;
}

.tm-banner-num {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: stretch;
  display: flex;
  align-items: flex-start;
  padding-top: 0.15rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.22em;
  color: rgba(var(--color-ink-rgb), 0.55);
  /* Slim vertical hairline runs the height of the card — the kind of
     editorial detail used elsewhere on the site. Turns green on hover. */
  border-right: 1px solid rgba(var(--color-ink-rgb), 0.18);
  padding-right: 1.15rem;
  transition: color 0.35s ease, border-color 0.35s ease;
}
.tm-banner-card:hover .tm-banner-num {
  color: var(--color-green);
  border-right-color: rgba(22, 112, 74, 0.55);
}

.tm-banner-photo {
  grid-column: 2;
  grid-row: 1;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 10px;
  margin-bottom: 0.9rem;
  background: rgba(var(--color-ink-rgb), 0.05);
}
.tm-banner-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(0.18) contrast(1.02);
  transition: filter 0.45s ease, transform 0.6s ease;
}
.tm-banner-card:hover .tm-banner-photo img {
  filter: grayscale(0) contrast(1.05) brightness(1.04);
  transform: scale(1.03);
}

.tm-banner-meta {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.tm-banner-name {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(1.1rem, 1vw, 1.3rem);
  letter-spacing: -0.012em;
  color: var(--color-ink);
  line-height: 1.2;
  /* Single-line elegance — names are short enough to fit. */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tm-banner-role {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(var(--color-ink-rgb), 0.62);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.2rem;
}

/* Reduce card size on smaller screens so the marquee stays readable. */
@media (max-width: 760px) {
  .tm-banner-card    { width: clamp(190px, 60vw, 230px); padding: 0.8rem 0.85rem 0.9rem; }
  .tm-banner-photo   { aspect-ratio: 1 / 1; }
  .tm-banner-mask {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, rgba(0,0,0,1) 6%, rgba(0,0,0,1) 94%, transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, rgba(0,0,0,1) 6%, rgba(0,0,0,1) 94%, transparent 100%);
  }
}

/* Smooth scrolling for the in-page anchor jumps from the marquee.
   Page-scoped so it doesn't change global behaviour. */
.page-team { scroll-behavior: smooth; }

/* Offset the scroll landing so the sticky nav doesn't cover the
   exec's index/name when the marquee jumps to a row. */
.tm-row[id^="exec-"] {
  scroll-margin-top: clamp(5rem, 8vh, 7rem);
}
