:root {
  --bg: #e2e3e1;
  --panel: rgba(250, 250, 248, .62);
  --ink: #272a29;
  --muted: #4d524f;
  --line: rgba(40, 42, 41, .23);
  --accent: #3d4441;
  --accent2: #d7c66b;
  --new: rgba(219, 190, 92, .22);
  --fresh: rgba(137, 162, 141, .2);
  --danger: #874b45;
  --shadow: 0 8px 24px rgba(18, 20, 19, .1);
  --panel-alpha: .78;
  --panel-alpha-scroll: .4;
  --bar-alpha: .41;
  --bar-alpha-scroll: .08;
  --nav-alpha: .48;
  --nav-alpha-scroll: .12;
  --nav-button-alpha: .81;
  --nav-button-alpha-scroll: .43;
  --control-alpha: .93;
  --control-alpha-scroll: .75;
  --inset-alpha: .66;
  --inset-alpha-scroll: .32;
}

html,
body {
  min-height: 100%;
  background: transparent;
}

body {
  position: relative;
  isolation: isolate;
  color: var(--ink);
  background-color: #dedfdd;
}

.page-backdrop {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background-color: #d8d9d7;
  background-image: linear-gradient(rgba(244, 244, 241, .025), rgba(244, 244, 241, .025)), url("assets/onboarding-ink.webp");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  transition: background-image .25s ease;
}

body[data-page="search"] .page-backdrop {
  background-image: linear-gradient(rgba(246, 246, 243, .035), rgba(246, 246, 243, .035)), url("assets/search-watercolor.webp");
  background-position: center 52%;
}

body[data-page="results"] .page-backdrop {
  background-image: linear-gradient(rgba(247, 247, 244, .045), rgba(247, 247, 244, .045)), url("assets/results-ink.webp?v=22");
  background-position: center;
}

.topbar,
.tabs,
main {
  position: relative;
}

.topbar {
  max-width: none;
  padding: 18px clamp(14px, 4vw, 46px) 12px;
  background: rgba(250, 250, 248, var(--bar-alpha));
  border-bottom: 1px solid rgba(40, 42, 41, .18);
  backdrop-filter: none;
  transition: background-color .24s ease;
}

.topbar h1,
.topbar p,
.hero .eyebrow,
.hero h2,
.hero p,
.section-head .eyebrow,
.section-head h2 {
  color: #fff;
  mix-blend-mode: difference;
  text-shadow: none;
}

.topbar h1 {
  letter-spacing: .015em;
}

.tabs {
  background: rgba(250, 250, 248, var(--nav-alpha));
  border-color: rgba(40, 42, 41, .18);
  backdrop-filter: none;
  transition: background-color .24s ease;
}

.tabs button {
  background: rgba(250, 250, 248, var(--nav-button-alpha));
  border-color: rgba(40, 42, 41, .4);
  transition: background-color .24s ease;
}

.tabs button.active {
  background: #333836;
  border-color: #d1bb57;
  color: #fff;
}

main {
  background: transparent;
  padding-top: clamp(22px, 3vw, 38px);
}

.hero,
.card,
.wizard-card,
.filterbar,
.job,
.entry,
.topic-entry,
.topic-rating,
.proposal-section,
.signal,
.source-item,
.status {
  background-color: rgba(250, 250, 248, var(--panel-alpha));
  border-color: var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: none;
  transition: background-color .24s ease, border-color .24s ease;
}

.hero {
  min-height: 0;
  margin: 8px 0 26px;
  padding: 10px clamp(16px, 2.5vw, 28px);
  background: rgba(250, 250, 248, var(--panel-alpha));
  border-color: rgba(40, 42, 41, .24);
  box-shadow: none;
  backdrop-filter: none;
  transition: background-color .24s ease;
}

.hero h2 {
  margin-block: .1em;
}

.hero p {
  margin-block: .28em;
}

.section-head {
  margin: 14px 0 24px;
}

.card,
.wizard-card,
.filterbar,
.job {
  margin-bottom: 20px;
}

#wizard {
  margin-top: 0;
}

.progress-ring {
  width: 76px;
  height: 76px;
  border-width: 5px;
}

.progress-ring span {
  margin-top: -16px;
}

.priority-questions {
  background: rgba(215, 198, 107, .16);
}

.topic-progress span {
  background: rgba(222, 223, 219, .92);
  color: var(--muted);
}

.topic-progress span.current {
  background: rgba(215, 198, 107, .38);
  color: var(--ink);
}

.entry-details,
.topic-details,
.more-entries {
  background: rgba(250, 250, 248, var(--inset-alpha));
  border-color: var(--line);
}

.entry-details > summary,
.topic-details > summary,
.more-entries > summary {
  background: rgba(222, 223, 219, var(--inset-alpha));
  color: var(--ink);
}

.progress-ring {
  background: rgba(255, 255, 253, .7);
  border-color: rgba(215, 198, 107, .65);
}

input,
select,
textarea {
  background: rgba(255, 255, 253, var(--control-alpha));
  border-color: rgba(40, 42, 41, .27);
}

button,
.filebtn {
  background: rgba(250, 250, 248, var(--nav-button-alpha));
  border-color: rgba(40, 42, 41, .35);
}

button.primary {
  background: #333836;
  border-color: #cbb755;
  color: #fff;
}

.pill,
.tag {
  background: rgba(222, 223, 219, .92);
}

.job.new {
  background: linear-gradient(90deg, var(--new), rgba(250, 250, 248, .94) 24%);
}

.job.fresh {
  box-shadow: inset 0 0 0 2px rgba(104, 136, 112, .62), var(--shadow);
}

.why {
  background: rgba(219, 229, 218, .94);
  color: #3b4840;
}

.status {
  border-left-color: #c7ae48;
}

:focus-visible {
  outline: 3px solid rgba(202, 174, 67, .88);
  outline-offset: 2px;
}

@media (max-width: 650px) {
  .page-backdrop {
    background-position: center;
  }
}


/* V16: reveal more of the fixed ink background while the page is moving. */
body.is-scrolling .topbar { background-color: rgba(250, 250, 248, var(--bar-alpha-scroll)); }
body.is-scrolling .tabs { background-color: rgba(250, 250, 248, var(--nav-alpha-scroll)); }
body.is-scrolling .tabs button:not(.active) {
  background-color: rgba(250, 250, 248, var(--nav-button-alpha-scroll));
}
body.is-scrolling .hero {
  background-color: rgba(250, 250, 248, var(--panel-alpha-scroll));
}
body.is-scrolling .card,
body.is-scrolling .wizard-card,
body.is-scrolling .filterbar,
body.is-scrolling .job,
body.is-scrolling .entry,
body.is-scrolling .topic-entry,
body.is-scrolling .topic-rating,
body.is-scrolling .proposal-section,
body.is-scrolling .signal,
body.is-scrolling .source-item,
body.is-scrolling .status {
  background-color: rgba(250, 250, 248, var(--panel-alpha-scroll));
}
body.is-scrolling .entry-details,
body.is-scrolling .topic-details,
body.is-scrolling .more-entries {
  background-color: rgba(250, 250, 248, var(--inset-alpha-scroll));
}
body.is-scrolling .entry-details > summary,
body.is-scrolling .topic-details > summary,
body.is-scrolling .more-entries > summary {
  background-color: rgba(222, 223, 219, var(--inset-alpha-scroll));
}
body.is-scrolling input,
body.is-scrolling select,
body.is-scrolling textarea {
  background-color: rgba(255, 255, 253, var(--control-alpha-scroll));
}
body.is-scrolling button:not(.primary),
body.is-scrolling .filebtn {
  background-color: rgba(250, 250, 248, var(--nav-button-alpha-scroll));
}
body.is-scrolling .priority-questions,
body.is-scrolling .optional-reflection,
body.is-scrolling .chat-prompt {
  background-color: rgba(250, 250, 248, .2);
}
body.is-scrolling .pill,
body.is-scrolling .tag,
body.is-scrolling .topic-progress span {
  background-color: rgba(222, 223, 219, .62);
}
body.is-scrolling .why {
  background-color: rgba(219, 229, 218, .62);
}
body.is-scrolling .job.new {
  background: linear-gradient(90deg, rgba(219, 190, 92, .18), rgba(250, 250, 248, .45) 24%);
}


/* Keep image-backed headings legible and tuneable. */
body[data-text-mode="light"] .topbar h1,
body[data-text-mode="light"] .topbar p,
body[data-text-mode="light"] .hero .eyebrow,
body[data-text-mode="light"] .hero h2,
body[data-text-mode="light"] .hero p,
body[data-text-mode="light"] .section-head .eyebrow,
body[data-text-mode="light"] .section-head h2,
body[data-text-mode="light"] .visual-preview-text {
  color: #fff;
  mix-blend-mode: normal;
}
body[data-text-mode="dark"] .topbar h1,
body[data-text-mode="dark"] .topbar p,
body[data-text-mode="dark"] .hero .eyebrow,
body[data-text-mode="dark"] .hero h2,
body[data-text-mode="dark"] .hero p,
body[data-text-mode="dark"] .section-head .eyebrow,
body[data-text-mode="dark"] .section-head h2,
body[data-text-mode="dark"] .visual-preview-text {
  color: #171918;
  mix-blend-mode: normal;
}
.visual-preview {
  display: flex;
  min-height: 110px;
  align-items: center;
  padding: 18px;
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(rgba(250, 250, 248, .12), rgba(250, 250, 248, .12)), url("assets/results-ink.webp?v=22") center 46% / cover;
}
.visual-preview-text {
  color: #fff;
  mix-blend-mode: difference;
  font-size: clamp(22px, 4vw, 38px);
  font-weight: 800;
  text-shadow: none;
}
.appearance-settings select,
.appearance-settings input[type="range"] { max-width: 100%; }

/* V18 base: sharper type, stronger contrast, a fixed header, and one live opacity control. */
:root {
  --ink: #000;
  --muted: #222;
  --line: rgba(20, 20, 20, .28);
  --shadow: 0 8px 24px rgba(0, 0, 0, .11);
}

body {
  color: var(--ink);
  font-family: var(--app-font, "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans JP", system-ui, sans-serif);
  -webkit-font-smoothing: auto;
  text-rendering: optimizeLegibility;
  padding-bottom: 92px;
}

body[data-font-choice="jp"] {
  --app-font: "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans JP", system-ui, sans-serif;
}

body[data-font-choice="modern"] {
  --app-font: Inter, "Helvetica Neue", Arial, system-ui, sans-serif;
}

body[data-font-choice="editorial"] {
  --app-font: Georgia, "Noto Serif JP", "Yu Mincho", serif;
}

h1, h2, h3, h4, p, label, small, li, b, strong, span, a,
.topbar, .section-head, .hero, .font-specimen {
  text-shadow: none !important;
  filter: none !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  background: transparent;
}

.topbar {
  max-width: none;
  margin: 0;
  padding: 10px clamp(14px, 4vw, 46px) 4px;
  background: transparent !important;
  border: 0;
  backdrop-filter: none !important;
}

.topbar h1 {
  margin: 0;
  color: #fff;
  mix-blend-mode: difference;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: .015em;
  line-height: 1.08;
  -webkit-text-stroke: 0;
}

.topbar p {
  max-height: 3em;
  margin: 4px 0 0;
  overflow: hidden;
  color: #fff;
  mix-blend-mode: difference;
  font-size: 14px;
  transition: max-height .18s ease, opacity .18s ease, margin .18s ease;
}

body.is-scrolled .topbar p {
  max-height: 0;
  margin-block: 0;
  opacity: 0;
  visibility: hidden;
}

.header-actions { align-self: center; }
.header-actions button,
.header-actions .filebtn {
  background: rgba(250, 250, 248, .96) !important;
  color: #000;
  border-color: rgba(10, 10, 10, .52);
}

.tabs {
  position: static;
  top: auto;
  z-index: auto;
  max-width: none;
  margin: 0;
  padding: 5px clamp(14px, 4vw, 46px) 9px;
  overflow-x: auto;
  background: transparent !important;
  border: 0;
  backdrop-filter: none !important;
}

.tabs button {
  flex: 0 0 auto;
  background: rgba(250, 250, 248, .96) !important;
  color: #000 !important;
  border-color: rgba(10, 10, 10, .56);
  font-weight: 550;
}

.tabs button.active {
  background: #101111 !important;
  color: #fff !important;
  border-color: #d4be53;
}

body.is-scrolling .tabs button:not(.active) {
  background: rgba(250, 250, 248, .9) !important;
}

main { padding-top: 3px; }

/* Difference blend gives onboarding/profile headings hard, location-aware contrast. */
body[data-text-mode="auto"]:not([data-page="search"]):not([data-page="results"]) .topbar h1,
body[data-text-mode="auto"]:not([data-page="search"]):not([data-page="results"]) .topbar p,
body[data-text-mode="auto"]:not([data-page="search"]):not([data-page="results"]) .hero .eyebrow,
body[data-text-mode="auto"]:not([data-page="search"]):not([data-page="results"]) .hero h2,
body[data-text-mode="auto"]:not([data-page="search"]):not([data-page="results"]) .hero p,
body[data-text-mode="auto"]:not([data-page="search"]):not([data-page="results"]) .section-head .eyebrow,
body[data-text-mode="auto"]:not([data-page="search"]):not([data-page="results"]) .section-head h2 {
  color: #fff;
  mix-blend-mode: difference;
  -webkit-text-stroke: 0;
}

/* Search headers are clean white type over the watercolor. */
body[data-page="search"] .topbar h1,
body[data-page="search"] .topbar p,
body[data-page="search"] .section-head .eyebrow,
body[data-page="search"] .section-head h2 {
  color: #fff !important;
  mix-blend-mode: normal !important;
  -webkit-text-stroke: 0;
}

/* The results image stays visible; near-black letterforms remain crisp. */
body[data-page="results"] .topbar h1,
body[data-page="results"] .topbar p,
body[data-page="results"] .section-head .eyebrow,
body[data-page="results"] .section-head h2 {
  color: #000 !important;
  mix-blend-mode: multiply !important;
  -webkit-text-stroke: 0;
}

body[data-text-mode="light"] .topbar h1,
body[data-text-mode="light"] .topbar p,
body[data-text-mode="light"] .hero .eyebrow,
body[data-text-mode="light"] .hero h2,
body[data-text-mode="light"] .hero p,
body[data-text-mode="light"] .section-head .eyebrow,
body[data-text-mode="light"] .section-head h2 {
  color: #fff !important;
  mix-blend-mode: normal !important;
  -webkit-text-stroke: 0;
}

body[data-text-mode="dark"] .topbar h1,
body[data-text-mode="dark"] .topbar p,
body[data-text-mode="dark"] .hero .eyebrow,
body[data-text-mode="dark"] .hero h2,
body[data-text-mode="dark"] .hero p,
body[data-text-mode="dark"] .section-head .eyebrow,
body[data-text-mode="dark"] .section-head h2 {
  color: #000 !important;
  mix-blend-mode: multiply !important;
  -webkit-text-stroke: 0;
}

.hero, .card, .wizard-card, .filterbar, .job, .entry, .topic-entry,
.topic-rating, .proposal-section, .signal, .source-item, .status {
  backdrop-filter: none !important;
}

.job.new {
  background: linear-gradient(90deg, var(--new), rgba(250, 250, 248, var(--panel-alpha)) 24%) !important;
}

body.is-scrolling .job.new {
  background: linear-gradient(90deg, var(--new), rgba(250, 250, 248, var(--panel-alpha-scroll)) 24%) !important;
}

.why { background: rgba(219, 229, 218, var(--inset-alpha)) !important; }
body.is-scrolling .why { background: rgba(219, 229, 218, var(--inset-alpha-scroll)) !important; }
.pill, .tag, .topic-progress span { background: rgba(222, 223, 219, var(--inset-alpha)) !important; }
body.is-scrolling .pill,
body.is-scrolling .tag,
body.is-scrolling .topic-progress span { background: rgba(222, 223, 219, var(--inset-alpha-scroll)) !important; }
.priority-questions, .optional-reflection, .chat-prompt { background-color: rgba(250, 250, 248, var(--inset-alpha)) !important; }
body.is-scrolling .priority-questions,
body.is-scrolling .optional-reflection,
body.is-scrolling .chat-prompt { background-color: rgba(250, 250, 248, var(--inset-alpha-scroll)) !important; }

.hint, .eyebrow, label, .meta, .breakdown, .score small,
.range-labels, .source-item small, .source-state, .progress-ring span,
.topic-rating small, .proposal-grid small, .employer-query-list details {
  color: #292929;
}

.why { color: #111 !important; }
.source-state.ok, .source-state.no { color: #151515; }
.job a, .employer-query-list a, .card a { color: #000; }
.progress-ring span, .score small { font-weight: 600; }

.font-specimens {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.font-specimen {
  display: flex;
  min-height: 118px;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  padding: 12px;
  background: rgba(250, 250, 248, .88) !important;
  border: 1px solid rgba(0, 0, 0, .28);
  color: #000 !important;
  text-align: left;
}

.font-specimen small { color: #292929; font-size: 10px; }
.font-specimen strong { font-size: 22px; letter-spacing: .02em; }
.font-specimen span { font-size: 11px; }
.font-specimen.font-jp { font-family: "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans JP", system-ui, sans-serif; }
.font-specimen.font-modern { font-family: Inter, "Helvetica Neue", Arial, system-ui, sans-serif; }
.font-specimen.font-editorial { font-family: Georgia, "Noto Serif JP", "Yu Mincho", serif; }
.font-specimen.selected { border: 2px solid #111; box-shadow: inset 0 0 0 2px #d4be53; }

.visual-preview-text {
  color: #fff !important;
  mix-blend-mode: normal !important;
  -webkit-text-stroke: 0;
  text-shadow: none !important;
}

.opacity-dock {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 60;
  width: min(310px, calc(100vw - 24px));
  padding: 9px 12px 7px;
  border: 1px solid rgba(0, 0, 0, .38);
  border-radius: 12px;
  background: rgba(250, 250, 248, .97);
  color: #000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .22);
}

.opacity-dock label {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: #000;
  font-size: 12px;
  font-weight: 700;
}

.opacity-dock output { font-variant-numeric: tabular-nums; }
.opacity-dock input { margin: 4px 0 0; padding: 0; accent-color: #111; }
.opacity-dock .range-labels { font-size: 9px; color: #292929; }
.opacity-dock .range-labels span:last-child { text-align: right; }

@media (max-width: 760px) {
  .font-specimens { grid-template-columns: 1fr; }
  .font-specimen { min-height: 92px; }
  .topbar { align-items: flex-start; }
  .header-actions { flex-wrap: wrap; }
}

@media (max-width: 650px) {
  .topbar { padding: 8px 10px 3px; }
  .tabs { padding: 4px 8px 7px; }
  .tabs button { padding: 7px 9px; font-size: 13px; }
  .opacity-dock { right: 8px; bottom: 8px; }
}


/* V22: crisp type, adaptive header lettering, and a wallpaper-only sticky header.
   The header repeats the fixed page artwork, so scrolled page text cannot show through it. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  isolation: isolate;
  background: transparent;
}
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("assets/onboarding-ink.webp");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
}
body[data-page="search"] .site-header::before {
  background-image: url("assets/search-watercolor.webp");
  background-position: center 52%;
}
body[data-page="results"] .site-header::before {
  background-image: url("assets/results-ink.webp?v=22");
  background-position: center center;
}
.site-header .topbar,
.site-header .tabs {
  position: relative;
  z-index: 1;
  background: transparent !important;
  border-color: transparent !important;
}

/* Remove every outline, halo, shadow, and filter from lettering. */
.topbar h1,
.topbar p,
.hero .eyebrow,
.hero h2,
.hero p,
.section-head .eyebrow,
.section-head h2,
.visual-preview-text {
  text-shadow: none !important;
  -webkit-text-stroke: 0 !important;
  filter: none !important;
  text-rendering: auto;
}

/* Onboarding and profile: white glyphs invert cleanly across light and dark ink. */
body[data-page="onboarding"] .topbar h1,
body[data-page="onboarding"] .topbar p,
body[data-page="onboarding"] .hero .eyebrow,
body[data-page="onboarding"] .hero h2,
body[data-page="onboarding"] .hero p,
body[data-page="onboarding"] .section-head .eyebrow,
body[data-page="onboarding"] .section-head h2,
body[data-page="profile"] .topbar h1,
body[data-page="profile"] .topbar p,
body[data-page="profile"] .hero .eyebrow,
body[data-page="profile"] .hero h2,
body[data-page="profile"] .hero p,
body[data-page="profile"] .section-head .eyebrow,
body[data-page="profile"] .section-head h2 {
  color: #fff !important;
  mix-blend-mode: difference !important;
  text-shadow: none !important;
  -webkit-text-stroke: 0 !important;
}

/* Search: unoutlined white type over the dark watercolor. */
body[data-page="search"] .topbar h1,
body[data-page="search"] .topbar p,
body[data-page="search"] .section-head .eyebrow,
body[data-page="search"] .section-head h2 {
  color: #fff !important;
  mix-blend-mode: normal !important;
  text-shadow: none !important;
  -webkit-text-stroke: 0 !important;
}

/* Results: return to the earlier dark type treatment, slightly deeper and fully sharp. */
body[data-page="results"] .topbar h1,
body[data-page="results"] .topbar p,
body[data-page="results"] .section-head .eyebrow,
body[data-page="results"] .section-head h2 {
  color: #050505 !important;
  mix-blend-mode: multiply !important;
  text-shadow: none !important;
  -webkit-text-stroke: 0 !important;
  filter: none !important;
}

/* Bring ordinary copy and metadata closer to black throughout the app. */
:root { --ink: #000; --muted: #292929; }
body { color: #000; -webkit-font-smoothing: auto; }
.hint, .eyebrow, label, .meta, .breakdown, .score small,
.range-labels, .source-item small, .source-state, .progress-ring span,
.topic-rating small, .proposal-grid small, .employer-query-list details {
  color: #292929 !important;
}


/* V22: Utopia-inspired Erewhon for large headings; form UI stays clear Sans. */
@font-face {
  font-family: "Erewhon";
  src: url("assets/Erewhon-Regular.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Erewhon";
  src: url("assets/Erewhon-Bold.otf") format("opentype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
h1,
h2 {
  font-family: "Utopia", "Erewhon", Georgia, serif !important;
}
label,
input,
select,
textarea,
button:not(.font-specimen),
.filebtn {
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif !important;
}
