/* Open roles panel: count, team filter and city cards. Careers filters with it; the Team page links
   into careers with it */
.career-roles__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 2.4vw, 36px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  color: #FAFAF7;
}

/* ---------- Team filter: text buttons with the blog's sliding bar ---------- */
.role-filters {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 18px 0 0 -14px;
}
.role-filter {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  min-height: 44px;
  padding: 12px 14px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: rgba(250, 250, 247, 0.62);
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: color 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.role-filter:hover,
.role-filter[aria-pressed="true"],
.role-filter.is-current { color: #FAFAF7; }
.role-filter:focus-visible {
  outline: 2px solid rgba(180, 156, 255, 0.9);
  outline-offset: -2px;
}
.role-filters__bar {
  position: absolute;
  top: 0;
  left: 0;
  display: none;
  width: var(--bar-w, 0);
  height: 2px;
  background: #D4C6FB;
  pointer-events: none;
  transform: translate(var(--bar-x, 0), var(--bar-y, 39px));
  transition:
    transform 460ms cubic-bezier(0.2, 0.8, 0.2, 1),
    width 460ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.role-filters.has-bar .role-filters__bar { display: block; }
/* Without the script there is no bar, so the chosen team is underlined in place */
.role-filters:not(.has-bar) .role-filter[aria-pressed="true"],
.role-filters:not(.has-bar) .role-filter.is-current {
  text-decoration: underline 2px #D4C6FB;
  text-underline-offset: 10px;
}
.role-filter__count {
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: rgba(250, 250, 247, 0.42);
}
.role-filter:disabled {
  opacity: 0.4;
  cursor: default;
}
.role-filter:disabled:hover { color: rgba(250, 250, 247, 0.62); }

.roles-panel {
  padding: clamp(22px, 2.6vw, 36px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  background: rgba(11, 13, 18, 0.82);
}
.roles-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.roles-panel__lead { min-width: 0; }
.roles-panel__tally {
  display: grid;
  justify-items: end;
  gap: 10px;
  flex: none;
  text-align: right;
}
.roles-panel__count {
  display: grid;
  justify-items: end;
  gap: 8px;
  margin: 0;
}
.roles-panel__number {
  font-family: var(--font-display);
  font-size: clamp(56px, 5.6vw, 80px);
  font-weight: 500;
  line-height: 0.86;
  font-variant-numeric: tabular-nums;
  color: #FAFAF7;
}
.roles-panel__unit {
  max-width: 16em;
  font-size: 14px;
  line-height: 1.35;
  color: rgba(250, 250, 247, 0.6);
}
.roles-panel__reset {
  min-height: 32px;
  padding: 0;
  border: 0;
  background: none;
  color: #D4C6FB;
  font: 500 14px/1 var(--font-sans);
  text-decoration: underline 1px rgba(212, 198, 251, 0.4);
  text-underline-offset: 4px;
  cursor: pointer;
}
.roles-panel__reset[hidden] { display: none; }
.roles-panel__reset:hover { text-decoration-color: #D4C6FB; }
.roles-panel__reset:focus-visible,
.city-card:focus-visible {
  outline: 2px solid rgba(180, 156, 255, 0.9);
  outline-offset: 3px;
}

.city-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: clamp(24px, 2.6vw, 36px);
}
.city-card {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: #0B0D12;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  isolation: isolate;
  transition: border-color 260ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.city-card__media {
  position: absolute;
  inset: 0;
  z-index: -1;
}
.city-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  transition: transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1), filter 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.city-card__label {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(11, 13, 18, 0.82);
  font-size: 13.5px;
  font-weight: 500;
  color: #FAFAF7;
  white-space: nowrap;
}
.city-card__body {
  position: absolute;
  right: 16px;
  bottom: 14px;
  left: 16px;
  display: grid;
  gap: 4px;
}
.city-card__count {
  font-size: 14px;
  font-weight: 500;
  color: #D4C6FB;
}

/* Chosen city: brighter border and full ticks; the others step back */
.city-card[aria-pressed="true"] { border-color: rgba(212, 198, 251, 0.7); }
.city-cards.has-choice .city-card[aria-pressed="false"] { opacity: 0.55; }
.city-cards.has-choice .city-card[aria-pressed="false"]:hover { opacity: 0.85; }
.city-card:disabled,
.city-cards.has-choice .city-card:disabled {
  opacity: 0.3;
  cursor: default;
}
@media (hover: hover) {
  .city-card:disabled:hover { border-color: rgba(255, 255, 255, 0.12); }
  .city-card:not(:disabled):hover { border-color: rgba(255, 255, 255, 0.28); }
  .city-card[aria-pressed="true"]:hover { border-color: rgba(212, 198, 251, 0.85); }
  .city-card:not(:disabled):hover .city-card__media img {
    transform: scale(1.0);
    filter: brightness(1.18);
  }
}

/* Corner ticks, as on the blog cards */
.ticks {
  --tc: rgba(212, 198, 251, 0.8);
  --t: 12px;
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(var(--tc), var(--tc)) left top / var(--t) 1px no-repeat,
    linear-gradient(var(--tc), var(--tc)) left top / 1px var(--t) no-repeat,
    linear-gradient(var(--tc), var(--tc)) right top / var(--t) 1px no-repeat,
    linear-gradient(var(--tc), var(--tc)) right top / 1px var(--t) no-repeat,
    linear-gradient(var(--tc), var(--tc)) left bottom / var(--t) 1px no-repeat,
    linear-gradient(var(--tc), var(--tc)) left bottom / 1px var(--t) no-repeat,
    linear-gradient(var(--tc), var(--tc)) right bottom / var(--t) 1px no-repeat,
    linear-gradient(var(--tc), var(--tc)) right bottom / 1px var(--t) no-repeat;
  opacity: 0;
  transition: background-size 460ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.city-card:not(:disabled):hover .ticks,
.city-card[aria-pressed="true"] .ticks,
.city-card.is-composing .ticks { opacity: 1; }
.city-card[aria-pressed="true"] .ticks {
  background-size:
    32px 1px, 1px 32px, 32px 1px, 1px 32px,
    32px 1px, 1px 32px, 32px 1px, 1px 32px;
}

/* Shards a card falls together from (built by roles-panel.js while it composes) */
.shards {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.shard { position: absolute; }
.city-card.is-composing {
  z-index: 3;
  overflow: visible;
  border-color: transparent;
  background: transparent;
}
.city-card.is-composing .city-card__media { visibility: hidden; }
.city-card.is-composing :is(.city-card__label, .city-card__body) { z-index: 2; }

@media (prefers-reduced-motion: no-preference) {
  /* Hidden until roles-panel.js throws the pieces in; visible anyway if it never runs */
  .city-card.is-armed { visibility: hidden; animation: compose-failsafe 0s 3s forwards; }
  .city-card.is-composing .ticks {
    animation: ticks-lock 900ms cubic-bezier(0.16, 1, 0.3, 1) var(--tick-delay, 640ms) backwards;
  }
}
@media (prefers-reduced-motion: reduce) {
  .city-card,
  .city-card__media img,
  .ticks { transition: none; }
}
@keyframes compose-failsafe {
  to { visibility: visible; }
}
@keyframes ticks-lock {
  from {
    background-size:
      64px 1px, 1px 64px, 64px 1px, 1px 64px,
      64px 1px, 1px 64px, 64px 1px, 1px 64px;
  }
}

@media (max-width: 960px) {
  .city-cards { grid-template-columns: minmax(0, 1fr); }
  .city-card { aspect-ratio: auto; min-height: 176px; }
}
@media (max-width: 720px) {
  .roles-panel { margin: 0 -8px; padding: 20px 16px 16px; border-radius: 16px; }
  /* Title and count share the top row; the team filter scrolls under them */
  .roles-panel__head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title   tally"
      "filters filters";
    align-items: start;
    gap: 0 16px;
  }
  .roles-panel__lead { display: contents; }
  .roles-panel .career-roles__title { grid-area: title; padding-top: 6px; }
  .roles-panel__tally { grid-area: tally; gap: 6px; }
  .roles-panel .role-filters { grid-area: filters; }
  .roles-panel__number { font-size: 44px; }
  .roles-panel__unit { max-width: 11em; font-size: 13px; }
}

/* Join button: a strip in the city cards' theme, with their hover */
.roles-panel__join {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  margin-top: 12px;
  padding: 0 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: #0B0D12;
  color: #FAFAF7;
  font: 500 16px/1.25 var(--font-sans);
  text-decoration: none;
  isolation: isolate;
  transition: border-color 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
/* Halftone dots in the photos' indigo, fading in towards the arrow */
.roles-panel__join-dots {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(rgba(163, 166, 239, 0.75) 1.3px, transparent 1.8px) 0 0 / 8px 8px,
    linear-gradient(90deg, rgba(93, 107, 230, 0) 30%, rgba(93, 107, 230, 0.16));
  -webkit-mask-image: linear-gradient(90deg, transparent 18%, rgba(0, 0, 0, 0.55) 60%, #000);
          mask-image: linear-gradient(90deg, transparent 18%, rgba(0, 0, 0, 0.55) 60%, #000);
  transform: scale(1.04);
  transition: transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1), filter 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.roles-panel__join-label { position: relative; }
.roles-panel__join-arrow {
  position: relative;
  color: #D4C6FB;
  font-size: 18px;
  transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.roles-panel__join:focus-visible {
  outline: 2px solid rgba(180, 156, 255, 0.9);
  outline-offset: 3px;
}
.roles-panel__join:focus-visible .ticks { opacity: 1; }
@media (hover: hover) {
  .roles-panel__join:hover { border-color: rgba(255, 255, 255, 0.28); }
  .roles-panel__join:hover .ticks { opacity: 1; }
  .roles-panel__join:hover .roles-panel__join-dots {
    transform: scale(1.0);
    filter: brightness(1.18);
  }
  .roles-panel__join:hover .roles-panel__join-arrow { transform: translateX(4px); }
}
@media (prefers-reduced-motion: reduce) {
  .roles-panel__join,
  .roles-panel__join-dots,
  .roles-panel__join-arrow { transition: none; }
}

/* Phones: a smaller title, and the team filter becomes a chip scroller */
@media (max-width: 720px) {
  .career-roles__title { font-size: clamp(24px, 7.2vw, 28px); }
  /* Chip scroller */
  .role-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 8px -16px 0;
    padding: 0 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 36px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 36px), transparent 100%);
  }
  .role-filters::-webkit-scrollbar { display: none; }
}
@media (max-width: 420px) {
  .role-filters {
    margin-left: -16px;
    margin-right: -16px;
    padding: 0 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .role-filter,
  .role-filters__bar { transition: none; }
}
