/* Équipe, round 6 (1 Oct 2026). Lessons from Galadrim's team page, in our
   system: life first (an office mosaic), the founders on a dark band, then the
   leaders as square portraits, every one visible, name and title under the
   photo; each department closes on its own small CTA. The rhythm comes from
   light and dark bands, never from divider lines. Design-system pieces: the
   button (components/button.css), the réalisations type scale. */

.tm { --tm-ink-band: #121417; }

/* ---------- Hero: title on top, then the team at work (one big photograph) ---------- */
.tm-hero { padding-block: clamp(3.5rem, 7vw, 6rem) clamp(4rem, 8vw, 7rem); }
.tm-hero__in { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); align-items: end; }
.tm-hero__title { margin: 0; font-size: clamp(2.75rem, 6vw, 5rem); line-height: 1; letter-spacing: -.045em; font-weight: 500; max-width: 16ch; }
.tm-hero__side { display: grid; gap: 1.75rem; justify-items: start; }
.tm-hero__lede { margin: 0; max-width: 28rem; font-size: 1.125rem; line-height: 1.55; color: var(--rw-muted); }
.tm-mosaic { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: repeat(2, clamp(10rem, 17vw, 16rem)); gap: 8px; margin-top: clamp(2.5rem, 5vw, 4rem); }
.tm-mosaic__item { margin: 0; overflow: hidden; background: #e3e6ea; animation: tm-pane-in 700ms cubic-bezier(.2, .8, .2, 1) both; }
.tm-mosaic__item { position: relative; }
/* Living mosaic, like hero B: each pane holds a few scenes and cross-fades
   between them, one pane at a time (team.js). */
.tm-mosaic__item img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.04); transition: opacity 1000ms ease, transform 6000ms cubic-bezier(.2, .8, .2, 1); }
.tm-mosaic__item img.is-on { opacity: 1; transform: scale(1); }
.tm-mosaic__item--1 { grid-column: 1 / span 6; grid-row: 1 / span 2; }
.tm-mosaic__item--2 { grid-column: 7 / span 4; grid-row: 1; animation-delay: 70ms; }
.tm-mosaic__item--3 { grid-column: 11 / span 2; grid-row: 1; animation-delay: 140ms; }
.tm-mosaic__item--4 { grid-column: 7 / span 2; grid-row: 2; animation-delay: 210ms; }
.tm-mosaic__item--5 { grid-column: 9 / span 2; grid-row: 2; animation-delay: 280ms; }
.tm-mosaic__item--6 { grid-column: 11 / span 2; grid-row: 2; animation-delay: 350ms; }
.tm-mosaic__item--3 img, .tm-mosaic__item--6 img { object-position: 50% 25%; }
.tm-mosaic__kpi { background: var(--brand); color: #fff; }
.tm-mosaic__kpi > div { position: absolute; inset: 0; display: grid; align-content: end; gap: .25rem; padding: 1rem; opacity: 0; transform: translateY(8px); transition: opacity 600ms ease, transform 700ms cubic-bezier(.2, .8, .2, 1); }
.tm-mosaic__kpi > div.is-on { opacity: 1; transform: none; }
.tm-mosaic__kpi b { font-size: clamp(1.75rem, 3vw, 2.75rem); line-height: 1; letter-spacing: -.04em; font-weight: 500; font-variant-numeric: tabular-nums; }
.tm-mosaic__kpi span { font-size: .9375rem; opacity: .9; }
@keyframes tm-pane-in { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { .tm-mosaic__item, .tm-mosaic__item img, .tm-mosaic__kpi > div { animation: none; transition: none; } }

/* ---------- Founders: the dark band, two big cards ---------- */
.tm-founders { position: relative; isolation: isolate; overflow: hidden; background: var(--tm-ink-band); color: #fff; padding-block: clamp(4rem, 8vw, 7rem); }
/* The ASCII field (team.js) sits behind the content. */
.tm-ascii { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
.tm-founders__title { margin: 0 0 clamp(2rem, 4vw, 3.5rem); font-size: clamp(2.25rem, 4.5vw, 3.75rem); line-height: 1; letter-spacing: -.045em; font-weight: 500; }
.tm-founders__pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 2.5vw, 2rem); }
.tm-founder { min-width: 0; }
/* 2 Nov (Hulusi): about 30% shorter than the 4:5 portrait, near square. */
.tm-founder__pic { aspect-ratio: 8 / 7; overflow: hidden; background: #1e2226; margin-bottom: 1.5rem; }
.tm-founder__pic img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; transition: transform 900ms cubic-bezier(.2, .8, .2, 1); }
.tm-founder:hover .tm-founder__pic img { transform: scale(1.03); }
.tm-founder__name { margin: 0; font-size: clamp(2rem, 3.4vw, 3rem); line-height: 1; letter-spacing: -.045em; font-weight: 500; }
.tm-founder__role { margin: .625rem 0 0; font-size: 1.0625rem; line-height: 1.4; color: #d5dae1; }
@media (prefers-reduced-motion: reduce) { .tm-founder__pic img { transition: none; } }

/* ---------- Leaders ---------- */
.tm-leaders { padding-block: clamp(4.5rem, 9vw, 8rem) clamp(2rem, 4vw, 3rem); }
.tm-leaders__title { margin: 0; font-size: clamp(2.25rem, 4.5vw, 3.75rem); line-height: 1; letter-spacing: -.045em; font-weight: 500; }
.tm-leaders__lede { margin: 1rem 0 0; max-width: 32rem; font-size: 1.125rem; line-height: 1.55; color: var(--rw-muted); }
.tm-depts { display: grid; gap: clamp(3.5rem, 7vw, 6rem); margin-top: clamp(3rem, 6vw, 5rem); }
/* A department: its name and its CTA on the left, its leaders on the right. */
.tm-dept { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(1.5rem, 3vw, 3rem); align-items: start; scroll-margin-top: 6rem; }
.tm-dept__side { display: grid; gap: 1.5rem; position: sticky; top: 7rem; }
.tm-dept__title { margin: 0; font-size: clamp(1.375rem, 2vw, 1.75rem); line-height: 1.15; letter-spacing: -.03em; font-weight: 500; }
/* 2 x 2 per department (Hulusi, 1 Oct): bigger portraits; four leaders make one square block. */
.tm-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2.5rem, 4vw, 3.5rem) clamp(1rem, 2vw, 1.5rem); }
/* One grid for the whole leadership team, in the order the founders set (14 Oct 2026). */
.tm-grid--all { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- The leadership wall (14 Oct 2026, round 3) ----------
   The ten heads in the founders' order and one wide dream plate in the
   middle row (Hulusi: one box, two columns, not a box in every row). Twelve
   cells, so 4, 3 and 2 columns all give full rows without reordering. The
   plate runs the full row, down to the last line of the names beside it. */
.tm-wall { --tm-cols: 4; --tm-gx: clamp(1rem, 2vw, 1.5rem); container-type: inline-size; column-gap: var(--tm-gx); align-items: stretch; }
.tm-wall { --tm-sq: calc((100cqw - (var(--tm-cols) - 1) * var(--tm-gx)) / var(--tm-cols)); }
.tm-tile--wide { grid-column: span 2; min-width: 0; display: flex; flex-direction: column; }
.tm-tile--wide .tm-tile__pic { flex: 1 1 auto; min-height: var(--tm-sq); position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; padding: clamp(1.25rem, 2.4cqw, 2rem); overflow: hidden; color: #fff; background-color: #2f7fa6; background-position: center; background-size: cover; background-repeat: no-repeat; /* the plate is set on the tile, so its path resolves against the page */ }
/* A soft veil top and foot, where the text sits; the dream stays clear in the middle. */
.tm-tile--wide .tm-tile__pic::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(rgb(4 20 54 / .45), rgb(4 20 54 / 0) 45%, rgb(4 20 54 / 0) 60%, rgb(4 20 54 / .45)); }
.tm-tile__say { margin: 0; max-width: 22rem; font-size: clamp(1.5rem, 3cqw, 2.25rem); line-height: 1.1; letter-spacing: -.03em; font-weight: 500; text-wrap: balance; }
.tm-tile__foot { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; }
.tm-tile__fig { margin: 0; display: grid; font-size: 1rem; line-height: 1.35; color: rgb(255 255 255 / .86); }
.tm-tile__fig b { font-size: clamp(2.5rem, 5cqw, 4rem); line-height: 1; letter-spacing: -.06em; font-weight: 500; color: #fff; }
.tm-tile__go { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.75rem; padding: 0 1.25rem; background: #fff; color: var(--rw-ink); font-size: 1rem; font-weight: 500; text-decoration: none; transition: background-color 200ms ease; }
.tm-tile__go svg { width: 1.125rem; height: 1.125rem; flex: none; transition: transform 200ms ease; }
.tm-tile__go:hover { background: #eef3ff; }
.tm-tile__go:hover svg, .tm-tile__go:focus-visible svg { transform: translateX(3px); }
.tm-tile__go:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
/* The portraits on the wall share the tile height (their square is the unit). */
.tm-wall .tm-leader__pic { aspect-ratio: auto; height: var(--tm-sq); }
@media (prefers-reduced-motion: reduce) { .tm-tile__go, .tm-tile__go svg { transition: none; } }
.tm-leader { min-width: 0; }
.tm-leader__pic { aspect-ratio: 1 / 1; overflow: hidden; background: #e3e6ea; margin-bottom: .875rem; }
.tm-leader__pic img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 8%; transform: scale(1.45); transform-origin: 50% 8%; transition: transform 700ms cubic-bezier(.2, .8, .2, 1); }
.tm-leader:hover .tm-leader__pic img { transform: scale(1.5); }
/* New square portraits are already framed head-and-shoulders: no zoom. */
.tm-leader__pic img[data-square] { object-position: 50% 50%; transform: none; }
.tm-leader:hover .tm-leader__pic img[data-square] { transform: scale(1.03); }
.tm-leader__none { display: grid; place-items: center; height: 100%; font-size: clamp(2.5rem, 4vw, 3.5rem); font-weight: 500; letter-spacing: -.04em; color: #b4bcc7; }
.tm-leader__name { margin: 0; font-size: clamp(1.25rem, 1.8vw, 1.625rem); line-height: 1.25; letter-spacing: -.02em; font-weight: 500; }
.tm-leader__role { margin: .25rem 0 0; font-size: 1rem; line-height: 1.4; color: var(--rw-muted); }

/* ---------- Behind the leaders ---------- */
.tm-behind { padding-block: clamp(3rem, 6vw, 5rem) clamp(4rem, 8vw, 7rem); }
.tm-behind__line { margin: 0; max-width: 22em; font-size: clamp(1.75rem, 3.2vw, 2.75rem); line-height: 1.12; letter-spacing: -.035em; font-weight: 500; text-wrap: balance; }

html[data-style="industrial"] .tm .btn { border-radius: 0; }

/* ---------- Review switches (localhost only, team.js) ---------- */
.tm-review { position: fixed; right: 1rem; bottom: 1rem; z-index: 90; display: flex; gap: .5rem; }
.tm-review div { display: flex; background: #fff; border: 1px solid #d8dce1; font-size: .875rem; }
.tm-review a { padding: .625rem .875rem; color: #51565e; text-decoration: none; }
.tm-review a[aria-current="true"] { background: #121417; color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .tm-dept { grid-template-columns: 1fr; }
  .tm-dept__side { position: static; grid-template-columns: 1fr auto; align-items: center; }
  .tm-grid--all { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tm-wall { --tm-cols: 3; }
}
@media (max-width: 860px) {
  .tm-hero__in { grid-template-columns: 1fr; }
  .tm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tm-wall { --tm-cols: 2; }
  .tm-hero__in { grid-template-columns: 1fr; align-items: start; }
  .tm-mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto; }
  .tm-mosaic__item { grid-column: auto !important; grid-row: auto !important; aspect-ratio: 4 / 3; }
  .tm-mosaic__item--1 { grid-column: 1 / -1 !important; aspect-ratio: 3 / 2; }
  /* 2 Nov: five small panes left one alone at the end; the last one closes the block full width, like the first. */
  .tm-mosaic__item--6 { grid-column: 1 / -1 !important; aspect-ratio: 3 / 2; }
}
@media (max-width: 560px) {
  .tm-founders__pair { grid-template-columns: 1fr; }
  .tm-review { display: none; }
}
@media (prefers-reduced-motion: reduce) { .tm-leader__pic img { transition: none; } }
