/* ---------- Tokens ---------- */
:root {
  --bg: #fcfcfa;
  --ink: #1a1a18;
  --ink-soft: #55554f;
  --accent: #1d4ed8;
  --rule: #e4e4de;
  --tag-bg: #efeeea;
  --max: 44rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141412;
    --ink: #e8e8e2;
    --ink-soft: #a3a399;
    --accent: #7ba3f7;
    --rule: #2c2c28;
    --tag-bg: #222220;
  }
}

/* ---------- Base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Masthead ---------- */
.masthead {
  border-bottom: 1px solid var(--rule);
  padding: 4.5rem 1.5rem 2.5rem;
}
.masthead-inner { max-width: var(--max); margin: 0 auto; }

h1 {
  font-size: 2.1rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.tagline {
  margin-top: 0.5rem;
  font-size: 1.125rem;
  color: var(--ink-soft);
  max-width: 34rem;
}

.contact { margin-top: 1.25rem; font-size: 0.9375rem; }
.contact .sep { color: var(--ink-soft); margin: 0 0.5rem; }
.contact .location { color: var(--ink-soft); }

/* ---------- Sections ---------- */
main { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }

section { padding: 2.25rem 0; border-bottom: 1px solid var(--rule); }
section:last-of-type { border-bottom: none; }

h2 {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-soft);
  margin-bottom: 1.25rem;
}

/* ---------- Roles ---------- */
.role + .role { margin-top: 1.75rem; }

.role-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

h3 { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; }

.dates {
  font-size: 0.875rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.role-context {
  font-size: 0.9375rem;
  color: var(--ink-soft);
  margin-top: 0.2rem;
}

.role ul { margin: 0.6rem 0 0 1.1rem; }
.role li { margin-top: 0.35rem; padding-left: 0.15rem; }

.earlier {
  margin-top: 1.75rem;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

/* ---------- Tags ---------- */
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tags li {
  background: var(--tag-bg);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.875rem;
}

/* ---------- Footer ---------- */
footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3.5rem;
  font-size: 0.875rem;
}

/* ---------- Placeholders (delete class as you fill in) ---------- */
.placeholder { outline: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 3px; border-radius: 2px; }

/* ---------- Print: the page IS the PDF CV ---------- */
@media print {
  :root {
    --bg: #fff;
    --ink: #111;
    --ink-soft: #444;
    --accent: #111;
    --rule: #ccc;
    --tag-bg: #f1f1f1;
  }

  @page { size: A4; margin: 16mm 18mm; }

  body { font-size: 10pt; line-height: 1.45; }

  .masthead { padding: 0 0 1rem; }
  main, .masthead-inner, footer { max-width: none; padding-left: 0; padding-right: 0; }

  h1 { font-size: 20pt; }
  .tagline { font-size: 11pt; }
  section { padding: 0.9rem 0; }
  .role + .role { margin-top: 0.8rem; }
  .role { break-inside: avoid; }

  .contact a { color: var(--ink); }
  .contact a[href^="mailto"]::after { content: ""; }

  footer, .print-link { display: none; }
  .placeholder { outline: none; }
}
