/* Match — Swiss editorial-technical. Black, greys, one accent (#FF4F00) for gates + missing only. */

@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #000;
  --grey-1: #555;
  --grey-2: #8a8a8a;
  --rule: #e5e5e5;
  --bg: #fff;
  --accent: #ff4f00;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --gutter: 16px;
  --gap: 16px;
  color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
button:focus-visible,
textarea:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 2px;
}

.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
}

/* 12-column grid; everything spans 12 on mobile */
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
}
.grid > * { grid-column: 1 / -1; min-width: 0; }

/* Masthead */
.masthead {
  align-items: baseline;
  row-gap: 4px;
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--ink);
}
.wordmark {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}
.tagline {
  color: var(--grey-1);
  font-size: 13px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.link {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  min-height: 32px;
}
.link:hover { color: var(--grey-1); }
.btn {
  border: 1px solid var(--ink);
  padding: 8px 12px;
  min-height: 36px;
  min-width: 140px;
  text-align: center;
  margin-left: auto;
}
.btn:hover,
.btn.is-done { background: var(--ink); color: var(--bg); }

/* Sections */
.section {
  border-bottom: 1px solid var(--rule);
  padding: 16px 0 24px;
}
.label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
}
.idx { color: var(--grey-2); }

/* Inputs */
.inputs { row-gap: 16px; }
.field { display: flex; flex-direction: column; }
.field-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--ink);
}
.count { color: var(--grey-2); }
textarea {
  display: block;
  width: 100%;
  height: 38vh;
  min-height: 200px;
  max-height: 640px;
  resize: vertical;
  margin: 0;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px; /* >= 16px: no iOS zoom on focus */
  line-height: 1.5;
  -webkit-appearance: none;
  appearance: none;
}
textarea::placeholder { color: var(--grey-2); }
textarea:focus { outline: none; border-bottom-color: var(--ink); }

/* Score */
.score { align-items: end; row-gap: 8px; }
.score-value {
  display: block;
  font-family: var(--mono);
  font-weight: 400;
  font-size: clamp(88px, 28vw, 168px);
  line-height: 0.9;
  letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
}
.score-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--grey-1);
  max-width: 44ch;
  padding-bottom: 6px;
}

/* Gates */
.gates li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  padding: 10px 0;
  border-top: 1px solid var(--rule);
  color: var(--accent);
}
.gates li:first-child { border-top: 0; padding-top: 0; }
.gates li.muted { color: var(--grey-2); font-family: var(--mono); font-size: 12px; }
.gate-label {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.gate-quote { overflow-wrap: anywhere; }

/* Keyword columns */
.columns { row-gap: 24px; }
.col-head {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-bottom: 6px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--ink);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.col-head--missing { color: var(--accent); border-bottom-color: var(--accent); }
.col-head--small { border-bottom-color: var(--rule); color: var(--grey-2); flex-wrap: wrap; }
.n { font-variant-numeric: tabular-nums; }
.hint { text-transform: none; letter-spacing: 0; font-weight: 400; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips li {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1;
  padding: 6px 7px;
  border: 1px solid var(--ink);
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.chips li .c { color: var(--grey-2); }
.chips li.empty { border: 0; padding: 6px 0; color: var(--grey-2); }
#missing li:not(.empty) { border-color: var(--accent); color: var(--accent); }
#missing li:not(.empty) .c { color: var(--accent); opacity: 0.7; }
#cvonly li:not(.empty) { border-color: var(--rule); color: var(--grey-1); }

.unknown { margin-top: 28px; }
.chips--unknown li { border-color: var(--rule); color: var(--grey-2); }
.chips--unknown li.in-cv { color: var(--grey-1); border-color: #bdbdbd; }
.chips--unknown li .tag { font-size: 10px; text-transform: uppercase; color: var(--grey-1); }

/* Footer */
.footer {
  padding: 16px 0 calc(24px + env(safe-area-inset-bottom));
  font-family: var(--mono);
  font-size: 11px;
  color: var(--grey-1);
}

/* Tablet / desktop */
@media (min-width: 720px) {
  :root { --gutter: 32px; --gap: 24px; }
  .masthead { padding: 28px 0 20px; }
  .wordmark { grid-column: 1 / span 3; font-size: 32px; }
  .tagline { grid-column: 4 / span 4; }
  .actions { grid-column: 8 / -1; justify-content: flex-end; margin-top: 0; }
  .btn { margin-left: 0; }
  .section { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); padding: 20px 0 32px; }
  .section > .label { grid-column: 1 / -1; }
  .section > .grid,
  .section > .gates,
  .section > .unknown { grid-column: 1 / -1; }
  .inputs .field:first-child { grid-column: 1 / span 6; }
  .inputs .field:last-child { grid-column: 7 / span 6; }
  textarea { height: 44vh; }
  .score-value { grid-column: 1 / span 6; }
  .score-meta { grid-column: 7 / span 6; }
  .gates li { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: baseline; }
  .gate-label { grid-column: 1 / span 3; }
  .gate-quote { grid-column: 4 / -1; }
  .columns .col { grid-column: span 4; }
}

@media (min-width: 1080px) {
  .section > .label { grid-column: 1 / span 2; margin-bottom: 0; flex-direction: column; gap: 4px; }
  .section > .grid,
  .section > .gates,
  .section > .unknown { grid-column: 3 / -1; }
  .section > .unknown { grid-row: 2; }
  .score-value { font-size: 168px; }
}

@media (prefers-reduced-motion: no-preference) {
  .btn { transition: background-color 120ms linear, color 120ms linear; }
}
