:root {
  --bg: #fff6e5;
  --ink: #1b1230;
  --muted: #554b6b;
  --card: #ffffff;
  --line: #1b1230;
  --yellow: #ffd23f;
  --green: #2ee59d;
  --soft: #f3e7d3;
  --link: #2a3fb0;
  --error: #a3123f;
  --r: 18px;
  --shadow: 0 5px 0 var(--ink);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  font-size: 1.0625rem;
}
a { color: var(--link); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

.top, main, .foot { width: min(920px, 100% - 40px); margin-inline: auto; }
.top { display: flex; justify-content: space-between; align-items: baseline; padding: 22px 0 0; }
.logo { font-weight: 850; font-size: 1.5rem; letter-spacing: -0.03em; color: var(--ink); text-decoration: none; }
.by { color: var(--muted); font-weight: 600; font-size: 0.95rem; }

.intro { padding: clamp(36px, 7vw, 72px) 0 26px; }
h1 {
  font-size: clamp(2.2rem, 6.4vw, 4.2rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 850;
  margin: 0;
  max-width: 16ch;
  text-wrap: balance;
}
h1 u { text-decoration: none; background: linear-gradient(transparent 62%, var(--yellow) 62% 92%, transparent 92%); }
.lede { font-size: clamp(1.08rem, 2vw, 1.25rem); color: var(--muted); max-width: 58ch; margin: 20px 0 10px; }
.meta { color: var(--muted); font-size: 0.95rem; margin: 0; min-height: 1.5em; }

.panel {
  background: var(--card);
  border: 3px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: clamp(18px, 3.5vw, 30px);
}
.cv-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.cv-head label { font-weight: 800; font-size: 1.15rem; }
.count { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
textarea {
  width: 100%;
  min-height: 15rem;
  resize: vertical;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #fffdf8;
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 14px 16px;
}
textarea::placeholder { color: #6b6280; }

.cv-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 12px; }
.or { color: var(--muted); font-size: 0.95rem; }
.examples { display: contents; }
.chip, .file span {
  display: inline-block;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--ink);
  background: var(--soft);
  border: 2px solid var(--ink);
  border-radius: 99px;
  padding: 6px 14px;
  cursor: pointer;
}
.chip:hover, .file:hover span { background: var(--yellow); }
.file { position: relative; }
.file input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.file input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 3px; }
.status { min-height: 1.5em; margin: 8px 0 0; font-size: 0.95rem; color: var(--muted); }
.status.error, .meta.error { color: var(--error); font-weight: 600; }

.filters {
  border: 0;
  padding: 0;
  margin: 18px 0 22px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px 16px;
}
.filters legend { font-weight: 800; font-size: 1.15rem; margin-bottom: 8px; padding: 0; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 0.92rem; font-weight: 650; color: var(--muted); }
select {
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #fffdf8;
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 8px 10px;
  min-width: 0;
}

.btn {
  font: inherit;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--ink);
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 99px;
  padding: 13px 26px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.btn:hover { transform: translateY(2px); box-shadow: 0 3px 0 var(--ink); }
.btn:active { transform: translateY(5px); box-shadow: 0 0 0 var(--ink); }
.btn[disabled] { cursor: progress; background: var(--soft); }
.privacy { color: var(--muted); font-size: 0.9rem; margin: 16px 0 0; max-width: 70ch; }

.results { margin: 44px 0 0; }
.results-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; margin-bottom: 14px; }
.results h2, .how h2 { font-size: clamp(1.6rem, 4vw, 2.3rem); letter-spacing: -0.03em; line-height: 1.1; margin: 0; }
.results-note { color: var(--muted); font-size: 0.95rem; margin: 0; }
.ai-note { background: var(--soft); border-radius: 12px; padding: 10px 14px; margin: 0 0 14px; font-size: 0.95rem; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.card {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--r);
  box-shadow: 0 4px 0 var(--ink);
  padding: 18px clamp(16px, 3vw, 24px);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 16px;
}
.rank {
  grid-row: span 2;
  font-weight: 850;
  font-size: 1.3rem;
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-variant-numeric: tabular-nums;
}
.card h3 { margin: 0; font-size: 1.2rem; line-height: 1.3; overflow-wrap: anywhere; }
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--link); }
.facts { margin: 2px 0 0; color: var(--muted); font-size: 0.93rem; overflow-wrap: anywhere; }
.body { grid-column: 2; margin-top: 8px; }
.fit { display: inline-block; font-size: 0.82rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; border: 2px solid var(--ink); border-radius: 99px; padding: 1px 10px; margin-right: 6px; }
.fit-strong { background: var(--green); }
.fit-good { background: var(--yellow); }
.fit-weak { background: var(--soft); }
.reason { margin: 8px 0 0; }
.gap, .preview { margin: 6px 0 0; color: var(--muted); }
.gap b, .preview b { color: var(--ink); }
.preview { font-size: 0.97rem; overflow-wrap: anywhere; }
details { margin-top: 10px; font-size: 0.95rem; }
summary { cursor: pointer; font-weight: 650; color: var(--link); }
details p { color: var(--muted); margin: 8px 0 0; overflow-wrap: anywhere; }

.how { margin: 64px 0 0; }
.steps { padding-left: 1.3em; max-width: 70ch; }
.steps li { margin: 10px 0; }
.steps li::marker { font-weight: 800; }
.foot { color: var(--muted); font-size: 0.92rem; padding: 40px 0 48px; }

@media (max-width: 520px) {
  .card { grid-template-columns: 1fr; }
  .rank { grid-row: auto; width: 2rem; height: 2rem; font-size: 1.05rem; }
  .body { grid-column: 1; }
  .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
