:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --paper: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #dfe4ea;
  --accent: #245a9c;
  --accent-soft: #edf4fb;
  --max-width: 900px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

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

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

.site-header {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-nav {
  width: min(calc(100% - 32px), var(--max-width));
  min-height: 58px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.version-links,
.action-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.site-nav a,
.site-nav button {
  color: #475569;
  font: inherit;
  font-size: 0.93rem;
  font-weight: 600;
  text-decoration: none;
}

.site-nav a.active {
  color: var(--accent);
}

.site-nav button {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  padding: 6px 10px;
  cursor: pointer;
}

.site-nav button:hover {
  border-color: #b8c4d2;
  background: #f8fafc;
}

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

.cv-content {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: clamp(30px, 6vw, 64px);
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.06);
}

.cv-content > h1:first-child {
  margin-top: 0;
  margin-bottom: 4px;
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: #111827;
}

.cv-content > h1:first-child + p {
  margin-top: 6px;
  color: #334155;
}

h2 {
  margin: 42px 0 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  color: #111827;
  font-size: 1.28rem;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

h3 {
  margin: 28px 0 6px;
  color: #172033;
  font-size: 1.07rem;
  line-height: 1.35;
}

h4 {
  margin: 24px 0 4px;
  color: #334155;
  font-size: 1rem;
}

p {
  margin: 10px 0;
}

ul,
ol {
  padding-left: 1.35rem;
  margin: 10px 0 18px;
}

li {
  margin: 7px 0;
  padding-left: 0.15rem;
}

strong {
  color: #172033;
  font-weight: 650;
}

em {
  color: #475569;
}

code {
  padding: 0.12em 0.3em;
  border-radius: 4px;
  background: #f1f5f9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

blockquote {
  margin: 18px 0;
  padding: 10px 16px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  color: #425466;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 32px 0;
}

.site-footer {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto 32px;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  .site-header {
    position: static;
  }

  .site-nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 0;
    gap: 9px;
  }

  .cv-shell {
    width: 100%;
    margin: 0;
  }

  .cv-content {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 28px 20px 44px;
  }

  h2 {
    margin-top: 34px;
  }

  .site-footer {
    display: none;
  }
}

@page {
  size: A4;
  margin: 14mm 15mm 16mm;
}

@media print {
  :root {
    --text: #111111;
    --muted: #444444;
    --line: #cfcfcf;
  }

  body {
    background: #fff;
    color: #111;
    font-size: 10.3pt;
    line-height: 1.45;
  }

  .site-header,
  .site-footer {
    display: none !important;
  }

  .cv-shell {
    width: auto;
    margin: 0;
  }

  .cv-content {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
  }

  .cv-content > h1:first-child {
    font-size: 23pt;
  }

  h2 {
    margin-top: 18pt;
    page-break-after: avoid;
  }

  h3,
  h4 {
    page-break-after: avoid;
  }

  p,
  li {
    orphans: 3;
    widows: 3;
  }

  ul,
  ol {
    break-inside: auto;
  }

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