/* Shared print stylesheet for both CV variants. Cmd-P -> Save as PDF. */

@page {
  size: A4;
  margin: 14mm 15mm;
}

:root {
  --ink: #16181d;
  --muted: #5a616e;
  --rule: #d4d8e0;
  --accent: #1a3f6b;
}

* { box-sizing: border-box; }

body {
  font-family: "Charter", "Iowan Old Style", Georgia, serif;
  font-size: 10.4pt;
  line-height: 1.42;
  color: var(--ink);
  max-width: 190mm;
  margin: 0 auto;
  padding: 14mm 10mm;
  -webkit-font-smoothing: antialiased;
}

h1 {
  font-size: 21pt;
  letter-spacing: -0.015em;
  margin: 0 0 2pt;
  font-weight: 600;
}

.tagline {
  font-size: 11pt;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 6pt;
}

.contact {
  font-size: 9.3pt;
  color: var(--muted);
  margin: 0 0 4pt;
}

.contact a { color: var(--muted); text-decoration: none; }

h2 {
  font-size: 9pt;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--accent);
  font-weight: 700;
  margin: 15pt 0 6pt;
  padding-bottom: 3pt;
  border-bottom: 0.7pt solid var(--rule);
}

h3 {
  font-size: 11pt;
  margin: 10pt 0 1pt;
  font-weight: 600;
}

h3 + .meta {
  font-size: 9.3pt;
  color: var(--muted);
  font-style: italic;
  margin: 0 0 5pt;
}

h4 {
  font-size: 10.2pt;
  margin: 9pt 0 3pt;
  font-weight: 600;
}

p { margin: 0 0 6pt; }

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

li { margin-bottom: 2.5pt; }

.summary p { text-align: justify; }

.project {
  margin-bottom: 8pt;
}

.project .title {
  font-weight: 600;
  font-size: 10.4pt;
}

.project .tech {
  font-style: italic;
  color: var(--muted);
}

.project .repo,
.stack {
  font-size: 9.2pt;
  color: var(--muted);
}

.repo code,
.stack code,
code {
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 8.8pt;
}

.skills {
  display: grid;
  grid-template-columns: 82pt 1fr;
  gap: 3pt 10pt;
  font-size: 9.9pt;
}

.skills dt { font-weight: 600; }
.skills dd { margin: 0; }

.note {
  font-size: 9.3pt;
  color: var(--muted);
  font-style: italic;
}

/* Keep headings attached to the block that follows them. */
h2, h3, h4 { break-after: avoid; page-break-after: avoid; }
.project, li { break-inside: avoid; page-break-inside: avoid; }

@media screen {
  body {
    background: #fff;
    box-shadow: 0 1px 24px rgba(0, 0, 0, 0.09);
    margin: 26px auto;
  }
  html { background: #eef0f4; }
}

/* @page already supplies the print margins — the body padding above is for
   on-screen viewing only. Leaving it in doubles the margin and cost a page. */
@media print {
  body {
    padding: 0;
    margin: 0;
    max-width: none;
    box-shadow: none;
    font-size: 10.2pt;
    line-height: 1.34;
  }
  h2 { margin-top: 10pt; margin-bottom: 5pt; }
  h3 { margin-top: 8pt; }
  h4 { margin-top: 7pt; }
  p  { margin-bottom: 5pt; }
  li { margin-bottom: 1.5pt; }
  .project { margin-bottom: 6pt; }

  /* Education is 3 short lines; never let it strand on its own page. */
  h2 + h3, h2 + h3 + .meta { break-before: avoid; page-break-before: avoid; }
}
