/* =============================================================================
   ReLeaf: the team page
   Layout & type system after iGEM Marburg 2024; label pills after Unicamp-Brazil.

   Project-flavoured touches, all subtle:
   · cards "light up" on hover (optogenetic activation: the photo warms and the
     frame switches from team green to that person's own task colours), see
     .card:hover
   · a profile wears the same frame, built from the tasks its person worked on
   · the task row in the legend is a filter: one press shows who was on a task
   ========================================================================== */

/* ---- Fonts ---------------------------------------------------------------
   Self-hosted from assets/fonts, so nothing is fetched from another server.
   Before the wiki freeze this can move to your own static.igem.wiki slot; keep
   it in step with the identical @font-face in tokens.css.                     */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-variable.woff2") format("woff2"),
       url("../fonts/inter-variable.ttf") format("truetype");
}

:root {
  /* neutrals (Tailwind `neutral`, as Marburg uses) */
  --white:      #ffffff;
  --gray-100:   #f5f5f5;
  --gray-200:   #e5e5e5;
  --gray-300:   #d4d4d4;
  --gray-500:   #6b6b6b;   /* tokens.css: 4.8:1 on --card-bg (#737373 was 4.3:1) */
  --gray-600:   #525252;
  --gray-700:   #404040;
  --black:      #171717;

  /* ReLeaf accents, pulled from the team hoodie */
  --leaf-900:   #14402b;
  --leaf-700:   #23684a;
  --leaf-500:   #4f9c6f;
  --leaf-100:   #e3f0e8;

  --card-bg:    #f4f4f2;       /* card body, a shade lighter than Marburg's gray-200 */
  --nav-h:      68px;          /* matches --nv-h in nav.css */
  --max:        1280px;        /* max-w-7xl */
  --radius:     0.5rem;        /* rounded-lg */
  --shadow-md:  0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);
  --shadow-lg:  0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 60px); }

body {
  margin: 0;
  font-family: var(--font-body);   /* tokens.css loads first on team/ */
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--black);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

/* ============================================================ GROUP SHOT ==== */

.hero { position: relative; }

.hero__img {
  width: 100%;
  /* the markup carries the file's own 2400x1361, so the browser reserves the
     right box before the photograph arrives and the page stops jumping. The
     height attribute is a presentational hint, so height: auto is what lets
     the aspect-ratio below keep deciding the shape. */
  height: auto;
  aspect-ratio: 12 / 5;
  object-fit: cover;
  object-position: center 58%;   /* trims the ceiling without clipping heads */
  background: var(--leaf-100);
}
/* On a narrow screen the photograph is shown whole. A taller crop looked
   bigger but cut the people at both ends out of their own team photo. */
@media (max-width: 820px) { .hero__img { aspect-ratio: 1920 / 1089; object-position: center; } }

/* a hairline of leaf green closes the photo off from the toolbar */
.hero__edge {
  height: 3px;
  background: linear-gradient(90deg, var(--leaf-900), var(--leaf-500) 55%, var(--leaf-100));
}

/* ========================================================= SECTION NAV ===== */

.toolbar {
  position: sticky;
  top: var(--nav-h);
  z-index: 20;
  background: rgb(255 255 255 / .94);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-200);
}

/* five equal segments spanning the full row, hairline-separated */
.toolbar__jump {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
}
@media (min-width: 640px) { .toolbar__jump { padding: 0 2rem; } }

.toolbar__jump a {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  gap: .45rem;
  min-height: 54px;
  padding: .55rem .4rem;
  font-size: .715rem; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--gray-500);
  text-align: center;
  text-decoration: none;
  transition: color .25s, background .25s;
}

/* one glyph per category, tinted with the link colour */
.jump__icon {
  width: 16px; height: 16px; flex: none;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
          mask: var(--icon) center / contain no-repeat;
  opacity: .85;
}
.toolbar__jump a:hover .jump__icon,
.toolbar__jump a.is-current .jump__icon { opacity: 1; }
.toolbar__jump a + a::before {           /* hairline between segments */
  content: "";
  position: absolute; left: 0; top: 26%; bottom: 26%;
  width: 1px; background: var(--gray-200);
}
.toolbar__jump a::after {                /* underline grows from the centre */
  content: "";
  position: absolute; left: 50%; right: 50%; bottom: 0;
  height: 2px; background: var(--leaf-700);
  transition: left .28s cubic-bezier(.2,.7,.3,1), right .28s cubic-bezier(.2,.7,.3,1);
}
.toolbar__jump a:hover { color: var(--leaf-900); background: rgb(227 240 232 / .55); }
.toolbar__jump a:hover::after { left: 18%; right: 18%; }

.toolbar__jump a.is-current { color: var(--leaf-900); }
.toolbar__jump a.is-current::after { left: 0; right: 0; }

/* nobody in this section is on the task being shown; a press brings it back */
.toolbar__jump a.is-off { opacity: .45; }

/* the first segment carries the weight, Project Leads */
.toolbar__jump a:first-child {
  font-weight: 800;
  font-size: .75rem;
  letter-spacing: .09em;
  color: var(--leaf-900);
}
.toolbar__jump a:first-child .jump__icon { width: 18px; height: 18px; opacity: 1; }

/* below the grid breakpoint the segments scroll sideways instead of squashing */
@media (max-width: 780px) {
  .toolbar__jump {
    grid-auto-columns: max-content;
    overflow-x: auto;
    -ms-overflow-style: none; scrollbar-width: none;
  }
  .toolbar__jump::-webkit-scrollbar { display: none; }
  .toolbar__jump a { padding: .55rem .95rem; min-height: 46px; letter-spacing: .06em; }
}

/* ---- owner / member key ------------------------------------------------- */
.legend {
  max-width: var(--max);
  width: calc(100% - 4rem);
  margin: 2.5rem auto 0;
  padding: 1.35rem 1.5rem 1.15rem;
  background: #fbfbf9;
  border: 1px solid rgb(23 23 23 / .06);
  border-radius: 12px;
}
@media (max-width: 639px) { .legend { width: calc(100% - 2rem); margin-top: 1.5rem; padding: 1.05rem 1rem .95rem; } }

/* The three definitions sit in a <details>. From 880px up it is held open by
   team.js and its title is plain text; on a phone the title is a switch, so
   the roster is not two screens of reading away. */
.legend__majors > summary { list-style: none; }
.legend__majors > summary::-webkit-details-marker { display: none; }

.legend__title {
  margin: 0;
  font-size: .66rem; font-weight: 800;
  letter-spacing: .15em; text-transform: uppercase;
  color: var(--leaf-700);
}
.legend__tracks { margin-top: 1rem; }

@media (min-width: 880px) {
  .legend__majors > summary { pointer-events: none; }
}
@media (max-width: 879px) {
  .legend__majors > summary {
    display: flex; align-items: center; justify-content: space-between;
    min-height: 2rem;
    cursor: pointer;
  }
  .legend__majors > summary::after {
    content: "";
    width: .5rem; height: .5rem; margin-right: .2rem;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: translateY(-25%) rotate(45deg);
    transition: transform .25s;
  }
  .legend__majors[open] > summary::after { transform: translateY(15%) rotate(-135deg); }
  .legend__majors > summary:focus-visible { outline: 2px solid var(--leaf-700); outline-offset: 4px; border-radius: 4px; }
}

/* three quiet columns, hairline between */
.legend__tracks {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
}
@media (min-width: 880px) {
  .legend__tracks { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
  .legend__track { padding: 0 1.5rem; }
  .legend__track:first-child { padding-left: 0; }
  .legend__track:last-child  { padding-right: 0; }
  .legend__track + .legend__track { border-left: 1px solid rgb(23 23 23 / .08); }
}

.legend__track { display: grid; gap: .5rem; align-content: start; justify-items: start; }

.legend__def {
  margin: 0;
  font-size: .775rem; line-height: 1.6;
  color: var(--gray-600);
}

/* the task key rides underneath on one hairline */
.legend__tasks {
  display: grid;
  grid-template-columns: 1fr;
  gap: .5rem 2.25rem;
  margin-top: 1.15rem;
  padding-top: .95rem;
  border-top: 1px solid rgb(23 23 23 / .08);
}
@media (min-width: 880px) { .legend__tasks { grid-template-columns: 1.85fr 1fr; } }
@media (max-width: 879px) { .legend__tasks { margin-top: .8rem; } }

/* pill, term, then the definition: on one line where there is room, the
   definition on a line of its own where there is not */
.legend__task {
  margin: 0;
  display: flex; flex-wrap: wrap;
  align-items: baseline;
  gap: .2rem .45rem;
  font-size: .775rem; line-height: 1.55;
  color: var(--gray-600);
}
.legend__task .tag { align-self: center; }
.legend__term { color: var(--black); font-weight: 700; white-space: nowrap; }
.legend__task .legend__def { flex: 1 1 14rem; }

/* every task on the board, on its own hairline under the two key pills */
.legend__all {
  margin-top: 1.15rem;
  padding-top: .95rem;
  border-top: 1px solid rgb(23 23 23 / .08);
  scroll-margin-top: calc(var(--nav-h) + 70px);
}
.legend__all-title {
  margin: 0 0 .7rem;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .7rem;
  font-size: .6875rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--gray-500);
}
.legend__hint {
  font-size: .775rem; font-weight: 400;
  letter-spacing: 0; text-transform: none;
}
.legend__row { display: flex; flex-wrap: wrap; gap: .4rem; }

/* Each task is a switch. At rest it is the filled pill it always was. Once a
   task is picked, that one keeps its fill and gains a ring, and the others
   step back to the washed member tint, still readable, still pressable. */
.legend__chip {
  border: 0;
  font-family: inherit;
  cursor: pointer;
  background: var(--fill);
  /* fill and ink swap at once: three of the fills are gradients, which cannot
     fade, and a half-faded label on a finished background is unreadable */
  transition: transform .2s cubic-bezier(.2,.7,.3,1), box-shadow .2s;
}
.legend__chip:hover { transform: translateY(-1px); box-shadow: 0 4px 10px -3px rgb(23 23 23 / .4); }
.legend__chip:focus-visible { outline: 2px solid var(--leaf-700); outline-offset: 2px; }
.legend__chip:disabled { opacity: .4; cursor: default; transform: none; box-shadow: none; }
.legend__count {
  margin-left: .1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  opacity: .78;
}
.legend__row.is-filtering .legend__chip:not(.is-on) {
  background: var(--wash);
  color: var(--ink);
  box-shadow: none;
}
.legend__row.is-filtering .legend__chip:not(.is-on) .tag__dot { background: currentColor; opacity: .5; }
.legend__chip.is-on { box-shadow: 0 0 0 2px #fbfbf9, 0 0 0 4px var(--c); }
/* a finger needs more to aim at than a pointer does */
@media (pointer: coarse) {
  .legend__row { gap: .5rem; }
  .legend__chip { font-size: .76rem; padding: .28rem .7rem .28rem .6rem; }
}

/* what the filter is showing, and the way back */
.legend__status {
  display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .55rem;
  margin: .95rem 0 0;
  font-size: .84rem; line-height: 1.4;
  color: var(--gray-600);
}
.legend__status[hidden] { display: none; }
.legend__status-dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--c); flex: none; }
.legend__status-task { color: var(--black); font-weight: 700; }
.legend__reset {
  margin-left: .35rem;
  padding: .28rem .8rem;
  border: 1px solid var(--gray-300); border-radius: 50rem;
  background: var(--white);
  font: inherit; font-size: .76rem; font-weight: 600;
  color: var(--leaf-900);
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.legend__reset:hover { border-color: var(--leaf-500); background: var(--leaf-100); }
.legend__reset:focus-visible { outline: 2px solid var(--leaf-700); outline-offset: 2px; }

.key__own { background: var(--gray-600); }
.key__mem { background: rgb(82 82 82 / .13); color: var(--gray-600); }

/* The roster re-forming under a filter: the cards that stay rise into place
   a beat apart. team.js numbers them (--i) and takes the class off again once
   they have landed. */
@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.is-swapping .card:not(.card--open) {
  animation: card-in .36s cubic-bezier(.2,.7,.3,1) both;
  animation-delay: calc(min(var(--i, 0), 11) * 24ms);
}

/* ================================================================ GRID ===== */

main { padding-bottom: 5rem; }

.section { max-width: var(--max); margin: 0 auto; padding: 0 1rem; }
@media (min-width: 640px) { .section { padding: 0 2rem; } }
.section[hidden] { display: none; }

.section__title {
  font-size: clamp(1.8rem, 3.2vw, 2.25rem);   /* text-4xl at full width */
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.1;
  margin: 4rem 0 1rem;
  scroll-margin-top: calc(var(--nav-h) + 60px);
}
.section:first-of-type .section__title { margin-top: 3rem; }
@media (max-width: 559px) {
  .section__title { margin-top: 3rem; }
  .section:first-of-type .section__title { margin-top: 2.25rem; }
}

/* how many people the section is showing: quiet, raised beside the title */
.section__count {
  margin-left: .55rem;
  font-size: .42em; font-weight: 600;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
  color: var(--gray-500);
  vertical-align: .95em;
}
.section__count:empty { display: none; }

.section__note { color: var(--gray-600); margin: 0 0 .55rem; }
.section__note:last-of-type { margin-bottom: 1.9rem; }

/* 4 across (Marburg ships 3, widened per request). A phone gets two compact
   cards a row instead of one tall one: forty-six people in a single column
   ran to forty-five screens. */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  align-items: stretch;
}
.grid[hidden] { display: none; }
@media (min-width: 560px)  { .grid { gap: 1.25rem; } }
@media (min-width: 900px)  { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1120px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* named, not carded: the quiet line under a grid */
.section__after {
  max-width: 62rem;
  margin: 1.7rem 0 0;
  padding-top: 1.15rem;
  border-top: 1px solid rgb(23 23 23 / .08);
  font-size: .84rem;
  line-height: 1.65;
  color: var(--gray-600);
}
.section__afternames { color: var(--black); font-weight: 600; }

.empty {
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  color: var(--gray-500);
  background: var(--gray-100);
}

/* ================================================================ CARD ===== */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card-bg);
  box-shadow: 0 0 0 1px rgb(23 23 23 / .06), 0 1px 2px rgb(23 23 23 / .04),
              0 10px 24px -16px rgb(23 23 23 / .45);
  cursor: pointer;
  transition: transform .3s cubic-bezier(.2,.7,.3,1), box-shadow .3s, opacity .3s;
}
.card[hidden] { display: none; }

/* optogenetic activation: the portrait warms and the frame switches on */
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 0 2px var(--leaf-500), 0 12px 28px -14px rgb(20 64 43 / .55),
              0 0 26px -6px rgb(79 156 111 / .5);
}
/* the same for keyboard focus; its own rule, so a browser without :has()
   drops only this one and keeps the hover */
.card:has(.card__open:focus-visible) {
  transform: translateY(-4px);
  box-shadow: 0 0 0 2px var(--leaf-500), 0 12px 28px -14px rgb(20 64 43 / .55),
              0 0 26px -6px rgb(79 156 111 / .5);
}
.card:hover .card__media img { filter: saturate(1.08) brightness(1.03); }

/* ---- an unclaimed project lead seat --------------------------------------
   Leads are boxed in flat green. This one runs a slow gradient through leaf
   green into gold, so an open seat outranks a held one on sight.            */
.card--open {
  cursor: default;
  padding: 4px;
  background: linear-gradient(115deg,
    var(--leaf-900) 0%,  var(--leaf-700) 10%, #dfbd63 22%, var(--leaf-500) 33%,
    var(--leaf-900) 46%, var(--leaf-700) 58%, #dfbd63 72%, var(--leaf-500) 84%,
    var(--leaf-900) 100%);
  background-size: 210% 210%;
  animation: seat-sweep 9s ease-in-out infinite;
  box-shadow: 0 0 0 1px rgb(20 64 43 / .12), 0 14px 30px -18px rgb(20 64 43 / .7);
}
@keyframes seat-sweep {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
.card--open:hover { transform: translateY(-4px); box-shadow: 0 0 0 1px rgb(20 64 43 / .18), 0 18px 34px -18px rgb(20 64 43 / .75); }

.card--open .card__media,
.card--open .card__body { background: #fff; }
.card--open .card__media { border-radius: 5px 5px 0 0; padding-top: 105%; border-bottom: 0; }
.card--open .card__body  { border-radius: 0 0 5px 5px; padding: .85rem 1rem .9rem; }
.card--open .card__badges { margin-bottom: 0; }

.card__media--open {
  display: grid; place-items: center;
  background:
    radial-gradient(120% 90% at 50% 0%, var(--leaf-100) 0%, #fff 70%);
}
.open__mark {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 5.2rem; font-weight: 800;
  line-height: 1;
  color: var(--leaf-700);
  opacity: .34;
}
.card--open:hover .open__mark { opacity: .48; }
.card__media--open::after {
  content: "";
  position: absolute; inset: 14px;
  border: 2px solid rgb(35 104 74 / .28);
  border-radius: 6px;
}

.card__role--open {
  background: var(--leaf-900);
  color: #fff;
  border-color: var(--leaf-900);
}
.card__name--open { color: var(--leaf-900); }

/* Every card is boxed. The frame used to read as rank, a full box for a lead
   and a top edge for a vice lead, but the roster is a team rather than a
   ladder and the roles are already spelled out on the badge above the name.
   .card--lead and .card--vice are still set by the renderer; they simply do
   not change the frame any more. */
.card::after {
  content: "";
  position: absolute; inset: 0;
  border: 3px solid var(--leaf-700);
  border-radius: var(--radius);
  pointer-events: none;
  z-index: 2;
}
/* an unclaimed seat carries its own hotter frame and animation */
.card--open::after { content: none; }

/* The frame switched on. Under the pointer, or under keyboard focus, the green
   box gives way to the person's own task colours: the same gradient their
   profile is framed in (team.js sets --frame per card). At rest every card is
   the one team green; the colours are what a person brings to it. Drawn as a
   masked ring so it lands exactly on the green frame it replaces. */
@supports ((-webkit-mask-composite: xor) or (mask-composite: exclude)) {
  .card::before {
    content: "";
    position: absolute; inset: 0;
    padding: 3px;
    border-radius: var(--radius);
    background: var(--frame, var(--leaf-700));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    transition: opacity .3s;
  }
  .card--open::before { content: none; }
  .card:hover::before { opacity: 1; }
  .card:has(.card__open:focus-visible)::before { opacity: 1; }
  /* the ring is the frame now, so the plain green halo outside it steps down */
  .card:hover {
    box-shadow: 0 12px 28px -14px rgb(20 64 43 / .55), 0 0 26px -6px rgb(79 156 111 / .5);
  }
  .card:has(.card__open:focus-visible) {
    box-shadow: 0 12px 28px -14px rgb(20 64 43 / .55), 0 0 26px -6px rgb(79 156 111 / .5);
  }
  .card--open:hover { box-shadow: 0 0 0 1px rgb(20 64 43 / .18), 0 18px 34px -18px rgb(20 64 43 / .75); }
}

.card__media {
  position: relative;
  width: 100%; padding-top: 125%;
  background: var(--leaf-100);
  border-bottom: 1px solid rgb(23 23 23 / .07);
}
.card__media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: opacity .3s, filter .3s;
}

.card__body {
  display: flex; flex-direction: column;
  flex: 1;
  padding: .9rem 1rem 1.05rem;
}

/* three tiers of badge: green role, neutral subteam track, coloured task pill */
.card__badges {
  display: flex; flex-wrap: nowrap; align-items: center;
  gap: .26rem;
  margin-bottom: .5rem;
  min-width: 0;
}

.card__track {
  font-size: .565rem; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase;
  border-radius: 50rem;
  padding: .17rem .48rem;
  border: 1px solid transparent;
  white-space: nowrap;
}
/* one neutral subteam chip. Major and minor had their own weights here; the
   card names the subteam only now, so there is a single style. */
.card__track--sub,
.card__track--major {
  background: #eceae5;
  color: #55534c;
  border-color: #dedbd3;
}
.card__track--minor {
  background: transparent;
  color: #6f6d66;          /* 4.7:1 on the card; #8b8981 was 3.2:1 */
  border-color: #d9d7d0;
}

.card__role {
  align-self: flex-start;
  font-size: .585rem; font-weight: 800;
  letter-spacing: .05em; text-transform: uppercase;
  border-radius: 50rem;
  padding: .17rem .58rem;
  border: 1.5px solid transparent;
  white-space: nowrap;
}
.card__role--lead       { background: var(--leaf-700); color: #fff; border-color: var(--leaf-700); }
.card__role--vice       { background: transparent; color: var(--leaf-700); border-color: var(--leaf-500); }
.card__role--advisor    { background: #fdf1da; color: #7a4c12; border-color: #f0d5a4; }
.card__role--instructor { background: #ece7f6; color: #4b3a75; border-color: #d5cbea; }

.card__name {
  font-size: 1.06rem; font-weight: 700;
  letter-spacing: -.012em; line-height: 1.25;
  margin: 0;
}
/* The name is the button, stretched over the whole card: one press target for
   a pointer, and for a screen reader a heading, a button and readable text
   underneath instead of one opaque block. */
.card__open {
  appearance: none;
  margin: 0; padding: 0; border: 0;
  background: none;
  font: inherit; letter-spacing: inherit; color: inherit;
  text-align: left;
  cursor: pointer;
}
.card__open::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: var(--radius);
  z-index: 4;
}
.card__open:focus { outline: none; }
.card__open:focus-visible::after { outline: 3px solid var(--leaf-900); outline-offset: 2px; }

.card__meta {
  font-size: .715rem; font-weight: 600;
  letter-spacing: .045em; text-transform: uppercase;
  color: var(--gray-500);
  margin: .22rem 0 0;
}

/* task pills sit directly under the school line */
.card__tags {
  display: flex; flex-wrap: wrap; gap: .3rem;
  margin: .65rem 0 0;
  padding: 0 0 .8rem;
  list-style: none;
  border-bottom: 1px solid rgb(23 23 23 / .07);
}
.card__tags li { display: flex; }

/* no bio below? then the rule under the pills has nothing to separate */
.card__tags:last-child { border-bottom: 0; padding-bottom: 0; }

.card__bio {
  font-size: .815rem;
  line-height: 1.62;
  color: var(--gray-600);
  margin: .75rem 0 0;
  text-wrap: pretty;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;         /* the ellipsis is added by the browser */
  overflow: hidden;
}

.card__more {
  margin: .55rem 0 0;
  font-size: .715rem; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
  color: var(--leaf-700);
  display: inline-flex; align-items: center; gap: .3rem;
}
.card__more::after { content: "\2192"; transition: transform .25s; }
.card:hover .card__more::after { transform: translateX(3px); }
/* no pills? the bio still needs its own breathing room */
.card__meta + .card__bio { margin-top: .65rem; }

.tag {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .695rem; line-height: 1.55;
  white-space: nowrap;
  border-radius: 50rem;
  padding: .08rem .55rem;
}
/* owner, saturated fill, white text, a lead dot */
.tag--own {
  color: #fff;
  font-weight: 700;
  letter-spacing: .005em;
  padding-left: .45rem;
  box-shadow: 0 1px 2px rgb(23 23 23 / .18);
}
.tag__dot {
  width: .34rem; height: .34rem;
  border-radius: 50%;
  background: rgb(255 255 255 / .85);
  flex: none;
}
/* member, the same hue, washed right back */
.tag--mem { font-weight: 600; }
/* the task the filter is showing, ringed in its own colour on every card
   that carries it. A ring, not a fill: a filled pill means task owner. */
.tag.is-hit { box-shadow: inset 0 0 0 1.5px var(--c); }

/* ---- two to a row on a phone --------------------------------------------
   The compact card keeps the portrait, the name, the school line and every
   task pill. The bio waits in the profile, one tap away. */
@media (max-width: 559px) {
  .card__body { padding: .6rem .65rem .75rem; }
  .card__badges { flex-wrap: wrap; margin-bottom: .4rem; }
  .card__role, .card__track { font-size: .5rem; white-space: normal; }
  .card__name { font-size: .95rem; }
  .card__meta { font-size: .625rem; letter-spacing: .035em; }
  .card__tags { gap: .22rem; margin-top: .5rem; padding-bottom: 0; border-bottom: 0; }
  .card .tag { font-size: .625rem; padding: .05rem .42rem; }
  .card__bio, .card__more { display: none; }
  .card--open .card__body { padding: .6rem .65rem .65rem; }
  .open__mark { font-size: 3.4rem; }
  .card__media--open::after { inset: 9px; }
}

/* =============================================================== MODAL ===== */

/* Always laid out, shown by visibility, so opening and closing can fade. A
   hidden profile is out of the tab order and out of the accessibility tree. */
.modal {
  position: fixed; inset: 0; z-index: 50;
  display: flex;
  align-items: center; justify-content: center;
  gap: 1rem;
  padding: 1.5rem;
  background: rgb(6 20 13 / .88);
  -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
  overscroll-behavior: contain;
  visibility: hidden;
  opacity: 0;
  transition: opacity .18s ease, visibility 0s linear .18s;
}
.modal.is-open {
  visibility: visible;
  opacity: 1;
  transition: opacity .22s ease;
}

/* the frame is built per person from their own task colours */
.modal__frame {
  position: relative;
  flex: 0 1 920px;
  min-width: 0;
  max-height: 90vh;
  max-height: 90dvh;
  padding: 9px;
  border-radius: 18px;
  background: var(--frame, linear-gradient(135deg, #14402b, #4f9c6f));
  box-shadow: 0 30px 70px -30px rgb(0 0 0 / .8), 0 0 0 1px rgb(255 255 255 / .12);
  overflow: hidden;
  transform: translateY(12px) scale(.985);
  transition: transform .32s cubic-bezier(.2,.7,.3,1);
}
.modal.is-open .modal__frame { transform: none; }

.modal__panel {
  position: relative;
  max-height: calc(90vh - 18px);
  max-height: calc(90dvh - 18px);
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--white);
  border-radius: 10px;
}

/* ---- working photo left, goofy right, the bio boxed below ---------------
   Nothing is cropped: both photos take one shared height and keep their own
   shape, so a portrait phone snap and a landscape camera shot sit level. The
   height is whatever lets the two fill the row (team.js supplies
   --ratio-sum), capped so the bio stays on screen when both are tall
   portraits; then the pair centres with room either side. A photo not sent
   yet is an empty 4:3 frame. */
.modal__pair {
  --gap: 10px;
  container-type: inline-size;
  display: flex;
  justify-content: center;
  gap: var(--gap);
  margin: 10px 10px 0;
}
.modal__shot-img {
  display: block;
  flex: none;
  width: auto;
  height: min(54vh, calc((100cqw - var(--gap)) / var(--ratio-sum, 1.6)));
  border-radius: 6px;
  background: var(--leaf-100);
  /* each photo fades in once it has arrived (team.js adds .is-ready) */
  opacity: 0;
  transition: opacity .28s ease;
}
.modal__shot-img.is-ready { opacity: 1; }
.modal__shot-img[hidden] { display: none; }
/* one landscape photo, edge to edge of the panel, never cropped */
.modal__pair--solo .modal__shot-img { width: 100%; height: auto; }

.modal__body {
  position: relative;
  margin: 10px;
  padding: 1.6rem 1.8rem 1.8rem;
  border: 1px solid rgb(23 23 23 / .1);
  border-radius: 8px;
}

/* a sprig of leaves, one leaf per task, watermarked behind the text */
.modal__sprig {
  position: absolute; right: 14px; bottom: 10px;
  height: 240px; width: auto;
  opacity: .26;
  pointer-events: none;
}
.modal__sprig svg { height: 100%; width: auto; display: block; }
@media (max-width: 700px) { .modal__sprig { height: 150px; opacity: .18; } }
.modal__role {
  position: relative;
  font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: var(--leaf-700); margin: 0 0 .25rem;
}
.modal__name {
  position: relative;
  font-size: 2rem; font-weight: 700;
  letter-spacing: -.025em; line-height: 1.15;
  margin: 0;
}
.modal__meta {
  position: relative;
  color: var(--gray-500); font-size: .74rem; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase;
  margin: .4rem 0 0;
}

/* The task pills sit under the name, where they put names to the colours the
   frame is made of. Each is a button: press one to see everybody on it. */
.modal__tags {
  position: relative;
  margin: .8rem 0 0;
  padding: 0;
  border-bottom: 0;
  gap: .35rem;
}
.modal__tags[hidden] { display: none; }
.modal__tags .tag {
  border: 0;
  font-family: inherit;
  font-size: .75rem;
  padding: .14rem .68rem;
  cursor: pointer;
  transition: box-shadow .2s, transform .2s;
}
.modal__tags .tag:hover { box-shadow: inset 0 0 0 1.5px var(--c); transform: translateY(-1px); }
.modal__tags .tag:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }

.modal__text { position: relative; margin: 1.2rem 0 0; color: var(--gray-700); font-size: 1rem; line-height: 1.7; text-wrap: pretty; }
.modal__text p { margin: 0; }
.modal__text p + p { margin-top: .85em; }

/* outside the scrolling panel, so it stays in reach all the way down a bio */
.modal__close {
  position: absolute; top: calc(9px + .6rem); right: calc(9px + .7rem);
  z-index: 3;
  width: 2.1rem; height: 2.1rem;
  padding: 0;
  background: rgb(255 255 255 / .92); border: 0; border-radius: 50%;
  box-shadow: 0 2px 8px rgb(0 0 0 / .18);
  cursor: pointer;
  font-size: 1.35rem; line-height: 1; color: var(--gray-600);
  transition: color .2s, transform .2s;
}
.modal__close:hover { color: var(--black); transform: scale(1.06); }
.modal__close:focus-visible { outline: 2px solid var(--leaf-700); outline-offset: 2px; }

/* ---- to the next person ---------------------------------------------------
   Wide screen: a round arrow either side of the frame. */
.modal__nav {
  flex: none;
  display: grid; place-items: center;
  width: 2.9rem; height: 2.9rem;
  padding: 0;
  border: 1px solid rgb(255 255 255 / .24);
  border-radius: 50%;
  background: rgb(255 255 255 / .1);
  color: #fff;
  cursor: pointer;
  transition: background .2s, transform .2s cubic-bezier(.2,.7,.3,1);
}
.modal__nav svg { width: 1.3rem; height: 1.3rem; }
.modal__nav:hover { background: rgb(255 255 255 / .22); }
.modal__nav--prev:hover { transform: translateX(-3px); }
.modal__nav--next:hover { transform: translateX(3px); }
.modal__nav:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.modal__nav[hidden] { display: none; }

/* Narrow screen: the two neighbours by name, under the bio. */
.modal__foot { display: none; }
.modal__step {
  max-width: 48%;
  padding: .45rem 0;
  border: 0; background: none;
  font: inherit; font-size: .74rem; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
  color: var(--leaf-700);
  cursor: pointer;
}
.modal__step--prev { text-align: left; }
.modal__step--next { text-align: right; margin-left: auto; }
.modal__step--prev::before { content: "\2190\00a0"; }
.modal__step--next::after  { content: "\00a0\2192"; }
.modal__step:hover { color: var(--leaf-900); }
.modal__step:focus-visible { outline: 2px solid var(--leaf-700); outline-offset: 3px; border-radius: 3px; }
.modal__step[hidden] { display: none; }

@media (max-width: 1099px) {
  .modal__nav { display: none; }
  .modal__foot {
    position: relative;
    display: flex; justify-content: space-between; gap: 1rem;
    margin-top: 1.4rem;
    padding-top: .75rem;
    border-top: 1px solid rgb(23 23 23 / .09);
  }
  .modal__foot[hidden] { display: none; }
}

/* ---- the profile on a phone ----------------------------------------------
   Side by side, two photos would each be a thumbnail. Here they become a
   strip: still one shared height, still uncropped, but tall enough to see,
   with the second photo peeking in from the right to say there is more. */
@media (max-width: 600px) {
  .modal { padding: .6rem; }
  .modal__frame { padding: 6px; border-radius: 16px; max-height: 94vh; max-height: 94dvh; }
  .modal__panel { max-height: calc(94vh - 12px); max-height: calc(94dvh - 12px); }
  .modal__close { top: calc(6px + .5rem); right: calc(6px + .5rem); }

  .modal__pair {
    --gap: 8px;
    justify-content: flex-start;
    margin: 8px 8px 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    -ms-overflow-style: none; scrollbar-width: none;
  }
  .modal__pair::-webkit-scrollbar { display: none; }
  .modal__shot-img {
    height: min(44vh, calc(88cqw / var(--ratio-max, 1.5)));
    scroll-snap-align: center;
  }
  /* auto margins centre a pair that fits and vanish for one that scrolls */
  .modal__shot-img:first-child { margin-left: auto; }
  .modal__shot-img:last-child  { margin-right: auto; }
  .modal__pair--solo { overflow: visible; }
  .modal__pair--solo .modal__shot-img { height: auto; margin: 0; }

  .modal__body { margin: 8px; padding: 1.15rem 1.1rem 1.25rem; }
  .modal__name { font-size: 1.6rem; }
  .modal__text { font-size: .97rem; line-height: 1.65; }
}

/* ============================================================ PAGE NAV ===== */
/* The same pair of cards every other standard page ends with. This page does
   not load page.css, so the rules are repeated here; keep them in step with
   the PAGE NAV block in assets/css/page.css. */

.pagenav {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}
@media (min-width: 640px) { .pagenav { padding-left: 2rem; padding-right: 2rem; } }
.pagenav a {
  display: block;
  padding: 1rem 1.25rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius, 10px);
  text-decoration: none;
  transition: border-color .18s, background .18s;
}
.pagenav a:hover { border-color: var(--leaf-500); background: var(--leaf-50); }
.pagenav b { display: block; font-size: .6875rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--gray-450); margin-bottom: .3rem; }
.pagenav span { font-size: 1rem; font-weight: 600; color: var(--leaf-900); }
.pagenav .is-next { text-align: right; }

/* ============================================================== FOOTER ===== */
/* This page does not load page.css, so it carries the footer rules itself.
   Keep them in step with the FOOTER block in assets/css/page.css: the page is
   one of thirty-two and the foot of it should not be the odd one out. */

.footer2 { border-top: 1px solid var(--gray-200); background: var(--gray-50); }
.footer2__inner {
  max-width: 1280px; margin: 0 auto;
  padding: 2.25rem 1.5rem;
  display: grid; gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  font-size: .8125rem; color: var(--gray-600);
}
@media (min-width: 640px) { .footer2__inner { padding-left: 2rem; padding-right: 2rem; } }
.footer2 h3 { margin: 0 0 .75rem; font-size: .6875rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gray-450); }
.footer2 ul { margin: 0; padding: 0; list-style: none; }
.footer2 li + li { margin-top: .35rem; }
.footer2__legal { grid-column: 1 / -1; padding-top: 1.5rem; border-top: 1px solid var(--gray-200); font-size: .75rem; color: var(--gray-500); }
.footer2__inner--legal { grid-template-columns: 1fr; }
.footer2__inner--legal .footer2__legal { padding-top: 0; border-top: 0; }
.footer2__legal p { margin: 0 0 .5rem; }
/* underlined: in a line of grey text a link told apart by colour alone fails WCAG 1.4.1 */
.footer2__legal a { text-decoration: underline; text-underline-offset: 2px; }
.footer2 a { color: var(--gray-700); text-decoration: none; }
.footer2 a:hover { color: var(--leaf-700); text-decoration: underline; }
.footer2 code { font-family: var(--font-mono); font-size: .95em; }

/* ============================================================= UTILITY ===== */

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
  .card:hover { transform: none; }
}
