/* =========================================================
   Meet the Team — page styles (global tokens live in style.css)
   ========================================================= */

/* ---------- Founder ---------- */
.tm-founder .prose .eyebrow { margin-bottom: 14px; }

/* ---------- Team grid ---------- */
.tm-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(48px, 6vw, 80px) clamp(24px, 3.4vw, 44px);
  align-items: start;
}
/* editorial rhythm: the middle column sits a step lower */
@media (min-width: 901px) { .tm:nth-child(3n+2) { margin-top: clamp(48px, 6vw, 88px); } }

.tm { position: relative; display: flex; flex-direction: column; }
.tm__photo { position: relative; aspect-ratio: 3 / 4; }
/* the site's offset frame block, sliding out from behind the photo on hover */
.tm__photo::before {
  content: ""; position: absolute; inset: 0; background: var(--sand);
  transform: translate(0, 0); transition: transform .7s var(--ease-out);
}
.tm:nth-child(even) .tm__photo::before { background: var(--teal); }
.tm:hover .tm__photo::before, .tm:focus-within .tm__photo::before { transform: translate(14px, 14px); }
.tm__photo picture { position: relative; display: block; height: 100%; overflow: hidden; }
.tm__photo img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 30%;
  transition: transform 1.2s var(--ease-out);
}
.tm:hover .tm__photo img { transform: scale(1.04); }
.tm__badge {
  position: absolute; left: -10px; bottom: 22px; z-index: 1;
  background: var(--teal-deep); color: var(--cream-2); padding: 8px 14px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
}
.tm__role { margin-top: 26px; font-size: 11px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--teal); }
.tm__name { margin-top: 8px; font-family: var(--font-title); font-weight: 300; font-size: clamp(28px, 2.6vw, 34px); line-height: 1.08; color: var(--ink); }
.tm__teaser { margin-top: 12px; font-size: 14.5px; line-height: 1.6; color: var(--ink-soft); }
.tm__off { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--gold-soft); font-size: 13px; color: var(--ink-soft); }
.tm__off > span:first-child { margin-right: 8px; font-size: 10.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-deep); }
.tm__more {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; margin-top: 18px; padding-bottom: 4px;
  font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink);
  border-bottom: 1px solid var(--ink);
}
/* the whole card opens the bio */
.tm__more::after { content: ""; position: absolute; inset: 0; z-index: 2; }
.tm__more:focus-visible { outline: none; }
.tm:has(.tm__more:focus-visible) { outline: 2px solid var(--teal); outline-offset: 10px; }
.tm:hover .tm__more { color: var(--teal); border-color: var(--teal); }
.tm:hover .tm__more .arrow { animation: nudge .6s var(--ease-out); }

/* reveal on scroll: team.js adds .is-in */
.js .tm { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }
.js .tm.is-in { opacity: 1; transform: none; }

/* ---------- Full bios ---------- */
/* without JavaScript the bios read inline below the grid; with it they live in the dialog */
.js .tm-bios { display: none; }
.tm-bios { margin-top: clamp(56px, 7vw, 96px); display: grid; gap: 40px; max-width: 760px; }
.tm-bio { padding-top: 28px; border-top: 1px solid var(--gold-soft); }
.tm-bio__role { font-size: 11px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--teal); }
.tm-bio__name { margin: 6px 0 14px; font-family: var(--font-title); font-weight: 300; font-size: 30px; }
.tm-bio p:not([class]) { margin-top: 12px; line-height: 1.75; color: var(--ink-soft); }

/* ---------- Bio dialog ---------- */
.tm-dialog {
  width: min(1060px, calc(100% - 2 * var(--gutter))); max-width: none; max-height: min(88vh, 760px);
  margin: auto; padding: 0; border: 0; background: var(--cream); color: var(--ink); overflow: hidden;
  box-shadow: 0 40px 100px -30px rgba(13, 20, 24, .55);
}
.tm-dialog::backdrop { background: rgba(13, 20, 24, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.tm-dialog[open] { animation: tmIn .6s var(--ease-out); }
.tm-dialog[open]::backdrop { animation: tmFade .4s ease-out; }
@keyframes tmIn { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes tmFade { from { opacity: 0; } }

.tm-dialog__inner { position: relative; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); height: min(88vh, 760px); }
.tm-dialog__photo { position: relative; background: var(--sand); }
.tm-dialog__photo picture, .tm-dialog__photo img { display: block; width: 100%; height: 100%; }
.tm-dialog__photo img { object-fit: cover; object-position: center 25%; }
.tm-dialog__copy { overflow-y: auto; overscroll-behavior: contain; padding: clamp(36px, 5vw, 64px) clamp(28px, 4.4vw, 60px) 0; display: flex; flex-direction: column; }
.tm-dialog__role { font-size: 11px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--teal); }
.tm-dialog__name { margin: 10px 0 22px; font-family: var(--font-title); font-weight: 300; font-size: clamp(34px, 4vw, 52px); line-height: 1.04; }
.tm-dialog__bio p { font-size: 15.5px; line-height: 1.75; color: var(--ink-soft); }
.tm-dialog__bio p + p { margin-top: 14px; }
.tm-dialog__bio p:first-child { font-size: 17px; color: var(--ink); }
.tm-dialog__nav {
  position: sticky; bottom: 0; margin-top: auto; padding: 22px 0 26px; background: var(--cream);
  display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--gold-soft);
}
.tm-dialog__bio { padding-bottom: 32px; }
.tm-dialog__step {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink);
  transition: color .3s;
}
.tm-dialog__step:hover { color: var(--teal); }
.tm-dialog__step .arrow--back { transform: scaleX(-1); }
.tm-dialog__close {
  position: absolute; top: 16px; right: 16px; z-index: 2; width: 44px; height: 44px; border-radius: 50%;
  background: var(--cream-2); box-shadow: 0 4px 14px rgba(31, 31, 31, .12); transition: background .3s, transform .3s;
}
.tm-dialog__close:hover { background: var(--white); transform: rotate(90deg); }
.tm-dialog__close span, .tm-dialog__close span::after {
  position: absolute; left: 50%; top: 50%; width: 16px; height: 1.5px; background: var(--ink);
  transform: translate(-50%, -50%) rotate(45deg);
}
.tm-dialog__close span::after { content: ""; transform: translate(-50%, -50%) rotate(90deg); }
.tm-dialog__close:focus-visible, .tm-dialog__step:focus-visible { outline: 2px solid var(--teal); outline-offset: 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .tm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .tm-dialog { width: 100%; max-height: 100dvh; height: 100dvh; margin: 0; }
  .tm-dialog__inner { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: 100dvh; }
  .tm-dialog__photo { height: 38dvh; }
  .tm-dialog__copy { padding-top: 28px; }
}
@media (max-width: 560px) {
  .tm-grid { grid-template-columns: 1fr; gap: 56px; }
  .tm__badge { left: 0; }
  .tm:hover .tm__photo::before, .tm:focus-within .tm__photo::before { transform: translate(10px, 10px); }
}
@media (prefers-reduced-motion: reduce) {
  .js .tm { opacity: 1; transform: none; }
  .tm-dialog[open], .tm-dialog[open]::backdrop { animation: none; }
  .tm__photo img, .tm__photo::before { transition: none; }
}
