/* Who we are: the crew as cards, one row per team. Built by who-crew.js from the roster
   in who-we-are.html. Every class here is prefixed wo-. Without JS the roster shows as
   the plain full grid (the .wo-js class is only added once the script runs). */

:root { --wo-ease: cubic-bezier(0.16, 1, 0.3, 1); }

.wo-stage { position: relative; margin-top: 4px; }
.wo-stage [hidden] { display: none !important; }
.wo-stage:not(.wo-js) .wo-toolbar,
.wo-stage:not(.wo-js) .wo-cards { display: none; }
.wo-stage:not(.wo-js) .wo-all > summary { display: none; }

.wo-stage :focus-visible { outline: 2px solid var(--accent-blue, #0062ff); outline-offset: 3px; }

/* Toolbar: just the pause button, on the right */
.wo-toolbar { display: flex; align-items: center; justify-content: flex-end; margin: 0 0 14px; }
.wo-btn {
  font-family: var(--font-mono, monospace); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  line-height: 1; min-height: 36px; padding: 9px 14px; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, 0.85); border: 1px solid rgba(15, 23, 42, 0.12); color: #0f172a;
  transition: background 0.3s var(--wo-ease), color 0.3s var(--wo-ease), border-color 0.3s var(--wo-ease);
}
.wo-btn:hover { border-color: rgba(0, 98, 255, 0.4); color: var(--accent-blue, #0062ff); }

/* ---------- Team rows ---------- */
.wo-cards { display: grid; gap: 26px; }
.wo-row-title {
  display: flex; align-items: center; gap: 12px; margin: 0 0 12px;
  font-family: var(--font-mono, monospace); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #475569;
}
.wo-row-title::after { content: ""; flex: 1; height: 1px; background: rgba(15, 23, 42, 0.1); }
.wo-row-grid { margin-top: 0; perspective: 1200px; }
.wo-slot { min-width: 0; height: 100%; }
.wo-slot > .who-agent { height: 100%; }
.wo-slot.is-flipping { animation: wo-flip 0.6s var(--wo-ease) both; }
@keyframes wo-flip {
  0% { transform: rotateY(0deg); }
  50% { transform: rotateY(90deg); }
  100% { transform: rotateY(0deg); }
}
.wo-you-wrap { margin-top: 0; }

/* ---------- Show every card ---------- */
.wo-all { margin-top: 26px; }
.wo-all > summary {
  display: inline-flex; align-items: center; min-height: 36px; padding: 9px 14px; border-radius: 999px; cursor: pointer; list-style: none;
  font-family: var(--font-mono, monospace); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: #0f172a; background: rgba(255, 255, 255, 0.85); border: 1px solid rgba(15, 23, 42, 0.12);
}
.wo-all > summary::-webkit-details-marker { display: none; }
.wo-all > summary:hover { color: var(--accent-blue, #0062ff); border-color: rgba(0, 98, 255, 0.4); }
.wo-all[open] > summary { margin-bottom: 16px; }
/* With the script running the roster is only a source; "Show every card" opens the rows */
.wo-stage.wo-js .wo-all { display: none; }
.wo-more { display: inline-flex; align-items: center; margin-top: 22px; }
.wo-stage.is-expanded .wo-toolbar { visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
  .wo-btn { transition: none; }
  .wo-slot.is-flipping { animation: none; }
}

/* ---------- More compact (Mars, 21 Nov) ----------
   Smaller avatar and type, tighter padding and gaps, the description held to three lines,
   so both team rows and the open seat sit in much less height. */
#crew .wo-cards { gap: 18px; }
#crew .wo-row-title { margin-bottom: 8px; }
#crew .wo-row-grid.who-crew-grid { gap: 12px; }
#crew .who-crew-grid .who-agent {
  grid-template-columns: 52px minmax(0, 1fr); column-gap: 12px; padding: 13px 15px 12px;
}
#crew .who-agent > .who-avatar,
#crew .who-agent > .who-you-mark { width: 52px; height: 52px; }
#crew .who-agent > .who-you-mark { border-radius: 14px; }
#crew .who-agent > .who-tag { font-size: 0.6rem; padding: 2px 8px; }
#crew .who-agent > h3 { font-size: 1rem; margin-top: 1px; }
#crew .who-agent > .who-role { font-size: 0.8rem; }
#crew .who-agent > p:not(.who-role) {
  margin-top: 6px; font-size: 0.82rem; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
#crew .who-agent > .who-link { padding-top: 6px; font-size: 0.82rem; }
#crew .wo-toolbar { margin-bottom: 8px; }
#crew .wo-all { margin-top: 18px; }
/* Phones: each team is one row you swipe sideways, instead of a long stack of cards */
@media (max-width: 600px) {
  #crew .wo-row-grid.who-crew-grid {
    display: flex !important; overflow-x: auto; gap: 10px; margin: 0 -16px !important; padding: 2px 16px 8px !important; scroll-padding-left: 16px;
    scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  #crew .wo-row-grid.who-crew-grid::-webkit-scrollbar { display: none; }
  #crew .wo-row-grid > .wo-slot { flex: 0 0 82%; scroll-snap-align: start; }
}

/* Rows and the "Your project" card keep to the column width (the phone swipe rows would widen it) */
#crew .wo-cards { grid-template-columns: minmax(0, 1fr); }
#crew .wo-cards > .wo-row, #crew .wo-you-wrap { min-width: 0; }
#crew .wo-you-wrap { grid-template-columns: minmax(0, 1fr); }
/* ===== Dark mode (html[data-theme="dark"]) ===== */
:root[data-theme="dark"] .wo-btn,
:root[data-theme="dark"] .wo-all > summary{ background:var(--dk-s2); border-color:var(--dk-line-3); color:var(--text-primary); box-shadow:inset 0 1px 0 var(--dk-light-top); }
:root[data-theme="dark"] .wo-btn:hover,
:root[data-theme="dark"] .wo-all > summary:hover{ background:var(--dk-s3); border-color:rgba(129,170,247,.5); color:var(--blue-text); }
:root[data-theme="dark"] .wo-row-title{ color:var(--text-secondary); }
:root[data-theme="dark"] .wo-row-title::after{ background:var(--dk-line-3); }
:root[data-theme="dark"] .wo-stage :focus-visible{ outline-color:var(--dk-focus); }

/* ===== Phones: the crew as a flock (Mars, 23 Nov) — who-crew.js builds it; desktop keeps the card rows ===== */
.wo-flock { display: none; }
@media (max-width: 767px) {
  .wo-flock-on .wo-cards, .wo-flock-on .wo-more { display: none !important; }
  .wo-flock-on .wo-flock { display: block; }
  .wo-sky { position: relative; height: 200px; margin: 4px 0 6px; }
  .wo-bird {
    position: absolute; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
    background: none; -webkit-tap-highlight-color: transparent;
    transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
    animation: woDrift calc(7s + var(--i) * 0.41s) ease-in-out calc(var(--i) * -0.9s) infinite alternate;
  }
  .wo-bird img { width: 100%; height: 100%; border-radius: 50%; display: block; box-shadow: 0 0 0 2px rgba(0, 98, 255, 0.35); background: #fff; }
  .wo-bird.is-mkt img { box-shadow: 0 0 0 2px rgba(15, 95, 166, 0.35); }
  .wo-bird.is-persona img { box-shadow: 0 0 0 2px rgba(255, 107, 0, 0.55); }
  .wo-bird.is-away { opacity: 0.15; transform: scale(0.7); }
  .wo-bird:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 3px; }
  .wo-story { min-height: 330px; text-align: center; opacity: 0; transform: translateY(8px); transition: opacity 0.4s ease, transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1); }
  .wo-story.is-in { opacity: 1; transform: none; }
  .wo-story-in { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0 6px; }
  .wo-story-ava { width: 96px; height: 96px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(0, 98, 255, 0.35); margin-bottom: 8px; }
  .wo-story-ava--you { display: grid; place-items: center; background: transparent; border: 2px dashed var(--accent-orange); box-shadow: none; color: var(--accent-orange); }
  .wo-story-ava--you svg { width: 34px; height: 34px; }
  .wo-story-tag { font: 500 0.7rem/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-secondary); }
  .wo-story-name { margin: 4px 0 0; font: 700 1.6rem/1.15 var(--font-display); color: var(--text-primary); }
  .wo-story-role { margin: 0; font: 600 0.98rem/1.35 var(--font-display); color: var(--accent-blue); }
  .wo-story-line { margin: 6px 0 0; max-width: 34ch; font-size: 1rem; line-height: 1.6; color: var(--text-secondary); }
  .wo-story-link { margin-top: 10px; font: 600 0.95rem/1.3 var(--font-display); color: var(--accent-blue); text-decoration: none; }
  .wo-ghost { position: fixed; z-index: 50; border-radius: 50%; pointer-events: none; transform-origin: 0 0; background: #fff; }
}
@keyframes woDrift {
  0% { transform: translate(0, 0); }
  50% { transform: translate(5px, -7px); }
  100% { transform: translate(-6px, 4px); }
}
@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .wo-bird { animation: none; }
  .wo-story, .wo-bird { transition: none; }
}
.wo-flock-on.is-paused .wo-bird { animation-play-state: paused; }
:root[data-theme="dark"] .wo-bird img { box-shadow: 0 0 0 2px rgba(70, 140, 255, 0.55); }
:root[data-theme="dark"] .wo-bird.is-mkt img { box-shadow: 0 0 0 2px rgba(113, 193, 224, 0.55); }
:root[data-theme="dark"] .wo-bird.is-persona img { box-shadow: 0 0 0 2px rgba(255, 125, 40, 0.7); }
:root[data-theme="dark"] .wo-story-ava { box-shadow: 0 0 0 3px rgba(70, 140, 255, 0.55); }
:root[data-theme="dark"] :is(.wo-story-role, .wo-story-link) { color: var(--blue-text); }
