/*
 * Self-hosted fonts, copied from @fontsource into assets/files at build time.
 * No network fonts, so the web page and the PDF use the same faces offline.
 */
@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('./files/inter-latin-wght-normal.woff2') format('woff2-variations');
}

@font-face {
  font-family: 'Source Serif 4 Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url('./files/source-serif-4-latin-wght-normal.woff2') format('woff2-variations');
}

:root {
  color-scheme: light;
  --accent: #006e6b;
  --ink: #1c1f23;
  --muted: #61666d;
  --rule: #e2e4e8;
  --tag-bg: #f2f3f5;
  --tag-ink: #2b2f34;
  --bg: #ffffff;
  --measure: 48rem;
  --font-sans: 'Inter Variable', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif: 'Source Serif 4 Variable', Georgia, 'Times New Roman', serif;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --accent: #75bdb7;
  --ink: #e6edec;
  --muted: #9aa1ab;
  --rule: #2a2e36;
  --tag-bg: #23262d;
  --tag-ink: #c9ced6;
  --bg: #14161a;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --accent: #75bdb7;
    --ink: #e6edec;
    --muted: #9aa1ab;
    --rule: #2a2e36;
    --tag-bg: #23262d;
    --tag-ink: #c9ced6;
    --bg: #14161a;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

.cv {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 3.5rem 1.5rem 5rem;
}

h1,
h2,
h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
}

.cv h1 {
  font-size: 2.75rem;
  letter-spacing: -0.015em;
}

.cv h1 + p {
  font-size: 1.2rem;
  color: var(--accent);
  margin: 0.5rem 0 0;
  font-weight: 500;
}

.cv h1 + p + p {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0.2rem 0 0;
}

.cv h2 {
  font-size: 0.85rem;
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.45rem;
  margin: 3rem 0 1.25rem;
}

.cv p {
  margin: 0 0 1rem;
}

.cv a {
  color: var(--ink);
  text-decoration-color: var(--rule);
  text-underline-offset: 0.2em;
}

.cv a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

/* Core tech */
.cv-tech {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.cv-tech-group {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.35rem 0;
  border-top: 1px solid var(--rule);
}

.cv-tech-group:first-child {
  border-top: none;
}

.cv-tech-label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.cv-tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.cv-tag {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--tag-ink);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.2;
  padding: 0.22rem 0.5rem;
  border-radius: 0.3rem;
  white-space: nowrap;
}

/* Experience */
.cv-experience {
  display: grid;
  gap: 0.5rem;
}

.cv-role {
  padding: 1.15rem 0;
  border-top: 1px solid var(--rule);
}

.cv-role:first-child {
  border-top: none;
  padding-top: 0;
}

.cv-role-header {
  display: grid;
  gap: 0.3rem;
}

.cv-role-company {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
}

.cv-role-kind {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  vertical-align: middle;
  margin-left: 0.35rem;
}

.cv-role-titles {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cv-role-title {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  align-items: baseline;
  font-size: 0.95rem;
}

.cv-role-position {
  font-weight: 500;
}

.cv-role-dates {
  color: var(--muted);
  font-size: 0.85rem;
}

.cv-role-tags {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.cv-role-bullets {
  margin: 0.7rem 0 0;
  padding: 0 0 0 1.1rem;
  display: grid;
  gap: 0.3rem;
  font-size: 0.95rem;
}

.cv-role-bullets li::marker {
  color: var(--accent);
}

/* Links and hobbies */
.cv-links,
.cv-hobbies {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.6rem;
}

.cv-links li,
.cv-hobbies li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.cv-icon {
  color: var(--accent);
  flex: none;
}

.cv-link-icon,
.cv-hobby-icon {
  display: inline-flex;
}

.cv-hobbies {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Print-only plain text, so the PDF text layer has real separators. */
.cv-tech-print,
.cv-role-tags-print {
  display: none;
}

@media (max-width: 34rem) {
  .cv {
    padding: 2.5rem 1.1rem 3.5rem;
  }

  .cv h1 {
    font-size: 2.1rem;
  }

  .cv-tech-group {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 0.6rem 0;
  }

  .cv-tech-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }

  .cv-tech-tags {
    gap: 0.3rem;
  }

  .cv-role-title {
    flex-direction: column;
    gap: 0.1rem;
  }
}

/* Theme toggle */
.cv-theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
}

.cv-theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.cv-theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cv-theme-icon {
  display: inline-flex;
}

.cv-theme-sun {
  display: none;
}

[data-theme='dark'] .cv-theme-sun {
  display: inline-flex;
}

[data-theme='dark'] .cv-theme-moon {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .cv-theme-sun {
    display: inline-flex;
  }

  :root:not([data-theme]) .cv-theme-moon {
    display: none;
  }
}

/*
 * Print and PDF rules. Single column, A4, ATS-friendly (real text only).
 * Playwright sets the page size and margins; this file controls the content.
 */
@media print {
  :root {
    --measure: none;
  }

  .cv-theme-toggle {
    display: none;
  }

  html,
  body {
    background: #ffffff;
  }

  body {
    font-size: 10.5pt;
    line-height: 1.4;
    color: #000000;
  }

  .cv {
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .cv h1 {
    font-size: 24pt;
  }

  .cv h1 + p {
    font-size: 12pt;
    margin-top: 2pt;
  }

  .cv h1 + p + p {
    font-size: 9.5pt;
    margin-top: 1pt;
  }

  .cv h2 {
    font-size: 8.5pt;
    margin: 14pt 0 6pt;
    padding-bottom: 3pt;
  }

  .cv p {
    margin: 0 0 5pt;
  }

  .cv-tech {
    gap: 1pt;
  }

  .cv-tech-group {
    display: block;
    padding: 1.5pt 0;
  }

  .cv-tech-label,
  .cv-tech-tags,
  .cv-role-tags,
  .cv-role-kind {
    display: none;
  }

  .cv-tech-print,
  .cv-role-tags-print {
    display: inline;
    font-size: 9pt;
  }

  .cv-role {
    padding: 8pt 0;
    break-inside: avoid;
  }

  .cv-role-company {
    font-size: 11.5pt;
  }

  .cv-role-title {
    display: block;
    font-size: 9.5pt;
  }

  .cv-role-dates {
    display: block;
  }

  .cv-role-bullets {
    margin-top: 4pt;
    gap: 2pt;
    font-size: 9.5pt;
  }

  .cv-link-icon,
  .cv-hobby-icon {
    color: #000000;
  }

  a {
    color: #000000;
    text-decoration: none;
  }
}
