*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #fafafa;
  --text: #111;
  --text-muted: #444;
  --link: #111;
  --accent: #ff00c3;
  --btn-color: #111;
  --btn-active-text: #fff;
  --page-width: 720px;
  --page-pad: 24px;
}

html[data-theme="dark"] {
  --bg: #000;
  --text: #e8e8e8;
  --text-muted: #888;
  --link: #e8e8e8;
  --btn-color: #fff;
  --btn-active-text: #000;
}

html {
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  transition: background 0.2s ease, color 0.2s ease;
}

.toolbar {
  position: fixed;
  top: max(20px, env(safe-area-inset-top));
  right: max(var(--page-pad), calc(50vw - var(--page-width) / 2 + var(--page-pad)));
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
  padding: 0;
  background: none;
  pointer-events: none;
}

.cv-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--btn-color);
  background: transparent;
  color: var(--btn-color);
  font-family: Arial, Helvetica, sans-serif;
  font-style: italic;
  font-size: 9px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: lowercase;
  cursor: pointer;
  text-decoration: none;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.12s ease, border-color 0.12s ease, background-color 0.12s ease;
}

.cv-btn--round {
  border-radius: 50%;
}

.cv-btn--square {
  border-radius: 0;
}

.cv-btn[hidden] {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .cv-btn:hover:not(:active):not(.is-pressed) {
    border-color: var(--accent);
    color: var(--accent);
  }
}

.cv-btn:active,
.cv-btn.is-pressed {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--btn-active-text);
}

.page {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) var(--page-pad) 48px;
  padding-bottom: max(48px, env(safe-area-inset-bottom));
}

.cv-document a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cv-document .contact a[href^="mailto:"] {
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  .cv-document a:hover {
    color: var(--accent);
  }
}

.cv-document {
  font-size: 15px;
  line-height: 1.45;
}

.cv-document h1 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.cv-document .title {
  font-size: 16px;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 8px;
}

.cv-document .contact {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 28px;
  line-height: 1.5;
}

.cv-document h2 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--text-muted);
}

.cv-document h2:first-of-type {
  margin-top: 0;
}

.cv-document h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 18px 0 4px;
}

.cv-document h3:first-of-type {
  margin-top: 0;
}

.cv-document .meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.cv-document ul {
  margin: 0 0 8px 18px;
}

.cv-document li {
  margin-bottom: 4px;
  font-size: 14px;
}

.cv-document .cv-list {
  font-size: 14px;
  line-height: 1.45;
}

.cv-document .cv-list p {
  margin-bottom: 6px;
}

@media (max-width: 600px) {
  :root {
    --page-pad: 18px;
  }

  .cv-btn {
    width: 38px;
    height: 38px;
    font-size: 8px;
  }

  .page {
    padding-right: 18px;
  }

  .cv-document h1 {
    font-size: 24px;
  }
}

@media print {
  @page {
    size: A4;
    margin: 13mm 15mm;
  }

  .toolbar {
    display: none !important;
  }

  body {
    background: #fff !important;
    color: #111 !important;
  }

  .page {
    max-width: none;
    padding: 0;
    margin: 0;
  }

  .cv-document {
    font-size: 9.75pt;
    line-height: 1.36;
  }

  .cv-document h1 {
    font-size: 18pt;
    margin-bottom: 10px;
  }

  .cv-document .title {
    font-size: 10.5pt;
    margin-bottom: 8px;
  }

  .cv-document .contact {
    font-size: 9pt;
    color: #444;
    margin-bottom: 20px;
  }

  .cv-document .contact a,
  .cv-document .cv-list a {
    color: #111;
    text-decoration: none;
  }

  .cv-document h2 {
    font-size: 10pt;
    color: #111;
    margin-top: 26px;
    margin-bottom: 8px;
  }

  .cv-document h3 {
    font-size: 9.75pt;
    margin: 12px 0 3px;
  }

  .cv-document .meta {
    font-size: 9pt;
    color: #444;
  }

  .cv-document li {
    font-size: 9.75pt;
    margin-bottom: 3px;
  }

  .cv-document .cv-list {
    font-size: 9.25pt;
    line-height: 1.34;
  }

  .cv-document .cv-list p {
    margin-bottom: 2px;
  }

  .cv-document .cv-list a {
    text-decoration: underline;
  }
}
