:root {
  --paper: #f5f0e8;
  --paper-deep: #eae1d4;
  --ink: #1d2422;
  --muted: #6c746f;
  --line: rgba(29, 36, 34, 0.16);
  --line-strong: rgba(29, 36, 34, 0.42);
  --cobalt: #2854c5;
  --cobalt-dark: #173889;
  --vermillion: #d8563d;
  --sage: #6d836b;
  --gold: #bd8a2d;
  --white: #fffdf9;
  --shadow: 0 18px 45px rgba(33, 39, 33, 0.08);
  color-scheme: light;
  font-family: "Avenir Next", "Noto Sans SC", "Helvetica Neue", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 12% 8%, rgba(40, 84, 197, 0.08), transparent 28rem),
    radial-gradient(circle at 88% 30%, rgba(216, 86, 61, 0.08), transparent 30rem),
    var(--paper);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: linear-gradient(rgba(29, 36, 34, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(29, 36, 34, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

button, input, select { font: inherit; }
button, select { cursor: pointer; }

.shell {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 22px 0 48px;
}

.masthead { padding-bottom: 18px; }
.masthead__rule { height: 5px; background: var(--ink); margin-bottom: 12px; }
.masthead__topline {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.masthead__body {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 32px;
  padding: 34px 0 28px;
}
.kicker, .section-label {
  margin: 0 0 16px;
  color: var(--cobalt);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: none;
  margin-bottom: 0;
  font-family: "Iowan Old Style", "Noto Serif SC", Georgia, serif;
  font-size: clamp(34px, 4.5vw, 60px);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 1.02;
  white-space: nowrap;
}
h1 em { color: var(--vermillion); font-style: italic; }
.masthead__home { color: inherit; text-decoration: none; }
.masthead__home:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 5px; }
.masthead__note {
  width: 300px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.metric {
  display: flex;
  min-height: 0;
  align-items: baseline;
  justify-content: center;
  gap: 9px;
  padding: 10px 12px;
  white-space: nowrap;
}
.metric + .metric { border-left: 1px solid var(--line); }
.metric__label { font-size: 12px; font-weight: 700; }
.metric strong { font-family: "Iowan Old Style", Georgia, serif; font-size: 24px; font-weight: 500; line-height: 1; }

.control-deck { margin-bottom: 16px; }
.filters { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(4, 1fr); gap: 8px; padding: 10px 0; }
.search-field { position: relative; }
.search-field input, select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 253, 249, 0.65);
  color: var(--ink);
  padding: 0 13px;
  outline: none;
}
.search-field input { padding-left: 36px; }
.search-field input:focus, select:focus { border-color: var(--cobalt); box-shadow: 0 0 0 3px rgba(40, 84, 197, 0.12); }
.search-icon { position: absolute; left: 13px; top: 8px; color: var(--cobalt); font-size: 23px; line-height: 1; }
.filter-status { display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 12px; }

.jobs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.job-card {
  position: relative;
  display: flex;
  min-height: 0;
  flex-direction: column;
  justify-content: flex-start;
  border: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.72);
  padding: 20px;
  cursor: pointer;
  box-shadow: 0 0 0 rgba(33,39,33,0);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.job-card:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.job-card:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; }
.job-card__footer, .job-card__meta { display: flex; justify-content: space-between; gap: 16px; }
.badge--remote { color: var(--cobalt); background: rgba(40, 84, 197, 0.08); }
.badge--hybrid { color: var(--gold); background: rgba(189, 138, 45, 0.1); }
.badge--onsite { color: var(--vermillion); background: rgba(216, 86, 61, 0.08); }
.badge--pending { color: #8b6420; background: rgba(189, 138, 45, 0.12); }
.job-card h3 { max-width: 95%; margin: 0 0 7px; color: var(--cobalt-dark); font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: clamp(18px, 1.55vw, 21px); font-weight: 800; letter-spacing: -0.025em; line-height: 1.2; }
.job-card__company { margin-bottom: 16px; font-size: 16px; font-weight: 400; line-height: 1.45; }
.job-card__company strong { font-weight: 800; }
.job-card__meta { justify-content: start; flex-wrap: wrap; color: var(--muted); font-size: 14px; line-height: 1.5; }
.job-card__meta span { display: inline-flex; align-items: center; gap: 5px; }
.job-card__meta span::before { color: var(--vermillion); content: "·"; font-weight: 900; }
.job-card__meta span:first-child::before { content: ""; }
.job-card__office-note { margin: 16px 0 0; border: 1px solid currentColor; padding: 9px 12px; font-size: 13px; line-height: 1.5; }
.job-card__office-note.badge--remote { color: var(--cobalt); background: rgba(40, 84, 197, 0.06); }
.job-card__office-note.badge--hybrid { color: var(--gold); background: rgba(189, 138, 45, 0.08); }
.job-card__office-note.badge--onsite { color: var(--vermillion); background: rgba(216, 86, 61, 0.06); }
.job-card__office-note.badge--pending { color: #8b6420; background: rgba(189, 138, 45, 0.08); }
.job-card__footer { align-items: center; margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.job-card__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.job-card__source { color: var(--muted); font-size: 11px; text-align: right; }
.type-tag { color: var(--ink); font-size: 11px; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; }
.type-tag + .type-tag::before { margin-right: 6px; color: var(--vermillion); content: "/"; }
.text-link { border: 0; background: none; color: var(--cobalt-dark); font-size: 12px; font-weight: 400; text-decoration: underline; text-underline-offset: 3px; }
.text-link:hover { color: var(--vermillion); }

.category-section { margin-top: 28px; border-top: 1px solid var(--line-strong); }
.category-section__header { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 0; }
.category-section__header strong { display: block; font-family: "Iowan Old Style", Georgia, serif; font-size: 27px; font-weight: 500; }
.category-section__header > span:last-child { color: var(--muted); font-size: 12px; }
.category-section .jobs-grid { padding-bottom: 24px; }

.empty-state { display: none; min-height: 250px; place-items: center; align-content: center; border: 1px dashed var(--line-strong); text-align: center; }
.empty-state.is-visible { display: grid; }
.empty-state__mark { color: var(--cobalt); font-size: 42px; }
.empty-state h2 { margin: 18px 0 8px; font-family: "Iowan Old Style", Georgia, serif; font-size: 32px; font-weight: 500; }
.empty-state p { margin: 0; color: var(--muted); font-size: 13px; }

.footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 72px; border-top: 1px solid var(--line-strong); padding-top: 14px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }

.drawer { position: fixed; inset: 0; z-index: 20; visibility: hidden; pointer-events: none; }
.drawer.is-open { visibility: visible; pointer-events: auto; }
.drawer__scrim { position: absolute; inset: 0; background: rgba(20, 25, 24, 0.42); opacity: 0; transition: opacity 220ms ease; }
.drawer.is-open .drawer__scrim { opacity: 1; }
.drawer__panel { position: absolute; top: 0; right: 0; display: flex; width: min(960px, 100%); height: 100%; flex-direction: column; overflow: auto; transform: translateX(100%); background: var(--white); padding: 46px clamp(22px, 4vw, 48px) 28px; box-shadow: -20px 0 60px rgba(0,0,0,0.12); transition: transform 260ms cubic-bezier(.22,.61,.36,1); }
.drawer.is-open .drawer__panel { transform: translateX(0); }
.drawer__close { position: absolute; top: 20px; right: 25px; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink); font-size: 24px; line-height: 1; }
.drawer__close:hover { border-color: var(--vermillion); color: var(--vermillion); }
.drawer__eyebrow { margin-bottom: 14px; color: var(--cobalt); font-size: 11px; font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; }
.drawer h2 { margin: 0 0 8px; color: var(--cobalt-dark); font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: clamp(30px, 3.2vw, 40px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.12; }
.drawer__company { margin-bottom: 10px; font-size: 17px; font-weight: 800; }
.drawer__badges { display: flex; flex-wrap: wrap; gap: 8px; }
.drawer__facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 18px 0 22px; }
.drawer__fact { min-height: 82px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: rgba(244, 241, 236, 0.72); }
.drawer__fact span { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; }
.drawer__fact strong { display: block; margin-top: 6px; font-size: 14px; line-height: 1.4; }
.drawer__fit { margin: 0 0 22px; border-left: 4px solid var(--cobalt); background: rgba(40, 84, 197, 0.06); padding: 13px 17px; color: var(--cobalt-dark); }
.drawer__fit h3 { margin: 0 0 6px; font-size: 16px; font-weight: 800; }
.drawer__section { border-top: 1px solid var(--line); padding-top: 16px; }
.drawer__section h3 { margin: 0 0 10px; font-family: "Iowan Old Style", Georgia, serif; font-size: 27px; font-weight: 500; }
.drawer__copy { white-space: pre-wrap; color: #303936; font-size: 15px; line-height: 1.6; }
.drawer details { margin-top: 20px; border-top: 1px dashed var(--line-strong); padding-top: 12px; }
.drawer details summary { cursor: pointer; color: var(--cobalt-dark); font-size: 12px; font-weight: 900; }
.drawer details .drawer__copy { margin-top: 16px; color: var(--muted); font-size: 13px; }
.drawer__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.drawer__action { display: inline-flex; align-items: center; min-height: 42px; border: 1px solid var(--ink); padding: 0 14px; color: var(--ink); font-size: 12px; font-weight: 900; text-decoration: none; }
.drawer__action--primary { border-color: var(--cobalt); background: var(--cobalt); color: white; }
.drawer__action:hover { border-color: var(--vermillion); background: var(--vermillion); color: white; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.is-hidden { display: none !important; }

@media (max-width: 980px) {
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric:nth-child(4) { border-left: 0; }
  .filters { grid-template-columns: repeat(2, 1fr); }
  .search-field { grid-column: span 2; }
}

@media (max-width: 680px) {
  .shell { width: min(100% - 28px, 1240px); padding-top: 18px; }
  .masthead__body { display: block; padding: 28px 0 22px; }
  .masthead__note { width: auto; margin-top: 14px; }
  .masthead__topline { font-size: 8px; }
  .masthead__topline span:last-child { text-align: right; }
  h1 { max-width: 100%; font-size: clamp(34px, 10vw, 56px); line-height: 1.08; white-space: normal; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 20px; }
  .metric { justify-content: space-between; padding: 9px 10px; }
  .metric:nth-child(odd) { border-left: 0; }
  .metric:nth-child(4) { border-left: 1px solid var(--line); }
  .filters { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: span 2; }
  .filter-status { display: block; }
  .filter-status span { display: block; margin-top: 5px; }
  .jobs-grid { grid-template-columns: 1fr; }
  .job-card { min-height: 0; padding: 18px; }
  .drawer__facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .drawer__fact { min-height: 96px; padding: 12px; }
  .drawer__section h3 { font-size: 28px; }
  .drawer__copy { font-size: 15px; }
  .footer { display: block; line-height: 1.8; }
  .footer span { display: block; }
}
