/* ==========================================================================
   TRACE — Who we are (explorer cards + one profile viewer)
   Self-contained: needs only lmu-tokens.css and base.css (both loaded by
   base.html). It does not depend on css/home.css.

   --trace-team-board is declared in who_we_are.html because it needs the
   {% static %} tag; everything else lives here.
   ========================================================================== */

:root {
  /* Page tokens. Colours come from lmu-tokens.css / base.css where they exist. */
  --trace-team-board-base: #0a3b23;   /* derived: board green shown behind / before the image */
  --trace-team-board-shade: 6 40 23;  /* derived: rgb of the overlay that keeps text on the board legible */
  --trace-team-duo-light: var(--lmu-green-20);         /* duotone highlights */
  --trace-team-duo-dark: var(--trace-team-board-base); /* duotone shadows: the board green */
  --trace-team-gutter: clamp(1rem, 4vw, 2.5rem);
  --trace-team-fade: clamp(10rem, 24vh, 14rem);  /* length of the board-to-white fade */
  --trace-team-radius: .25rem;
  --trace-team-ease: cubic-bezier(.2, .7, .2, 1);
}

.trace-team-container {
  box-sizing: border-box;
  width: 100%;
  /* Keeps a three-column card near 300 px wide: the size of the current photo files. */
  max-width: 64rem;
  margin-inline: auto;
  padding-inline: var(--trace-team-gutter);
}

/* ---------- Hero: chalkboard with a long, soft fade into the page ---------- */

.trace-team-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background-color: var(--trace-team-board-base);
  color: var(--lmu-white);
}

.trace-team-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    /* A soft shade behind the centred copy keeps it legible over the chalk drawings. */
    radial-gradient(ellipse 62rem 24rem at 50% 34%, rgb(var(--trace-team-board-shade) / .38), transparent 70%),
    linear-gradient(rgb(var(--trace-team-board-shade) / .12), rgb(var(--trace-team-board-shade) / .12)),
    var(--trace-team-board, none) center top / cover no-repeat;
}

/* The fade covers only the bottom --trace-team-fade of the hero: the empty
   space above the masthead and the masthead itself, never the white text.
   Its stops are eased and pass through a faint LMU green wash, so the board
   does not turn grey on its way to white. */
.trace-team-hero::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  z-index: -1;
  height: var(--trace-team-fade);
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgb(240 247 243 / 0) 0%,
    rgb(240 247 243 / .07) 14%,
    rgb(240 247 243 / .2) 28%,
    rgb(241 248 244 / .4) 42%,
    rgb(243 249 246 / .62) 56%,
    rgb(247 251 249 / .82) 70%,
    rgb(251 253 252 / .95) 85%,
    var(--lmu-white) 100%
  );
}

/* Centred copy: the board's busiest drawings sit along its left and right edges. */
.trace-team-hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 56rem;
  margin-inline: auto;
  padding-top: clamp(2.25rem, 6vh, 4rem);
  text-align: center;
}

.trace-team-eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  margin: 0 0 1.1rem;
  white-space: nowrap; /* some browsers otherwise size this label to its narrowest word */
  color: var(--lmu-green-20);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.trace-team-eyebrow::before,
.trace-team-eyebrow::after {
  content: "";
  flex: 0 0 1.75rem;
  height: 2px;
  background: var(--lmu-green-60);
}

.trace-team-hero h1 {
  margin: 0;
  color: var(--lmu-white);
  font-size: clamp(2.3rem, 1.5rem + 3vw, 3.5rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -.03em;
  overflow-wrap: anywhere;
  text-wrap: balance;
  text-shadow: 0 2px 14px rgb(0 25 14 / .25);
}

.trace-team-accent {
  color: var(--lmu-green-20);
}

.trace-team-lead {
  max-width: 48rem;
  margin: 1.35rem auto 0;
  color: rgb(255 255 255 / .88);
  font-size: clamp(1rem, .95rem + .3vw, 1.125rem);
  line-height: 1.6;
  text-wrap: balance;
  text-shadow: 0 1px 8px rgb(0 25 14 / .3);
}

.trace-team-lead strong {
  color: var(--lmu-white);
  font-weight: 600;
}

.trace-team-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .75rem;
  margin-top: 2rem;
}

.trace-team-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 2.75rem;
  padding: 0 1.15rem;
  border: 1px solid transparent;
  border-radius: .65rem;
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.trace-team-btn-light {
  background: var(--lmu-white);
  color: var(--trace-primary-ink);
  box-shadow: 0 10px 28px rgb(0 45 25 / .25);
}

.trace-team-btn-light:hover {
  background: var(--trace-primary-soft);
  color: var(--trace-primary-hover);
}

.trace-team-btn-ghost {
  border-color: rgb(255 255 255 / .45);
  background: rgb(255 255 255 / .06);
  color: var(--lmu-white);
}

.trace-team-btn-ghost:hover {
  background: rgb(255 255 255 / .14);
  color: var(--lmu-white);
}

.trace-team-hero .trace-team-btn:focus-visible {
  outline: 3px solid var(--lmu-white);
  outline-offset: 3px;
}

/* The masthead's top margin leaves exactly the fade length minus its own
   height, so the fade starts below the actions on every screen size. */
.trace-team-masthead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-top: calc(var(--trace-team-fade) - 5.5rem);
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--trace-border-strong);
  color: var(--text-main);
  scroll-margin-top: 1.5rem;
}

.trace-team-masthead h2 {
  margin: 0;
  color: var(--text-main);
  font-size: clamp(1.35rem, 1.2rem + .5vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -.02em;
}

.trace-team-masthead-intro {
  margin: .35rem 0 0;
  color: var(--text-muted);
  font-size: .95rem;
  line-height: 1.5;
}

.trace-team-count {
  flex-shrink: 0;
  margin: 0;
  color: var(--text-muted);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .04em;
}

.trace-team-count[hidden] {
  display: none;
}

/* ---------- Team section and grid ---------- */

.trace-team-section {
  padding: 2.5rem 0 5rem;
}

/* The grid responds to the width it actually has (the 280 px sidebar
   included), not to the viewport. */
.trace-team-section .trace-team-container {
  container: trace-team / inline-size;
}

.trace-team-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: 1.75rem;
  row-gap: 2.75rem;
}

@container trace-team (min-width: 36rem) {
  .trace-team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container trace-team (min-width: 50rem) {
  .trace-team-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@supports not (container-type: inline-size) {
  @media (min-width: 640px) {
    .trace-team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @media (min-width: 1200px) {
    .trace-team-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  }
}

/* ---------- Card ---------- */

.trace-team-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  container-type: inline-size;
}

.trace-team-portrait {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  /* Public team photos use one consistent portrait frame. Uploaded images are
     normalized to 4:5; temporary legacy landscape photos are cropped here. */
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--trace-team-radius);
  background-color: var(--trace-team-board-base);
}

/* No photo: chalk initials on the board. */
.trace-team-portrait::before,
.trace-team-profile-portrait::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg, rgb(var(--trace-team-board-shade) / .55), rgb(var(--trace-team-board-shade) / .8)),
    var(--trace-team-board, none) center / cover no-repeat;
}

.trace-team-initials {
  position: relative;
  color: var(--lmu-green-20);
  font-size: 4rem;
  font-size: clamp(3rem, 22cqi, 6rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: .04em;
  transition: color .3s ease;
}

/* Photo: shown as an LMU-green duotone at rest, in colour on hover and
   keyboard focus. The frame stays invisible until who-we-are.js confirms
   that the image loaded (.has-photo), so a missing file shows the initials. */
.trace-team-photo-frame {
  position: absolute;
  inset: 0;
  z-index: 1;
  isolation: isolate;
  opacity: 0;
  background-color: var(--trace-team-duo-light);
  transition: opacity .3s ease, background-color .45s ease;
}

.trace-team-portrait.has-photo .trace-team-photo-frame {
  opacity: 1;
}

.trace-team-photo-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--trace-team-duo-dark);
  mix-blend-mode: lighten;
  pointer-events: none;
  transition: opacity .45s ease;
}

.trace-team-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: grayscale(1) contrast(1.1);
  mix-blend-mode: multiply;
  transition: filter .45s ease;
}

.trace-team-photo[hidden] {
  display: none;
}

.trace-team-bar {
  display: block;
  height: 3px;
  background: var(--trace-primary);
  transform: scaleX(.16);
  transform-origin: left center;
  transition: transform .35s var(--trace-team-ease);
}

/* Cards in a row share a height, so "Read profile" lines up across the row. */
.trace-team-card-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  padding-top: 1rem;
}

/* Number and role stay on one line; a long role wraps beside the number. */
.trace-team-kicker {
  display: flex;
  gap: .65rem;
  margin: 0;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.trace-team-index {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.trace-team-role {
  min-width: 0;
  color: var(--trace-primary-ink);
  overflow-wrap: anywhere;
}

.trace-team-name {
  margin: .5rem 0 0;
  color: var(--text-main);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.015em;
  overflow-wrap: anywhere;
}

.trace-team-teaser {
  margin: .6rem 0 0;
  color: var(--text-muted);
  font-size: .875rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.trace-team-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-height: 2.75rem;
  margin-top: auto;
  padding-top: .5rem;
}

.trace-team-open {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--trace-primary-ink);
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
}

.trace-team-open:hover {
  color: var(--trace-primary-hover);
}

/* The link stretches over the whole card (the Bootstrap stretched-link
   idea), so the card is one tab stop and one click target. */
.trace-team-open::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: var(--trace-team-radius);
}

.trace-team-card .trace-team-open:focus-visible {
  outline: none;
}

.trace-team-card .trace-team-open:focus-visible::after {
  outline: 3px solid var(--trace-primary);
  outline-offset: 6px;
}

.trace-team-open i {
  transition: transform .25s ease;
}

.trace-team-hints {
  display: inline-flex;
  gap: .65rem;
  color: var(--text-muted);
  font-size: .95rem;
}

.trace-team-demo-tag {
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
}

/* Active card: hover and keyboard focus bring the colour back. */
@media (hover: hover) {
  .trace-team-card:hover .trace-team-photo-frame { background-color: var(--lmu-white); }
  .trace-team-card:hover .trace-team-photo-frame::after { opacity: 0; }
  .trace-team-card:hover .trace-team-photo { filter: none; }
  .trace-team-card:hover .trace-team-initials { color: var(--lmu-white); }
  .trace-team-card:hover .trace-team-bar { transform: scaleX(1); }
  .trace-team-card:hover .trace-team-open i { transform: translateX(4px); }
}

.trace-team-card:focus-within .trace-team-photo-frame { background-color: var(--lmu-white); }
.trace-team-card:focus-within .trace-team-photo-frame::after { opacity: 0; }
.trace-team-card:focus-within .trace-team-photo { filter: none; }
.trace-team-card:focus-within .trace-team-initials { color: var(--lmu-white); }
.trace-team-card:focus-within .trace-team-bar { transform: scaleX(1); }

/* One column: portraits use the full width. */
@container trace-team (width < 36rem) {
  .trace-team-portrait,
  .trace-team-bar {
    margin-inline: calc(var(--trace-team-gutter) * -1);
    border-radius: 0;
  }
}

/* ==========================================================================
   Profile viewer — one place for every profile
   With JS: a modal <dialog> (.trace-team-js on <html>); profiles switch
   in place via .is-current. Without JS: the targeted profile shows the
   same overlay through :target.
   ========================================================================== */

html:has(.trace-team-viewer[open]),
html:not(.trace-team-js):has(.trace-team-profile:target) {
  overflow: hidden;
}

/* The dialog itself is the full-screen scrim; the frame is the panel. */
.trace-team-viewer {
  position: fixed;
  inset: 0;
  z-index: 1060; /* above the sidebar (1040) when shown without JS */
  display: none;
  place-items: center;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: clamp(.75rem, 3vw, 2rem);
  border: 0;
  background: rgb(var(--trace-team-board-shade) / .6);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  color: var(--lmu-white);
  overflow: hidden;
}

.trace-team-viewer::backdrop {
  background: transparent;
}

.trace-team-viewer[open] {
  display: grid;
}

html:not(.trace-team-js) .trace-team-viewer:has(.trace-team-profile:target) {
  display: grid;
}

.trace-team-viewer-frame {
  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  width: min(64rem, 100%);
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: .5rem;
  background:
    linear-gradient(160deg, rgb(var(--trace-team-board-shade) / .74), rgb(var(--trace-team-board-shade) / .88)),
    var(--trace-team-board, none) center / cover no-repeat,
    var(--trace-team-board-base);
  box-shadow: 0 30px 80px rgb(0 20 10 / .45);
}

/* Progress segments: one per profile, built by who-we-are.js. */
.trace-team-viewer-dots {
  display: flex;
  gap: .35rem;
  padding: .85rem 4.5rem 0 1.25rem;
}

.trace-team-viewer-dots:empty {
  display: none;
}

.trace-team-viewer-dot {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  min-width: 0;
  min-height: 1.5rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.trace-team-viewer-dot::before {
  content: "";
  flex: 1 1 auto;
  height: 3px;
  border-radius: 3px;
  background: rgb(255 255 255 / .28);
  transition: background-color .2s ease;
}

.trace-team-viewer-dot:hover::before {
  background: rgb(255 255 255 / .6);
}

.trace-team-viewer-dot[aria-current="true"]::before {
  background: var(--lmu-green-40);
}

.trace-team-viewer-dot:focus-visible {
  outline: 2px solid var(--lmu-white);
  outline-offset: 2px;
  border-radius: 2px;
}

/* One profile */
.trace-team-profile {
  position: relative;
  isolation: isolate;
  display: none;
  grid-template-columns: minmax(0, 1fr);
}

.trace-team-profile.is-current {
  display: grid;
}

html:not(.trace-team-js) .trace-team-profile:target {
  display: grid;
}

.trace-team-profile-close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgb(255 255 255 / .35);
  border-radius: 999px;
  background: rgb(var(--trace-team-board-shade) / .6);
  color: var(--lmu-white);
  font-size: 1rem;
  text-decoration: none;
  transition: background-color .15s ease;
}

.trace-team-viewer-dots:not(:empty) + .trace-team-viewer-profiles .trace-team-profile-close {
  top: -2.1rem; /* sits beside the progress segments */
}

.trace-team-profile-close:hover {
  background: rgb(255 255 255 / .16);
  color: var(--lmu-white);
}

/* Phones: the aside dissolves so photo, text, links and navigation read in that order. */
.trace-team-profile-aside {
  display: contents;
}

.trace-team-profile-portrait {
  position: relative;
  isolation: isolate;
  display: grid;
  order: 1;
  place-items: center;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background-color: var(--trace-team-board-base);
}

.trace-team-profile-main {
  order: 2;
}

.trace-team-profile-links {
  order: 3;
  padding: 0 1.5rem .5rem;
}

.trace-team-profile-links > :first-child {
  margin-top: 0;
}

.trace-team-profile-nav {
  order: 4;
}

.trace-team-profile-portrait .trace-team-initials {
  font-size: clamp(4rem, 9vw, 6.5rem);
}

.trace-team-profile-photo {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.trace-team-profile-photo[hidden] {
  display: none;
}

.trace-team-profile-main {
  min-width: 0;
  padding: 1.5rem 1.5rem 1rem;
}

.trace-team-profile-count {
  margin: 0;
  color: var(--lmu-green-40);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.trace-team-profile-name {
  margin: .55rem 0 0;
  color: var(--lmu-white);
  font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}

.trace-team-profile-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem .85rem;
  margin: .75rem 0 0;
  color: rgb(255 255 255 / .78);
  font-size: .9rem;
  line-height: 1.5;
}

.trace-team-profile-role {
  color: var(--lmu-green-20);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.trace-team-profile-bio {
  max-width: 40rem;
  margin-top: 1.35rem;
  color: rgb(255 255 255 / .9);
  font-size: 1.0625rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.trace-team-profile-bio > :first-child { margin-top: 0; }
.trace-team-profile-bio > :last-child { margin-bottom: 0; }

.trace-team-profile-bio a {
  color: var(--lmu-green-20);
  text-underline-offset: .2em;
}

.trace-team-profile-bio img,
.trace-team-profile-bio video {
  max-width: 100%;
  height: auto;
}

.trace-team-profile-bio pre {
  max-width: 100%;
  overflow-x: auto;
}

.trace-team-profile-ids {
  margin: 1.5rem 0 0;
}

.trace-team-profile-ids dt {
  color: var(--lmu-green-40);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.trace-team-profile-ids dd {
  margin: .25rem 0 0;
  font-size: .95rem;
  letter-spacing: .03em;
  font-variant-numeric: tabular-nums;
}

.trace-team-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1.35rem;
}

.trace-team-chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 2.5rem;
  padding: 0 1rem;
  border: 0;
  border-radius: 999px;
  background: var(--lmu-white);
  color: var(--trace-primary-ink);
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .15s ease;
}

.trace-team-chip:hover {
  background: var(--trace-primary-soft);
  color: var(--trace-primary-hover);
}

.trace-team-chip:disabled {
  background: rgb(255 255 255 / .12);
  color: rgb(255 255 255 / .75);
  cursor: default;
}

/* Previous / Next */
.trace-team-profile-nav {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  padding: 1rem 1.5rem 1.5rem;
}

.trace-team-profile-step {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  min-width: 0;
  max-width: 48%;
  min-height: 2.75rem;
  padding: .35rem 1rem;
  border: 1px solid rgb(255 255 255 / .3);
  border-radius: 999px;
  background: rgb(255 255 255 / .06);
  color: var(--lmu-white);
  text-decoration: none;
  transition: background-color .15s ease;
}

.trace-team-profile-step[data-step="next"] {
  margin-left: auto;
  text-align: right;
}

.trace-team-profile-step:hover {
  background: rgb(255 255 255 / .16);
  color: var(--lmu-white);
}

.trace-team-profile-step-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.trace-team-profile-step-label {
  color: var(--lmu-green-40);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.trace-team-profile-step-name {
  overflow: hidden;
  font-size: .9rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trace-team-profile-step-name:empty {
  display: none;
}

.trace-team-viewer a:focus-visible,
.trace-team-viewer button:not(.trace-team-viewer-dot):focus-visible {
  outline: 3px solid var(--lmu-white);
  outline-offset: 3px;
}

.trace-team-monogram {
  position: absolute;
  right: 1.5rem;
  bottom: 3.5rem;
  z-index: -1;
  color: transparent;
  font-size: clamp(8rem, 16vw, 15rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: .02em;
  -webkit-text-stroke: 1.5px rgb(255 255 255 / .12);
  pointer-events: none;
  user-select: none;
}

/* Wider screens: portrait, identifiers and links on the left; text and
   navigation on the right. */
@media (min-width: 48rem) {
  .trace-team-profile {
    grid-template-columns: minmax(0, 19rem) minmax(0, 1fr);
    grid-template-rows: 1fr auto;
  }

  .trace-team-profile-aside {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    grid-column: 1;
    grid-row: 1 / span 2;
    padding: 1rem 0 1.5rem 1.25rem;
  }

  .trace-team-profile-portrait {
    border-radius: .35rem;
  }

  .trace-team-profile-links {
    padding: 0 .25rem;
  }

  .trace-team-profile-main {
    grid-column: 2;
    grid-row: 1;
    padding: 1.25rem 2.75rem 1rem 2.5rem;
  }

  .trace-team-profile-nav {
    grid-column: 2;
    grid-row: 2;
    padding: .5rem 2.75rem 1.75rem 2.5rem;
  }
}

/* Phones: the panel takes the whole screen; Previous / Next stay at thumb height. */
@media (max-width: 47.99rem) {
  .trace-team-viewer {
    padding: 0;
  }

  .trace-team-viewer-frame {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .trace-team-profile-nav {
    position: sticky;
    bottom: 0;
    z-index: 1;
    padding-top: 2rem;
    background: linear-gradient(
      to top,
      rgb(var(--trace-team-board-shade) / .98) 0%,
      rgb(var(--trace-team-board-shade) / .98) 62%,
      rgb(var(--trace-team-board-shade) / 0) 100%
    );
  }

  .trace-team-profile-step {
    background-color: rgb(var(--trace-team-board-shade) / .92);
  }

  .trace-team-profile-bio {
    font-size: 1rem;
    line-height: 1.7;
  }

  .trace-team-monogram {
    bottom: 5rem;
  }
}

/* Swipe-down-to-close on phones: the panel follows the finger, then springs back. */
.trace-team-viewer-frame {
  transition: transform .25s var(--trace-team-ease), opacity .25s ease;
}

.trace-team-viewer-frame.is-dragging {
  transition: none;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .trace-team-viewer[open] .trace-team-viewer-frame {
    animation: trace-team-frame-in .28s var(--trace-team-ease) both;
  }

  .trace-team-viewer[data-direction="next"] .trace-team-profile.is-current {
    animation: trace-team-from-right .32s var(--trace-team-ease) both;
  }

  .trace-team-viewer[data-direction="prev"] .trace-team-profile.is-current {
    animation: trace-team-from-left .32s var(--trace-team-ease) both;
  }
}

@keyframes trace-team-frame-in {
  from { opacity: 0; transform: translateY(.75rem) scale(.985); }
  to   { opacity: 1; transform: none; }
}

@keyframes trace-team-from-right {
  from { opacity: 0; transform: translateX(1.5rem); }
  to   { opacity: 1; transform: none; }
}

@keyframes trace-team-from-left {
  from { opacity: 0; transform: translateX(-1.5rem); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Demo notice, empty state, text links ---------- */

.trace-team-demo-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1.25rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--trace-primary-soft-strong);
  border-radius: .75rem;
  background: var(--trace-primary-soft);
  color: var(--trace-primary-ink);
}

.trace-team-demo-notice[hidden] {
  display: none;
}

.trace-team-demo-notice strong {
  font-size: .9rem;
}

.trace-team-demo-notice p {
  margin: .25rem 0 0;
  color: var(--text-main);
  font-size: .85rem;
  line-height: 1.6;
}

.trace-team-empty {
  grid-column: 1 / -1;
  padding: 2.5rem 1.5rem;
  border: 1px solid var(--trace-border);
  border-radius: .75rem;
  background: var(--trace-surface-soft);
  text-align: center;
}

.trace-team-empty h3 {
  margin: 0 0 .5rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.trace-team-empty p {
  margin: 0 0 .75rem;
  color: var(--text-muted);
}

.trace-team-text-link {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 2.75rem;
  color: var(--trace-primary-ink);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  text-underline-offset: .2em;
}

.trace-team-text-link:hover {
  color: var(--trace-primary-hover);
  text-decoration: underline;
}

.trace-team-text-link:focus-visible {
  outline: 3px solid var(--trace-primary);
  outline-offset: 3px;
}

/* ---------- Preferences and modes ---------- */

@media (max-width: 575.98px) {
  .trace-team-actions {
    flex-direction: column;
    align-items: stretch;
    align-self: stretch;
  }

  .trace-team-btn {
    min-height: 3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .trace-team-photo,
  .trace-team-photo-frame,
  .trace-team-photo-frame::after,
  .trace-team-initials,
  .trace-team-bar,
  .trace-team-open i,
  .trace-team-btn,
  .trace-team-chip,
  .trace-team-profile-step,
  .trace-team-profile-close {
    transition: none;
  }
}

@media (forced-colors: active) {
  .trace-team-monogram {
    display: none;
  }

  .trace-team-bar {
    background: CanvasText;
  }

  .trace-team-viewer-dot::before {
    background: CanvasText;
  }

  .trace-team-viewer-dot[aria-current="true"]::before {
    background: Highlight;
  }
}
