/* The résumé page: a designed, readable sheet on screen, and a clean A4 page from the browser's Print.
   Content order is the reading order (name, contact, profile, education, experience, projects, skills),
   so it stays plain and ATS-friendly; nothing depends on background colours to be legible. */

.resume-main { max-width: calc(900px + 2 * var(--gutter)); }
.resume-tools { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 24px; margin-bottom: 22px; }
.tool-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.textlink { color: var(--muted); font-size: 13.5px; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 4px; }
.textlink:hover { color: var(--fg); }

.sheet {
  --cv-ink: #1d241f; --cv-soft: #5d665e; --cv-teal: #3e5a47; --cv-sand: #93a96f; --cv-hair: #dce1d8;
  position: relative; padding: clamp(30px, 5vw, 62px) clamp(24px, 5.5vw, 66px); border-radius: 18px;
  background: #f9faf6; color: var(--cv-ink); box-shadow: 0 30px 80px rgb(0 0 0 / 0.4);
  font: 400 15px/1.6 var(--sans); animation: rise 0.35s var(--ease);
}
.sheet a { color: inherit; text-decoration-color: rgb(62 90 71 / 0.4); }

/* Header: the name large, a short sand rule, contact on the right. */
.cv-head { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 16px 32px; padding: 0 0 26px; margin-bottom: 8px; border-bottom: 1px solid var(--cv-hair); position: relative; }
.cv-head::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 72px; height: 3px; border-radius: 2px; background: var(--cv-sand); }
.cv-head h1 { margin: 0; font-size: clamp(38px, 5.5vw, 50px); line-height: 1; font-weight: 500; letter-spacing: -0.045em; color: #151c17; }
.cv-role { margin-top: 13px; color: var(--cv-teal); font-size: 14px; letter-spacing: 0.01em; }
.narrow-break { display: none; }
.cv-contact { display: grid; justify-items: end; gap: 2px; font-style: normal; font: 400 12.5px/1.55 var(--mono); color: var(--cv-soft); text-align: right; }
.cv-contact small { font-family: var(--sans); font-size: 11.5px; color: var(--cv-soft); }

/* Sections: a quiet label rail, then the content. */
.cv-sec { display: grid; grid-template-columns: 142px 1fr; gap: 0 32px; padding: 22px 0; }
.cv-sec + .cv-sec { border-top: 1px solid var(--cv-hair); }
.cv-sec h2 { margin: 3px 0 8px; font: 500 10.5px/1.4 var(--mono); letter-spacing: 0.13em; text-transform: uppercase; color: var(--cv-teal); }
.cv-sec h2::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 9px; border-radius: 50%; background: var(--cv-sand); vertical-align: 1px; }
.cv-body > p + p { margin-top: 8px; }
.cv-item { display: grid; grid-template-columns: 1fr auto; gap: 0 18px; }
.cv-item + .cv-item { margin-top: 18px; }
.cv-item h3 { margin: 0; font-size: 15px; font-weight: 400; letter-spacing: -0.005em; line-height: 1.45; }
.cv-item h3 strong { font-weight: 600; color: #15181c; }
.cv-item h3 span { color: var(--cv-soft); }
.cv-item h3 span::before { content: "· "; color: var(--cv-sand); }
.cv-when { grid-column: 2; grid-row: 1; font: 400 12px/1.9 var(--mono); color: var(--cv-soft); white-space: nowrap; }
.cv-item ul { grid-column: 1 / -1; margin: 4px 0 0; padding-left: 16px; }
.cv-item li { margin-top: 3px; }
.cv-item li::marker { color: var(--cv-teal); }
.cv-skills { margin: 0; display: grid; gap: 6px; }
.cv-skills div { display: grid; grid-template-columns: 170px 1fr; gap: 12px; }
.cv-skills dt { font-weight: 600; color: #15181c; }
.cv-skills dd { margin: 0; color: var(--cv-ink); }

@media (max-width: 720px) {
  .cv-head { grid-template-columns: 1fr; }
  .cv-contact { justify-items: start; text-align: left; }
  .cv-sec { grid-template-columns: 1fr; }
  .cv-item { grid-template-columns: 1fr; }
  .cv-when { grid-column: 1; grid-row: auto; line-height: 1.5; }
  .cv-skills div { grid-template-columns: 1fr; gap: 0; }
  .narrow-break { display: inline; }
  .cv-role span[aria-hidden] { display: none; }
}

/* ---------- Print: just the sheet, on A4, ink on white ---------- */
@page { size: A4; margin: 12mm 14mm 12mm; }
@media print {
  html, body { background: #fff !important; }
  body { color: #000; }
  #backdrop, .skip-link, .topnav, .footer, .no-print { display: none !important; }
  .page { min-height: 0; display: block; }
  .page main { max-width: none; margin: 0; padding: 0; }
  .sheet { padding: 0; border-radius: 0; background: none; box-shadow: none; animation: none; font-size: 10.5pt; line-height: 1.38; color: #1f2328; }
  .cv-head { padding-bottom: 10pt; margin-bottom: 2pt; }
  .cv-head::after { background: #748c57; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cv-head h1 { font-size: 24pt; }
  .cv-role { font-size: 10pt; margin-top: 5pt; }
  .cv-contact { font-size: 8.6pt; }
  .cv-sec { grid-template-columns: 30mm 1fr; gap: 0 6mm; padding: 6pt 0; }
  .cv-sec h2 { font-size: 7.6pt; margin-top: 1pt; }
  .cv-sec h2::before { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cv-item + .cv-item { margin-top: 6pt; }
  .cv-item { break-inside: avoid; }
  .cv-item h3 { font-size: 10.5pt; }
  .cv-when { font-size: 8.2pt; line-height: 1.7; }
  .cv-item li { margin-top: 1pt; }
  .cv-skills { gap: 2pt; }
  .cv-skills div { grid-template-columns: 36mm 1fr; }
  .sheet a { text-decoration: none; }
}
