@media print {
  /* Page setup */
  @page {
    size: A4 portrait;
    margin: 0.75in;
  }

  /* Root styles (print overrides) */
  html {
    font-size: 9pt;
    scrollbar-gutter: auto;
  }

  html[data-theme="dark"] {
    --hue: 60;
    --accent-hue: 20;
    --invert-percent: 0;

    --background: hsl(var(--hue), 17%, 98%);
    --active-color-normal: hsl(var(--hue), 2.94%, 93.67%);
    --border-color-normal: hsl(var(--accent-hue), 6.88%, 37.06%);

    --text-color-normal: hsl(var(--hue), 0%, 0%);
    --secondary-color-normal: hsl(var(--hue), 0%, 10%);
    --accent-color-normal: hsl(21, 78.65%, 34.9%);
  }

  /* Base element styles */
  body {
    max-width: 880px;
    margin-block: 6pt 24pt;
    background-color: #ffffff;
  }

  p,
  h2,
  h3,
  blockquote,
  pre,
  span,
  section > section {
    break-inside: avoid;
  }

  ul {
    padding-inline-start: 1.25rem !important;
  }

  ul li {
    padding-inline-start: 0.25rem !important;
  }

  a {
    text-decoration: none;
  }

  /* Hide UI-only elements */
  .header,
  .printButton,
  .footer {
    display: none;
  }

  /* Links */
  a.expandLink[href]:before {
    content: "(" attr(href) ") ";
    font-size: 5pt;
  }

  a.noteLink span,
  a.expandLink span {
    display: none;
  }

  a.noteLink[href]::after {
    content: "(" attr(href) ") ";
  }

  .addressLinks a {
    font-size: 6pt;
  }

  /* --- CV Layout --- */

  /* CV header */
  body .cv-header {
    padding: 6pt;
    gap: 12pt;
  }

  #profilePic {
    object-fit: cover;
    height: 48pt;
    width: 48pt;
    box-shadow: 3pt 3pt var(--accent-color-normal);
  }

  body .cv-header h1 {
    font-size: 18pt;
  }

  body .cv-header h1 span {
    font-size: 12pt;
  }

  body .cv-header address {
    line-height: 1.6;
  }

  body .cv-header address a::after {
    margin-inline-start: 0.5rem;
    right: 0.5pt;
    bottom: -2pt;
    width: 9pt;
    height: 9pt;
    font-size: 9pt;
    background-size: 1rem 1rem;
  }

  /* CV content */
  body .cv-content {
    display: grid;
    grid-template-columns: max-content 1fr;
    row-gap: 9pt;
  }

  body .cv-content > section {
    display: block;
    border-block-start: 2px solid var(--accent-color-normal);
    column-gap: 12pt;
    row-gap: 12pt;
    padding-block-start: 9pt;
    padding-inline: 6pt;
    margin-inline: 3pt;
    line-height: 1.4;
  }

  body .cv-content > section > h2 {
    margin-block-start: 0.2rem;
    margin-bottom: 6pt;
    font-size: 10pt;
    line-height: 1;
  }

  body .cv-content > section > p,
  body .cv-content > section > section {
    margin-block: 6pt;
  }

  body .cv-content > section > section {
    display: grid;
    gap: 0.25rem;
  }

  body .cv-content > section > section > header {
    display: grid;
    grid-template-columns: 1fr max-content;
    column-gap: 0.25rem;
  }

  body .cv-content > section > section > header > h3 {
    grid-column: 1;
    font-size: 9pt;
  }

  body .cv-content > section > section > header > span {
    grid-column: 1;
  }

  body .cv-content > section > section > header > span.date {
    grid-column: 2;
    grid-row: 1;
  }

  body .cv-content > section > section > ul {
    padding-inline-start: 1rem;
  }

  body .cv-content .skills span {
    font-size: 8pt;
  }
}
