/* ============================================================
   a-zvg.ru — CV Stylesheet
   Typeface: IBM Plex Serif (headings) + IBM Plex Sans (body)
   Aesthetic: Technical Editorial
   ============================================================ */

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

/* === TOKENS === */
:root {
  --bg:           #F7F6F3;
  --white:        #FFFFFF;
  --text:         #1C1C1E;
  --text-muted:   #6E6E73;
  --text-light:   #AEAEB2;
  --accent:       #1E3A5F;
  --accent-mid:   #3B6494;
  --border:       #E2DED8;
  --border-light: #EDEBE7;

  --serif:  'IBM Plex Serif', Georgia, serif;
  --sans:   'IBM Plex Sans', system-ui, sans-serif;

  --label-w:  130px;
  --max-w:    880px;
  --col-gap:  36px;
}

/* === BASE === */
html {
  font-size: 16px;
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: var(--sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(30, 58, 95, 0.45);
  transition: text-decoration-color 0.15s, color 0.15s;
}
a:hover {
  color: var(--accent-mid);
  text-decoration-color: currentColor;
}

ul {
  list-style: none;
  padding: 0;
}
ul li {
  position: relative;
  padding-left: 1.3em;
  margin-bottom: 0.45em;
  font-size: 0.875rem;
  color: var(--text);
}
ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--text-light);
}

p {
  font-size: 0.875rem;
  margin-bottom: 0.7em;
  color: var(--text);
}
p:last-child { margin-bottom: 0; }

/* === PAGE === */
.page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 56px 44px 80px;
  background: var(--white);
  min-height: 100vh;
  border-top: 3px solid var(--accent);
}

/* === HEADER === */
.cv-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
  animation: fadeUp 0.5s ease both;
}

.cv-header__identity { flex: 1; }

.cv-name {
  font-family: var(--serif);
  font-size: 2.5rem;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.08;
  color: var(--text);
  margin-bottom: 10px;
}

.cv-tagline {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 18px;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.cv-header-contacts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 4px;
  font-size: 0.825rem;
  color: var(--text-muted);
}
.cv-header-contacts a { font-size: 0.825rem; }
.cv-header-contacts .sep {
  margin: 0 9px;
  color: var(--border);
  user-select: none;
}

.cv-header__photo {
  flex-shrink: 0;
  width: 116px;
  height: 116px;
}
.cv-header__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  border-radius: 3px;
  display: block;
  filter: grayscale(8%);
}

/* === SECTIONS === */
.cv-section {
  display: grid;
  grid-template-columns: var(--label-w) 1fr;
  gap: 0 var(--col-gap);
  padding: 32px 0;
  border-bottom: 1px solid var(--border-light);
}
.cv-section--last { border-bottom: none; }

/* Staggered reveal */
.cv-header          { animation-delay: 0.00s; }
.cv-section:nth-child(1) { animation: fadeUp 0.5s ease both; animation-delay: 0.08s; }
.cv-section:nth-child(2) { animation: fadeUp 0.5s ease both; animation-delay: 0.16s; }
.cv-section:nth-child(3) { animation: fadeUp 0.5s ease both; animation-delay: 0.24s; }
.cv-section:nth-child(4) { animation: fadeUp 0.5s ease both; animation-delay: 0.32s; }
.cv-section:nth-child(5) { animation: fadeUp 0.5s ease both; animation-delay: 0.40s; }
.cv-section:nth-child(6) { animation: fadeUp 0.5s ease both; animation-delay: 0.48s; }
.cv-section:nth-child(7) { animation: fadeUp 0.5s ease both; animation-delay: 0.56s; }

.cv-section__label {
  font-size: 0.675rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--accent);
  padding-top: 3px;
  line-height: 1.4;
}

.cv-section__content { min-width: 0; }

/* === JOB ENTRIES === */
.cv-job {
  margin-bottom: 26px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--border-light);
}
.cv-job:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }

.cv-job__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.cv-job__title {
  font-family: var(--serif);
  font-size: 0.975rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 2px;
}

.cv-job__company {
  font-size: 0.825rem;
  color: var(--text-muted);
}
.cv-job__company a { color: var(--text-muted); font-size: 0.825rem; }
.cv-job__company a:hover { color: var(--accent); }

.cv-job__note,
.cv-job__meta { font-size: 0.775rem; color: var(--text-light); }

.cv-job__meta-line {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.cv-job__date {
  font-size: 0.775rem;
  color: var(--text-light);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 4px;
  letter-spacing: 0.01em;
}

.cv-project-name {
  font-size: 0.725rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  margin: 14px 0 6px;
}

/* === COLLAPSIBLE === */
.cv-details { margin-top: 4px; }

.cv-details summary {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.825rem;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
  padding: 6px 0;
  user-select: none;
  transition: color 0.15s;
}
.cv-details summary:hover { color: var(--accent-mid); }
.cv-details summary::-webkit-details-marker { display: none; }

.cv-details summary::before {
  content: '›';
  font-size: 1.05rem;
  transition: transform 0.2s ease;
  display: inline-block;
  line-height: 1;
}
.cv-details[open] summary::before { transform: rotate(90deg); }

.cv-details__content {
  padding-top: 16px;
  animation: fadeUp 0.3s ease both;
}

/* === EDUCATION === */
.cv-edu { margin-bottom: 18px; }
.cv-edu:last-child { margin-bottom: 0; }

.cv-edu__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 5px;
}
.cv-edu__header strong {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 0.925rem;
}

/* === SKILLS === */
.cv-skills {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cv-skill-group__title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.cv-skill-group p { font-size: 0.85rem; margin: 0; color: var(--text); }

/* === STRENGTHS === */
.cv-strengths { display: flex; flex-direction: column; gap: 14px; }

.cv-strength__title {
  font-family: var(--serif);
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 3px;
}

/* === CONTACTS LIST === */
.cv-contacts-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.cv-contacts-list > div {
  display: flex;
  gap: 14px;
  font-size: 0.875rem;
}
.cv-contact-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-light);
  min-width: 66px;
  padding-top: 2px;
  flex-shrink: 0;
}

/* === EXPERTISE PILLS === */
.cv-expertise {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cv-expertise-item {
  font-size: 0.8rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 3px 10px;
  letter-spacing: 0.01em;
}

/* === FOOTER === */
.cv-footer {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cv-footer-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 14px;
  font-size: 0.825rem;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--border) !important;
  border-radius: 4px;
  background: #F8FAFC;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.cv-footer-link:hover {
  color: var(--accent);
  background: #EEF4F9;
  border-color: var(--accent-mid) !important;
}

.cv-footer-note {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* === ANIMATIONS === */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* === SHORT RESUME BANNER === */
.cv-full-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 5px 12px;
  margin-top: 4px;
  transition: background 0.15s, border-color 0.15s;
  border-bottom: 1px solid var(--border) !important;
}
.cv-full-link:hover {
  background: #F0F4F8;
  border-color: var(--accent-mid) !important;
  color: var(--accent-mid);
}

/* === RESPONSIVE === */
@media (max-width: 680px) {
  .page { padding: 40px 28px 64px; }

  .cv-header {
    flex-direction: column-reverse;
    gap: 28px;
    padding-bottom: 32px;
  }
  .cv-header__photo {
    width: 96px;
    height: 96px;
  }
  .cv-name {
    font-size: 2.35rem;
    letter-spacing: 0;
    line-height: 1.04;
    max-width: 7.5em;
  }
  .cv-tagline {
    font-size: 0.92rem;
    line-height: 1.55;
    max-width: 18em;
  }
  .cv-header-contacts {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 4px 10px;
    align-items: baseline;
    font-size: 0.86rem;
  }
  .cv-header-contacts strong {
    color: var(--text-muted);
  }
  .cv-header-contacts a {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 0.86rem;
  }
  .cv-header-contacts .sep {
    display: none;
  }

  .cv-section {
    grid-template-columns: 1fr;
    gap: 8px 0;
  }
  .cv-section__label { padding-bottom: 2px; }
}

/* === PRINT === */
@media print {
  html { background: white; }
  .page { max-width: none; padding: 16px 24px; box-shadow: none; background: white; }
  .cv-section, .cv-job { break-inside: avoid; }
  a { color: var(--text); border: none !important; }
  .cv-footer { display: none; }
  * { animation: none !important; }
}
