@font-face {
  font-family: "Google Sans Code";
  src: url("../fonts/GoogleSansCode-Variable.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Google Sans Code";
  src: url("../fonts/GoogleSansCode-Italic-Variable.woff2") format("woff2");
  font-weight: 300 800;
  font-style: italic;
  font-display: swap;
}

/* Theme tokens (blog.nuneslopes.org) — used only by the chrome around the
   sheet. The CV document itself is always light: it is the printed page, and
   the PDF must match it regardless of the visitor's theme. */
:root,
:root[data-theme="light"] {
  --background: #fffaf6;
  --foreground: #060503;
  --accent: #aa0215;
  --accent-foreground: #ffcf75;
  --border: #ffdc98;
}

:root[data-theme="dark"] {
  --background: #1a1a1a;
  --foreground: #f5efe4;
  --accent: #ff3737;
  --accent-foreground: #1a1a1a;
  --border: #6f5648;
}

/* Document palette: light-theme values, hardcoded on purpose */
:root {
  --doc-foreground: #060503;
  --doc-accent: #aa0215;
  --doc-muted: #54515b;
  --doc-rule: #ffdc98;
}

* { box-sizing: border-box; }

::selection {
  background: color-mix(in srgb, var(--doc-accent) 75%, transparent);
  color: #ffcf75;
}

body {
  margin: 0;
  background: var(--background);
  font-family: "Google Sans Code", "Courier New", monospace;
  font-size: 10pt;
  line-height: 1.5;
  color: var(--doc-foreground);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 210mm;
  margin: 0 auto;
  padding: 1.25rem 1rem;
}

.site-title {
  color: var(--foreground);
  font-size: 1.25rem;
  font-weight: 600;
  text-decoration: none;
}

.site-title:hover { color: var(--accent); }

.download-btn {
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--background);
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.download-btn:hover {
  background: color-mix(in srgb, var(--accent) 85%, var(--foreground));
}

/* Screen: an A4-proportioned white sheet whose padding mirrors the @page
   margins, so what you see is what the PDF paginates. */
.page {
  max-width: 210mm;
  margin: 0 auto 2.5rem;
  padding: 18mm 16mm;
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: 0 2px 16px rgb(0 0 0 / 8%);
}

h1 {
  margin: 0 0 0.2rem;
  font-size: 19pt;
  font-weight: 700;
  letter-spacing: -0.015em;
}

/* Contact line: the first paragraph after the name */
h1 + p {
  margin: 0 0 1.4rem;
  color: var(--doc-muted);
  font-size: 9pt;
}

h2 {
  margin: 1.6rem 0 0.7rem;
  font-size: 12pt;
  font-weight: 600;
  letter-spacing: 0.025em;
  color: var(--doc-accent);
  border-bottom: 1px solid var(--doc-rule);
  padding-bottom: 0.25rem;
}

h3 {
  margin: 1rem 0 0.1rem;
  font-size: 10.5pt;
  font-weight: 600;
}

/* Date/location line: the emphasized paragraph right after a job title */
h3 + p em {
  font-style: normal;
  color: var(--doc-muted);
  font-size: 9pt;
}

h3 + p {
  margin: 0 0 0.4rem;
}

p { margin: 0.4rem 0; }

ul {
  margin: 0.3rem 0 0.6rem;
  padding-left: 1.2rem;
}

li { margin: 0.2rem 0; }

code {
  font-family: inherit;
  background: #fff3e0;
  padding: 0 0.2em;
  border-radius: 0.15em;
  font-size: 0.95em;
}

.page a {
  color: var(--doc-accent);
  text-decoration: none;
  text-underline-offset: 4px;
}

.page a:hover { text-decoration: underline dashed; }

.entry { break-inside: avoid; }

@media (max-width: 700px) {
  .page {
    margin: 0;
    padding: 10mm 5mm;
    border: none;
    box-shadow: none;
  }
}

/* Print: @page owns the margins; the sheet dissolves into the paper. */
@page {
  size: A4;
  margin: 18mm 16mm;
}

@media print {
  body { background: #ffffff; }

  .page {
    max-width: none;
    margin: 0;
    padding: 0;
    border: none;
    box-shadow: none;
  }

  .no-print { display: none; }

  h1, h2, h3 { break-after: avoid; }
}
