:root {
  color-scheme: light;
  --background: #f7f6f2;
  --surface: #ffffff;
  --text: #20211f;
  --muted: #60645f;
  --line: #d9d8d2;
  --accent: #b54127;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
}

body {
  margin: 0;
  color: var(--text);
  background: var(--background);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
}

.page-actions {
  display: flex;
  width: min(100% - 40px, 920px);
  margin: 32px auto -32px;
  justify-content: flex-end;
}

.download-link {
  display: inline-flex;
  min-height: 44px;
  padding: 0.65rem 1rem;
  align-items: center;
  border: 1px solid var(--accent);
  border-radius: 0.35rem;
  color: #fff;
  background: var(--accent);
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.download-link:hover {
  filter: brightness(0.92);
  text-decoration: none;
}

.download-link:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: 3px;
}

.resume {
  width: min(100% - 40px, 920px);
  margin: 56px auto;
  padding: clamp(32px, 7vw, 80px);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 16px 60px rgb(32 33 31 / 7%);
}

h1,
h2,
h3,
h4 {
  line-height: 1.18;
  letter-spacing: -0.025em;
}

h1 {
  margin: 0;
  font-size: clamp(2.7rem, 8vw, 4.8rem);
  letter-spacing: -0.06em;
}

h1 + p {
  margin: 0.7rem 0 0;
  font-size: clamp(1.12rem, 3vw, 1.45rem);
}

h1 + p + p {
  margin: 0.8rem 0 0;
  color: var(--muted);
}

h2 {
  margin: 4.5rem 0 1.4rem;
  padding-top: 1.1rem;
  border-top: 2px solid var(--text);
  font-size: clamp(1.65rem, 4vw, 2.2rem);
}

h3 {
  margin: 2.8rem 0 0.4rem;
  font-size: clamp(1.22rem, 3vw, 1.48rem);
}

h4 {
  margin: 2rem 0 0.35rem;
  color: var(--accent);
  font-size: 1.06rem;
}

p {
  margin: 0.7rem 0;
}

strong {
  font-weight: 720;
}

ul {
  margin: 0.8rem 0 1.4rem;
  padding-left: 1.25rem;
}

li {
  margin: 0.4rem 0;
  padding-left: 0.25rem;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

@media (max-width: 600px) {
  .page-actions {
    width: 100%;
    margin: 0;
    padding: 16px 22px;
    background: var(--surface);
  }

  .resume {
    width: 100%;
    margin: 0;
    padding: 32px 22px 56px;
    border: 0;
    box-shadow: none;
  }

  h2 {
    margin-top: 3.5rem;
  }

  h3 {
    margin-top: 2.4rem;
  }
}

@media print {
  :root {
    --background: #fff;
  }

  @page {
    size: A4;
    margin: 9mm 11mm;
  }

  body {
    font-size: 9.2pt;
    line-height: 1.28;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .page-actions {
    display: none;
  }

  .resume {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  h1 {
    font-size: 28pt;
    line-height: 1;
  }

  h1 + p {
    margin-top: 4pt;
    font-size: 11.5pt;
    line-height: 1.15;
  }

  h1 + p + p {
    margin-top: 4pt;
  }

  h2 {
    margin: 11pt 0 5pt;
    padding-top: 5pt;
    border-top-width: 1.2pt;
    font-size: 13pt;
    break-after: avoid;
  }

  h3 {
    margin: 8pt 0 2.5pt;
    font-size: 11pt;
    break-after: avoid;
  }

  h4 {
    margin: 7pt 0 2pt;
    font-size: 10.2pt;
    break-after: avoid;
  }

  /* Balance the complete Markdown résumé across two intentional pages. */
  h4:nth-of-type(3) {
    break-before: page;
  }

  p {
    margin: 2.5pt 0;
  }

  ul {
    margin: 3pt 0 5pt;
    padding-left: 14pt;
  }

  li {
    margin: 1.5pt 0;
    padding-left: 2pt;
  }

  li,
  p {
    orphans: 2;
    widows: 2;
  }

  a {
    color: inherit;
    text-decoration: none;
  }
}
