/* Jobs picker (#jobs): tick the jobs you want gone, watch your AI team fill in.
   Every selector is scoped to .jobs. Brand tiles copy the look of .team .agent-tile in story.css. */

.jobs { padding-block: 0 var(--section-y); }

/* ---------- Head: same two column rhythm as the team head ---------- */
.jobs .jobs-head {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: end;
  gap: 18px clamp(32px, 6vw, 96px);
}
.jobs .jobs-head h2 { margin-top: 14px; }
.jobs .jobs-head .lede { padding-bottom: 6px; }

.jobs .jobs-body {
  display: grid;
  gap: 16px;
  margin-top: clamp(32px, 4.5vw, 56px);
}
.jobs .jobs-groups {
  display: grid;
  align-content: start;
  gap: clamp(12px, 1.3vw, 18px);
}

/* ---------- One card per agent ---------- */
.jobs .jobs-group {
  min-width: 0;
  margin: 0;
  padding: 20px 18px 20px;
  background: #fff;
  border: 1px solid rgba(20, 18, 14, .06);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 2px rgba(20, 18, 14, .04), 0 22px 48px -34px rgba(20, 18, 14, .45);
  transition: border-color .25s;
}
/* Enzo's row is child 1, so the right hand column of groups is the odd children */
.jobs .jobs-group:nth-child(odd) { --rv-delay: .08s; }
.jobs .jobs-group:has(input:checked) { border-color: rgba(31, 73, 255, .22); }

/* float + full width keeps the legend inside the card padding instead of on the border */
.jobs .jobs-legend {
  float: left;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0;
  margin-bottom: 18px;
}
.jobs .jobs-legend + * { clear: both; }
/* name on top, role and the AI tag underneath, like the team cards */
.jobs .jobs-who { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.jobs .jobs-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px;
  line-height: 1;
  letter-spacing: -.03em;
  font-variation-settings: "opsz" 96;
  color: var(--ink);
}
.jobs .jobs-role {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  color: var(--ink-2);
  font-weight: 500;
  font-size: 14.5px;
}
.jobs .ai-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid rgba(20, 18, 14, .14);
  color: var(--ink-2);
  font-family: var(--mono);
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* Brand tile: initial plus a small job icon. Never a face. */
.jobs .agent-tile {
  position: relative;
  flex: none;
  width: 48px; height: 48px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 24px;
  line-height: 1;
  letter-spacing: -.04em;
  font-variation-settings: "opsz" 96;
  transition: box-shadow .3s var(--ease);
}
.jobs .tile-cobalt { background: var(--cobalt); color: #fff; }
.jobs .tile-sun { background: var(--sun); color: var(--ink); }
.jobs .tile-ink { background: var(--ink); color: var(--paper); }
.jobs .agent-ico {
  position: absolute;
  right: -7px; bottom: -7px;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 0 0 2.5px #fff, 0 4px 10px -4px rgba(20, 18, 14, .35);
}
.jobs .agent-ico svg { width: 12px; height: 12px; }
/* An agent with at least one ticked job gets a sunshine ring: they are on your team now */
.jobs .jobs-group:has(input:checked) .jobs-legend .agent-tile { box-shadow: 0 0 0 3px #fff, 0 0 0 5.5px var(--sun); }

/* ---------- Enzo, the Chief of Staff: a fixed row above the groups, always on your team ---------- */
.jobs .jobs-chief {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px 12px 18px;
  background: #FFFBEC;
  border: 1px solid rgba(255, 201, 49, .6);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 2px rgba(20, 18, 14, .04), 0 22px 48px -34px rgba(20, 18, 14, .45);
}
/* The same sunshine ring a group's tile gets once it has a ticked job: Enzo is on your team already */
.jobs .jobs-chief .agent-tile { width: 42px; height: 42px; border-radius: 13px; font-size: 21px; box-shadow: 0 0 0 3px #FFFBEC, 0 0 0 5px var(--sun); }
.jobs .jobs-chief .agent-ico { right: -6px; bottom: -6px; width: 21px; height: 21px; box-shadow: 0 0 0 2px #FFFBEC, 0 4px 10px -4px rgba(20, 18, 14, .35); }
.jobs .jobs-chief .agent-ico svg { width: 11px; height: 11px; }
.jobs .jobs-chief-text { flex: 1 1 auto; min-width: 0; color: var(--ink-2); font-size: 15px; font-weight: 500; line-height: 1.35; word-spacing: .04em; }
.jobs .jobs-chief-text b { color: var(--ink); font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: -.02em; font-variation-settings: "opsz" 96; }
.jobs .jobs-chief-part { white-space: nowrap; }
.jobs .jobs-chief .ai-tag { flex: none; }

/* ---------- Job chips ---------- */
.jobs .jobs-list { display: grid; gap: 8px; }
.jobs .job {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  padding: 11px 15px 11px 12px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -.005em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .2s, border-color .2s, color .2s, box-shadow .25s var(--ease), transform .2s var(--ease);
}
.jobs .job:hover { background: #fff; border-color: rgba(20, 18, 14, .38); }
.jobs .job input {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  width: 20px; height: 20px;
  margin: 0;
  border: 1.5px solid rgba(20, 18, 14, .32);
  border-radius: 6px;
  background: #fff center / 14px 14px no-repeat;
  cursor: pointer;
  transition: background-color .2s, border-color .2s;
}
.jobs .job input:checked {
  background-color: var(--cobalt);
  border-color: var(--cobalt);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.4l2.9 2.9 6-6.6' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.jobs .job input:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; border-radius: 6px; }
.jobs .job:has(input:focus-visible) { border-color: var(--cobalt); }

/* Checked: the whole chip fills cobalt, the box shows a white check */
.jobs .job:has(input:checked) {
  background: var(--cobalt);
  border-color: var(--cobalt);
  color: #fff;
  box-shadow: 0 10px 22px -14px rgba(31, 73, 255, .9);
}
.jobs .job:has(input:checked):hover { background: var(--cobalt-deep); border-color: var(--cobalt-deep); }
.jobs .job:has(input:checked) input { background-color: rgba(255, 255, 255, .16); border-color: #fff; }
.jobs .job:has(input:checked) input:focus-visible { outline-color: var(--sun); }

/* ---------- Summary: your AI team so far ---------- */
.jobs .jobs-summary {
  padding: clamp(22px, 2.2vw, 28px);
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-md);
  box-shadow: 0 30px 60px -34px rgba(20, 18, 14, .7);
}
.jobs .jobs-summary :focus-visible { outline-color: var(--sun); }
.jobs .jobs-summary h3 { color: var(--paper); font-size: clamp(24px, 2vw, 28px); }

.jobs .jobs-empty { margin-top: 14px; }
.jobs .jobs-empty p { color: rgba(255, 253, 246, .74); font-size: 15px; }
/* Empty slots under Enzo, one per specialist, until the first job is ticked */
.jobs .jobs-ghosts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.jobs .jobs-ghosts i {
  width: 32px; height: 32px;
  border-radius: 10px;
  border: 1.5px dashed rgba(255, 253, 246, .3);
}

.jobs .jobs-count {
  margin-top: 14px;
  color: var(--sun);
  font-family: var(--mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.jobs .jobs-team {
  list-style: none;
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
}
.jobs .jobs-team:empty { display: none; }
.jobs .jobs-member {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 12px 8px 8px;
  background: rgba(255, 253, 246, .06);
  border: 1px solid rgba(255, 253, 246, .1);
  border-radius: 14px;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.3;
}
.jobs .jobs-member-text { color: rgba(255, 253, 246, .76); word-spacing: .08em; }
.jobs .jobs-member-text b { color: var(--paper); font-weight: 600; }
.jobs .jobs-member-part { white-space: nowrap; }
.jobs .jobs-member .agent-tile {
  width: 38px; height: 38px;
  border-radius: 12px;
  font-size: 19px;
  box-shadow: 0 0 0 1.5px rgba(255, 253, 246, .22);
}
.jobs .jobs-member .agent-ico {
  right: -6px; bottom: -6px;
  width: 19px; height: 19px;
  box-shadow: 0 0 0 2px var(--ink);
}
.jobs .jobs-member .agent-ico svg { width: 10px; height: 10px; }
/* Enzo heads the list every time: a warm edge, and his ink tile gets a sunshine ring */
.jobs .jobs-member.is-chief { background: rgba(255, 201, 49, .08); border-color: rgba(255, 201, 49, .34); }
.jobs .jobs-member.is-chief .agent-tile { box-shadow: 0 0 0 1.5px var(--sun); }

.jobs .jobs-note {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 253, 246, .14);
  color: rgba(255, 253, 246, .74);
  font-size: 14px;
  line-height: 1.5;
}
.jobs #jobsBook { width: 100%; margin-top: 18px; }
.jobs .jobs-clear {
  display: block;
  margin: 10px auto 0;
  padding: 6px 12px;
  background: none;
  border: 0;
  border-radius: 8px;
  color: rgba(255, 253, 246, .78);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.jobs .jobs-clear:hover { color: var(--paper); }

/* ---------- Motion, only when welcome ---------- */
@media (prefers-reduced-motion: no-preference) {
  .jobs .job:active { transform: scale(.975); }
  .jobs .jobs-member.is-new { animation: jobs-join .45s var(--ease) both; }
}
@keyframes jobs-join {
  from { opacity: 0; transform: translateY(8px) scale(.97); }
  to { opacity: 1; transform: none; }
}

/* ---------- Layout ---------- */
@media (min-width: 900px) {
  .jobs .jobs-body {
    grid-template-columns: minmax(0, 1fr) clamp(290px, 26vw, 360px);
    align-items: start;
    gap: clamp(16px, 1.8vw, 24px);
  }
  .jobs .jobs-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .jobs .jobs-summary { position: sticky; top: 96px; }
}
@media (max-width: 899px) {
  .jobs .jobs-head { grid-template-columns: 1fr; }
}
@media (max-width: 639px) {
  .jobs .jobs-group { padding: 18px 16px; }
  /* Enzo's row: the AI tag moves under the words so they keep a full line on a small phone */
  .jobs .jobs-chief { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 16px; padding: 14px 16px 14px 18px; }
  .jobs .jobs-chief .agent-tile { grid-row: span 2; align-self: center; }
  .jobs .jobs-chief .ai-tag { justify-self: start; }
  .jobs .jobs-name { font-size: 22px; }
  .jobs .job { font-size: 14.5px; }
}

/* ---------- Phone bar: a small reminder while the summary panel is still below the screen ----------
   jobs.js adds .is-on. Without the script the bar keeps its hidden attribute and never shows. */
.jobs .jobs-bar { display: none; }
@media (max-width: 767px) {
  .jobs .jobs-bar {
    position: fixed;
    z-index: 40;
    left: max(16px, env(safe-area-inset-left, 0px));
    right: max(16px, env(safe-area-inset-right, 0px));
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 8px 8px 16px;
    background: var(--ink);
    color: var(--paper);
    border-radius: 18px;
    box-shadow: 0 0 0 1px rgba(255, 253, 246, .1) inset, 0 18px 40px -16px rgba(20, 18, 14, .7);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, visibility 0s linear .2s;
  }
  .jobs .jobs-bar.is-on {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition: opacity .2s, visibility 0s;
  }
  .jobs .jobs-bar-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    line-height: 1.1;
  }
  .jobs .jobs-bar-k {
    color: rgba(255, 253, 246, .72);
    font-family: var(--mono);
    font-weight: 500;
    font-size: 10.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
    white-space: nowrap;
  }
  .jobs .jobs-bar-text b {
    color: var(--sun);
    font-family: var(--display);
    font-weight: 700;
    font-size: 19px;
    letter-spacing: -.02em;
    font-variation-settings: "opsz" 96;
    white-space: nowrap;
  }
  .jobs .jobs-bar-book { --h: 42px; flex: none; padding: 0 16px; font-size: 14px; }
  /* A chip that takes keyboard focus scrolls clear of the bar instead of hiding under it */
  html:has(.jobs .jobs-bar.is-on) { scroll-padding-bottom: 88px; }
}
@media (max-width: 359px) {
  .jobs .jobs-bar { gap: 8px; padding-left: 12px; }
  .jobs .jobs-bar-k { font-size: 9.5px; letter-spacing: .06em; }
  .jobs .jobs-bar-text b { font-size: 17px; }
  .jobs .jobs-bar-book { padding: 0 12px; font-size: 13px; }
}
/* The small rise only when motion is welcome; with reduced motion the bar simply appears */
@media (max-width: 767px) and (prefers-reduced-motion: no-preference) {
  .jobs .jobs-bar { transform: translateY(10px); transition: opacity .2s, transform .3s var(--ease), visibility 0s linear .3s; }
  .jobs .jobs-bar.is-on { transform: none; transition: opacity .2s, transform .3s var(--ease), visibility 0s; }
}
