/* ---------- Tokens (same palette as the site) ---------- */
:root {
  --cream: #F5EFE1;
  --paper: #FBF8F1;
  --ink: #1C1A17;
  --muted: #8A8377;
  --line: #D8D0C0;
  --cobalt: #3446C9;
  --butter: #F2E59A;
  --sans: "Inter Tight", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--cream); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ol { list-style: none; }

/* ---------- Toolbar ---------- */
.cv-bar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 14px clamp(16px, 3vw, 36px); background: var(--cream); font: 12px var(--mono); }
.cv-bar .back:hover { color: var(--cobalt); }
.cv-bar .actions { display: flex; gap: 10px; }
.btn { padding: 7px 14px; border: 1.5px solid var(--ink); border-radius: 99px; white-space: nowrap; }
.btn:hover { background: var(--butter); }
.btn.primary { background: var(--ink); color: var(--cream); }
.btn.primary:hover { background: var(--cobalt); border-color: var(--cobalt); }
.embed .cv-bar .back { visibility: hidden; }

/* ---------- The sheet: one A4 page ---------- */
.sheet { width: 210mm; min-height: 297mm; margin: 10px auto 48px; padding: 18mm 18mm 16mm; background: var(--paper);
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.35); font-size: 10.5pt; line-height: 1.45; }
.sheet > * { animation: rise .6s cubic-bezier(.2,.7,.2,1) both; }
.sheet > *:nth-child(2) { animation-delay: .08s; } .sheet > *:nth-child(3) { animation-delay: .16s; }
.sheet > *:nth-child(4) { animation-delay: .24s; } .sheet > *:nth-child(5) { animation-delay: .32s; } .sheet > *:nth-child(6) { animation-delay: .4s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.cv-head h1 { font-size: 30pt; font-weight: 500; line-height: 1; letter-spacing: -0.035em; }
.cv-head .star { color: var(--cobalt); }
.cv-head .role { margin-top: 6px; font: 10pt var(--mono); }
.cv-head .contact { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 12px; font: 9pt var(--mono); color: var(--muted); }
.cv-head .contact a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }

.cv-section { margin-top: 9mm; }
.cv-section h2 { padding-bottom: 5px; margin-bottom: 10px; border-bottom: 1px solid var(--ink); font: 500 9pt var(--mono); color: var(--muted); }
.summary { max-width: 62ch; font-size: 11pt; }

.jobs li { display: grid; grid-template-columns: 30mm 1fr; gap: 12px; padding: 6px 0; break-inside: avoid; }
.jobs li + li { border-top: 1px dashed var(--line); }
.years { font: 9pt var(--mono); color: var(--muted); padding-top: 1px; }
.job b { font-weight: 600; }
.job .where { color: var(--muted); }
.job .co { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.job .co:hover { color: var(--cobalt); }
.hl { margin-top: 3px; color: #4A453E; }

.facts { display: grid; grid-template-columns: 30mm 1fr; gap: 6px 12px; }
.facts dt { font: 9pt var(--mono); color: var(--muted); padding-top: 1px; }

/* ---------- Phones: the sheet becomes the page ---------- */
@media (max-width: 820px) {
  html:not(.pdf) .sheet { width: auto; min-height: 0; margin: 0 0 40px; padding: 28px 18px; box-shadow: none; }
  .cv-bar { flex-wrap: wrap; }
  html:not(.pdf) .jobs li, html:not(.pdf) .facts { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- Print / PDF: just the sheet, white paper ---------- */
@page { size: A4; margin: 0; }
@media print {
  body { background: #fff; }
  .cv-bar { display: none; }
  .sheet { margin: 0; box-shadow: none; background: #fff; }
  .sheet > * { animation: none; }
}
@media (prefers-reduced-motion: reduce) { .sheet > * { animation: none; } }

/* Making the PDF (cv.html?pdf): the bare A4 sheet on white */
.pdf body { background: #fff; }
.pdf .cv-bar { display: none; }
.pdf .sheet { width: 210mm; min-height: 297mm; margin: 0; box-shadow: none; background: #fff; }
.pdf .sheet > *, .printed .sheet > * { animation: none; }
