/* ============================================================
   /staff — newsroom directory + individual profile
   Reskinned to the Mavion home design system (mavion.css tokens).
   Premium dark-mode editorial: Fraunces titles, Inter body,
   JetBrains Mono meta. Accent discipline — RED only on live/
   birthday signals, BLUE only on interactive affordances.

   Element IDs/classes are preserved 1:1 so staff.js keeps
   populating them unchanged:
     directory  → .sp-directory / __head / __filters / __pill / __grid
                  + .sp-dir-card (+ __avatar / __role / __dept / __bday)
     profile    → #spProfile / #spAvatar / #spName / #spTitle / #spDept
                  / #spBio / #spDetails / #spLinks / #spEmail / #spShare
                  / #spShortLink + .sp-detail / .sp-link / .sp-action / …
   staff.js builds fallback-avatar gradients with var(--accent-deep);
   we define it below so those gradients resolve to a calm tinted disc.
   ============================================================ */

:root {
  --accent-deep: #0b0c10;   /* deep end of fallback-avatar gradients */
}

/* Material Symbols base — staff.js injects glyph spans at runtime
   (location_on, mail, call, cake, share, check, link, edit). Pin the
   ligature font here so they resolve even if Google's utility class
   isn't applied; the stylesheet <link> ships the @font-face. */
.material-symbols-rounded {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: 'liga';
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  vertical-align: middle;
}

/* ============ MAIN WRAPPER ============ */
.sp-main {
  min-height: 60vh;
  padding: clamp(30px, 4vw, 48px) 0 clamp(60px, 8vw, 100px);
}

/* ---- Loading + 404 (centred utility states) ---- */
.sp-loading,
.sp-404 {
  text-align: center;
  padding: clamp(56px, 9vw, 96px) 24px;
  color: var(--dim);
}
.sp-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  border-top-color: var(--blue);
  display: block;
  margin: 0 auto 18px;
  animation: sp-spin 0.9s linear infinite;
}
@keyframes sp-spin { to { transform: rotate(360deg); } }
.sp-loading p {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dimmer);
}

.sp-404__icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 18px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: var(--blue-soft);
}
.sp-404__icon svg { width: 24px; height: 24px; }
.sp-404 h2 {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  letter-spacing: -0.018em;
  color: var(--white);
  margin: 0 0 10px;
}
.sp-404 p {
  margin: 0 auto 24px;
  color: var(--dim);
  font-size: 0.96rem;
  line-height: 1.6;
  max-width: 420px;
}

/* ============ DIRECTORY VIEW (no hash) ============
   staff.js injects <div class="sp-directory"> into .sp-main. */
.sp-directory {
  padding-top: clamp(18px, 2.5vw, 28px);
}
.sp-directory__head {
  margin-bottom: clamp(20px, 3vw, 30px);
}
.sp-directory__head h1 { display: none; } /* the .phead already shows the headline */
.sp-directory__head p {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dimmer);
  margin: 0;
  max-width: 60ch;
}

/* Department filter pills — same language as .chip in mavion.css:
   rest = hairline + dim, hover = blue cue, active = white fill. */
.sp-directory__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: clamp(18px, 2.4vw, 26px) 0 clamp(24px, 3vw, 34px);
}
.sp-directory__pill {
  flex-shrink: 0;
  white-space: nowrap;
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 8px 15px;
  border-radius: 999px;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: color 0.18s var(--ease-soft), border-color 0.18s, background 0.18s;
}
.sp-directory__pill:hover {
  color: var(--blue);
  border-color: rgba(76, 141, 255, 0.4);
  background: var(--blue-soft);
}
.sp-directory__pill.is-active {
  color: #06070a;
  background: var(--white);
  border-color: var(--white);
}

/* Directory grid */
.sp-directory__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: clamp(16px, 2vw, 24px);
}

/* Staff card */
.sp-dir-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(24px, 3vw, 32px) 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.4s var(--ease), border-color 0.18s, background 0.18s;
}
.sp-dir-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-2);
  background: var(--bg-raised);
}
.sp-dir-card:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.sp-dir-card__avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: 1.7rem;
  font-weight: 500;
  color: var(--white);
  margin-bottom: 16px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  overflow: hidden;
  flex-shrink: 0;
}
.sp-dir-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.sp-dir-card h3 {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: 1.15rem;
  line-height: 1.15;
  letter-spacing: -0.012em;
  margin: 0 0 6px;
  color: var(--white);
}
.sp-dir-card__role {
  font-size: 0.86rem;
  color: var(--dim);
  line-height: 1.4;
  margin-bottom: 8px;
}
.sp-dir-card__dept {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dimmer);
  margin-top: auto;
}
/* Birthday / spotlight chip — RED is the only allowed accent here. */
.sp-dir-card__bday {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--red-soft);
  border: 1px solid rgba(255, 59, 51, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
}
.sp-dir-card__bday .material-symbols-rounded { font-size: 14px; }

/* ============ INDIVIDUAL PROFILE VIEW (#hash) ============ */
.sp-profile {
  max-width: 720px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}

.sp-cover {
  position: relative;
  height: 180px;
  background: var(--bg-raised);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.sp-cover__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 22% 120%, rgba(76, 141, 255, 0.16), transparent 55%),
    radial-gradient(circle at 80% -20%, rgba(255, 255, 255, 0.05), transparent 55%);
}

.sp-avatar {
  position: absolute;
  bottom: -56px;
  left: 50%;
  transform: translateX(-50%);
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 4px solid var(--bg-card);
  box-shadow: 0 0 0 1px var(--line-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: 2.3rem;
  font-weight: 500;
  color: var(--white);
  overflow: hidden;
}
.sp-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.sp-info {
  padding: 76px clamp(24px, 4vw, 40px) clamp(28px, 4vw, 40px);
  text-align: center;
}
.sp-name {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: clamp(1.7rem, 3.4vw, 2.1rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--white);
}
.sp-title {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 6px;
}
.sp-dept {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dimmer);
  margin-bottom: 18px;
}
.sp-bio {
  font-size: 0.98rem;
  color: var(--text);
  line-height: 1.7;
  margin: 0 auto 22px;
  max-width: 52ch;
}

/* Detail chips (location, email, phone) */
.sp-details {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 22px;
}
.sp-detail {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--dim);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 7px 13px;
  border-radius: 999px;
}
.sp-detail .material-symbols-rounded {
  font-size: 14px;
  color: var(--dimmer);
}

/* Links / social rows */
.sp-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 22px auto 0;
  max-width: 380px;
}
.sp-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.18s, background 0.18s;
}
.sp-link:hover {
  background: var(--bg-raised);
  border-color: var(--line-2);
}
.sp-link:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.sp-link__icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--text);
  flex-shrink: 0;
}
.sp-link__icon svg { width: 16px; height: 16px; fill: currentColor; }
/* Social brand tints kept neutral to honour accent discipline —
   the icon glyph carries recognition; surfaces stay on tokens. */
.sp-link__label {
  flex: 1;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
}
.sp-link__arrow {
  font-size: 18px;
  color: var(--dimmer);
  transition: color 0.18s, transform 0.18s;
}
.sp-link:hover .sp-link__arrow {
  color: var(--blue);
  transform: translateX(2px);
}

/* Action buttons */
.sp-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 28px 0 16px;
}
.sp-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 11px;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: filter 0.18s, background 0.18s, border-color 0.18s, color 0.18s, transform 0.12s;
}
.sp-action svg { width: 16px; height: 16px; }
.sp-action:active { transform: scale(0.98); }
.sp-action:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: #fff;
}
.sp-action:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.sp-action--primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #04060c;
}
.sp-action--primary:hover {
  background: var(--blue);
  filter: brightness(1.08);
  color: #04060c;
}

/* Short-link badge */
.sp-short-link {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 0.7rem;
}
.sp-short-link a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--dimmer);
  text-decoration: none;
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  letter-spacing: 0.02em;
  transition: color 0.18s, border-color 0.18s;
}
.sp-short-link a:hover { color: var(--blue); border-color: rgba(76, 141, 255, 0.4); }
.sp-short-link a .material-symbols-rounded { font-size: 13px; }

/* Edit-own chip (logged-in owner) */
.sp-edit-own {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(8, 9, 11, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid var(--line-2);
  z-index: 2;
  transition: color 0.18s, border-color 0.18s;
}
.sp-edit-own:hover { color: var(--blue); border-color: rgba(76, 141, 255, 0.4); }
.sp-edit-own .material-symbols-rounded { font-size: 14px; }

/* Birthday ribbon + theme — RED is the sole accent (it's a live signal). */
.sp-birthday-ribbon {
  position: absolute;
  top: 16px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--red-soft);
  border: 1px solid rgba(255, 59, 51, 0.4);
  color: var(--red);
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  z-index: 2;
}
.sp-birthday-ribbon .material-symbols-rounded { font-size: 14px; }

.sp-profile.is-birthday .sp-cover__bg {
  background:
    radial-gradient(circle at 20% 120%, rgba(255, 59, 51, 0.18), transparent 55%),
    radial-gradient(circle at 80% -20%, rgba(255, 59, 51, 0.1), transparent 55%);
}
.sp-birthday-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.sp-birthday-confetti span {
  position: absolute;
  font-size: 22px;
  animation: sp-confetti 6s linear infinite;
  opacity: 0.85;
}
.sp-birthday-confetti span:nth-child(1) { top: 10%; left: 12%; animation-delay: 0s; }
.sp-birthday-confetti span:nth-child(2) { top: 30%; left: 80%; animation-delay: -1s; }
.sp-birthday-confetti span:nth-child(3) { top: 60%; left: 20%; animation-delay: -2s; }
.sp-birthday-confetti span:nth-child(4) { top: 75%; left: 70%; animation-delay: -3s; }
.sp-birthday-confetti span:nth-child(5) { top: 15%; left: 60%; animation-delay: -4s; }
.sp-birthday-confetti span:nth-child(6) { top: 50%; left: 40%; animation-delay: -5s; }
.sp-birthday-confetti span:nth-child(7) { top: 85%; left: 30%; animation-delay: -2.5s; }
.sp-birthday-confetti span:nth-child(8) { top: 25%; left: 35%; animation-delay: -3.5s; }
@keyframes sp-confetti {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-12px) rotate(180deg); }
}

/* "View all team" link below profile */
.sp-team-link {
  text-align: center;
  padding: clamp(20px, 3vw, 28px) 0 clamp(8px, 2vw, 16px);
}
.sp-team-link a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--dim);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}
.sp-team-link a:hover {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue-soft);
}
.sp-team-link a svg { width: 16px; height: 16px; }
.sp-team-link a .material-symbols-rounded { font-size: 18px; }

/* Admin chip (logged-in staff with admin perms) */
.sp-admin-chip {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(8, 9, 11, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line-2);
  color: var(--text);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  z-index: 2;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 720px) {
  .sp-directory__grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .sp-dir-card { padding: 22px 14px 18px; }
  .sp-dir-card__avatar { width: 76px; height: 76px; font-size: 1.35rem; }
  .sp-dir-card h3 { font-size: 1rem; }
  .sp-profile { max-width: none; }
  .sp-cover { height: 150px; }
  .sp-avatar { width: 104px; height: 104px; font-size: 1.9rem; bottom: -48px; }
  .sp-info { padding-top: 66px; }
  .sp-actions { flex-wrap: wrap; }
}
