:root {
  --paper: #ffffff;
  --page: #f3f5f7;
  --ink: #1e2732;
  --muted: #596574;
  --subtle: #7b8794;
  --line: #d9dee5;
  --line-dark: #bcc5cf;
  --accent: #173f67;
  --accent-soft: #eaf0f6;
  --max-width: 1050px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.58;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 3px solid #7ca8d1;
  outline-offset: 3px;
  border-radius: 2px;
}


button {
  font: inherit;
}

.print-cv {
  padding: 0;
  border: 0;
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.print-cv:hover {
  text-decoration-thickness: 2px;
}

.print-cv:focus-visible {
  outline: 3px solid #7ca8d1;
  outline-offset: 3px;
  border-radius: 2px;
}

.nav-print {
  color: var(--muted);
  text-decoration: none;
}

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

.download-link,
.contact-print {
  font-weight: 700;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 1000;
  transform: translateY(-180%);
  padding: 8px 12px;
  color: #fff;
  background: var(--accent);
}

.skip-link:focus {
  transform: translateY(0);
}

.page-shell {
  width: min(calc(100% - 40px), var(--max-width));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
}

.topbar-inner {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.name-link {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
}

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

.topbar nav a:hover {
  color: var(--accent);
}

.resume {
  margin-top: 34px;
  margin-bottom: 34px;
  padding: 54px 64px 58px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 8px 30px rgba(24, 38, 55, 0.07);
}

.resume-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding-bottom: 26px;
  border-bottom: 2px solid var(--accent);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: clamp(36px, 5vw, 50px);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.job-title {
  margin: 12px 0 0;
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 700;
  line-height: 1.4;
  color: var(--accent);
  text-align: left;
}

.job-specialties {
  display: block;
  margin-top: 6px;
  font-size: 16px;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
}

.contact-block {
  display: grid;
  justify-items: start;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
}

.contact-block a {
  text-decoration: none;
}

.download-link {
  margin-top: 4px;
  font-weight: 700;
}

.resume-section {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 34px;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}

.resume-section > h2 {
  margin: 2px 0 0;
  color: var(--accent);
  font-size: 14px;
  line-height: 1.3;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.section-content {
  min-width: 0;
}

.profile-copy p {
  margin-bottom: 12px;
}

.profile-copy p:last-child {
  margin-bottom: 0;
}

.role + .role {
  margin-top: 34px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

.role-header,
.project-heading,
.education-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
}

.role h3,
.project h3,
.education-row h3 {
  margin-bottom: 2px;
  font-size: 19px;
  line-height: 1.25;
}

.company {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 700;
}

.role-meta {
  min-width: 180px;
  display: grid;
  gap: 2px;
  color: var(--subtle);
  font-size: 13px;
  text-align: right;
}

ul {
  margin: 15px 0 0;
  padding-left: 20px;
}

li {
  margin-bottom: 7px;
  padding-left: 2px;
}

li::marker {
  color: var(--accent);
}

.skills-list {
  display: grid;
  gap: 0;
}

.skill-row {
  display: grid;
  grid-template-columns: 185px minmax(0, 1fr);
  gap: 22px;
  padding: 11px 0;
  border-bottom: 1px solid #edf0f3;
}

.skill-row:first-child {
  padding-top: 0;
}

.skill-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.skill-row h3 {
  margin-bottom: 0;
  font-size: 14px;
}

.skill-row p {
  margin-bottom: 0;
  color: var(--muted);
}

.project p {
  margin: 14px 0 0;
}

.project-heading > a {
  white-space: nowrap;
}

.education-row > span {
  color: var(--subtle);
  white-space: nowrap;
}

.final-section {
  border-bottom: 0;
}

.contact-footer p {
  margin-bottom: 12px;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-weight: 700;
}

.site-footer {
  padding: 0 0 28px;
  color: var(--subtle);
  font-size: 13px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

@media (max-width: 820px) {
  .resume {
    padding: 36px 30px 42px;
  }

  .resume-header {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .contact-block {
    justify-items: start;
    text-align: left;
  }

  .resume-section {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .resume-section > h2 {
    margin-top: 0;
  }

  .skill-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 620px) {
  .page-shell {
    width: min(calc(100% - 24px), var(--max-width));
  }

  .topbar-inner {
    min-height: 54px;
  }

  .topbar nav a:not(:last-child) {
    display: none;
  }

  .resume {
    margin-top: 12px;
    margin-bottom: 12px;
    padding: 28px 20px 34px;
  }

  h1 {
    font-size: 34px;
  }

  .job-title {
    font-size: 18px;
  }

  .job-specialties {
    font-size: 14px;
  }

  .role-header,
  .project-heading,
  .education-row {
    display: grid;
    gap: 8px;
  }

  .role-meta {
    min-width: 0;
    text-align: left;
  }

  .footer-inner {
    display: grid;
    gap: 3px;
  }
}

@media print {
  @page {
    size: A4;
    margin: 11mm 12mm;
  }

  html {
    scroll-behavior: auto;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 9.2pt;
    line-height: 1.34;
  }

  .topbar,
  .site-footer,
  .print-cv,
  .final-section,
  .skip-link {
    display: none !important;
  }

  .page-shell {
    width: 100%;
    max-width: none;
  }

  .resume {
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .resume-header {
    gap: 20px;
    padding-bottom: 12px;
    border-bottom-width: 1.5px;
  }

  h1 {
    font-size: 25pt;
  }

  .job-title {
    font-size: 12.5pt;
  }

  .job-specialties {
    font-size: 10pt;
  }

  .contact-block {
    font-size: 8.5pt;
  }

  .resume-section {
    grid-template-columns: 135px minmax(0, 1fr);
    gap: 20px;
    padding: 13px 0;
  }

  .resume-section > h2 {
    font-size: 8.5pt;
  }

  .role + .role {
    margin-top: 15px;
    padding-top: 13px;
  }

  .role h3,
  .project h3,
  .education-row h3 {
    font-size: 11pt;
  }

  .role-meta {
    min-width: 145px;
    font-size: 8pt;
  }

  ul {
    margin-top: 7px;
    padding-left: 16px;
  }

  li {
    margin-bottom: 3px;
  }

  .skill-row {
    grid-template-columns: 145px minmax(0, 1fr);
    gap: 12px;
    padding: 5px 0;
  }

  .skill-row h3 {
    font-size: 8.7pt;
  }

  .project p {
    margin-top: 7px;
  }

  .role,
  .project,
  .education-row,
  .skill-row {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  a {
    color: inherit;
    text-decoration: none;
  }
}

/* Keep controls easy to use on touchscreens and keyboard navigation. */
.topbar nav a, .nav-print, .download-link, .contact-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
/* A linear print layout preserves a predictable reading order. */
@media print {
  .cv-download { display: none !important; }
  .resume-header, .resume-section, .skill-row, .role-header, .project-heading, .education-row {
    display: block;
  }
  .resume-section > h2 { margin-bottom: 8px; }
  .role-meta { text-align: left; margin-top: 4px; }
  .contact-block { margin-top: 10px; }
  .role { break-inside: auto; page-break-inside: auto; }
  .role-header, h2, h3 { break-after: avoid; }
  li { break-inside: avoid; }
  p, li { orphans: 2; widows: 2; }
  .skill-row h3 { margin-bottom: 2px; }
  .project-heading > a { display: block; margin-top: 4px; }
  .contact-block a { min-height: 0; display: block; }
}
