:root {
  --bg: #ffffff;
  --text: #1b1f24;
  --muted: #5b6570;
  --accent: #2f6feb;
  --rule: #e3e6ea;
  --link: #1f5fd0;
  --c-mail: #1f5fd0;
  --c-tel: #1f5fd0;
  --c-web: #6d28d9;
  --c-li: #0a66c2;
  --c-gh: #24292f;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418;
    --text: #e6e9ed;
    --muted: #9aa4b0;
    --accent: #7aa2f7;
    --rule: #262b32;
    --link: #8fb6ff;
    --c-mail: #8fb6ff;
    --c-tel: #8fb6ff;
    --c-web: #b794ff;
    --c-li: #6ea8fe;
    --c-gh: #d0d7de;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  padding: 2.5rem 1.25rem;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Helvetica, Arial, sans-serif;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.page {
  max-width: 46rem;
  margin: 0 auto;
}

.header {
  padding-bottom: 1.1rem;
  border-bottom: 2px solid var(--rule);
}

.identity h1 {
  margin: 0;
  font-size: 1.9rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.role {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.contact {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 1.15rem;
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.925rem;
}

.contact-left,
.contact-right {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.3rem;
}

.contact-left { flex: 1 1 auto; }
.contact-right { flex: 0 0 auto; justify-content: flex-end; }

.contact li {
  white-space: nowrap;
}

.contact a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: inherit;
  text-decoration: none;
}

.contact svg {
  width: 1.05em;
  height: 1.05em;
  flex: none;
}

.contact a:hover { text-decoration: underline; }

.c-mail { color: var(--c-mail); }
.c-tel  { color: var(--c-tel); }
.c-web  { color: var(--c-web); }
.c-li   { color: var(--c-li); }
.c-gh   { color: var(--c-gh); }
.loc    { color: var(--muted); }

section { margin-top: 1.9rem; }

section > h2 {
  margin: 0 0 0.9rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

p { margin: 0 0 0.6rem; }

.entry + .entry { margin-top: 1.15rem; }

.entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.15rem 1rem;
}

.entry h3 {
  margin: 0;
  font-size: 1.05rem;
}

.entry h3 a {
  color: inherit;
  text-decoration: none;
}

.entry h3 a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.org { font-weight: 500; }

.dates::before {
  content: "\00b7";
  margin: 0 0.4rem;
  color: var(--rule);
}

.client {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
  font-style: italic;
}

.entry ul {
  margin: 0.4rem 0 0;
  padding-left: 1.15rem;
}

.entry li { margin-bottom: 0.25rem; }

.skill-group {
  display: grid;
  grid-template-columns: 185px 1fr;
  align-items: baseline;
  gap: 0.15rem 0.75rem;
}

.skill-group + .skill-group { margin-top: 0.45rem; }

.skill-group h3 {
  margin: 0;
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skill-group p {
  margin: 0;
  word-wrap: break-word;
}

.certs {
  margin: 0;
  padding-left: 1.15rem;
}

.certs li { margin-bottom: 0.25rem; }

.two-up {
  display: flex;
  flex-wrap: wrap;
  gap: 0 2.5rem;
}

.two-up > * { flex: 1 1 16rem; }
.two-up section,
.two-up > div { margin-top: 0; }

.footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.footer p { margin: 0; }

.updated { margin-left: auto; }

.print-only { display: none; }

.btn {
  display: inline-block;
  padding: 0.45rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

.btn:hover { opacity: 0.88; }

.linkish {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
}

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

@media (max-width: 34rem) {
  body { padding: 1.5rem 1rem; }
  .identity h1 { font-size: 1.55rem; }
  .meta { white-space: normal; }
}

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

@media print {
  :root {
    --bg: #fff;
    --text: #000;
    --muted: #333;
    --rule: #ccc;
    --link: #000;
    /* Pin accents to their light values: prefers-color-scheme can otherwise
       apply the dark palette, which is unreadable on white paper. */
    --c-mail: #1f5fd0;
    --c-tel: #1f5fd0;
    --c-web: #6d28d9;
    --c-li: #0a66c2;
    --c-gh: #24292f;
  }

  body { padding: 0; font-size: 10.5pt; line-height: 1.4; }

  a { text-decoration: none; color: #000; }
  /* Remove URL footnotes for cleaner ATS-friendly PDF */
  a[href^="http"]::after { content: none; }

  .header { padding-bottom: 0.7rem; }
  .identity h1 { font-size: 1.4rem; }
  .contact { font-size: 9.5pt; gap: 0.2rem 0.9rem; margin-top: 0.4rem; }

  section { margin-top: 0.95rem; }
  section > h2 { margin-bottom: 0.5rem; }

  .entry + .entry { margin-top: 0.7rem; }
  .entry ul { margin-top: 0.25rem; }
  .entry li { margin-bottom: 0.15rem; }

  .skill-group + .skill-group { margin-top: 0.2rem; }

  .entry,
  .skill-group,
  .certs li,
  .two-up > div { break-inside: avoid; }

  .btn,
  .linkish { display: none; }
  .footer { margin-top: 1rem; }
  .print-only {
    display: block;
    flex: 1 0 100%;
    font-size: 9pt;
    word-spacing: 0.15em;
  }
}