/* Colour tokens: the site is always light. */
:root {
  --bg: #ffffff;
  --surface: #f3f4f6;
  --text: #1f2328;
  --muted: #4b5563;
  --accent: #1d4ed8;
  --border: #d1d5db;
}

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

body {
  margin: 0 auto;
  max-width: 50rem;
  padding: 1.5rem 1rem 3rem;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  line-height: 1.25;
}

h1 {
  margin: 0;
  font-size: clamp(1.75rem, 6vw, 2.5rem);
}

h2 {
  margin: 2.25rem 0 1rem;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid var(--border);
  font-size: 1.375rem;
}

h3 {
  margin: 0;
  font-size: 1.0625rem;
}

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

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -999px;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.toolbar a {
  padding: 0.375rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  text-decoration: none;
}

.role {
  margin: 0.25rem 0 0;
  font-size: 1.25rem;
}

.contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.9375rem;
}

.skills {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 1.25rem;
  margin: 0;
}

.skills dt {
  font-weight: 600;
}

.skills dd {
  margin: 0;
}

.job {
  margin-bottom: 1.5rem;
}

.period {
  margin: 0.125rem 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

.job ul,
.education {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.education li + li {
  margin-top: 0.5rem;
}

@media (max-width: 30rem) {
  .skills {
    grid-template-columns: 1fr;
  }

  .skills dd {
    margin-bottom: 0.5rem;
  }
}

/* Print and PDF: always light, compact, no site controls. */
@page {
  size: A4;
  margin: 14mm 14mm 12mm;
}

@media print {
  :root {
    --bg: #ffffff;
    --text: #000000;
    --muted: #333333;
    --accent: #000000;
    --border: #999999;
  }

  body {
    max-width: none;
    padding: 0;
    font-size: 10pt;
    line-height: 1.4;
  }

  .toolbar,
  .skip-link {
    display: none;
  }

  a {
    text-decoration: none;
  }

  h1 {
    font-size: 18pt;
  }

  h2 {
    margin: 1rem 0 0.5rem;
    font-size: 12pt;
    break-after: avoid;
  }

  .role {
    font-size: 11pt;
  }

  .contacts,
  .period {
    font-size: 9pt;
  }

  .job {
    margin-bottom: 0.75rem;
    break-inside: avoid;
  }
}
