:root {
  --sidebar: #a9cfee;
  --sidebar-dark: #2869a5;
  --rule: #006b8e;
  --text: #111;
  --muted: #666;
  --link: #4d809d;
  --paper: #fff;
  --page-width: 1060px;
}

* { box-sizing: border-box; }
html { height: 100%; background: #eef1f4; }
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  color: var(--text);
  background: #eef1f4;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.18;
}

.cv-nav {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 20;
  width: 152px;
  display: grid;
  gap: 8px;
}
.cv-nav a,
.cv-nav button {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: #08265c;
  color: #fff;
  cursor: pointer;
  font: 700 14px/1 Arial, Helvetica, sans-serif;
  padding: 11px 13px;
  text-align: left;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(0,0,0,.18);
}
.cv-nav .active {
  background: #3f8e20;
}
.viewer-shell {
  height: 100vh;
  margin-left: 206px;
  padding: 16px 24px;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.fit-stage {
  flex: 0 0 auto;
  transform-origin: top left;
}

.cv {
  width: var(--page-width);
  min-height: 1498px;
  margin: 0;
  background: var(--paper);
  display: grid;
  grid-template-columns: 330px 1fr;
  box-shadow: 0 8px 30px rgba(0,0,0,.12);
  overflow: hidden;
}

.sidebar {
  position: relative;
  background: var(--sidebar);
  padding: 0 25px 38px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-top {
  position: absolute;
  inset: 0 0 auto 0;
  height: 120px;
  background: var(--sidebar-dark);
  border-bottom: 1px solid #111;
  clip-path: ellipse(82% 70% at 50% 0%);
}

.portrait-wrap {
  position: relative;
  z-index: 1;
  width: 250px;
  height: 250px;
  margin: 25px auto 73px;
  border-radius: 50%;
  background: #fff;
  padding: 9px;
  flex: 0 0 auto;
}
.portrait {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
  border-radius: 50%;
}

.side-section { margin: 0 0 20px; }
.side-section h2 {
  font-size: 16px;
  margin: 0 0 8px;
  padding-bottom: 9px;
  border-bottom: 3px solid var(--rule);
}
.side-section p { margin: 0; }
.side-section dl { margin: 0; }
.side-section dt { font-weight: 700; margin-top: 4px; }
.side-section dd { margin: 0; }
.side-section a { color: var(--link); text-decoration: none; overflow-wrap: anywhere; }
.side-section a:hover { text-decoration: underline; }
.licenses { margin-top: auto; margin-left: 6px; }
.languages { margin-left: 6px; }
.languages p { padding: 4px 0 0 0; }

.content {
  padding: 28px 34px 36px 29px;
  min-width: 0;
}
.intro h1 {
  margin: 0 0 22px 18px;
  font-size: 23px;
  line-height: 1;
}
.intro p { margin: 0; font-size: 17px; line-height: 1.22; }

.section { margin-top: 42px; }
.section h2,
.section h3 {
  color: var(--muted);
  margin-left: 12px;
}
.section h2 { font-size: 16px; margin-bottom: 16px; }
.section h3 { font-size: 16px; margin-top: 0; margin-bottom: 13px; }
.rule {
  height: 3px;
  background: var(--rule);
  width: 100%;
  margin-bottom: 11px;
}
.indent { padding-left: 18px; }
.indent h4 { margin: 0; font-size: 16px; }
.indent p { margin: 3px 0 0; }
.indent .spaced { margin-top: 29px; }
ul { margin: 3px 0 0; padding-left: 0; list-style-position: inside; }
li { margin: 0; }

.career-grid {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  row-gap: 1px;
  margin-top: 3px;
}
.subline { display: inline-block; margin-left: 44px; }

.compact-section { margin-top: 65px; }
.compact-section + .compact-section { margin-top: 17px; }
.compact-section h2 { margin: 0 0 8px 12px; }
.detail-line { margin: 0 0 0 47px; line-height: 1.22; }
.hobbies { margin-top: 20px !important; }

@media (max-width: 760px) {
  body { background: #fff; overflow: hidden; }
  .cv-nav {
    position: relative;
    top: 0;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0,1fr));
    padding: 10px;
    background: #fff;
  }
  .cv-nav a,
  .cv-nav button {
    text-align: center;
    padding: 11px 6px;
    font-size: 13px;
  }
  .viewer-shell {
    height: calc(100vh - var(--cv-nav-height, 0px));
    margin-left: 0;
    padding: 12px;
  }
  .cv {
    display: grid;
    min-height: 1498px;
    width: var(--page-width);
    margin: 0;
    box-shadow: none;
  }
  .sidebar {
    padding-bottom: 25px;
  }
  .sidebar-top { height: 105px; }
  .portrait-wrap {
    width: 205px;
    height: 205px;
    margin-bottom: 30px;
  }
  .licenses { margin-top: 18px; }
  .content { padding: 30px 22px 40px; }
  .intro h1 { margin-left: 0; }
  .intro p { font-size: 16px; }
  .section h2, .section h3 { margin-left: 0; }
  .indent { padding-left: 0; }
  .detail-line { margin-left: 18px; }
  .career-grid { grid-template-columns: 88px minmax(0,1fr); }
  .subline { margin-left: 0; }
  .section, .compact-section { margin-top: 35px; }
}

@media print {
  @page { size: A4; margin: 0; }
  .cv-nav { display: none; }
  html, body { height: auto; overflow: visible; background: #fff; }
  body { font-size: 8.6pt; line-height: 1.12; }
  .viewer-shell { height: auto; margin: 0; padding: 0; display: block; overflow: visible; }
  .fit-stage { width: auto !important; height: auto !important; transform: none !important; }
  .cv {
    width: 210mm;
    height: 297mm;
    min-height: 297mm;
    margin: 0;
    grid-template-columns: 67mm 1fr;
    box-shadow: none;
    overflow: hidden;
  }
  .sidebar { padding: 0 5mm 6mm; }
  .sidebar-top {
    height: 25mm;
    clip-path: none;
    border-bottom-left-radius: 55% 32%;
    border-bottom-right-radius: 55% 32%;
  }
  .portrait-wrap { width: 50mm; height: 50mm; margin: 5mm auto 11mm; padding: 2mm; }
  .side-section { margin-bottom: 3.5mm; }
  .side-section h2 { font-size: 9pt; padding-bottom: 1.5mm; margin-bottom: 1.5mm; border-bottom-width: .65mm; }
  .side-section dt { margin-top: .7mm; }
  .licenses { margin-top: auto; }
  .content { padding: 6.2mm 7mm 5mm 6mm; }
  .intro h1 { font-size: 14.5pt; margin: 0 0 4.5mm 4mm; }
  .intro p { font-size: 9.4pt; line-height: 1.14; }
  .section { margin-top: 6.4mm; }
  .section h2 { margin-bottom: 2.3mm; }
  .section h3 { margin-bottom: 2.1mm; }
  .section h2, .section h3, .indent h4 { font-size: 9pt; }
  .rule { height: .55mm; margin-bottom: 2mm; }
  .indent { padding-left: 4mm; }
  .indent .spaced { margin-top: 4mm; }
  .career-grid { grid-template-columns: 22mm minmax(0, 1fr); row-gap: 0; }
  .subline { margin-left: 9mm; }
  .compact-section { margin-top: 6.5mm; }
  .compact-section + .compact-section { margin-top: 2.6mm; }
  .compact-section h2 { margin-bottom: 1.4mm; }
  .detail-line { margin-left: 10mm; line-height: 1.13; }
  .hobbies { margin-top: 2.8mm !important; }
  a { color: inherit !important; text-decoration: none !important; }
}
