:root {
  color-scheme: light;
  --bg: #f6f6f2;
  --surface: #fff;
  --text: #1d1d1b;
  --muted: #696965;
  --line: #deded7;
  --soft: #eeeee8;
  --danger: #a33a2b;
  --danger-soft: #fff1ed;
  --success-soft: #edf7ef;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a { color: inherit; }
button, input { font: inherit; }
h1, h2, h3, p, dl, dd { margin: 0; }

.site-header { border-bottom: 1px solid var(--line); background: rgba(246, 246, 242, .94); }
.site-header__inner, .app-shell { width: min(1080px, calc(100% - 36px)); margin-inline: auto; }
.site-header__inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; letter-spacing: -.02em; }
.brand__mark { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 8px; background: var(--text); color: var(--surface); }
.quick-nav { display: flex; align-items: center; gap: 8px; }
.quick-nav a { padding: 8px 10px; border-radius: 8px; color: var(--muted); font-size: .9rem; text-decoration: none; }
.quick-nav a:hover { background: var(--soft); color: var(--text); }
.quick-nav strong { margin-left: 4px; color: var(--danger); }

.app-shell { padding-block: 64px; }
.page-shell { display: grid; gap: 48px; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, .8fr); gap: 64px; align-items: end; }
.hero__copy { max-width: 590px; }
.eyebrow { margin-bottom: 8px; color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
h1 { max-width: 9ch; font-size: clamp(2.8rem, 7vw, 5rem); line-height: .98; letter-spacing: -.065em; }
.hero__copy > p:not(.eyebrow) { max-width: 52ch; margin-top: 20px; color: var(--muted); font-size: 1.05rem; }
.hero__copy > .button { margin-top: 24px; }
.hero-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.hero-stats div { padding: 18px 8px; border-bottom: 1px solid var(--line); }
.hero-stats div:nth-child(odd) { border-right: 1px solid var(--line); }
.hero-stats dt { color: var(--muted); font-size: .8rem; }
.hero-stats dd { margin-top: 2px; font-size: 1.55rem; font-weight: 700; letter-spacing: -.03em; }
.hero-stats__highlight dd { color: var(--danger); }

.tool-card { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.panel__heading { display: flex; justify-content: space-between; gap: 32px; align-items: end; padding: 24px; border-bottom: 1px solid var(--line); }
h2 { font-size: 1.45rem; letter-spacing: -.025em; }
.section-copy { margin-top: 4px; color: var(--muted); font-size: .9rem; }
.inline-form { display: grid; grid-template-columns: minmax(0, 220px) auto; gap: 8px; align-items: center; }
.file-label { grid-column: 1 / -1; color: var(--muted); font-size: .8rem; font-weight: 600; }
input[type="file"] { min-width: 0; color: var(--muted); font-size: .8rem; }

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--text);
  border-radius: 8px;
  padding: 8px 13px;
  background: var(--text);
  color: var(--surface);
  cursor: pointer;
  font-weight: 650;
  text-decoration: none;
}
.button:hover { background: #000; }
.button--secondary { border-color: var(--line); background: var(--surface); color: var(--text); }
.button--secondary:hover, .button--quiet:hover { background: var(--soft); }
.button--danger { border-color: #e7b9af; background: var(--danger-soft); color: var(--danger); }
.button--danger:hover { background: #fbe3dc; }
.button--quiet { border-color: transparent; background: transparent; color: var(--muted); }
:focus-visible { outline: 3px solid #6a91c8; outline-offset: 2px; }

.flash { margin: 16px 24px 0; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; }
.flash--success { border-color: #bcd9c1; background: var(--success-soft); }
.flash--error { border-color: #e7b9af; background: var(--danger-soft); color: var(--danger); }
.candidate-list { padding-inline: 24px; }
.candidate-row { display: flex; min-height: 94px; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.candidate-row:last-child { border-bottom: 0; }
.candidate-main { display: flex; min-width: 0; align-items: center; gap: 12px; }
.candidate-main h3 { overflow: hidden; font-size: 1rem; text-overflow: ellipsis; white-space: nowrap; }
.candidate-main p { margin-top: 2px; color: var(--muted); font-size: .85rem; }
.avatar { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 50%; background: var(--soft); font-size: .8rem; font-weight: 700; }
.candidate-actions { display: flex; align-items: center; gap: 18px; }
.candidate-actions form { display: flex; gap: 6px; }
.status { color: var(--muted); font-size: .8rem; }
.empty-state { padding: 48px 0; color: var(--muted); text-align: center; }

@media (max-width: 760px) {
  .site-header__inner { min-height: 60px; }
  .quick-nav a:last-child { display: none; }
  .app-shell { padding-block: 40px; }
  .page-shell { gap: 36px; }
  .hero { grid-template-columns: 1fr; gap: 36px; }
  .panel__heading, .candidate-row { align-items: stretch; flex-direction: column; }
  .panel__heading { gap: 22px; }
  .inline-form { grid-template-columns: minmax(0, 1fr) auto; }
  .candidate-row { min-height: 0; padding-block: 18px; gap: 14px; }
  .candidate-actions { justify-content: space-between; }
}

@media (max-width: 430px) {
  .site-header__inner, .app-shell { width: min(100% - 24px, 1080px); }
  .quick-nav a { padding-inline: 6px; }
  .hero-stats { grid-template-columns: 1fr; }
  .hero-stats div:nth-child(odd) { border-right: 0; }
  .panel__heading, .candidate-list { padding-inline: 16px; }
  .inline-form { grid-template-columns: 1fr; }
  .file-label { grid-column: auto; }
  .candidate-actions { align-items: flex-start; flex-direction: column; gap: 10px; }
  .candidate-actions form { width: 100%; }
  .candidate-actions .button { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
