:root {
  --fg: #16181c;
  --muted: #5c636e;
  --line: #e3e5e8;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

@page { size: A4; margin: 12mm 0; }

*, *::before, *::after { box-sizing: border-box; }

html { background: #e9eaec; }

body {
  margin: 0;
  color: var(--fg);
  font: 10pt/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

.toolbar {
  display: flex;
  justify-content: space-between;
  max-width: 210mm;
  margin: 0 auto;
  padding: 20px 4px;
  font: 13px var(--mono);
  color: var(--muted);
}

.sheet {
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto 48px;
  padding: 16mm 16mm 14mm;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 8px 32px rgb(0 0 0 / .08);
}

.head { display: flex; justify-content: space-between; gap: 24px; }
.head img { width: 84px; height: 101px; border-radius: 6px; object-fit: cover; }

h1 { margin: 0; font-size: 24pt; font-weight: 650; line-height: 1.1; }
.title { margin: 6px 0 10px; font-size: 11.5pt; }

.contact { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 0; font: 8.5pt/1.6 var(--mono); color: var(--muted); }
.contact > * { white-space: nowrap; }

.summary { margin: 14px 0 0; }

section { margin-top: 14px; }

h2 {
  margin: 0 0 8px;
  padding-bottom: 4px;
  break-after: avoid;
  border-bottom: 1px solid var(--line);
  font: 500 8.5pt var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.job { margin-bottom: 8px; break-inside: avoid; }
.role { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.date { font: 8.5pt var(--mono); color: var(--muted); white-space: nowrap; }
.context { color: var(--muted); }
.job > p { margin: 0 0 3px; }

h3 { margin: 0 0 3px; font-size: 10pt; font-weight: 600; }
h3 span { font-weight: 400; color: var(--muted); }
h3 span::before { content: "·"; margin: 0 6px; }

ul { margin: 0; padding-left: 14px; }
li { margin: 1px 0; }
li::marker { color: var(--muted); }

.skills { display: grid; grid-template-columns: 24mm 1fr; gap: 3px 12px; margin: 0; }
.skills dt { color: var(--muted); }
.skills dd { margin: 0; }

section > p { margin: 0; }

@media screen {
  .sheet a { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 2px; }
  .sheet a:hover { text-decoration-color: currentColor; }
}

@media screen and (max-width: 820px) {
  .sheet { width: auto; min-height: 0; margin: 0 0 24px; padding: 24px 20px; box-shadow: none; }
  .toolbar { padding: 16px 20px; }
  .role { flex-direction: column; gap: 0; }
  .skills { grid-template-columns: 1fr; gap: 2px; }
  .head img { width: 64px; height: 77px; }
}

@media print {
  html { background: none; }
  body { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
  .toolbar { display: none; }
  .sheet { width: auto; min-height: 0; margin: 0; padding: 0 16mm; box-shadow: none; }
}
