/* ==========================================================================
   Resume Checker — design tokens
   Concept: a resume as a physical sheet of paper, graded by hand — red-pen
   circles on the weak spots, a highlighter streak over the keywords that
   land, a paperclip in the corner. Everything else stays quiet so those
   marks read as intentional, not decorative.
   ========================================================================== */
:root {
  --paper:      #F2ECDD;
  --paper-dark: #E7DEC7;
  --ink:        #21231F;
  --ink-soft:   #4B4B42;
  --folder:     #C9B98C;
  --redpen:     #A8321F;
  --redpen-dim: #C4573F;
  --highlight:  #F2C744;
  --good:       #3E6B4F;
  --line:       #D8CDAC;
  --shadow:     0 10px 30px rgba(33, 35, 31, 0.14);

  --font-display: 'Space Mono', 'Courier New', monospace;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Space Mono', 'Courier New', monospace;

  --radius: 3px;
  --container: 1080px;
}

/* ---------------- Accessibility ---------------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 6px 0;
  z-index: 300;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.skip-link:focus {
  left: 0;
  top: 0;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(ellipse at top left, rgba(255,255,255,0.35), transparent 55%),
    var(--paper);
  background-attachment: fixed;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Subtle paper-fiber texture without an image asset */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    repeating-linear-gradient(0deg, rgba(33,35,31,0.015) 0px, transparent 1px, transparent 2px, rgba(33,35,31,0.015) 3px);
  z-index: 0;
}

a { color: var(--redpen); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ---------------- Header ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(242, 236, 221, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
}
.brand .clip {
  width: 20px; height: 26px;
  display: inline-block;
}
.header-actions { display: flex; align-items: center; gap: 14px; }
.stat-pill {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
  border: 1px dashed var(--line);
  padding: 5px 10px;
  border-radius: 999px;
}

/* ---------------- Hero ---------------- */
.hero {
  padding: 72px 0 48px;
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
.eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--redpen);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "";
  width: 8px; height: 8px;
  background: var(--redpen);
  border-radius: 50%;
  display: inline-block;
}
h1.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.4vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
}
h1.hero-title .mark {
  background: linear-gradient(120deg, transparent 0%, transparent 4%, var(--highlight) 4%, var(--highlight) 96%, transparent 96%);
  padding: 0 2px;
}
.hero-sub {
  font-size: 1.08rem;
  color: var(--ink-soft);
  max-width: 46ch;
  margin-bottom: 30px;
}
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}
.badge {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255,255,255,0.4);
}

/* Signature element: a "graded paper" mock resume with hand-marked annotations */
.paper-mock {
  background: #FBF8EF;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
  padding: 34px 30px;
  position: relative;
  transform: rotate(1.1deg);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #3a3a33;
}
.paper-mock::before {
  content: "";
  position: absolute;
  top: -10px; left: 34px;
  width: 34px; height: 20px;
  background: linear-gradient(135deg, #cfd6da, #9aa4ab);
  clip-path: polygon(20% 0%, 80% 0%, 100% 30%, 100% 100%, 0 100%, 0 30%);
  transform: rotate(-8deg);
  box-shadow: 0 3px 6px rgba(0,0,0,0.2);
}
.paper-mock .pm-line { height: 8px; background: #e4dfcf; border-radius: 2px; margin-bottom: 10px; }
.paper-mock .pm-line.w60 { width: 60%; }
.paper-mock .pm-line.w80 { width: 80%; }
.paper-mock .pm-line.w40 { width: 40%; }
.paper-mock .pm-name { height: 14px; width: 45%; background: var(--ink); opacity: 0.85; border-radius: 2px; margin-bottom: 16px; }
.pm-highlight { background: var(--highlight); border-radius: 2px; }
.pm-section { margin: 18px 0 10px; padding-top: 12px; border-top: 1px dashed var(--line); }
.pm-circle {
  position: absolute;
  border: 2.5px solid var(--redpen);
  border-radius: 50%;
  transform: rotate(-4deg);
}
.pm-note {
  position: absolute;
  font-family: var(--font-display);
  color: var(--redpen);
  font-size: 0.78rem;
  transform: rotate(-3deg);
}
.pm-score {
  position: absolute;
  bottom: -18px; right: -14px;
  background: var(--redpen);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  width: 68px; height: 68px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
  transform: rotate(6deg);
  border: 3px solid #fff;
}

/* ---------------- Upload card ---------------- */
.checker-section { padding: 20px 0 80px; }
.checker-card {
  background: var(--paper-dark);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 36px;
  box-shadow: var(--shadow);
}
.checker-card h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-top: 0;
}
.tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.tabs-row .tabs { border-bottom: none; margin-bottom: 0; }
.link-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--redpen);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 6px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn:hover { color: var(--redpen-dim); }
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.tab-btn {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: none;
  border: none;
  padding: 10px 4px;
  margin-right: 18px;
  cursor: pointer;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
}
.tab-btn.active { color: var(--ink); border-bottom-color: var(--redpen); font-weight: 700; }

.dropzone {
  border: 2px dashed var(--folder);
  border-radius: 6px;
  padding: 46px 20px;
  text-align: center;
  cursor: pointer;
  background: rgba(255,255,255,0.35);
  transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--redpen);
  background: rgba(255,255,255,0.6);
}
.dropzone .dz-icon { font-size: 2.1rem; margin-bottom: 10px; }
.dropzone .dz-title { font-weight: 600; margin-bottom: 4px; }
.dropzone .dz-sub { font-size: 0.85rem; color: var(--ink-soft); }
#file-input { display: none; }
.file-chip {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 16px;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.file-chip button {
  background: none; border: none; cursor: pointer; color: var(--redpen); font-size: 0.85rem;
}

textarea, .jd-textarea {
  width: 100%;
  min-height: 140px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  resize: vertical;
  color: var(--ink);
}
.jd-block { margin-top: 20px; }
.jd-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.jd-block label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.jd-optional { font-weight: normal; text-transform: none; letter-spacing: normal; opacity: 0.7; }
.jd-list { display: flex; flex-direction: column; gap: 14px; }
.jd-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.jd-hint { font-size: 0.78rem; color: var(--ink-soft); margin-top: 8px; }

.btn {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 6px;
  padding: 14px 26px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-primary {
  background: var(--redpen);
  color: #fff;
  box-shadow: 0 4px 0 var(--ink);
}
.btn-primary:hover { background: var(--redpen-dim); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
.actions-row { margin-top: 24px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.privacy-note { font-size: 0.78rem; color: var(--ink-soft); }

/* ---------------- Results ---------------- */
.results { display: none; margin-top: 44px; }
.results.visible { display: block; }
.score-hero {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 34px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 30px;
  box-shadow: var(--shadow);
}
.score-ring-wrap { display: flex; justify-content: center; }
.score-num {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 700;
}
.score-grade {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 4px 12px;
  border-radius: 999px;
  display: inline-block;
  margin-top: 10px;
}
.grade-Excellent { background: #E1EEE3; color: var(--good); }
.grade-Good { background: #FCEFCB; color: #8a6a12; }
.grade-Fair { background: #FBE3D3; color: #a15521; }
.grade-Needs.Work, .grade-Needs-Work { background: #F6D9D3; color: var(--redpen); }
.score-meta { font-family: var(--font-mono); font-size: 0.82rem; color: var(--ink-soft); margin-top: 10px; }

.breakdown {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}
.bd-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px 20px;
}
.bd-card h4 {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  justify-content: space-between;
}
.bar-track { height: 8px; background: var(--paper-dark); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--redpen); border-radius: 999px; transition: width .8s ease; }
.bd-card ul { margin: 12px 0 0; padding-left: 18px; font-size: 0.86rem; color: var(--ink-soft); }
.bd-card ul li { margin-bottom: 5px; }
.check-yes::before { content: "✓ "; color: var(--good); font-weight: 700; }
.check-no::before { content: "✕ "; color: var(--redpen); font-weight: 700; }

.keyword-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { font-family: var(--font-mono); font-size: 0.76rem; padding: 4px 10px; border-radius: 999px; }
.chip-match { background: #E1EEE3; color: var(--good); }
.chip-missing { background: #F6D9D3; color: var(--redpen); }

.results-actions { margin-top: 24px; display: flex; gap: 12px; flex-wrap: wrap; }

.bd-card-enter { opacity: 0; transform: translateY(10px); transition: opacity .4s ease, transform .4s ease; }
.bd-card-in { opacity: 1; transform: translateY(0); }

.tips-panel {
  margin-top: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--redpen);
  border-radius: 6px;
  padding: 20px 22px;
}
.tips-panel h4 {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tips-panel ul { margin: 0; padding-left: 0; list-style: none; }
.tips-panel li { padding: 8px 0; border-top: 1px dashed var(--line); font-size: 0.9rem; color: var(--ink-soft); }
.tips-panel li:first-child { border-top: none; padding-top: 0; }
.tip-area {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--paper-dark);
  color: var(--ink);
  padding: 2px 8px;
  border-radius: 999px;
  margin-right: 10px;
}

.compare-panel { margin-top: 20px; }
.compare-panel h4 {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}
.compare-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.compare-card { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 16px 18px; }
.compare-card.compare-best { border-color: var(--good); box-shadow: 0 0 0 1px var(--good); }
.compare-card h5 { margin: 0 0 10px; font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-soft); }
.compare-percent { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; margin-top: 8px; }
.compare-detail { font-size: 0.78rem; color: var(--ink-soft); margin-top: 4px; }

.print-letterhead { display: none; }

/* ---------------- Features ---------------- */
.features { padding: 70px 0; border-top: 1px solid var(--line); }
.section-head { max-width: 60ch; margin-bottom: 40px; }
.section-head h2 { font-family: var(--font-display); font-size: 1.9rem; margin-bottom: 10px; }
.section-head p { color: var(--ink-soft); }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
}
.feature-card {
  background: rgba(255,255,255,0.5);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 22px;
}
.feature-card .f-num {
  font-family: var(--font-mono);
  color: var(--redpen);
  font-size: 0.8rem;
  margin-bottom: 10px;
}
.feature-card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.feature-card p { margin: 0; color: var(--ink-soft); font-size: 0.9rem; }

/* ---------------- Tools ---------------- */
.tools-section { padding: 0 0 80px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; }
.tool-card {
  background: rgba(255,255,255,0.5);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 24px;
}
.tool-card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.tool-card p { margin: 0 0 16px; color: var(--ink-soft); font-size: 0.9rem; }
.tool-output { margin-top: 16px; }
.tool-output textarea {
  min-height: 200px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  background: #fff;
}

/* ---------------- History ---------------- */
.history-section { padding: 0 0 70px; }
.history-list { display: flex; flex-direction: column; gap: 10px; }
.history-item {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 12px 18px;
  font-family: var(--font-mono); font-size: 0.82rem;
}
.history-empty { color: var(--ink-soft); font-family: var(--font-mono); font-size: 0.85rem; }

/* ---------------- Footer ---------------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 30px 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------------- Utility ---------------- */
.hidden { display: none !important; }
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 6px;
  font-size: 0.85rem; z-index: 200; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.toast.show { opacity: 1; }

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .paper-mock { transform: none; max-width: 380px; margin: 0 auto; }
  .score-hero { grid-template-columns: 1fr; text-align: center; }
  .score-ring-wrap { justify-content: center; }
}
@media (max-width: 560px) {
  .checker-card { padding: 22px; }
  .hero { padding-top: 50px; }
}

/* ---------------- Print (downloadable report) ---------------- */
@media print {
  .site-header, .checker-section .checker-card, .features, .history-section, .tools-section, .site-footer, .results-actions, .hero { display: none !important; }
  .results { display: block !important; margin-top: 0; }
  body { background: #fff; }
  body::before { display: none; }
  .print-letterhead {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 2px solid var(--redpen);
    padding-bottom: 12px;
    margin-bottom: 20px;
    font-family: var(--font-display);
  }
  .print-letterhead .brand { font-weight: 700; font-size: 1.1rem; }
  .print-letterhead span:last-child { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-soft); }
  .score-hero, .bd-card, .tips-panel, .compare-card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .breakdown { break-inside: avoid; }
}
