/* ============================================================
   QA Career Level Calibrator — "Ledger" theme (matches pnakhat.com)
   Warm paper · Newsreader serif + Archivo · clay accent
   ============================================================ */

:root {
  --bg:     #F5F2EA;
  --paper:  #FBF9F3;
  --ink:    #1B1A17;
  --mut:    #5C5A50;
  --faint:  #6E6C62;
  --line:   rgba(27, 26, 23, 0.12);
  --line-2: rgba(27, 26, 23, 0.06);
  --acc:    #B0512F;
  --acc-tint: rgba(176, 81, 47, 0.08);

  --serif: 'Newsreader', Georgia, serif;
  --sans:  'Archivo', system-ui, sans-serif;
  --mono:  'IBM Plex Mono', ui-monospace, monospace;

  --wrap: 880px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--acc); color: var(--paper); }

a { color: var(--acc); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }
.mono { font-family: var(--mono); }
.mut { color: var(--mut); }
.hidden { display: none !important; }

/* ── nav ── */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245, 242, 234, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-nav .wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 18px; padding-bottom: 18px; gap: 12px;
}
.brand { font-family: var(--serif); font-size: 19px; font-weight: 500; letter-spacing: -0.01em; color: var(--ink); }
.brand em { font-style: italic; color: var(--acc); }
.nav-links { display: flex; gap: 22px; align-items: center; font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; }
.nav-links a { color: var(--mut); }
.nav-links a:hover { color: var(--ink); }
.nav-cta {
  color: var(--acc) !important;
  border: 1px solid rgba(176, 81, 47, 0.4);
  padding: 7px 13px; border-radius: 8px;
}
.nav-cta:hover { background: var(--acc); color: var(--paper) !important; }

/* ── type ── */
.kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--acc);
  margin-bottom: 8px;
}
.page-h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(38px, 5.5vw, 58px);
  line-height: 1.05; letter-spacing: -0.02em;
  margin: 14px 0 20px;
}
.page-h1 em { font-style: italic; color: var(--acc); }
.lede {
  font-family: var(--serif); font-size: 22px; font-weight: 300;
  line-height: 1.45; letter-spacing: -0.01em;
  color: var(--mut); max-width: 30em; margin-bottom: 12px;
}
h2 { font-family: var(--serif); font-size: 28px; font-weight: 400; letter-spacing: -0.01em; }
h3 { font-family: var(--serif); font-size: 21px; font-weight: 500; }
.prose { max-width: 40em; margin-bottom: 14px; }
.prose-block p { max-width: 42em; margin-bottom: 18px; }
.fine { font-size: 13px; color: var(--faint); margin-top: 10px; }
.mono-line { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: var(--faint); }

/* ── layout ── */
.page { padding: 64px 28px 90px; }
.page-narrow { max-width: 760px; }
.hero { margin-bottom: 30px; }
.hero-sm { margin-bottom: 26px; }
.sec { padding: 44px 0 6px; border-top: 1px solid var(--line); margin-top: 34px; }
.hero + .sec, .hero-sm + .sec { margin-top: 10px; }
.sec-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 26px; }
.sec-head .num { font-size: 12px; color: var(--acc); }

/* ── cards / buttons ── */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: 15px; font-weight: 500;
  padding: 13px 24px; border-radius: 9px;
  border: 1px solid transparent; transition: all .18s ease; cursor: pointer;
}
.btn-primary { background: var(--ink); color: var(--paper); font-weight: 600; }
.btn-primary:hover:not(:disabled) { background: var(--acc); color: var(--paper); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }
.btn-ghost { border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-sm { font-family: var(--mono); font-size: 12.5px; padding: 11px 18px; border-radius: 8px; }
.cta-row { display: flex; gap: 13px; flex-wrap: wrap; margin-top: 22px; align-items: center; }

/* ── consent gate ── */
.terms-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px; margin: 22px 0 8px;
}
.term { padding: 18px 20px; font-size: 14.5px; line-height: 1.55; color: var(--mut); }
.term a { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.term-k { font-size: 11px; letter-spacing: 0.12em; color: var(--acc); margin-bottom: 7px; }
.consent {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 18px 20px; margin: 22px 0 4px; cursor: pointer;
  transition: border-color .18s ease;
}
.consent:hover { border-color: var(--acc); }
.consent input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--acc); flex-shrink: 0; }
.consent span { font-size: 15px; line-height: 1.55; }

/* ── form ── */
.form-sec { padding: 36px 0 8px; border-top: 1px solid var(--line); margin-top: 26px; }
.hero-sm + form .form-sec:first-of-type { margin-top: 8px; }
.opt-tag, .req-tag {
  font-size: 10.5px; letter-spacing: 0.12em; vertical-align: middle;
  padding: 5px 10px; border-radius: 999px; margin-left: 10px;
  border: 1px solid var(--line); color: var(--faint);
}
.req-tag { border-color: rgba(176, 81, 47, 0.5); color: var(--acc); background: var(--acc-tint); }
textarea {
  width: 100%; font-family: var(--sans); font-size: 15px; line-height: 1.55;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px;
  resize: vertical; transition: border-color .18s ease;
}
textarea:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-tint); }
textarea::placeholder { color: var(--faint); }
.q { display: block; margin: 14px 0; padding: 18px 20px; }
.q-num { display: block; font-size: 11px; letter-spacing: 0.1em; color: var(--acc); margin-bottom: 6px; }
.q-text { display: block; font-family: var(--serif); font-size: 17.5px; font-weight: 500; margin-bottom: 12px; line-height: 1.4; }
.q-missing { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-tint); }
.q-missing .q-num::after { content: '  ·  ANSWER REQUIRED'; }
.hp { position: absolute; left: -9999px; top: -9999px; height: 1px; width: 1px; opacity: 0; }
.upload-row { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.upload-btn { cursor: pointer; }
.upload-row .fine { margin-top: 0; }
#turnstile-box { margin-top: 22px; }
#turnstile-box:empty { display: none; }
.submit-row { display: flex; align-items: center; gap: 18px; margin-top: 26px; flex-wrap: wrap; }
.status { font-family: var(--mono); font-size: 12.5px; color: var(--mut); }
.status.error { color: var(--acc); }

/* ── result page ── */
.verdict { margin-bottom: 8px; }
.verdict h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.08; letter-spacing: -0.02em; margin: 12px 0 14px;
}
.level-id { color: var(--acc); font-weight: 500; }
.headline { font-family: var(--serif); font-style: italic; font-size: 21px; font-weight: 300; color: var(--mut); max-width: 34em; line-height: 1.45; margin-bottom: 18px; }
.meta-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 4px 0 16px; }
.chip {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--mut); background: var(--paper);
}
.chip-high { border-color: rgba(61, 107, 53, .45); color: #3D6B35; }
.chip-medium { border-color: rgba(154, 106, 18, .45); color: #9A6A12; }
.chip-low { border-color: rgba(176, 81, 47, .5); color: var(--acc); }
.chip-cap { border-color: var(--acc); color: var(--acc); background: var(--acc-tint); }
.conf-note { font-size: 14.5px; color: var(--mut); max-width: 44em; }
.cap-note {
  background: var(--acc-tint); border-left: 3px solid var(--acc); border-radius: 0 8px 8px 0;
  padding: 12px 16px; font-size: 14.5px; margin: 14px 0; max-width: 44em;
}
.summary { font-size: 16.5px; max-width: 42em; margin-top: 14px; }

.dim { margin: 0 0 26px; }
.dim-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.dim-head span { font-weight: 500; font-size: 15.5px; }
.dim-head b { font-size: 13px; color: var(--ink); }
.bar { height: 6px; background: var(--line-2); border: 1px solid var(--line-2); border-radius: 3px; margin: 8px 0 9px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--acc); border-radius: 3px; }
.evidence { font-size: 14.5px; margin: 3px 0; max-width: 46em; }
.note { font-size: 14.5px; color: var(--mut); font-family: var(--serif); font-style: italic; max-width: 46em; }

.clean-list { list-style: none; max-width: 44em; }
.clean-list li { padding: 10px 0 10px 26px; position: relative; border-bottom: 1px solid var(--line-2); }
.clean-list li::before { content: '·'; position: absolute; left: 6px; color: var(--acc); font-weight: 700; }
.clean-list li:last-child { border-bottom: none; }

.gap { padding: 22px 24px; margin: 0 0 16px; position: relative; }
.gap-num { font-size: 11px; letter-spacing: 0.12em; color: var(--acc); margin-bottom: 6px; }
.gap h3 { margin-bottom: 10px; }
.gap p { font-size: 14.5px; color: var(--mut); margin-bottom: 8px; max-width: 48em; }
.gap p b { color: var(--ink); }
.do-this { border-left: 3px solid var(--acc); padding-left: 14px; }

.endnote { padding: 26px 28px; margin-top: 48px; text-align: left; }
.endnote p { font-family: var(--serif); font-size: 18px; }

/* ── dashboard / rubric ── */
.spark { display: flex; align-items: flex-end; gap: 3px; height: 96px; margin: 6px 0 20px; }
.spark span { flex: 1; min-height: 2px; background: var(--acc); border-radius: 2px 2px 0 0; opacity: .85; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; margin-bottom: 10px; }
th, td { text-align: left; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--line-2); vertical-align: top; }
th { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); font-weight: 500; }
td.mono { font-size: 12.5px; color: var(--acc); white-space: nowrap; padding-right: 18px; }
.anchors { margin-bottom: 4px; }
.anchors td:first-child { width: 2.6rem; }

/* ── footer ── */
.foot { border-top: 1px solid var(--line); padding: 30px 0 44px; margin-top: 20px; }
.foot p { font-size: 14px; color: var(--mut); max-width: 44em; }
.foot .mono-line { margin-top: 10px; }
.foot .mono-line a { color: var(--faint); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }

@media (max-width: 640px) {
  .page { padding: 40px 4px 70px; }
  .nav-links { gap: 14px; }
  .nav-cta { display: none; }
  .lede { font-size: 19px; }
  .sec-head { gap: 10px; }
  .terms-grid { grid-template-columns: 1fr; }
}
