:root {
  color-scheme: light dark;
  --bg: #eef2f0;
  --paper: #ffffff;
  --text: #151b18;
  --muted: #56635d;
  --line: #cbd5d0;
  --accent: #087f5b;
  --accent-soft: #e2f5ed;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1311;
    --paper: #171d1a;
    --text: #eef5f1;
    --muted: #a8b8b0;
    --line: #35423b;
    --accent: #4dd7a8;
    --accent-soft: #18382d;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef2f0;
  --paper: #ffffff;
  --text: #151b18;
  --muted: #56635d;
  --line: #cbd5d0;
  --accent: #087f5b;
  --accent-soft: #e2f5ed;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1311;
  --paper: #171d1a;
  --text: #eef5f1;
  --muted: #a8b8b0;
  --line: #35423b;
  --accent: #4dd7a8;
  --accent-soft: #18382d;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

a {
  color: var(--accent);
  overflow-wrap: anywhere;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

.icon {
  display: block;
  width: 18px;
  height: 18px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  transform: translateY(-150%);
  padding: 8px 12px;
  background: var(--text);
  color: var(--paper);
}

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

.cv-toolbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px max(18px, calc((100vw - 980px) / 2));
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
}

.cv-toolbar a,
.cv-toolbar button {
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.cv-toolbar .theme-toggle {
  display: inline-grid;
  width: 36px;
  padding: 0;
  place-items: center;
}

.cv {
  width: min(980px, calc(100% - 32px));
  margin: 28px auto 56px;
  padding: clamp(26px, 5vw, 56px);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  box-shadow: 0 18px 55px rgba(14, 27, 21, 0.12);
}

.cv-header {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding-bottom: 28px;
  border-bottom: 3px solid var(--accent);
}

.cv-header img {
  width: 128px;
  height: 128px;
  border: 1px solid var(--line);
  border-radius: 7px;
  object-fit: cover;
}

.cv-kicker {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.cv-header h1 {
  margin: 0;
  font-size: clamp(35px, 6vw, 54px);
  line-height: 1;
}

.cv-headline {
  margin: 10px 0 4px;
  font-size: 18px;
  font-weight: 700;
}

.cv-header p {
  color: var(--muted);
}

.cv-contact,
.cv-profiles {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 9px;
  font-size: 12px;
}

.cv-contact a,
.cv-profiles a {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
}

.cv-section {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.cv-section h2 {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 18px;
  letter-spacing: 0.02em;
}

.cv-section > p {
  margin: 0;
}

.capability-list,
.recognition-list,
.skill-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 28px;
}

.capability-list div,
.recognition-list div,
.skill-groups div {
  min-width: 0;
}

.capability-list strong,
.capability-list span,
.recognition-list strong,
.recognition-list span,
.skill-groups strong,
.skill-groups span {
  display: block;
}

.capability-list span,
.recognition-list span,
.skill-groups span {
  color: var(--muted);
  font-size: 13px;
}

.cv-entry {
  margin-top: 20px;
}

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

.cv-entry header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}

.cv-entry h3,
.cv-projects h3,
.cv-publication h3 {
  margin: 0;
  font-size: 15px;
}

.cv-entry header p,
.cv-entry > p,
.cv-projects p,
.cv-publication p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.cv-publication p {
  overflow-wrap: anywhere;
}

.cv-entry time,
.cv-publication time {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.cv-entry.compact {
  margin-top: 16px;
}

.cv-projects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.cv-projects article {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.cv-projects .technology-line {
  margin-top: 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.cv-publication {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.service-note {
  margin-top: 16px !important;
  color: var(--muted);
  font-size: 13px;
}

.cv-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 24px;
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 680px) {
  .cv-toolbar {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .cv {
    width: 100%;
    margin: 0;
    padding: 24px 16px 40px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .cv-header {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
  }

  .cv-header img {
    width: 92px;
    height: 92px;
  }

  .cv-header h1 {
    font-size: 34px;
  }

  .cv-headline {
    font-size: 15px;
  }

  .cv-contact,
  .cv-profiles {
    grid-column: 1 / -1;
  }

  .capability-list,
  .recognition-list,
  .skill-groups,
  .cv-projects {
    grid-template-columns: 1fr;
  }

  .cv-entry header {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .cv-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media print {
  :root,
  :root[data-theme="dark"] {
    color-scheme: light;
    --bg: #ffffff;
    --paper: #ffffff;
    --text: #111111;
    --muted: #444444;
    --line: #bbbbbb;
    --accent: #075d45;
    --accent-soft: #e7f3ee;
  }

  @page {
    size: A4;
    margin: 8mm 10mm;
  }

  body {
    background: #ffffff;
    font-size: 8.8pt;
    line-height: 1.42;
  }

  .cv-toolbar,
  .skip-link {
    display: none;
  }

  .cv {
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .cv-header {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 14px;
    padding-bottom: 10px;
  }

  .cv-header img {
    width: 76px;
    height: 76px;
  }

  .cv-header h1 {
    font-size: 24pt;
  }

  .cv-headline {
    margin-top: 5px;
    font-size: 10pt;
  }

  .cv-contact,
  .cv-profiles {
    margin-top: 3px;
    font-size: 7pt;
  }

  .cv-contact a,
  .cv-profiles a {
    min-height: 0;
  }

  .cv-section {
    padding: 7px 0;
  }

  .cv-section h2 {
    margin-bottom: 5px;
    font-size: 10.5pt;
  }

  .cv-entry {
    margin-top: 5px;
    break-inside: avoid;
  }

  .cv-entry h3,
  .cv-projects h3,
  .cv-publication h3 {
    font-size: 8.8pt;
  }

  .cv-entry header p,
  .cv-entry > p,
  .cv-projects p,
  .cv-publication p,
  .capability-list span,
  .recognition-list span,
  .skill-groups span {
    font-size: 7.5pt;
  }

  .cv-projects {
    gap: 5px;
  }

  .cv-projects article {
    padding: 5px;
    break-inside: avoid;
  }

  .cv-publication {
    margin-top: 5px;
    break-inside: avoid;
  }

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