/* ===========================================================================
   APPLY — /careers, /partners and their detail pages
   Loaded after pages.css and inherits its tokens (--red, --fg, --muted,
   --line, --mono, --sans, --display).

   Two page shapes:
     index   — one line per opening, filterable. Nothing expands in place.
     detail  — one opening per page, with the form that belongs to it.
   =========================================================================== */

/* ---------------------------------------------------------------------------
   PRINCIPLES — four short statements under the hero. Prose, not cards.
   -------------------------------------------------------------------------- */
.principles {
  display: grid;
  gap: 14px;
  max-width: 74ch;
  padding: clamp(30px, 4.5vw, 52px) 0 clamp(10px, 2vw, 22px);
}
.principles p { color: var(--muted); font-size: .95rem; line-height: 1.62; }
.principles b { color: var(--fg); font-weight: 600; }

/* ---------------------------------------------------------------------------
   FILTER CHIPS
   -------------------------------------------------------------------------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: clamp(26px, 4vw, 44px);
}
.chip {
  padding: 9px 16px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 600 10.5px/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}
@media (hover: hover) { .chip:hover { color: var(--fg); border-color: rgba(255, 255, 255, .24); } }
.chip[aria-pressed="true"] {
  border-color: var(--red);
  background: rgba(255, 34, 51, .1);
  color: var(--fg);
}
@media (prefers-reduced-motion: reduce) { .chip { transition: none; } }

/* ---------------------------------------------------------------------------
   OPENINGS INDEX — one row per opening. Title left, the two deciding facts
   right, hairline between. Everything else is on the opening's own page.
   -------------------------------------------------------------------------- */
.ops { padding-bottom: clamp(40px, 6vw, 80px); }
.op-group + .op-group { margin-top: clamp(34px, 5vw, 58px); }
.op-group[hidden] { display: none; }

.op-group-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
  color: var(--muted);
  font: 700 10px/1 var(--mono);
  letter-spacing: .22em;
  text-transform: uppercase;
}
.op-group-title span { color: var(--red); }

.op {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 21px 2px;
  border-bottom: 1px solid var(--line);
  color: var(--fg);
  text-decoration: none;
  transition: border-color .2s ease;
}
.op:first-of-type { border-top: 1px solid var(--line); }
@media (hover: hover) {
  .op:hover { border-bottom-color: rgba(255, 34, 51, .55); }
  .op:hover .op-name { color: var(--red); }
  .op:hover .op-go { transform: translateX(4px); color: var(--red); }
}
.op:focus-visible { outline-offset: -3px; }

.op-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: clamp(1.02rem, 2vw, 1.24rem);
  font-weight: 600;
  letter-spacing: -0.012em;
  transition: color .2s ease;
}
.op-sub {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 400;
  letter-spacing: 0;
}

.op-meta { display: flex; flex: none; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.op-pill {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font: 600 9.5px/1.5 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}
/* Equity-first and volunteer are the facts most likely to change someone's
   mind, so they are tinted rather than left to read as an ordinary job. */
.op-pill--accent { border-color: rgba(255, 34, 51, .42); color: #ff8b95; }

.op-go { flex: none; color: var(--muted); font-size: 1rem; transition: transform .2s ease, color .2s ease; }
@media (prefers-reduced-motion: reduce) {
  .op, .op-name, .op-go { transition: none; }
}
.ops-empty { padding: 30px 0; color: var(--muted); }

/* ---------------------------------------------------------------------------
   DETAIL PAGE
   -------------------------------------------------------------------------- */
.back {
  display: inline-block;
  margin-top: 6px;
  color: var(--muted);
  font: 600 10.5px/1 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color .18s ease;
}
.back:hover { color: var(--red); }

.detail-head { padding-top: clamp(24px, 4vw, 46px); }
.detail-head h1 { font-size: clamp(2.1rem, 6.4vw, 4.4rem); }
.detail-sub { margin-top: 12px; color: var(--muted); font-size: 1.05rem; }
.detail-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.detail-head .page-lede { max-width: 54ch; }

.detail-body { max-width: 680px; padding-top: clamp(34px, 5vw, 60px); }
.detail-body > section + section,
.detail-body > section + p,
.detail-body > p + section { margin-top: clamp(32px, 4.5vw, 50px); }

.detail-h2 {
  margin-bottom: 16px;
  color: var(--red);
  font: 700 10px/1 var(--mono);
  letter-spacing: .22em;
  text-transform: uppercase;
}

.detail-list { display: grid; gap: 11px; padding-left: 0; list-style: none; }
.detail-list li {
  position: relative;
  padding-left: 22px;
  color: rgba(245, 245, 247, .8);
  font-size: .98rem;
  line-height: 1.6;
}
.detail-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .7em;
  width: 9px;
  height: 1px;
  background: rgba(255, 34, 51, .8);
}

.detail-terms {
  margin-top: clamp(30px, 4vw, 44px);
  padding: 15px 18px;
  border-left: 2px solid var(--red);
  border-radius: 0 8px 8px 0;
  background: rgba(255, 34, 51, .05);
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.6;
}
.detail-terms b { color: var(--fg); font-weight: 600; }
.detail-terms--soft { border-left-color: rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .03); }

/* What happens next — the same three steps the confirmation email repeats. */
.next-list { display: grid; gap: 0; padding-left: 0; list-style: none; }
.next-list li {
  position: relative;
  display: flex;
  gap: 18px;
  padding: 0 0 22px 0;
}
.next-list li:last-child { padding-bottom: 0; }
/* The rail runs between the markers, so it stops at the last one. */
.next-list li:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 28px;
  bottom: 2px;
  width: 1px;
  background: var(--line);
}
.next-n {
  position: relative;
  z-index: 1;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  border: 1px solid rgba(255, 34, 51, .5);
  border-radius: 50%;
  background: var(--ink);
  color: var(--red);
  font: 700 9.5px/1 var(--mono);
  letter-spacing: .04em;
}
.next-list p { color: rgba(245, 245, 247, .78); font-size: .96rem; line-height: 1.6; padding-top: 3px; }

/* ---------------------------------------------------------------------------
   FORM — underlined fields, matching the page's rule-and-space language
   rather than introducing boxed inputs.
   -------------------------------------------------------------------------- */
.apply { padding-top: clamp(40px, 5.5vw, 66px); scroll-margin-top: calc(var(--nav-h) + 24px); }

.ap-form { max-width: 680px; }
.ap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 22px;
}
.ap-field { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.ap-field--full { grid-column: 1 / -1; }
/* The message field sits outside .ap-grid, so it gets no grid gap — without
   this its label lands on the previous field's underline. */
.ap-grid + .ap-field { margin-top: 26px; }

.ap-field label {
  color: rgba(245, 245, 247, .8);
  font: 600 10px/1.4 var(--mono);
  letter-spacing: .17em;
  text-transform: uppercase;
}
.ap-field label span { margin-left: 8px; color: var(--muted); font-weight: 400; letter-spacing: .1em; }

.ap-field input,
.ap-field textarea {
  width: 100%;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  font-family: var(--sans);
  /* 16px exactly: anything smaller and iOS zooms the page on focus. */
  font-size: 16px;
  line-height: 1.5;
  transition: border-color .18s ease;
  -webkit-appearance: none;
  appearance: none;
}
.ap-field textarea { min-height: 130px; resize: vertical; }
.ap-field input::placeholder,
.ap-field textarea::placeholder { color: rgba(245, 245, 247, .28); }

.ap-field input:focus,
.ap-field textarea:focus { border-bottom-color: var(--red); outline: none; }
.ap-field input:focus-visible,
.ap-field textarea:focus-visible { outline: 2px solid rgba(255, 34, 51, .75); outline-offset: 4px; }
.ap-field [aria-invalid="true"] { border-bottom-color: var(--red); }

.ap-hint { color: var(--muted); font: 400 11px/1.5 var(--mono); letter-spacing: .08em; }
.ap-hint.is-short { color: #ff8b95; }

/* Off-screen rather than display:none — some bots skip hidden inputs. */
.ap-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.ap-consent {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-top: 30px;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.6;
  cursor: pointer;
}
.ap-consent input {
  flex: none;
  width: 19px;
  height: 19px;
  margin-top: 2px;
  accent-color: var(--red);
  cursor: pointer;
}
.ap-consent a { color: var(--fg); text-decoration: none; border-bottom: 1px solid rgba(255, 34, 51, .5); }
.ap-consent a:hover { color: var(--red); }
.ap-consent input[aria-invalid="true"] { outline: 2px solid var(--red); outline-offset: 3px; }

.ap-status { margin-top: 18px; color: #ff8b95; font-size: .9rem; line-height: 1.5; }
.ap-status:empty { margin-top: 0; }

.ap-submit,
.ap-done {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  padding: 15px 32px;
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font: 700 13px/1 var(--sans);
  letter-spacing: .05em;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s ease;
}
@media (hover: hover) { .ap-submit:hover, .ap-done:hover { background: #ff4351; } }
.ap-submit:disabled { background: rgba(255, 34, 51, .4); cursor: progress; }
@media (prefers-reduced-motion: reduce) { .ap-submit, .ap-done { transition: none; } }

.ap-fine { max-width: 58ch; margin-top: 20px; color: var(--muted); font-size: .82rem; line-height: 1.6; }

.ap-success { max-width: 560px; }
.ap-success[hidden] { display: none; }
.ap-success h2 {
  margin-bottom: 16px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  line-height: 1.04;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}
.ap-success p { color: var(--muted); font-size: 1rem; line-height: 1.62; }
.ap-reference {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: .82rem;
  letter-spacing: .08em;
}
.ap-reference strong { color: var(--fg); }

@media (max-width: 620px) {
  /* Stacked, so the pills sit under the title instead of squeezing it. */
  .op { flex-wrap: wrap; gap: 10px; padding: 18px 2px; }
  .op-name { flex: 1 1 100%; }
  .op-meta { justify-content: flex-start; }
  .op-go { margin-left: auto; }
  .ap-grid { gap: 20px; }
  .ap-submit, .ap-done { width: 100%; }
}
