/* =====================================================================
   MANAM — careers.html page styles. Loaded after v3.css + v3-pages.css (reuses .fgroup/.fchip/.page-head).
   Midnight & champagne; no new colours. Motion start states live under html.motion-ready + no-preference.
   ===================================================================== */

/* ---------- Header: stats under a champagne hairline ---------- */
.page-head--careers .page-head__title, #top .page-head__title { max-width: 14ch; text-wrap: wrap; }
.hstats { position: relative; margin-top: clamp(32px, 4vw, 52px); padding-top: 26px; max-width: 640px; }
.hstats__rule { position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--champagne); opacity: .7; transform-origin: 0 50%; }
.hstats__list { display: flex; flex-wrap: wrap; gap: 20px clamp(28px, 5vw, 72px); }
.hstats__v { display: block; font-family: var(--font-serif); font-size: clamp(40px, 4.4vw, 60px); line-height: 1; letter-spacing: -.01em; color: var(--ivory); white-space: nowrap; }
.hstats__l { display: block; margin-top: 8px; font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ivory-muted); }

/* ---------- What we offer: 3x2 hairline ledger ---------- */
.perks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.perk { position: relative; display: grid; gap: 8px; align-content: start; padding: 32px 32px 38px; border-left: 1px solid var(--line); }
.perk:nth-child(3n+1) { padding-left: 0; border-left: 0; }
.perk::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--line); transform-origin: 0 50%; }
.perk:nth-child(n+4)::before { top: -1px; }
.perk__nw { display: block; overflow: hidden; }
.perk__n { display: block; font-family: var(--font-serif); font-size: 44px; line-height: 1.05; color: var(--champagne-deep); }
.perk__t { font-family: var(--font-serif); font-weight: 400; font-size: clamp(24px, 2.2vw, 30px); line-height: 1.15; color: var(--text); }
.perk__d { font-size: 15.5px; line-height: 1.55; color: var(--muted); max-width: 34ch; }
@media (max-width: 900px) {
  .perks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .perk:nth-child(3n+1) { padding-left: 32px; border-left: 1px solid var(--line); }
  .perk:nth-child(2n+1) { padding-left: 0; border-left: 0; }
  .perk:nth-child(n+3)::before { top: -1px; }
  .perk:nth-child(n+3):nth-child(-n+4)::before { top: 0; }
}
@media (max-width: 560px) {
  .perks { grid-template-columns: minmax(0, 1fr); }
  .perk, .perk:nth-child(n) { padding: 24px 0 28px; border-left: 0; }
  .perk::before, .perk:nth-child(n)::before { top: 0; }
  .perk + .perk { border-top: 0; }
}

/* ---------- Opportunities ---------- */
.opps { --bar-h: 120px; padding-bottom: clamp(72px, 8vw, 112px); }
.opps .section-head { margin-bottom: clamp(28px, 3.5vw, 44px); }
.opps .lead { max-width: 62ch; }

/* sticky filter bar (as the case-studies index bar) */
.fbar {
  position: sticky; top: 72px; z-index: 40; background: #fff; transition: top .4s var(--e-loom);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); box-shadow: 0 8px 24px -18px rgba(10, 16, 32, .25);
}
html.nav-hidden .fbar { top: 0; transition-duration: .32s; transition-timing-function: var(--e-ink); }
html:not(.js) .fbar { display: none; }
.fbar__inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 28px; align-items: center; padding-block: 12px; }
.fbar__panel { display: contents; }
.fbar__inner > .fbar__panel > .fgroup:first-child { grid-column: 1 / -1; }
.fbar .fgroup { min-width: 0; }
.fbar .fgroup__k { min-width: 76px; }
.fbar .fgroup__chips {
  flex: 1; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-block: 2px; position: relative;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent);
}
.fbar .fgroup__chips::-webkit-scrollbar { display: none; }
.fbar .fchip { flex: none; white-space: nowrap; }
.fchip--closed { color: var(--muted); border-style: dashed; }
.fchip--closed[aria-pressed='true'] { color: var(--ivory); border-style: solid; }
.fbar__meta { display: flex; align-items: center; gap: 20px; justify-self: end; }
.fbar__count { font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fbar__filters {
  display: none; appearance: none; cursor: pointer; min-height: 36px; padding: 4px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--white); color: var(--text); font: 600 12.5px/1.3 var(--font-sans);
}
.fbar__filters[aria-expanded='true'] { background: var(--ink); border-color: var(--ink); color: var(--ivory); }
.fbar__filters:hover { border-color: var(--champagne-deep); }

/* closed-roles switch */
.switch { appearance: none; background: none; border: 0; padding: 4px 0; cursor: pointer; display: inline-flex; align-items: center; gap: 10px; font: 600 13px/1.3 var(--font-sans); color: var(--text); }
.switch__track { position: relative; flex: none; width: 38px; height: 22px; border-radius: 999px; border: 1px solid rgba(20, 27, 43, .28); background: var(--paper); transition: background .25s, border-color .25s; }
.switch__track i { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); transition: transform .3s var(--e-settle), background .25s; }
.switch[aria-pressed='true'] .switch__track { background: var(--ink); border-color: var(--ink); }
.switch[aria-pressed='true'] .switch__track i { transform: translateX(16px); background: var(--champagne); }
.switch:hover .switch__track { border-color: var(--champagne-deep); }

/* ---------- Role index ---------- */
.roles { padding-top: 8px; position: relative; }
.rgroup { display: flex; align-items: baseline; gap: 12px; padding: 40px 0 14px; font-family: var(--font-sans); }
.rgroup:first-child { padding-top: 32px; }
.rgroup__t { font-size: 13px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--champagne-deep); }
.rgroup__n { font-family: var(--font-serif); font-size: 22px; line-height: 1; color: var(--muted); font-variant-numeric: tabular-nums; }
.rgroup[hidden], .role[hidden] { display: none !important; }
html.js .role--closed, html.js .rgroup--closed { display: none; }
html.js .roles.show-closed .role--closed { display: block; }
html.js .roles.show-closed .rgroup--closed { display: flex; }

.role { position: relative; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--bar-h) - 12px); }
.role:last-child { border-bottom: 1px solid var(--line); }
.role::before { /* hover: champagne hairline draws across the top */
  content: ''; position: absolute; z-index: 1; top: -1px; left: 0; right: 0; height: 1px; background: var(--champagne-deep);
  transform: scaleX(0); transform-origin: 0 50%; transition: transform .4s var(--e-comb); pointer-events: none;
}
.role:hover::before, .role:focus-within::before, .role.is-open::before { transform: scaleX(1); }
.role--priority { background: var(--champagne-wash); box-shadow: inset 2px 0 0 var(--champagne-deep); }
.role--closed .role__title, .role--closed .role__meta, .role--closed .role__cat { opacity: .72; }

.role__row {
  position: relative; display: grid; align-items: center; column-gap: 20px; row-gap: 6px; padding: 20px 16px 14px;
  grid-template-columns: 150px minmax(0, 1fr) 210px 96px 108px 122px;
  grid-template-areas: 'cat title meta pos badge go' '. sub sub sub sub sub';
}
.role__cat { grid-area: cat; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; line-height: 1.45; color: var(--champagne-deep); }
.role__title { grid-area: title; font-family: var(--font-serif); font-weight: 400; font-size: 24px; line-height: 1.15; color: var(--text); text-wrap: balance; }
.role__meta { grid-area: meta; display: flex; flex-wrap: wrap; gap: 0 8px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.role__meta span + span::before { content: '\00b7'; margin-right: 8px; color: var(--champagne-deep); }
.role__pos { grid-area: pos; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.role__badge { grid-area: badge; justify-self: start; }
.badge { display: inline-block; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; color: var(--text); background: var(--white); }
.badge--urgent { background: var(--ink); border-color: var(--ink); color: var(--ivory); }
.badge--closed { background: transparent; border-style: dashed; border-color: rgba(20, 27, 43, .3); color: var(--muted); }
.role__go { grid-area: go; justify-self: end; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; }
.role__go .ic { width: 16px; height: 16px; color: var(--champagne-deep); transition: transform .18s var(--e-comb); }
.role:hover .role__go .ic { transform: translateY(2px); }
.role.is-open .role__go .ic, .role.is-open:hover .role__go .ic { transform: rotate(180deg); }
html:not(.js) .role__go { display: none; }

/* the whole row is the button (stretched title button) */
.role__btn { all: unset; cursor: pointer; display: inline; color: inherit; font: inherit; }
.role__btn::after { content: ''; position: absolute; inset: 0; z-index: 2; }
.role__btn:focus-visible { outline: none; }
.role__row:has(.role__btn:focus-visible) { outline: 2px solid var(--champagne-deep); outline-offset: -2px; }
html:not(.js) .role__btn { cursor: auto; }

/* second line: skill tags + Visa/Relocation ticks (hover / focus on desktop, always on touch / no JS) */
.role__sub { grid-area: sub; display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 22px; overflow: hidden; opacity: 0; transition: opacity .25s; }
.role:hover .role__sub, .role:focus-within .role__sub, .role.is-open .role__sub { opacity: 1; }
@media (hover: none) { .role__sub { opacity: 1; } }
html:not(.js) .role__sub { opacity: 1; }
.role__tags { display: flex; gap: 0 14px; flex-wrap: nowrap; min-width: 0; overflow: hidden; font-size: 12px; color: var(--muted); white-space: nowrap; }
.role__tags li + li::before { content: '\00b7'; margin-right: 14px; color: var(--champagne-deep); }
.role__perks { display: flex; gap: 14px; flex: none; font-size: 12px; font-weight: 600; color: var(--text); }
.role__perks li { display: inline-flex; align-items: center; gap: 4px; }
.role__perks .ic { width: 14px; height: 14px; color: var(--champagne-deep); }

/* drawer */
.role__drawer { position: relative; }
html.js .role:not(.is-open):not(.is-closing) .role__drawer { display: none; }
.drawer { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(32px, 5vw, 72px); align-items: start; padding: 20px 16px 48px; }
.dsec { padding-bottom: 22px; }
.dsec__h { font-family: var(--font-serif); font-weight: 400; font-size: clamp(24px, 2.2vw, 30px); line-height: 1.15; color: var(--text); margin-bottom: 12px; }
.dsec p { font-size: 16px; line-height: 1.65; color: var(--text); max-width: 68ch; }
.dsec ul { border-top: 1px solid var(--line); max-width: 68ch; }
.dsec li { position: relative; padding: 7px 0 7px 18px; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.5; color: var(--text); }
.dsec li::before { content: ''; position: absolute; left: 0; top: 1.05em; width: 7px; height: 1px; background: var(--champagne-deep); }
.dsec li strong, .dsec p strong { font-weight: 600; }
.dsec p + ul, .dsec p + p, .dsec ul + p { margin-top: 12px; }

/* apply box: ink-2 card, champagne hairline */
.apply {
  --ln: 1; position: sticky; top: calc(var(--bar-h) + 80px); padding: 28px 28px 30px; border-radius: 16px; background: var(--ink-2); color: var(--ivory);
  border: 1px solid rgba(217, 191, 140, .32); box-shadow: 0 30px 80px -50px rgba(0, 0, 0, .8); overflow: hidden;
}
.apply::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--champagne); transform-origin: 0 50%; transform: scaleX(var(--ln)); }
.apply__h { font-family: var(--font-serif); font-weight: 400; font-size: 28px; line-height: 1.1; color: var(--ivory); }
.apply__lead { margin-top: 10px; font-size: 14.5px; color: var(--ivory-muted); }
.apply__mail { margin-top: 16px; max-width: 100%; min-width: 0; font-size: 13.5px; padding-inline: 18px; gap: 10px; }
.apply__mail .ic { width: 17px; height: 17px; }
.apply__ins { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--ink-line); font-size: 14.5px; line-height: 1.55; color: var(--ivory); }
.apply__ins p + p { margin-top: 10px; }
.apply__ins strong { font-weight: 600; color: var(--champagne); }
.apply__ins ul { margin-top: 8px; }
.apply__ins li { position: relative; padding: 7px 0 7px 16px; border-top: 1px solid var(--ink-line); }
.apply__ins li::before { content: ''; position: absolute; left: 0; top: 1.15em; width: 7px; height: 1px; background: var(--champagne); }

/* empty state */
.roles__empty { padding: 48px 0 16px; color: var(--muted); font-size: 16px; }
.roles__empty[hidden] { display: none; }
.roles__empty-btn { appearance: none; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-weight: 600; color: var(--text); text-decoration: underline 1px var(--champagne-deep); text-underline-offset: 4px; }

/* ---------- Apply band (shared ink closing band) ---------- */
.careers-apply .cta-band__inner { align-items: center; }
.apply-band__h { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ivory-muted); }
.checks { margin-top: 14px; border-top: 1px solid var(--ink-line); }
.checks li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: center; min-height: 56px; padding: 10px 4px; border-bottom: 1px solid var(--ink-line); font-size: 17px; color: var(--ivory); }
.tick { display: inline-flex; color: var(--champagne); }
.tick .ic { width: 20px; height: 20px; }
.apply-pill { position: relative; overflow: hidden; margin-top: 28px; max-width: 100%; }
.apply-pill::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 35%, rgba(255, 246, 220, .75) 50%, transparent 65%); transform: translateX(-120%); pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .apply-pill.is-in::after { animation: cr-sheen 1.1s .6s var(--e-comb) both; }
}
@keyframes cr-sheen { to { transform: translateX(120%); } }

/* ---------- Motion start states ---------- */
@media (prefers-reduced-motion: no-preference) {
  html.motion-ready .perk::before { transition: transform .6s var(--e-loom); }
  html.motion-ready .perk:not(.is-in)::before { transform: scaleX(0); }
  html.motion-ready .perk .perk__n { transition: transform .6s var(--e-loom) .12s; }
  html.motion-ready .perk:not(.is-in) .perk__n { transform: translateY(105%); }
  html.motion-ready .role[data-rv]:not(.is-in) { opacity: 0; }
  html.motion-ready .checks:not(.is-in) .tick { clip-path: inset(0 100% 0 0); }
  html.motion-ready .checks:not(.is-in) li > span:last-child { opacity: 0; }
  html.motion-ready .checks:not(.is-in) li { border-bottom-color: transparent; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .role__row { grid-template-columns: 130px minmax(0, 1fr) 180px 100px 112px; grid-template-areas: 'cat title meta badge go' '. title pos . .' '. sub sub sub sub'; }
  .drawer { grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; }
}
@media (max-width: 900px) {
  .role__row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'cat cat' 'title title' 'meta pos' 'sub sub' 'badge go'; row-gap: 8px; padding: 18px 14px 16px; }
  .role__sub { height: auto; overflow: visible; flex-wrap: wrap; gap: 8px 16px; opacity: 1; }
  .role__tags { flex-wrap: wrap; white-space: normal; gap: 2px 12px; }
  .role__tags li + li::before, .role__meta span + span::before { display: none; }
  .role__meta { gap: 0 14px; }
  .role__pos { justify-self: end; text-align: right; }
  .drawer { grid-template-columns: minmax(0, 1fr); padding: 12px 14px 40px; gap: 12px; }
  .apply { position: static; }
  .role__badge { justify-self: start; }
}
@media (max-width: 800px) {
  .fbar { top: 66px; }
  .fbar__inner { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding-block: 8px; }
  .fbar__meta { order: -1; justify-self: auto; display: flex; flex-wrap: nowrap; gap: 10px; width: 100%; }
  .fbar__filters { display: inline-flex; align-items: center; flex: none; }
  .fbar__count { flex: 1; min-width: 0; font-size: 12px; white-space: normal; line-height: 1.25; }
  .switch { flex: none; font-size: 12px; gap: 8px; }
  .switch .toggle-closed-label { max-width: 8.5em; line-height: 1.2; text-align: left; }
  .fbar__panel { display: none; gap: 6px; }
  .fbar.is-open .fbar__panel { display: grid; }
  .fbar .fgroup { flex-wrap: nowrap; }
  .fbar .fgroup__k { min-width: 0; width: 70px; font-size: 10.5px; }
  .fbar .fgroup__chips { flex: 1; }
}
@media (max-width: 480px) {
  .perk__n { font-size: 38px; }
  .role__title { font-size: 22px; }
  .checks li { font-size: 16px; }
  .apply { padding: 24px 20px 26px; }
}
