/* The idea: an editor marking up a resume.
 * Paper, ink, one highlighter and one red pen. Big type, no chrome. */

@font-face {
  font-family: "Fraunces";
  src: url("../vendor/fraunces.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f4f0e6;
  --card: #fbf9f3;
  --ink: #17150f;
  --muted: #6a6457;
  --line: #d8d2c2;
  --marker: #e1ef55;
  --pen: #cf3a1c;
  --good: #1c7a49;
  --warn: #a96400;
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --measure: 46rem;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.25rem/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .wordmark, .score, .drop-title, .gain, .drop-veil {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-variant-numeric: lining-nums;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3, .lede, .context { text-wrap: balance; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 0.06em; }
a:hover { background: var(--marker); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; border-radius: 4px; }

.wrap { width: 100%; max-width: 72rem; margin-inline: auto; padding-inline: clamp(1.25rem, 5vw, 3rem); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- header / footer ---------- */

.top, .foot { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.top { padding-block: 1.75rem; }
.foot { margin-top: 6rem; padding-block: 2.5rem 3.5rem; border-top: 1px solid var(--line); }
.wordmark { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; text-decoration: none; }
.top nav, .foot nav { display: flex; flex-wrap: wrap; gap: 0.6rem 1.75rem; font-size: 1.05rem; color: var(--muted); }
.top nav a, .foot nav a { text-decoration: none; }
.top nav a:hover, .foot nav a:hover { color: var(--ink); }

/* ---------- stage: the big centred moment ---------- */

.stage { text-align: center; padding-block: clamp(1.5rem, 5vh, 4rem) 3rem; }

h1 {
  font-size: clamp(3.1rem, 9.4vw, 8rem);
  font-weight: 380;
  line-height: 0.98;
  letter-spacing: -0.035em;
  max-width: 12ch;
  margin-inline: auto;
}
mark {
  color: inherit;
  background: linear-gradient(transparent 14%, var(--marker) 14%, var(--marker) 90%, transparent 90%);
  padding-inline: 0.08em;
  margin-inline: -0.04em;
  border-radius: 0.06em;
}
.kicker { display: block; margin-bottom: 1.4rem; font: 600 1rem/1.2 var(--body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.sub-heading { margin-top: 3rem; }
.lede { max-width: 34rem; margin: 1.75rem auto 0; font-size: clamp(1.25rem, 2.2vw, 1.5rem); line-height: 1.4; color: var(--muted); }

.drop {
  display: grid;
  place-content: center;
  gap: 0.6rem;
  max-width: 52rem;
  min-height: clamp(14rem, 34vh, 20rem);
  margin: 3rem auto 0;
  padding: 2rem;
  border: 3px dashed var(--ink);
  border-radius: 2rem;
  background: var(--card);
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, border-color 0.15s;
}
.drop:hover, .drop:focus-within { background: var(--marker); border-style: solid; transform: scale(1.01); }
.drop:focus-within { outline: 3px solid var(--ink); outline-offset: 5px; }
.drop.busy { pointer-events: none; border-style: solid; background: var(--marker); }
.drop-title { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 420; letter-spacing: -0.025em; line-height: 1.05; }
.drop-sub { color: var(--muted); font-size: 1.15rem; }
.drop:hover .drop-sub, .drop:focus-within .drop-sub, .drop.busy .drop-sub { color: var(--ink); }

.alt { margin-top: 1.5rem; display: flex; justify-content: center; gap: 0.9rem; flex-wrap: wrap; color: var(--muted); }
.proof { margin-top: 3rem; font-size: 1.05rem; color: var(--muted); }
.proof svg { vertical-align: -0.15em; margin-right: 0.25em; }
.loaded-job { display: inline-block; margin-top: 2rem; padding: 0.35rem 0.9rem; background: var(--marker); font-size: 1.1rem; }

.drop-veil {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  place-items: center;
  background: var(--marker);
  font-size: clamp(5rem, 19vw, 18rem);
  font-weight: 380;
  letter-spacing: -0.04em;
  pointer-events: none;
}
body.dragging .drop-veil { display: grid; }

/* ---------- controls ---------- */

.btn {
  font: 600 1.15rem/1 var(--body);
  padding: 1.1rem 2rem;
  color: var(--paper);
  background: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.15s, color 0.15s;
}
.btn:hover { background: var(--marker); color: var(--ink); }
.btn:disabled { opacity: 0.5; cursor: progress; }
.btn-ghost { background: transparent; color: var(--ink); }
.text-btn { font: inherit; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 0.06em; }
.text-btn:hover { background: var(--marker); }

textarea {
  display: block;
  width: 100%;
  margin-bottom: 1rem;
  padding: 1.1rem 1.25rem;
  font: 1.05rem/1.5 var(--body);
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 1rem;
  resize: vertical;
}
textarea:focus-visible { outline-offset: 2px; border-radius: 1rem; }
#paste-form { max-width: 52rem; margin: 1.5rem auto 0; text-align: left; }

.notice { max-width: 40rem; margin: 1.5rem auto 0; padding-left: 1rem; border-left: 4px solid var(--pen); color: var(--pen); text-align: left; font-size: 1.1rem; }
#job-form .notice { margin-inline: 0; }

/* ---------- result ---------- */

.eyebrow { font-size: 1rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.score { display: flex; justify-content: center; align-items: baseline; line-height: 0.85; margin-top: 0.5rem; animation: rise 0.5s ease-out both; }
.score-num { font-size: clamp(9rem, 32vw, 22rem); font-weight: 340; letter-spacing: -0.05em; font-variant-numeric: lining-nums tabular-nums; }
.score-of { font-size: clamp(1.5rem, 4vw, 3rem); color: var(--muted); margin-left: 0.2em; }
.score[data-band="ready"] .score-num, .score[data-band="strong"] .score-num { color: var(--good); }
.score[data-band="fair"] .score-num, .score[data-band="work"] .score-num { color: var(--warn); }
.score[data-band="risk"] .score-num { color: var(--pen); }
.verdict { max-width: 22ch; margin: 1.75rem auto 0; font-size: clamp(1.9rem, 4.4vw, 3.25rem); font-weight: 420; line-height: 1.08; letter-spacing: -0.025em; outline: none; }
.context { max-width: 36rem; margin: 1.25rem auto 0; color: var(--muted); }
#unreadable .context { margin-bottom: 2.5rem; color: var(--ink); }
@keyframes rise { from { opacity: 0; transform: translateY(0.4em); } }
@media (prefers-reduced-motion: reduce) { .score, .ai-status::before { animation: none; } html { scroll-behavior: auto; } }

.block { max-width: var(--measure); margin-inline: auto; padding-block: 3.5rem; border-top: 1px solid var(--line); }
.block h3, .more h2 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); font-weight: 420; letter-spacing: -0.025em; line-height: 1.1; }
.block-sub { margin-top: 0.75rem; color: var(--muted); }
#job-form { margin-top: 1.75rem; }

.fixes { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 2rem; }
.fixes li { display: grid; grid-template-columns: 5.5rem 1fr; gap: 1.25rem; align-items: start; }
.gain { justify-self: start; padding: 0.1em 0.2em; background: var(--marker); font-size: 2.4rem; font-weight: 420; line-height: 1; letter-spacing: -0.03em; }
.fixes strong { display: block; font-size: 1.4rem; line-height: 1.25; }
.fixes p, .checks p, .lines p { margin-top: 0.35rem; font-size: 1.1rem; color: var(--muted); }

.kw-label { margin-top: 2rem; font-size: 1rem; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); }
.kw-cloud { display: flex; flex-wrap: wrap; gap: 0.5rem 1.1rem; margin-top: 0.75rem; font-size: 1.3rem; line-height: 1.3; }
.ai-tag { margin-left: 0.5em; padding: 0.15em 0.55em; background: var(--ink); color: var(--paper); border-radius: 999px; font-size: 0.8rem; letter-spacing: 0.03em; white-space: nowrap; }
.ai-status { margin-top: 2rem; color: var(--muted); }
.ai-status::before { content: ""; display: inline-block; width: 0.6em; height: 0.6em; margin-right: 0.6em; border-radius: 50%; background: var(--ink); animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: 0.2; } }
#requirements .yours { font-family: var(--display); font-size: 1.15rem; color: var(--ink); }
#requirements .their-words { color: var(--pen); }
.kw.hit { background: var(--marker); padding-inline: 0.2em; }
.kw.miss { text-decoration: underline wavy var(--pen); text-decoration-thickness: 0.08em; text-underline-offset: 0.22em; }

details + details { margin-top: 2.5rem; }
summary { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font: 300 2rem/1 var(--display); color: var(--muted); }
details[open] > summary::after { content: "–"; }
summary:hover h3, .more summary:hover { background: var(--marker); }
summary h3 { display: inline; }
.count { color: var(--muted); font-size: 0.6em; vertical-align: 0.3em; }

.checks, .lines, .next { list-style: none; margin: 1.75rem 0 0; padding: 0; display: grid; gap: 1.5rem; }
.checks li { display: grid; grid-template-columns: 2rem 1fr; gap: 0.75rem; }
.mark { font-weight: 700; }
.pass .mark { color: var(--good); }
.warn .mark { color: var(--warn); }
.fail .mark { color: var(--pen); }
.lines q { display: block; padding-left: 1rem; border-left: 4px solid var(--pen); font-family: var(--display); font-size: 1.3rem; line-height: 1.35; quotes: none; }
.lines p { padding-left: calc(1rem + 4px); }
.next a { font-weight: 600; }
.fine { margin-top: 1.5rem; font-size: 0.95rem; color: var(--muted); }
.again { text-align: center; padding-block: 1rem 2rem; }

/* ---------- below the fold + article pages ---------- */

.more { margin-top: 5rem; }
.more section, .prose { max-width: var(--measure); margin-inline: auto; }
.more section { padding-block: 4rem; border-top: 1px solid var(--line); }
.more p, .more ul, .prose p, .prose ul { margin-top: 1.25rem; }
.plain { padding-left: 1.2em; display: grid; gap: 0.9rem; }

.weights { width: 100%; margin-top: 2rem; border-collapse: collapse; font-size: 1.1rem; }
.weights th, .weights td { padding: 0.9rem 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: baseline; }
.weights th { width: 34%; padding-right: 1rem; font-weight: 600; }
.weights td:nth-child(2) { color: var(--muted); }
.weights td:last-child { width: 3.5rem; text-align: right; font: 420 1.6rem/1 var(--display); font-variant-numeric: lining-nums; }

.more details, .prose details { border-bottom: 1px solid var(--line); margin: 0; }
.more details:first-of-type { margin-top: 1.5rem; border-top: 1px solid var(--line); }
.more summary, .prose summary { padding-block: 1.25rem; font: 420 1.45rem/1.25 var(--display); }
.more details p, .prose details p { margin: 0 0 1.5rem; color: var(--muted); }
.guide-links { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; font: 420 1.5rem/1.3 var(--display); }

.prose { padding-block: clamp(1.5rem, 5vh, 4rem) 0; }
.prose h1 { max-width: none; margin: 0; font-size: clamp(2.7rem, 6.5vw, 4.75rem); line-height: 1.02; }
.prose h2 { margin-top: 3.5rem; font-size: clamp(1.7rem, 3.2vw, 2.25rem); font-weight: 420; letter-spacing: -0.02em; line-height: 1.15; }
.prose .lede { margin: 1.75rem 0 0; max-width: none; }
.prose ul { padding-left: 1.2em; display: grid; gap: 0.9rem; }
.prose .cta { margin-top: 2.5rem; }
.prose details:first-of-type { margin-top: 1.5rem; border-top: 1px solid var(--line); }
.crumb { margin-bottom: 1.5rem; font-size: 1rem; color: var(--muted); }
.kw-table { width: 100%; margin-top: 1.5rem; border-collapse: collapse; font-size: 1.1rem; }
.kw-table th, .kw-table td { padding: 0.85rem 1rem 0.85rem 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: baseline; }
.kw-table thead th { font-size: 0.95rem; letter-spacing: 0.04em; color: var(--muted); }
.kw-table td:first-child { font-weight: 600; width: 42%; }
.kw-table td:last-child { color: var(--muted); }

@media (max-width: 40rem) {
  body { font-size: 1.125rem; }
  .fixes li { grid-template-columns: 1fr; gap: 0.6rem; }
  .weights td:nth-child(2) { display: none; }
  .weights th { width: auto; }
  .top { flex-wrap: nowrap; }
  .top .wordmark { font-size: 1.3rem; white-space: nowrap; }
  .top nav a[href^="#"] { display: none; } /* in-page links are a scroll away on a phone */
}
