:root {
  --navy: #17243d;
  --teal: #19a5a6;
  --ink: #28303d;
  --muted: #68717c;
  --line: #dfe3e5;
  --paper: #fff;
  --page-bg: #edf0ef;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--page-bg); color: var(--ink); font-family: Calibri, Arial, sans-serif; line-height: 1.45; }
button { font: inherit; }
.page { display: grid; grid-template-columns: minmax(245px, 30%) minmax(0, 1fr); width: min(100% - 40px, 960px); min-height: 1355px; margin: 42px auto; background: var(--paper); box-shadow: 0 18px 55px rgba(23, 36, 61, 0.15); overflow: hidden; }
.sidebar { padding: 42px 28px; background: var(--navy); color: #fff; }
.portrait { width: 126px; height: 126px; margin: 0 auto 30px; border: 7px solid #fff; border-radius: 50%; background: #aaa; overflow: hidden; }
.portrait img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center top; }
.identity { text-align: center; padding-bottom: 30px; border-bottom: 1px solid rgba(255, 255, 255, .18); }
.eyebrow, .document-label { margin: 0 0 10px; color: var(--teal); font-size: .7rem; font-weight: 700; letter-spacing: .2em; }
.identity h1 { margin: 0; color: #fff; font-family: Georgia, serif; font-size: clamp(1.45rem, 3vw, 2.15rem); font-weight: 700; line-height: 1.05; }
.role { margin: 14px 0 0; color: #c3cedd; font-size: .93rem; }
.rail-section { padding-top: 28px; }
.rail-section h2, .resume-section h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 15px; color: var(--teal); font-size: .83rem; letter-spacing: .13em; text-transform: uppercase; }
.rail-section h2::after, .resume-section h2::after { content: ""; height: 1px; flex: 1; background: currentColor; opacity: .35; }
.rail-section h3 { margin: 16px 0 7px; color: #fff; font-size: .68rem; }
.rail-section p { margin: 0; color: #d5dce6; font-size: .82rem; }
.contact p + p { margin-top: 13px; }
.contact strong { display: block; margin-bottom: 2px; color: #8c9bb3; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; }
.skill-list, .cert-list { margin: 0; padding: 0; list-style: none; }
.skill-list { display: grid; gap: 8px; }
.skill-list li { color: #d5dce6; font-size: .79rem; }
.skill-list li::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 10px 1px 0; border-radius: 50%; background: var(--teal); }
.sidebar .cert-list { color: #d5dce6; font-size: .68rem; }
.sidebar .cert-list li { padding: 4px 0 4px 12px; border: 0; }
.sidebar .cert-list li::before { margin-left: -12px; }
.languages p { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.languages span { color: #fff; font-weight: 700; }
.content { min-width: 0; padding: 42px 44px 30px; }
.content-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 44px; }
.content-head .document-label { color: var(--muted); }
#printBtn { border: 1px solid var(--teal); border-radius: 2px; padding: 8px 12px; background: transparent; color: var(--teal); font-size: .72rem; cursor: pointer; }
#printBtn:hover { background: var(--teal); color: #fff; }
.resume-section { padding-bottom: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.resume-section > p { margin: 0; color: var(--muted); font-size: .88rem; }
.resume-section h3 { margin: 0; color: var(--navy); font-family: Georgia, serif; font-size: 1.06rem; font-weight: 600; }
.job { position: relative; }
.job-header::before { content: ""; display: block; width: 10px; height: 10px; flex: 0 0 10px; margin-top: 5px; border-radius: 50%; background: var(--teal); }
.job-header { display: flex; }
.job-header > div { flex: 1; }
.job + .job { margin-top: 19px; padding-top: 19px; border-top: 1px solid var(--line); }
.job-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 7px; }
.company { margin: 4px 0 0; color: var(--teal); font-size: .78rem; font-weight: 700; }
.date { flex: 0 0 auto; color: var(--muted); font-size: .72rem; font-weight: 700; }
.job ul { margin: 8px 0 0; padding-left: 17px; color: var(--muted); font-size: .81rem; }
.job li + li { margin-top: 5px; }
.split-section { display: block; }
.split-section > div + div { display: none; }
.split-section p { margin: 10px 0 0; color: var(--muted); font-size: .8rem; }
.split-section .date { display: block; margin-top: 9px; }
.cert-list { color: var(--muted); font-size: .79rem; }
.cert-list li { padding: 6px 0 6px 14px; border-bottom: 1px solid var(--line); }
.cert-list li::before { content: "•"; margin-left: -14px; margin-right: 8px; color: var(--teal); }
.affiliation { margin-bottom: 0; padding-bottom: 18px; }
.footer { color: var(--muted); font-size: .7rem; }
.resume-actions, .certificate-picker { width: min(100% - 40px, 960px); margin-left: auto; margin-right: auto; }
.resume-actions { margin-top: -24px; margin-bottom: 18px; text-align: right; }
#downloadBtn, #certificatesBtn, #downloadCertificatesBtn { border: 1px solid var(--teal); border-radius: 2px; padding: 9px 14px; background: var(--teal); color: #fff; font-size: .72rem; font-weight: 700; cursor: pointer; }
#downloadBtn { display: inline-block; text-decoration: none; }
#downloadBtn:hover { background: var(--navy); border-color: var(--navy); }
#certificatesBtn { margin-left: 8px; background: transparent; color: var(--teal); }
#certificatesBtn:hover { background: var(--teal); color: #fff; }
.certificate-picker { margin-bottom: 32px; padding: 18px 20px; border: 1px solid var(--line); background: #f8faf9; }
.certificate-picker fieldset { display: grid; gap: 9px; margin: 0 0 16px; padding: 0; border: 0; }
.certificate-picker legend { margin-bottom: 10px; color: var(--navy); font-family: Georgia, serif; font-size: .96rem; font-weight: 600; }
.certificate-picker label { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: .78rem; cursor: pointer; }
.certificate-picker input { accent-color: var(--teal); margin: 2px 0 0; }
#downloadCertificatesBtn:disabled { background: #d7dddd; border-color: #d7dddd; color: #68717c; cursor: not-allowed; }
.certificate-status { min-height: 1em; margin: 10px 0 0; color: var(--muted); font-size: .72rem; }
@media (max-width: 850px) {
  .page { grid-template-columns: 235px minmax(0, 1fr); width: min(100% - 30px, 820px); min-height: 1180px; margin: 20px auto; }
  .sidebar { padding: 35px 22px; }
  .content { padding: 35px 30px 28px; }
  .portrait { width: 105px; height: 105px; }
  .split-section { display: block; }
}
@media (max-width: 640px) {
  body { background: var(--paper); }
  .page { display: grid; grid-template-columns: 30% 70%; width: 100%; min-height: 0; margin: 0; box-shadow: none; }
  .sidebar { padding: 24px 12px 20px; }
  .portrait { width: 64px; height: 64px; margin-bottom: 15px; border-width: 4px; }
  .identity { padding-bottom: 16px; }
  .identity h1 { font-size: clamp(.75rem, 4vw, 1.2rem); }
  .role { margin-top: 8px; font-size: .55rem; line-height: 1.25; }
  .rail-section { padding-top: 16px; }
  .rail-section h2, .resume-section h2 { gap: 5px; margin-bottom: 8px; font-size: .51rem; letter-spacing: .08em; }
  .rail-section h3 { margin: 10px 0 4px; font-size: .48rem; }
  .rail-section p, .skill-list li, .sidebar .cert-list { font-size: .48rem; line-height: 1.35; }
  .contact p + p { margin-top: 8px; }
  .contact strong { font-size: .4rem; }
  .skill-list { gap: 4px; }
  .skill-list li::before { width: 4px; height: 4px; margin-right: 4px; }
  .languages p { padding: 4px 0; }
  .sidebar .cert-list li { padding: 2px 0 2px 8px; }
  .sidebar .cert-list li::before { margin-left: -8px; }
  .content { padding: 24px 16px 18px; }
  .resume-section { padding-bottom: 14px; margin-bottom: 14px; }
  .resume-section > p, .split-section p { font-size: .57rem; line-height: 1.4; }
  .resume-section h3 { font-size: .68rem; }
  .job + .job { margin-top: 12px; padding-top: 12px; }
  .job-header { gap: 5px; margin-bottom: 4px; }
  .job-header::before { width: 5px; height: 5px; flex-basis: 5px; margin-top: 3px; }
  .company, .date { font-size: .48rem; }
  .job ul { margin-top: 4px; padding-left: 10px; font-size: .54rem; line-height: 1.35; }
  .job li + li { margin-top: 3px; }
  .footer { font-size: .48rem; }
  .resume-actions, .certificate-picker { width: 100%; padding-left: 16px; padding-right: 16px; }
  .resume-actions { margin: 14px 0 14px; text-align: right; }
  #downloadBtn, #certificatesBtn, #downloadCertificatesBtn { padding: 7px 10px; font-size: .52rem; }
  #certificatesBtn { margin: 6px 0 0 4px; }
  .certificate-picker { margin-bottom: 24px; padding-top: 14px; padding-bottom: 14px; }
  .certificate-picker legend { font-size: .68rem; }
  .certificate-picker label { font-size: .52rem; }
  .certificate-status { font-size: .5rem; }
}
@media print {
  body { background: #fff; }
  .page { display: grid; max-width: none; min-height: 0; margin: 0; box-shadow: none; }
  #printBtn, .resume-actions { display: none; }
}
