/* ─── Home page ───────────────────────────────── */

body.home {
  background: var(--background);
  font-family: 'Source Serif 4', Georgia, serif;
  color: var(--primary);
  line-height: 1.5;
}

.home-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 40px 80px;
}

.home-content {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

.home-main {
  max-width: 800px;
  min-width: 0;
}

.home-sidebar {
  position: sticky;
  top: 40px;
}

.home-nav {
  display: flex;
  flex-direction: row;
  gap: 24px;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.02em;
  padding-top: 4px;
}

.home-nav a {
  color: var(--primary);
  text-decoration: none;
}

.home-nav a:hover {
  opacity: 0.5;
}

.home-photo {
  width: 387px;
  height: 320px;
  overflow: hidden;
  border-radius: 2px;
  margin-bottom: 32px;
  position: relative;
}

.home-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.home-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.4px;
  line-height: 1.2;
  margin-bottom: 12px;
  max-width: 707px;
}

.home-bio {
  max-width: 720px;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 27px;
}

.home-bio a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.home-bio a:hover {
  opacity: 0.6;
}

.home-section-title {
  font-size: var(--font-h2-size);
  font-weight: var(--font-h2-weight);
  letter-spacing: var(--font-h2-tracking);
  line-height: var(--font-h2-line-height);
  margin-bottom: 24px;
}

.home-experience {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.exp-item {
  display: flex;
  flex-direction: column;
}

.exp-header {
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
}

.exp-logo {
  display: inline-block;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.exp-logo--a2a      { background-image: url('../assets/logos/a2a.webp'); }
.exp-logo--ddl      { background-image: url('../assets/logos/ddl.webp'); }
.exp-logo--megafon  { background-image: url('../assets/logos/megafon.webp'); }
.exp-logo--mts      { background-image: url('../assets/logos/mts.webp'); }

.exp-link {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  text-decoration: none;
}

.exp-link:hover {
  opacity: 0.6;
}

.exp-company-name {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.exp-sep {
  color: var(--primary);
  font-weight: 600;
  white-space: nowrap;
}

.exp-role {
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  white-space: nowrap;
}

.exp-date {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}

.exp-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.exp-context {
  font-size: 16px;
  font-weight: 400;
  line-height: 20px;
  color: #737373;
}

.exp-desc {
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: var(--primary);
}

/* ─── Bio hover tooltip ───────────────────────── */

.bio-tip {
  cursor: default;
  border-bottom: 1px dashed var(--secondary);
  text-underline-offset: 3px;
  transition: opacity 0.15s;
}

.bio-tip:hover {
  opacity: 0.7;
}

#bio-tooltip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 100;
  pointer-events: none;

  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.06);

  opacity: 0;
  transform: translateY(6px) scale(0.97);
  transition: opacity 0.18s ease, transform 0.18s ease;
  will-change: transform, opacity;
}

#bio-tooltip.btip--visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

img.btip-photo {
  display: block;
  width: 200px;
  height: 300px;
  object-fit: cover;
  object-position: center 50%;
}

.btip-video-wrap {
  position: relative;
  display: block;
  line-height: 0;
}

video.btip-photo {
  display: block;
  width: 325px;
  height: auto;
}

.btip-playbtn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.18s, background 0.15s, transform 0.15s;
}

.btip-video-wrap.is-paused .btip-playbtn,
.btip-video-wrap:hover .btip-playbtn {
  opacity: 1;
}

.btip-playbtn:hover {
  background: rgba(0, 0, 0, 0.65);
  transform: translate(-50%, -50%) scale(1.08);
}

.btip-closebtn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.18s;
}

.btip-closebtn svg {
  opacity: 0.75;
}

.btip-video-wrap.is-playing .btip-closebtn {
  opacity: 1;
}

.btip-closebtn:hover svg {
  opacity: 1;
}

.btip-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
}

.btip-progress-bar {
  height: 100%;
  width: 0%;
  background: rgba(255, 255, 255, 0.85);
}

/* ─── Responsive (768px) ──────────────────────── */

@media (max-width: 768px) {
  .home-wrap {
    padding: 4px 16px 60px;
  }

  .home-content {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .home-sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    order: -1;
    margin: -4px -16px 0;
    padding: 0 16px;
    background: var(--background);
    border-bottom: 1px solid transparent;
  }

  .home-sidebar.is-stuck {
    border-bottom-color: rgba(0, 0, 0, 0.08);
  }

  .home-nav {
    justify-content: center;
    gap: 0;
    padding: 0;
    font-size: 14px;
  }

  .home-nav a {
    padding: 8px 12px;
    line-height: 24px;
  }

  .home-photo {
    width: 100%;
    height: auto;
    aspect-ratio: 387 / 320;
    margin-bottom: 24px;
  }

  .home-photo img {
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    object-fit: cover;
    object-position: center 20%;
    position: absolute;
    transform: scale(1.2) translateX(5%);
  }

  .home-title {
    font-size: 18px;
    letter-spacing: -0.36px;
    margin-bottom: 8px;
  }

  .home-bio {
    font-size: 14px;
    line-height: 20px;
    margin-bottom: 24px;
  }

  .home-experience {
    gap: 16px;
  }

  .exp-item {
    gap: 4px;
  }

  .exp-header,
  .exp-company-name,
  .exp-role,
  .exp-date,
  .exp-sep {
    font-size: 14px;
    line-height: 20px;
  }

  .exp-context,
  .exp-desc {
    font-size: 14px;
    line-height: 20px;
  }

  .exp-logo {
    width: 20px;
    height: 20px;
  }

  .exp-link {
    flex-wrap: wrap;
    row-gap: 4px;
    column-gap: 6px;
  }

  .exp-company-name + .exp-sep {
    display: none;
  }

  .exp-company-name {
    flex: 1 1 auto;
    min-width: calc(100% - 26px);
    white-space: normal;
  }

  .exp-role,
  .exp-date,
  .exp-sep {
    white-space: normal;
  }

  @keyframes btip-slide-up {
    from {
      opacity: 0;
      transform: translate(-50%, calc(-50% + 20px));
    }
    to {
      opacity: 1;
      transform: translate(-50%, -50%);
    }
  }

  #bio-tooltip.btip--centered {
    position: fixed;
    transform: translate(-50%, -50%);
    transition: none;
    opacity: 0;
    pointer-events: none;
  }

  #bio-tooltip.btip--centered.btip--visible {
    animation: btip-slide-up 0.22s ease forwards;
    pointer-events: auto;
  }

  #bio-tooltip .btip-closebtn {
    opacity: 1;
  }

  video.btip-photo {
    width: calc(100vw - 32px);
    height: auto;
  }
}
