/* Quant Roles site styles. Contrast: text >= 4.5:1, control borders >= 3:1 (light and dark). */
:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-2: #f0f1f3;
  --text: #16181d;
  --muted: #5f6672;
  --border: #d9dde3;          /* decorative: card outlines */
  --control-border: #858c98; /* inputs, chips, buttons: >= 3:1 on bg and surface */
  --accent: #1d4ed8;
  --accent-text: #ffffff;
  --cta: #1d4ed8;
  --accent-soft: #e6edfd;
  --new: #047857;
  --new-soft: #dcf5ea;
  --warn: #92400e;
  --warn-soft: #fdf1e3;
  --danger: #b91c1c;
  --gem: #6d28d9;
  --gem-soft: #efe7fe;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --header-h: 56px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115; --surface: #171a21; --surface-2: #1f232c; --text: #e8eaee; --muted: #9aa3b2;
    --border: #2e3440; --control-border: #646b7a; --accent: #7aa2ff; --accent-text: #ffffff; --cta: #2f5bea; --accent-soft: #1c2742;
    --new: #4ade80; --new-soft: #16301f; --warn: #fbbf24; --warn-soft: #2d2410; --danger: #f87171;
    --gem: #c4b5fd; --gem-soft: #2a1f47; --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1115; --surface: #171a21; --surface-2: #1f232c; --text: #e8eaee; --muted: #9aa3b2;
  --border: #2e3440; --control-border: #646b7a; --accent: #7aa2ff; --accent-text: #ffffff; --cta: #2f5bea; --accent-soft: #1c2742;
  --new: #4ade80; --new-soft: #16301f; --warn: #fbbf24; --warn-soft: #2d2410; --danger: #f87171;
  --gem: #c4b5fd; --gem-soft: #2a1f47; --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 620px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 8px; top: -60px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 20; }
.skip-link:focus { top: 8px; }
h1, h2, h3 { letter-spacing: -0.01em; }

/* header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 19px; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.logo { color: var(--gem); flex: none; }
.nav { display: flex; gap: 2px; align-items: center; }
.nav a, .subnav a { color: var(--muted); padding: 10px 12px; border-radius: 8px; font-size: 15px; white-space: nowrap; }
.nav a[aria-current="page"], .subnav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.nav a:hover, .subnav a:hover { text-decoration: none; color: var(--text); }
.nav a.nav-cta { color: #fff; background: var(--cta); font-weight: 700; margin-left: 4px; }
.theme-toggle { font: inherit; font-size: 18px; line-height: 1; width: 40px; height: 40px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.theme-toggle:hover { background: var(--surface-2); color: var(--text); }
.subnav { display: none; }
@media (max-width: 719px) {
  :root { --header-h: 52px; }
  .nav .nav-link { display: none; }
  .theme-toggle { width: 44px; height: 44px; }
  .nav a.nav-cta { padding: 10px 14px; }
  .subnav { display: block; background: var(--surface); border-bottom: 1px solid var(--border); }
  .subnav .wrap { display: flex; gap: 2px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; padding-top: 2px; padding-bottom: 2px; }
  .subnav a { padding: 12px 10px; }
}

/* hero + hidden gems */
.hero { display: grid; gap: 20px; padding: 24px 0 8px; }
@media (min-width: 900px) { .hero { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; padding: 40px 0 16px; align-items: start; } }
.hero h1 { font-size: clamp(26px, 4.2vw, 40px); line-height: 1.15; margin: 0 0 10px; letter-spacing: -0.025em; }
.hero-sub { margin: 0 0 14px; color: var(--muted); font-size: 17px; max-width: 36em; }
.stat-chips { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--muted); }
.stat-chips li { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; }
.stat-chips strong { font: 700 15px/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--text); margin-right: 2px; }
.stat-chips .stat-gem strong { color: var(--gem); }
.gems { background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--gem); border-radius: var(--radius); padding: 14px 16px 16px; box-shadow: var(--shadow); min-width: 0; }
.gems-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.gems-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gem); margin: 0; }
.gems-head a { font-size: 14px; font-weight: 600; padding: 8px 0; }
.gems-why { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.gem-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.gem-card { padding: 10px 0; border-top: 1px solid var(--border); min-width: 0; }
.gem-firm { margin: 0; font-size: 13px; font-weight: 700; }
.gem-title { margin: 2px 0; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.gem-title a { color: var(--text); }
.gem-blurb { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.4; }
@media (max-width: 899px) {
  .gem-list { grid-auto-flow: column; grid-auto-columns: 78%; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; padding-bottom: 4px; }
  .gem-card { scroll-snap-align: start; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--bg); }
  .gems-why { display: none; }
}

/* inline signup */
.signup { display: grid; gap: 10px; }
.signup-row { display: flex; gap: 8px; }
.signup-email { flex: 1; min-width: 0; }
.signup-row .button { white-space: nowrap; }
@media (max-width: 359px) { .signup-row { flex-direction: column; } }
@media (max-width: 719px) {
  .hero { gap: 14px; padding-top: 16px; }
  .hero-sub { display: none; }
  .hero h1 { font-size: 25px; margin-bottom: 8px; }
  .stat-chips { margin-bottom: 10px; gap: 4px 12px; font-size: 13px; }
  .stat-chips li { padding: 0; border: 0; background: none; }
  .hero .signup .fine { font-size: 12px; }
  .hero .signup .sample-link { display: none; }
  .hero { padding-bottom: 0; }
  .results { padding-top: 0; }
  .results .filters { margin-top: 4px; }
  .hero .chips-sm { display: none; }  /* regions are optional: set later via the confirmation email's link */
  .hero .signup-row .button { padding: 10px 14px; }
  .gems { padding: 10px 12px 12px; }
  .gem-blurb { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
.signup-error { margin: 0; color: var(--danger); font-size: 14px; }
.signup-done { background: var(--surface); border: 1px solid var(--new); border-radius: var(--radius); padding: 14px 16px; }
.signup-done p { margin: 0 0 6px; }
.signup-done-title { font-weight: 700; font-size: 18px; }
.check { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--new-soft); color: var(--new); margin-right: 4px; }
.signup-next { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px !important; }
.signup-next a { padding: 8px 0; font-weight: 600; }
.chips-sm .chip span { padding: 6px 11px; font-size: 13px; min-height: 36px; }
.cta-band { background: var(--surface); border-top: 1px solid var(--border); margin-top: 32px; padding: 24px 0; }
.cta-band-inner { display: grid; gap: 12px; }
@media (min-width: 900px) { .cta-band-inner { grid-template-columns: 1fr 1.1fr; align-items: center; gap: 32px; } }
.cta-band h2 { margin: 0 0 4px; font-size: 20px; }
.cta-band p { margin: 0; }

/* filters */
.results { scroll-margin-top: calc(var(--header-h) + 8px); padding-top: 8px; }
.filters { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin: 16px 0 12px; box-shadow: var(--shadow); display: grid; gap: 12px; }
.filter-bar { display: flex; gap: 8px; align-items: end; }
.search { flex: 1 1 240px; min-width: 0; }
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
input[type="search"], input[type="email"], input[type="text"], input[type="number"], select {
  width: 100%;
  font: inherit;
  font-size: 16px; /* >= 16px: no iOS zoom on focus */
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--control-border);
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 44px;
}
.select { display: grid; gap: 2px; flex: 1 1 150px; }
.select > span { font-size: 13px; color: var(--muted); }
.select-inline { flex: 0 0 180px; }
.filters .filters-toggle, .filters .filters-done { display: none; }
.filter-bar { flex-wrap: wrap; }
.filter-panel { display: grid; gap: 12px 24px; }
@media (min-width: 720px) {
  .filter-panel { grid-template-columns: auto 1fr; align-items: start; }
  .filter-panel .filter-row { grid-column: 1 / -1; }
  .filter-row .select { flex: 0 1 260px; }
}
@media (max-width: 719px) {
  .filter-bar .search { order: 1; flex: 1 1 calc(100% - 120px); }
  .filters .filters-toggle { order: 2; display: inline-flex; flex: none; padding: 10px 14px; }
  .filter-bar .segmented { order: 3; flex: 1 1 auto; }
  .select-inline { order: 4; flex: 0 0 116px; }
  .select-inline > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .segmented label > span { padding: 6px 10px; }
  .segmented .seg-long { display: none; }
  .filter-panel { display: none; }
  .filters-open .filter-panel { display: grid; border-top: 1px solid var(--border); padding-top: 12px; }
  .filters.filters-open .filters-done { display: flex; width: 100%; }
}
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-size: 13px; color: var(--muted); margin-bottom: 6px; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips legend { width: 100%; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px; border: 1px solid var(--control-border); border-radius: 999px; font-size: 14px; background: var(--surface); user-select: none; }
@media (pointer: coarse) { .chip span { min-height: 44px; } }
.chip input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--text); font-weight: 600; }
.chip input:checked + span::before { content: "✓"; margin-right: 6px; color: var(--accent); }
.chip input:focus-visible + span, .segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.segmented { display: flex; gap: 0; border: 1px solid var(--control-border); border-radius: 10px; padding: 3px; width: fit-content; max-width: 100%; overflow-x: auto; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label > span { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border-radius: 7px; font-size: 14px; white-space: nowrap; color: var(--muted); }
.segmented b { font: 600 13px/1 var(--mono); font-variant-numeric: tabular-nums; }
.segmented input:checked + span { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.segmented .seg-gem input:checked + span { background: var(--gem-soft); color: var(--gem); }
.segmented .seg-gem span { color: var(--gem); }

/* results: one card per firm */
.result-count { font-size: 15px; font-weight: 700; margin: 4px 0 10px; font-variant-numeric: tabular-nums; }
/* One column: firm cards differ a lot in height, so a 2-column grid left 250-300px holes
   and made the ranked order zig-zag. On wide screens each role is one row instead. */
.groups { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.role-head { display: block; }
@media (max-width: 719px) { .has-filters .hero { display: none; } }
.filters-n:not(:empty) { margin-left: 0.3em; }
.group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px 8px; box-shadow: var(--shadow); min-width: 0; }
.group-gem { border-left: 3px solid var(--gem); }
.group-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.group-firm { font-size: 16px; margin: 0; margin-right: auto; }
.group-n { font-size: 13px; color: var(--muted); }
.group-blurb { margin: 2px 0 4px; font-size: 14px; color: var(--muted); line-height: 1.4; }
.roles { list-style: none; margin: 4px 0 0; padding: 0; }
.role { border-top: 1px solid var(--border); }
.role:first-child { border-top: 0; }
.role-link { display: block; padding: 9px 0; min-height: 44px; color: var(--text); }
a.role-link:hover { text-decoration: none; }
a.role-link:hover .role-title { color: var(--accent); text-decoration: underline; }
.role-title { font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.ext { color: var(--muted); font-size: 13px; }
.role-meta { display: block; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.deadline.soon { color: var(--warn); font-weight: 600; }
@media (min-width: 900px) {
  .group { padding: 12px 18px 6px; }
  .role-link { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 4px 20px; align-items: baseline; }
  .role-meta { text-align: right; }
}
.more-roles { display: inline-flex; align-items: center; font-size: 14px; font-weight: 600; min-height: 44px; }
.more-row { display: flex; justify-content: center; margin: 0 0 32px; }
.to-top { position: fixed; right: 16px; bottom: 16px; z-index: 9; background: var(--cta); color: #fff; font-weight: 700; padding: 12px 16px; border-radius: 999px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2); }
.to-top:hover { text-decoration: none; }
.badge { display: inline-block; font-size: 12px; line-height: 1; padding: 4px 7px; border-radius: 6px; background: var(--surface-2); color: var(--muted); white-space: nowrap; vertical-align: 2px; }
.badge-new { background: var(--new-soft); color: var(--new); font-weight: 700; margin-left: 6px; }
.badge-gem { background: var(--gem-soft); color: var(--gem); font-weight: 700; }
.badge-type { text-transform: capitalize; }
.badge-warn { background: var(--warn-soft); color: var(--warn); font-weight: 700; }
.empty { grid-column: 1 / -1; padding: 24px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--control-border); border-radius: var(--radius); }
.empty p { margin: 0 0 10px; }
.empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* generic content */
.intro { padding: 28px 0 8px; }
.intro h1 { font-size: clamp(24px, 4vw, 34px); line-height: 1.2; margin: 0 0 8px; letter-spacing: -0.02em; }
.lede { margin: 0; color: var(--muted); font-size: 17px; }
.section-title { font-size: 20px; margin: 28px 0 12px; }
.cards { list-style: none; margin: 0 0 32px; padding: 0; display: grid; gap: 10px; }
@media (min-width: 720px) { .cards { grid-template-columns: 1fr 1fr; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.card-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.firm { font-weight: 700; color: var(--text); margin-right: auto; }
.card-title { font-size: 17px; line-height: 1.35; margin: 6px 0; overflow-wrap: anywhere; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); }
.meta { font-size: 14px; color: var(--muted); margin: 2px 0; overflow-wrap: anywhere; }
.note { font-size: 14px; margin: 8px 0 0; }
.dates { list-style: none; margin: 6px 0; padding: 0; font-size: 14px; }
.past-section summary { cursor: pointer; font-size: 18px; font-weight: 700; padding: 12px 0; min-height: 44px; }
.past-section[open] summary { margin-bottom: 8px; }
.card-muted { opacity: 0.85; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: grid; gap: 16px; margin: 16px 0 40px; box-shadow: var(--shadow); }
.field { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.button { display: inline-flex; align-items: center; justify-content: center; font: inherit; font-weight: 700; background: var(--cta); color: #fff; border: 1px solid transparent; border-radius: 8px; padding: 10px 18px; cursor: pointer; min-height: 44px; text-align: center; }
.button:hover { text-decoration: none; filter: brightness(1.08); }
.button:disabled { opacity: 0.6; cursor: progress; }
.button-ghost { background: var(--surface); color: var(--text); border-color: var(--control-border); font-weight: 600; }
.button-soft { background: var(--accent-soft); color: var(--accent); }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.link-button { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 10px 4px; min-height: 44px; }
.link-danger { color: var(--danger); font-size: 14px; }
.fine { margin: 0; font-size: 13px; color: var(--muted); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.notice { border-radius: var(--radius); padding: 12px 14px; margin: 16px 0 0; border: 1px solid var(--control-border); background: var(--surface); }
.notice.ok { border-color: var(--new); }
.notice.error { border-color: var(--danger); }

/* subscribe page */
.sub-layout { display: grid; gap: 24px; padding: 24px 0 48px; }
.sub-title { order: 1; } .sub-layout .form-card { order: 2; } .sub-benefits { order: 3; }
@media (min-width: 900px) {
  .sub-layout { grid-template-columns: 1.1fr 1fr; grid-template-areas: "title form" "benefits form"; column-gap: 48px; row-gap: 8px; padding-top: 48px; align-items: start; }
  .sub-title { grid-area: title; } .sub-layout .form-card { grid-area: form; } .sub-benefits { grid-area: benefits; }
}
.sub-layout h1 { font-size: clamp(26px, 4vw, 38px); line-height: 1.15; margin: 0 0 12px; letter-spacing: -0.02em; }
.benefits { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px; }
.benefits li { display: grid; grid-template-columns: 28px 1fr; gap: 8px; align-items: start; }
.benefits .ico { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 14px; }
.benefits .ico-gem { background: var(--gem-soft); color: var(--gem); }
.benefits strong { display: block; }
.benefits span.muted { font-size: 14px; }
.trust { font-size: 14px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 12px; }
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: grid; gap: 12px; }
.form-card h2 { margin: 0; font-size: 18px; }

/* footer */
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; padding: 24px 0 32px; }
.footer-grid { display: grid; gap: 16px; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-grid p { margin: 0 0 6px; }
.footer-grid nav { display: grid; gap: 0; align-content: start; }
.footer-grid nav a { color: var(--muted); padding: 6px 0; }
.footer-grid nav a:hover { color: var(--text); }
.footer-brand, .footer-h { font-weight: 700; color: var(--text); }

/* touch: every target >= 44px tall */
@media (pointer: coarse) {
  .brand, .nav a.nav-cta { min-height: 44px; display: inline-flex; align-items: center; }
  .gems-head a { padding: 12px 0; }
  .gem-title a { display: inline-block; padding: 2px 0; min-height: 44px; }
  .segmented label > span { min-height: 44px; }
  .footer-grid nav a { padding: 12px 0; }
  .signup-next a { padding: 12px 0; }
  .chips-sm .chip span { min-height: 44px; }
}
.signup-done .link-button { min-height: 0; padding: 0; font-size: inherit; text-decoration: underline; }

/* subscribe: how we find roles */
.how { margin-top: 28px; }
.how h2 { font-size: 18px; margin: 0 0 10px; }
.how-steps { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.how-steps li { line-height: 1.5; }
.how-steps strong { display: block; }
