/* ============================================================
   MAINFRAME — TEAM carousel section
   Drop-in section for the public one-pager. Inherits tokens,
   fonts and base styles from ../colors_and_type.css.
   Three look directions toggle via [data-direction] on .team:
     filmstrip · dossier · card
   Plus [data-shape], [data-treatment], [data-credit].
   ============================================================ */

.team {
  position: relative;
  padding: clamp(96px, 14vh, 200px) 0;
  background: var(--bone);
  color: var(--ink);
  overflow: hidden;
}

/* The header + rail share the page gutter; the track bleeds to the edge */
.team-inner {
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ---------- Section head — site vocabulary ------------------ */
.team-head {
  display: flex;
  align-items: baseline;
  gap: 32px;
  margin-bottom: clamp(40px, 6vh, 88px);
  border-bottom: 1.5px solid var(--ink);
  padding-bottom: 24px;
  flex-wrap: wrap;
}
.team-key {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rust);
}
.team-head h2 {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(48px, 7vw, 120px);
  letter-spacing: -0.032em;
  line-height: 0.95;
  margin: 0;
  flex: 1;
  text-wrap: balance;
}
.team-head h2 .serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--rust);
}
.team-sub {
  flex-basis: 100%;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(20px, 2.2vw, 32px);
  line-height: 1.3;
  color: var(--ink-soft);
  margin: 16px 0 0;
  max-width: 34ch;
}
.team-sub em {
  font-family: var(--font-sans);
  font-style: normal;
  font-weight: 700;
  color: var(--ink);
}

/* ============================================================
   TRACK — horizontal, drag/swipe, edge-bleeding
   ============================================================ */
.tm-track {
  display: flex;
  gap: clamp(20px, 2.4vw, 40px);
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px var(--gutter) 4px;
  scroll-behavior: auto;
  cursor: grab;
  /* lock each card into place on scroll/swipe */
  scroll-snap-type: x mandatory;
  scroll-padding-left: var(--gutter);
  /* hide native scrollbar — the rail is the affordance */
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.tm-track::-webkit-scrollbar { display: none; }
.tm-track.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
  user-select: none;
  scroll-snap-type: none;
}

.tm-card {
  flex: 0 0 var(--tm-card-w, clamp(280px, 78vw, 360px));
  width: var(--tm-card-w, clamp(280px, 78vw, 360px));
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
}
/* While dragging, swallow image/text drags */
.tm-track.is-dragging .tm-card * { pointer-events: none; }

/* ---------- Headshot frame ---------------------------------- */
.tm-shot {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;            /* portrait default */
  margin: 0 0 20px;
  background: var(--bone-deep);
  overflow: hidden;
}
.tm-shot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Striped placeholder — replaced by an <img> when content lands */
.tm-ph {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--bone-deep);
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0,
    transparent 9px,
    rgba(26, 24, 20, 0.045) 9px,
    rgba(26, 24, 20, 0.045) 10px
  );
}
.tm-ph-tag {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.tm-ph-dim {
  font-family: var(--font-mono);
  font-size: var(--t-tiny);
  letter-spacing: 0.16em;
  color: var(--ink-faint);
}

/* Corner brackets — film-frame motif */
.tm-shot::before,
.tm-shot::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--rust);
  z-index: 3;
  pointer-events: none;
}
/* Keep marks legible when the shot itself is rust-toned */
.team[data-treatment="duotone"] .tm-shot::before,
.team[data-treatment="duotone"] .tm-shot::after { border-color: var(--bone); }
.tm-shot::before { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }
.tm-shot::after  { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }

/* Index chip — top-right of the shot */
.tm-idx {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  letter-spacing: 0.1em;
  color: var(--bone);
  background: rgba(26, 24, 20, 0.62);
  padding: 4px 7px;
}

/* ---------- Meta block -------------------------------------- */
.tm-meta { display: flex; flex-direction: column; }
.tm-id {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 14px;
}
.tm-name {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(22px, 2vw, 28px);
  letter-spacing: -0.022em;
  line-height: 1.05;
  margin: 0;
  color: var(--ink);
  white-space: nowrap;
}
.tm-post {
  font-size: 0.5em;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
  vertical-align: super;
  margin-left: 0.05em;
}
.team[data-direction="dossier"] .tm-post { color: var(--bone); }
.tm-role {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rust);
  text-align: left;
  white-space: nowrap;
  line-height: 1.4;
}
.tm-bio {
  font-size: var(--t-small);
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0;
  text-wrap: pretty;
}
.tm-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
  flex-wrap: wrap;
}
.tm-loc {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.tm-loc::before {
  content: '';
  width: 5px; height: 5px;
  background: var(--rust);
  border-radius: 50%;
  flex: 0 0 auto;
}
.tm-credit {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: right;
}

/* Bio still pending real copy */
.tm-bio--pending {
  font-style: italic;
  color: var(--ink-faint);
}
.team[data-direction="dossier"] .tm-bio--pending { color: var(--ink-mute); }

/* ============================================================
   RAIL — progress indicator + drag affordance + counter
   ============================================================ */
.tm-rail {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 40px);
  margin-top: clamp(32px, 5vh, 56px);
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.tm-rail-track {
  position: relative;
  flex: 1;
  height: 2px;
  background: var(--hairline-strong);
  cursor: pointer;
}
.tm-rail-thumb {
  position: absolute;
  top: -1px;
  height: 4px;
  min-width: 24px;
  background: var(--rust);
  left: 0;
  width: 30%;
  transition: none;
}
.tm-hint {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.tm-hint::before {
  content: '';
  width: 26px; height: 1px;
  background: var(--ink-faint);
}
.tm-count {
  font-family: var(--font-mono);
  font-size: var(--t-small);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  color: var(--ink);
  white-space: nowrap;
}
.tm-count .tm-count-total { color: var(--ink-faint); }

/* ============================================================
   ENTRANCE — section reveals, cards stagger in
   ============================================================ */
/* Content is always visible — no entrance animation (kept simple + robust). */

/* ============================================================
   SHAPE VARIANTS
   ============================================================ */
.team[data-shape="portrait"]  .tm-shot { aspect-ratio: 3 / 4; }
.team[data-shape="landscape"] .tm-shot { aspect-ratio: 3 / 2; }
.team[data-shape="square"]    .tm-shot { aspect-ratio: 1 / 1; }

/* ============================================================
   TREATMENT — duotone (rust) vs natural
   ============================================================ */
.team[data-treatment="duotone"] .tm-shot img {
  filter: grayscale(1) contrast(1.05);
}
.team[data-treatment="duotone"] .tm-shot::after,
.team[data-treatment="duotone"] .tm-shot::before { /* keep brackets crisp */ }
.team[data-treatment="duotone"] .tm-shot {
  background: var(--rust);
}
.team[data-treatment="duotone"] .tm-ph {
  background-color: var(--rust-soft);
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0, transparent 9px,
    rgba(138, 58, 31, 0.18) 9px, rgba(138, 58, 31, 0.18) 10px
  );
}
.team[data-treatment="duotone"] .tm-ph-tag { color: var(--rust-deep); }
.team[data-treatment="duotone"] .tm-ph-dim { color: var(--rust-deep); opacity: 0.7; }
/* multiply a rust wash over real photos */
.team[data-treatment="duotone"] .tm-shot img {
  mix-blend-mode: multiply;
}

/* ============================================================
   CREDIT toggle
   ============================================================ */
.team[data-credit="off"] .tm-credit { display: none; }
.team[data-credit="off"] .tm-foot { justify-content: flex-start; }

/* ============================================================
   DIRECTION: DOSSIER — ink ground, cinematic crew cards
   ============================================================ */
.team[data-direction="dossier"] {
  background: var(--ink);
  color: var(--bone);
}
.team[data-direction="dossier"] .team-head { border-bottom-color: var(--bone-line); }
.team[data-direction="dossier"] .team-head h2 { color: var(--bone); }
.team[data-direction="dossier"] .team-head h2 .serif { color: var(--ember); }
.team[data-direction="dossier"] .team-key { color: var(--ember); }
.team[data-direction="dossier"] .team-sub { color: var(--bone-line); }
.team[data-direction="dossier"] .team-sub em { color: var(--bone); }

.team[data-direction="dossier"] .tm-shot { background: #25221d; }
.team[data-direction="dossier"] .tm-shot::before,
.team[data-direction="dossier"] .tm-shot::after { border-color: var(--rust); }
.team[data-direction="dossier"] .tm-ph {
  background-color: #25221d;
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0, transparent 9px,
    rgba(242, 235, 221, 0.05) 9px, rgba(242, 235, 221, 0.05) 10px
  );
}
.team[data-direction="dossier"] .tm-ph-tag { color: var(--bone-line); }
.team[data-direction="dossier"] .tm-ph-dim { color: var(--ink-mute); }
.team[data-direction="dossier"] .tm-id { border-bottom-color: var(--hairline-bone, rgba(242,235,221,0.18)); }
.team[data-direction="dossier"] .tm-name { color: var(--bone); }
.team[data-direction="dossier"] .tm-role { color: var(--ember); }
.team[data-direction="dossier"] .tm-bio { color: var(--bone-line); }
.team[data-direction="dossier"] .tm-foot { border-top-color: rgba(242,235,221,0.18); }
.team[data-direction="dossier"] .tm-loc { color: var(--bone-line); }
.team[data-direction="dossier"] .tm-credit { color: var(--ink-faint); }
.team[data-direction="dossier"] .tm-rail-track { background: rgba(242,235,221,0.2); }
.team[data-direction="dossier"] .tm-rail-thumb { background: var(--ember); }
.team[data-direction="dossier"] .tm-hint { color: var(--bone-line); }
.team[data-direction="dossier"] .tm-hint::before { background: var(--ink-mute); }
.team[data-direction="dossier"] .tm-count { color: var(--bone); }
.team[data-direction="dossier"] .tm-count .tm-count-total { color: var(--ink-mute); }
.team[data-direction="dossier"][data-treatment="duotone"] .tm-shot { background: var(--rust); }

/* ============================================================
   DIRECTION: CARD — bordered tiles on bone-soft, hover lift
   ============================================================ */
.team[data-direction="card"] { background: var(--bone-soft); }
.team[data-direction="card"] .tm-card {
  background: var(--bone);
  border: 1px solid var(--hairline-strong);
  padding: clamp(16px, 1.4vw, 22px);
  transition: transform 360ms var(--ease), box-shadow 360ms var(--ease), opacity 760ms var(--ease);
}
.team[data-direction="card"] .tm-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--sh-pop);
}
.team[data-direction="card"] .tm-shot { margin-bottom: 18px; }
.team[data-direction="card"] .tm-foot { border-top: 0; padding-top: 0; margin-top: 14px; }
.team[data-direction="card"] .tm-id { border-bottom-color: var(--bone-line); }

/* When dragging, suppress the hover lift so cards don't jump */
.team[data-direction="card"] .tm-track.is-dragging .tm-card:hover { transform: none; box-shadow: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 720px) {
  .tm-card { --tm-card-w: 80vw; }
  .team-head { gap: 18px; }
  .tm-hint { display: none; }
}
