/* ══════════════════════════════════════════
   Tokens
══════════════════════════════════════════ */
:root {
  --white:          #FFFFFF;
  --bg:             #FAFAFA;
  --gray-light:     #F5F5F5;
  --gray-mid:       #E0E0E0;
  --gray-muted:     #8A8A8A;
  --gray-dim:       #B0B0B0;
  --text:           #111111;
  --text-secondary: #444444;
  --accent:         #2563EB;
  --accent-bg:      #EFF6FF;
  --accent-border:  #BFDBFE;
  --border:         #E8E8E8;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --r:    6px;
  --r-md: 8px;

  --max-w: 940px;

  color-scheme: light dark;
}

/* ══════════════════════════════════════════
   Reset
══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
.print-only { display: none; }
.screen-only { display: inline; }
a:hover { text-decoration: underline; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font); }

/* ══════════════════════════════════════════
   Layout
══════════════════════════════════════════ */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

/* ══════════════════════════════════════════
   Top nav
══════════════════════════════════════════ */
.topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  height: 44px;
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.topnav--visible {
  transform: translateY(0);
  opacity: 1;
}

.topnav__inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 0;
}

.topnav__brand {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
  margin-right: auto;
}
.topnav__brand:hover { text-decoration: none; }

.topnav__links {
  display: flex;
  gap: 20px;
  list-style: none;
  margin-right: 20px;
}

.topnav__link {
  font-size: 13px;
  color: var(--gray-muted);
  text-decoration: none;
  transition: color 0.12s;
  letter-spacing: -0.01em;
}
.topnav__link:hover { color: var(--text); text-decoration: none; }

.topnav__cta {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ══════════════════════════════════════════
   Buttons
══════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: opacity 0.12s;
  white-space: nowrap;
  font-family: var(--font);
  letter-spacing: -0.01em;
}
.btn:hover { opacity: 0.8; text-decoration: none; }

.btn--sm { padding: 5px 12px; font-size: 12px; }

.btn--primary { background: var(--accent); color: var(--white); border-color: var(--accent); }
.btn--secondary { background: var(--gray-light); color: var(--text); border-color: var(--border); }
.btn--ghost { background: transparent; color: var(--gray-muted); border-color: var(--border); }
.btn--hh { background: transparent; color: var(--gray-muted); border-color: var(--border); transition: background 0.18s, color 0.18s, border-color 0.18s; }
.btn--hh:hover { opacity: 1; background: #ff0002; color: #fff; border-color: #ff0002; }

/* ══════════════════════════════════════════
   Hero
══════════════════════════════════════════ */
.hero {
  background: var(--white);
  padding: 40px 0 32px;
  border-bottom: 1px solid var(--border);
}

.hero__inner {
  display: flex;
  align-items: center;
  gap: 32px;
}

.photo-placeholder {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  background: var(--gray-light);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 700;
  color: var(--gray-muted);
  flex-shrink: 0;
  letter-spacing: -0.03em;
}

/* Swap placeholder for real photo: add <img src="photo.jpg" alt="…"> inside .hero__photo */
.hero__photo img {
  width: 192px;
  height: 192px;
  border-radius: 50%;
  object-fit: cover;
}

.hero__content { flex: 1; min-width: 0; }

.hero__name {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 6px;
}

.hero__role {
  font-size: 20px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.hero__meta {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  letter-spacing: 0;
}

.hero__subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.sep { margin: 0 8px; color: var(--gray-mid); }

.hero__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.hero__actions .btn {
  padding: 6px 14px;
  font-size: 12px;
}

.hero__actions .btn--secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--gray-muted);
}
.hero__actions .btn--secondary:hover { color: var(--text); opacity: 1; }

.hero__actions .btn--ghost {
  font-size: 11px;
  color: var(--gray-dim);
  border-color: transparent;
}
.hero__actions .btn--ghost:hover { color: var(--gray-muted); opacity: 1; }
.hero__actions .btn--hh { border-color: transparent; }

/* ══════════════════════════════════════════
   Sections — all separated by border, no bg swaps
══════════════════════════════════════════ */
.section {
  padding: 28px 0;
  border-top: 1px solid var(--border);
}

/* Section headings */
.eyebrow {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 20px;
  line-height: 1.15;
}
.eyebrow--center { text-align: center; }

/* Body text paragraphs */
.body-text {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.65;
}
.body-text:last-child { margin-bottom: 0; }
.body-text--accent-italic {
  color: var(--accent);
  font-style: italic;
}

/* ══════════════════════════════════════════
   Two-column layout (summary)
══════════════════════════════════════════ */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

/* Contacts */
.contacts-list { margin-bottom: 16px; }

.contacts-list__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.contacts-list__item:first-child { border-top: 1px solid var(--border); }

.icon { width: 16px; height: 16px; color: var(--gray-dim); flex-shrink: 0; }

.link { color: var(--accent); }
.link:hover { text-decoration: underline; }

/* Meta rows */
.meta-label {
  font-weight: 700;
  color: var(--text);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
  white-space: nowrap;
}

.about-meta-row {
  display: flex;
  gap: 24px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.about-meta-item {
  display: flex;
  flex-direction: column;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

#clients + #about { border-top: none; padding-top: 12px; }

/* ══════════════════════════════════════════
   Brands
══════════════════════════════════════════ */
.brands {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 36px;
  flex-wrap: wrap;
}

.brand {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-dim);
  letter-spacing: -0.02em;
  transition: color 0.15s;
  user-select: none;
}
.brand:hover { color: var(--text-secondary); }

.brand[data-brand="yandex"]:hover  { color: #FC3F1D; }
.brand[data-brand="avito"]:hover   { color: #111111; }
.brand[data-brand="x5tech"]:hover  { color: #95FF42; }
.brand[data-brand="winline"]:hover { color: #FF6A13; }
.brand[data-brand="ferrero"]:hover { color: #C8A951; }

/* ══════════════════════════════════════════
   Skills grid
══════════════════════════════════════════ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px 48px;
}

.skill-block {
  padding: 0;
}

.skill-block__label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.skill-block__desc {
  font-size: 14px;
  color: var(--gray-muted);
  line-height: 1.55;
}

.skills-taglines {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.skills-tagline {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -0.3px;
}

.skills-tagline:last-child {
  color: var(--accent);
}

/* ══════════════════════════════════════════
   Workflow
══════════════════════════════════════════ */
.workflow {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}

.workflow__step {
  padding: 16px 14px;
  border-right: 1px solid var(--border);
}

.workflow__step:last-child {
  border-right: none;
}

.workflow__num {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.workflow__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.workflow__desc {
  font-size: 12px;
  color: var(--gray-muted);
  line-height: 1.45;
}

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.tag {
  display: inline-block;
  padding: 3px 10px;
  background: var(--gray-light);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
}

/* ══════════════════════════════════════════
   Experience / Timeline
══════════════════════════════════════════ */
.timeline { display: flex; flex-direction: column; gap: 0; }

.job {
  padding: 20px 0 20px 18px;
  border-left: 2px solid var(--accent);
  margin-left: 0;
  position: relative;
}

/* dot on timeline */
.job::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 24px;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--white);
  outline: 1px solid var(--accent);
}

/* Separate jobs with a gap + faint connector */
.job + .job {
  margin-top: 4px;
}

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

.job__title-group { min-width: 0; }

.job__role {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.job__company {
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  margin-top: 1px;
}

.job__period {
  font-size: 13px;
  color: var(--gray-muted);
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 3px;
  font-variant-numeric: tabular-nums;
}

.job__about {
  font-size: 14px;
  color: var(--gray-muted);
  margin-bottom: 8px;
  font-style: italic;
}

.job__desc {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.6;
}

.job__sublabel {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
  margin: 10px 0 6px;
}

.job__bullets { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; }

.job__bullets li {
  font-size: 15px;
  color: var(--text-secondary);
  padding-left: 14px;
  position: relative;
  line-height: 1.55;
}

.job__bullets li::before {
  content: '•';
  position: absolute;
  left: 0;
  font-weight: 700;
  color: var(--text);
  font-weight: 300;
}

.job__subsection { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }

/* ══════════════════════════════════════════
   Pet Projects
══════════════════════════════════════════ */
.projects-list {
  display: flex;
  flex-direction: column;
}

.project-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.project-item:first-child {
  border-top: 1px solid var(--border);
}

.project-item__title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  line-height: 1.2;
}

.project-item .tags {
  margin-top: 0;
  margin-bottom: 8px;
}

.project-item__desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ══════════════════════════════════════════
   Footer
══════════════════════════════════════════ */
.footer {
  padding: 18px 0;
  border-top: 1px solid var(--border);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--gray-muted);
}

/* ══════════════════════════════════════════
   Responsive — Tablet
══════════════════════════════════════════ */
@media (max-width: 768px) {
  .topnav__links { display: none; }

  .hero__inner { flex-direction: column; align-items: flex-start; gap: 16px; }

  .two-col { grid-template-columns: 1fr; gap: 24px; }

  .skills-grid { grid-template-columns: repeat(2, 1fr); }

  .workflow { grid-template-columns: repeat(3, 1fr); }
  .workflow__step:nth-child(3) { border-right: none; }
  .workflow__step:nth-child(4),
  .workflow__step:nth-child(5),
  .workflow__step:nth-child(6) { border-top: 1px solid var(--border); }

  .projects-grid { grid-template-columns: 1fr; }

  .job__header { flex-direction: column; gap: 2px; }

  .footer__inner { flex-direction: column; gap: 4px; text-align: center; }

  .brands { gap: 20px; }
}

/* ══════════════════════════════════════════
   Responsive — Mobile
══════════════════════════════════════════ */
@media (max-width: 480px) {
  .hero { padding: 0 0 16px; }
  .hero__photo {
    width: calc(100% + 40px);
    margin-left: -20px;
    margin-right: -20px;
    margin-bottom: 16px;
  }
  .hero__photo picture,
  .hero__photo img {
    display: block;
    width: 100%;
    height: 100vw;
    border-radius: 0;
    object-fit: cover;
    object-position: center top;
  }
  .hero__name { font-size: 24px; }
  .hero__role { font-size: 17px; margin-bottom: 6px; }
  .hero__subtitle { font-size: 14px; margin-bottom: 8px; }
  .hero__meta { font-size: 11px; margin-bottom: 14px; }

  .section { padding: 16px 0; }

  .skills-grid { grid-template-columns: 1fr; }

  .workflow { grid-template-columns: repeat(2, 1fr); }
  .workflow__step:nth-child(3) { border-right: 1px solid var(--border); }
  .workflow__step:nth-child(2),
  .workflow__step:nth-child(4),
  .workflow__step:nth-child(6) { border-right: none; }
  .workflow__step:nth-child(3),
  .workflow__step:nth-child(4),
  .workflow__step:nth-child(5),
  .workflow__step:nth-child(6) { border-top: 1px solid var(--border); }

  .topnav__cta .btn--ghost { display: none; }
}

/* ══════════════════════════════════════════
   Dark theme (OS prefers-color-scheme)
══════════════════════════════════════════ */
@media (prefers-color-scheme: dark) {
  :root {
    --white:          #0F0F0F;
    --bg:             #0F0F0F;
    --gray-light:     #1A1A1A;
    --gray-mid:       #2E2E2E;
    --gray-muted:     #888888;
    --gray-dim:       #666666;
    --text:           #EBEBEB;
    --text-secondary: #A0A0A0;
    --accent:         #4D8EFF;
    --accent-bg:      #0F1F3D;
    --accent-border:  #1A3560;
    --border:         #242424;
  }

  .topnav {
    background: rgba(15, 15, 15, 0.96);
  }

  /* avito hover was #111 — invisible on dark bg */
  .brand[data-brand="avito"]:hover { color: #DEDEDE; }
}

/* ══════════════════════════════════════════
   Print / PDF — A4 Landscape, max 3 pages
══════════════════════════════════════════ */
@media print {
  @page {
    size: A4 portrait;
    margin: 10mm 14mm;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Hide nav and PDF button */
  .topnav { display: none; }
  .btn--ghost { display: none; }

  /* Hero compact */
  .hero { padding: 0 0 8px; border-bottom: 1px solid #ddd; }
  .hero__inner { gap: 16px; }
  .photo-placeholder { width: 80px; height: 80px; }
  .hero__actions .btn--ghost { display: none; }
  .btn--hh { display: none; }
  .hero__meta { font-size: 14.25px; }

  /* Sections tight */
  .section { padding: 12px 0; border-top: 1px solid #e0e0e0; }
  .eyebrow { margin-bottom: 10px; }

  /* Two-col */
  .two-col { gap: 20px; }
  .contacts-list__item { padding: 4px 0; }

  /* print/screen toggle */
  .print-only { display: inline; }
  .screen-only { display: none; }

  /* Telegram + email: plain link, no button chrome */
  .hero__actions .btn--primary {
    background: none;
    border: none;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
  }
  .hero__actions .btn--secondary {
    background: none;
    border: none;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    color: var(--text-secondary);
    text-decoration: none;
  }

  /* Brands */
  .brands { justify-content: center; gap: 18px; }
  /* .brand[data-brand="yandex"]  { color: #FC3F1D; }
  .brand[data-brand="avito"]   { color: #222222; }
  .brand[data-brand="x5tech"]  { color: #95FF42; }
  .brand[data-brand="winline"] { color: #FF6A13; }
  .brand[data-brand="ferrero"] { color: #C8A951; } */

  /* Skills - 4 cols in print */
  .skills-grid { grid-template-columns: repeat(4, 1fr); }
  .skill-block { padding: 8px; }

  /* Workflow */
  .workflow { grid-template-columns: repeat(6, 1fr); }
  .workflow__step { padding: 8px; border-top: none !important; }
  .workflow__step:nth-child(3) { border-right: 1px solid var(--border) !important; }
  .workflow__step:nth-child(2),
  .workflow__step:nth-child(4),
  .workflow__step:nth-child(6) { border-right: none !important; }

  /* Jobs */
  .job { padding: 6px 0 6px 12px; page-break-inside: avoid; }
  .job + .job { margin-top: 2px; }
  .job::before { width: 6px; height: 6px; left: -4px; top: 10px; }
  .job__bullets { gap: 1px; }
  .job__subsection { padding-top: 6px; margin-top: 6px; }

  /* Projects */
  .project-item { padding: 6px 0; }

  .footer { display: none; }
}
