: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; }

.workspace-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  border-bottom: 1px solid var(--line-strong);
}
.workspace-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border-bottom: 2px solid transparent;
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}
.workspace-nav a:hover, .workspace-nav a.is-active { color: var(--cobalt-dark); }
.workspace-nav a.is-active { border-bottom-color: var(--cobalt); }
.workspace-nav { flex-wrap: wrap; }

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;
}

.page-nav { display: flex; gap: 24px; align-items: center; margin: -4px 0 20px; border-bottom: 1px solid var(--line); }
.page-nav__link { position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 38px; color: var(--muted); font-size: 13px; font-weight: 700; text-decoration: none; }
.page-nav__link:hover, .page-nav__link.is-active { color: var(--cobalt-dark); }
.page-nav__link.is-active::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--cobalt); content: ""; }
.page-nav__link span { color: var(--gold); font-variant-numeric: tabular-nums; }

.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: 14px; }
.job-card {
  position: relative;
  display: flex;
  min-height: 252px;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(33, 39, 33, 0.035);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.job-card:hover { transform: translateY(-2px); border-color: rgba(40, 84, 197, 0.38); box-shadow: 0 12px 28px rgba(33, 39, 33, 0.09); }
.job-card__open { display: flex; width: 100%; height: 100%; flex: 1; flex-direction: column; align-items: stretch; border: 0; border-radius: inherit; background: transparent; padding: 22px 24px 18px; color: inherit; text-align: left; }
.job-card__open:focus-visible { outline: 2px solid var(--cobalt); outline-offset: -4px; }
.job-card__footer, .job-card__meta { display: flex; justify-content: space-between; gap: 16px; }
.job-card__identity { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.job-card__badges, .drawer__badges { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.job-card__status, .job-card__score { display: inline-flex; align-items: center; min-height: 28px; border: 1px solid; padding: 3px 9px; font-size: 11px; font-weight: 800; line-height: 1.2; white-space: nowrap; }
.job-card__status { border-color: var(--line-strong); color: var(--muted); background: rgba(255, 255, 255, 0.42); }
.job-card__status--pending { border-color: #a97821; color: #8a621d; }
.job-card__status--confirmed { border-color: var(--cobalt); color: var(--cobalt); }
.job-card__status--excluded { border-color: var(--vermillion); color: var(--vermillion); }
.job-card__score { border-color: var(--vermillion); background: var(--vermillion); color: white; }
.job-card h3 { max-width: calc(100% - 40px); 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: 2px 0 0; color: #343c38; 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: nowrap; gap: 4px 12px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.job-card__meta-item { display: inline-flex; min-width: 0; max-width: 100%; align-items: center; gap: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-card__meta-item + .job-card__meta-item::before { color: var(--vermillion); content: "·"; font-weight: 900; }
.job-card__details { display: grid; gap: 6px; margin: 8px 0 12px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.job-card__salary, .job-card__timeline { display: -webkit-box; overflow: hidden; margin: 0; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.job-card__salary::before, .job-card__timeline::before { margin-right: 7px; color: var(--vermillion); content: "·"; font-weight: 900; }
.job-card__fit { margin: 12px 0 14px; border-left: 4px solid var(--cobalt); background: rgba(40, 84, 197, 0.065); padding: 10px 12px; color: var(--cobalt-dark); }
.job-card__fit p { display: -webkit-box; overflow: hidden; margin: 0; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 15px; line-height: 1.55; }
.job-card__footer { align-items: center; margin-top: auto; 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: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.type-tag + .type-tag::before { margin-right: 6px; color: var(--vermillion); content: "/"; }
.favorite-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; background: transparent; color: var(--gold); cursor: pointer; transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease; }
.favorite-toggle:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; }
.favorite-toggle__icon { font-family: Arial, sans-serif; font-size: 30px; line-height: 1; }
.favorite-toggle--card { position: absolute; z-index: 1; top: 16px; right: 16px; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: var(--white); }
.favorite-toggle--card .favorite-toggle__icon { font-size: 23px; }
.favorite-toggle--card:hover, .favorite-toggle--card.is-favorite { border-color: rgba(189, 138, 45, 0.55); color: #a77a21; }
.favorite-toggle--drawer { justify-content: flex-start; align-self: flex-start; min-height: 40px; margin: 2px 0 0; border-color: var(--line); border-radius: 999px; padding: 0 14px; color: var(--cobalt-dark); font-size: 13px; font-weight: 800; }
.favorite-toggle--drawer .favorite-toggle__icon { color: var(--gold); font-size: 20px; }
.favorite-toggle--drawer:hover, .favorite-toggle--drawer.is-favorite { border-color: var(--gold); background: rgba(189, 138, 45, 0.1); }
.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; }

.favorites-view { margin-top: 18px; }
.favorites-view__header { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; border-bottom: 1px solid var(--line-strong); padding: 0 0 18px; }
.favorites-view__header .section-label { display: block; margin-bottom: 8px; }
.favorites-view__header h2 { margin: 0; font-family: "Iowan Old Style", "Noto Serif SC", Georgia, serif; font-size: clamp(32px, 4vw, 48px); font-weight: 500; letter-spacing: -0.04em; }
.favorites-view__header > span { padding-bottom: 6px; color: var(--muted); font-size: 13px; }
.favorites-view .empty-state { margin-top: 16px; }

.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(700px, 100%); height: 100%; flex-direction: column; overflow: auto; transform: translateX(100%); border-left: 1px solid var(--line); border-radius: 14px 0 0 14px; background: var(--white); padding: 46px clamp(22px, 4vw, 48px) 28px; box-shadow: -16px 0 48px rgba(0,0,0,0.1); transition: transform 260ms cubic-bezier(.22,.61,.36,1); }
.drawer.is-open .drawer__panel { transform: translateX(0); }
.drawer__close { position: absolute; top: 16px; right: 18px; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: var(--white); color: var(--ink); font-size: 24px; line-height: 1; }
.drawer__close:hover { border-color: var(--vermillion); color: var(--vermillion); }
.drawer__eyebrow { color: var(--cobalt); font-size: 10px; font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; }
.drawer h2 { margin: 6px 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; overflow-wrap: anywhere; }
.drawer__company { margin-bottom: 10px; font-size: 17px; font-weight: 800; }
.drawer__badges { justify-content: flex-start; margin: 0 0 14px; }
.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: 8px; padding: 12px; background: #f7f4ef; }
.drawer__fact span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.drawer__fact strong { display: block; margin-top: 6px; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.drawer__section { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 16px; }
.drawer__section h3 { margin: 0 0 10px; font-family: "Iowan Old Style", "Noto Serif SC", Georgia, serif; font-size: 27px; font-weight: 500; }
.drawer__copy { white-space: pre-wrap; color: #303936; font-size: 15px; line-height: 1.6; }
.drawer__copy--jd { display: grid; gap: 12px; font-size: 15px; line-height: 1.8; }
.drawer__jd-paragraph { margin: 0; }
.drawer__jd-heading { margin: 8px 0 0; color: var(--ink); font-size: 16px; font-weight: 800; line-height: 1.5; }
.drawer__jd-list { margin: 0; padding-left: 1.4em; }
.drawer__jd-list li + li { margin-top: 5px; }
.drawer__jd-list li::marker { color: var(--vermillion); }
.drawer__fit { margin-top: 0; margin-bottom: 22px; border-top: 0; border-left: 4px solid var(--cobalt); background: rgba(40, 84, 197, 0.065); padding: 13px 17px; }
.drawer__fit h3 { margin-bottom: 6px; color: var(--cobalt-dark); font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 16px; font-weight: 900; }
.drawer__fit .drawer__copy { color: var(--cobalt-dark); 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: 10px; margin-top: 24px; }
.drawer__action { display: inline-flex; align-items: center; min-height: 42px; border: 1px solid var(--line-strong); border-radius: 7px; padding: 0 14px; color: var(--ink); font-size: 13px; font-weight: 800; 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; }
  .page-nav { margin-bottom: 16px; }
  .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; }
  .job-card__open { min-height: 0; padding: 20px 18px 16px; }
  .favorite-toggle--card { top: 12px; right: 12px; }
  .job-card__identity { flex-direction: column; gap: 7px; }
  .job-card__company { padding-right: 24px; font-size: 15px; }
  .job-card__badges { justify-content: flex-start; }
  .job-card__footer { align-items: flex-start; flex-direction: column; gap: 8px; }
  .job-card__source { text-align: left; }
  .favorites-view__header { align-items: flex-start; }
  .drawer__panel { border-radius: 12px 0 0 12px; padding: 46px 20px 24px; }
  .drawer__facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .drawer__fact { min-height: 0; }
  .footer { display: block; line-height: 1.8; }
  .footer span { display: block; }
}

@media (max-width: 420px) {
  .drawer__facts { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
