@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=MuseoModerno:ital,wght@0,100..900;1,100..900&display=swap');

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

:root {
  --main-black: #272C2E;
  --main-white: #FAFAF5;
  --reveal-stagger: 90ms;
}

body {
  margin: 0px;
  font-family: 'Montserrat';
  color: var(--main-white);
  background-color: var(--main-black);
}

.header {
  position: fixed;
  font-family: MuseoModerno;
  justify-content: center;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-16px);
  /* було лише translateX(-50%) */
  opacity: 0;
  /* додали */
  width: 100%;
  max-width: 1280px;
  z-index: 1000;
  padding: 12px;
  color: var(--main-black);
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    transform 0.45s ease,
    /* додали */
    opacity 0.45s ease;
  /* додали */
}

/* коли сторінка «завантажена» */
.page-loaded .header {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Контейнер */
.container {
  margin: 0 auto;
  width: 1440px;
}

.header-inner {
  position: relative;
  margin: 0 auto;
  padding: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 24px;
  background: transparent;
  z-index: 1;
}

/* Псевдоелемент з ефектом скла */
.header-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background: rgba(255, 255, 245, 0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow:
    0 8px 8px rgba(0, 0, 0, 0.067),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(255, 255, 255, 0.1),
    inset 0 0 20px 10px rgba(255, 255, 255, 0.6);
  opacity: 1;
  /* невидимий на старті */
  transition: opacity 0.8s ease;
  z-index: -1;
  /* за контентом */
}

/* Додаткові світлові ефекти */
.header-inner::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  right: 0;
  height: 1px;
  width: 93%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, rgb(255, 255, 255),
      transparent,
      rgb(255, 255, 255),
      transparent);
  border-radius: 100px;
  opacity: 1;
  transition: opacity 0.4s ease;
  z-index: -1;
  
}

/* При скролі */
.header-inner.scrolled::before,
.header-inner.scrolled::after {
  opacity: 1;
}

/* Ліва частина */
.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  /* 16px */
}

.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  /* 10px */
}

.logo-icon {
  width: 48px;
  /* 48px */
  height: 48px;
  /* 48px */
}

.header-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

/* Текст логотипу */
.logo-text {
  line-height: 0.95;
  font-family: 'MuseoModerno';
  color: var(--main-black);
  font-weight: 500;
  font-size: 18px;
  justify-content: center;
}

.email {
  font-size: 16px;
  font-weight: 450;
  color: var(--main-black);
  text-decoration: none;
  font-family: 'MuseoModerno';
  position: relative;
  top: -2px;
  /* -2px */
}

/* Права частина */
.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-right: 12px;
}

/* базові посилання */
.header-right a {
  position: relative;
  text-decoration: none;
  color: var(--main-black);
  opacity: .8;
  font-weight: 450;
  font-size: 16px;
  transition: color .3s ease, opacity .3s ease;
}

/* спільна база для псевдоелемента */
.header-right a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -75%; /* близько під текстом */
  transform: translateX(-50%) scaleY(0); /* сховано (вертикально) */
  transform-origin: top center; /* випливає зверху-вниз */
  opacity: 0;
  width: 0;
  height: 0;
  background: currentColor;
  transition:
    width .25s ease,
    height .25s ease,
    border-radius .25s ease,
    opacity .25s ease,
    transform .25s ease;
}

/* hover: ПІВКРАПКА (півколо, що дивиться догори) */
.header-right a:hover:not(.active)::after {
  width: 80%;                 /* діаметр крапки */
  height: 5px;                 /* половина діаметра */
  border-radius: 999px 999px 0 0;/* півколо вгору */
  opacity: 1;
  transform: translateX(-50%) scaleY(1);
}

/* active: ПІВЛІНІЯ (50%+ ширини тексту), з закругленими краями */
.header-right a.active {
  color: var(--main-black);
  opacity: 1;
  line-height: normal;
}

.header-right a.active::after {
  width: 110%;                  /* половина ширини тексту */
  height: 5px;                 /* товщина лінії */
  border-radius: 999px 999px 0 0; /* округлі краї */
  opacity: 1;
  transform: translateX(-50%) scaleY(1);
}

/* HOVER на активному — стискаємо лінію назад у півкрапку,
   але лише якщо НЕ just-activated */
.header-right a.active:hover:not(.just-activated)::after {
  width: 80%;
  height: 5px;
  border-radius: 10px 10px 0 0;
}

/* Щойно активували — тримаємо лінію навіть на hover */
.header-right a.active.just-activated:hover::after {
  width: 110%;
  height: 5px;
  border-radius: 999px 999px 0 0;
}

/* (необов’язково) фокус з клавіатури — як hover */
.header-right a:focus-visible:not(.active)::after {
  width: 80%;
  height: 5px;
  border-radius: 10px 10px 0 0;
  opacity: 1;
  transform: translateX(-50%) scaleY(1);
}

.globe {
  font-size: 19px;
  cursor: pointer;
}

.header .header-right a,
.header .email,
.header .logo-text {
  transition: color 0.3s ease;
}

.header.scrolled .header-right a,
.header.scrolled .email,
.header.scrolled .logo-text {
  color: var(--main-black);
  opacity: 1;
}

.header .logo-icon .divider{
  transition: color 0.3s ease;
  color: white;
}

.header.scrolled .logo-icon .divider{
  color: var(--main-black);
}

.hero {
  position: relative;
  overflow: hidden;
  height: 100vh;
  background: var(--main-white);
  background-attachment: fixed;
  background-size: cover;
  background-repeat: no-repeat;
  color: var(--main-black);
  display: flex;
  align-items: center;
  z-index: 0;
  height: 820px;
}

.hero .container {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 64px;
  z-index: 0;
  /* відстань між лівою і правою частинами */
  padding: 0px 12px 0px 12px;
}

.tags {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  /* 10px */
}

.tags span {
  padding: 6px 24px;
  /* 14px 36px */
  background: linear-gradient(90deg,
        rgba(29, 77, 103, 0.05) 0%,
        rgba(11, 29, 38, 0.05) 37%,
        rgba(0, 0, 0, 0.05) 59%,
        rgba(9, 11, 45, 0.05) 96%);
  border-radius: 12px;
  /* 12px */
  font-family: 'MuseoModerno', sans-serif;
  font-optical-sizing: auto;
  font-weight: 450;
  font-size: 14px;
  color: var(--main-black);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: 0.3s;
}

.handle {
  color: var(--main-black);
  font-family: "MuseoModerno", sans-serif;
  font-size: 1em;
  font-style: normal;
  font-weight: 450;
  margin-top: 16px;
}

.hero h1 {
  font-family: 'MuseoModerno', sans-serif;
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
}

.hero .location {
  font-weight: 450;
  font-size: 16px;
  margin-top: 3px;
  font-family: MuseoModerno;
}

.hero .desc {
  font-size: 16px;
  font-weight: 450;
  line-height: 1.6;
  max-width: 600px;
  margin-top: 18px;
  color: var(--main-black);
  width: 480px;
  line-height: normal;
}

/* Переваги */
.benefits {
  margin-top: 22px;
  list-style: none;
  padding: 0;
  font-size: 16px;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 29px;
}

.benefits li {
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.6;
}

.benefits .icon {
  width: 20px;
  height: 20px;
}

/* Соцмережі */
.socials {
  display: flex;
  gap: 8px;
  font-size: 24px;
  margin-top: 19px;
}

.socials a {
  text-decoration: none;
  color: white;
  opacity: 0.8;
  transition: 0.2s;
}

.socials a:hover {
  opacity: 1;
  transform: scale(1.05);
}

/* Кнопки */
.buttons {
  margin-top: 6px;
  margin-bottom: 3px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Загальні стилі для обох кнопок */
.buttons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-style: normal;
  font-weight: 550;
  font-family: 'Montserrat', sans-serif;
  text-decoration: none;
  border-radius: 48px;
  line-height: 1;
  padding: 14px 28px;
  height: 46px;
  transition: 0.3s ease;
  box-sizing: border-box;
}

/* Primary кнопка */
.primary {
  background-color: var(--main-black);
  color: var(--main-white);
  border: none;
}

.primary:hover {
  background-color: var(--main-black);
  opacity: 0.9;
}

.secondary {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--main-black);
}

.secondary:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

/* Рейтинг */
.rating {
  font-size: 14px;
  font-style: italic;
  color: var(--main-black);
}

/* Початковий стан тільки для елементів лівої колонки з класом reveal-hero */
.left .reveal-hero {
  opacity: 0;
  transform: translateY(16px);
  will-change: opacity, transform;
}

/* Запуск анімації після додавання body.page-loaded */
.page-loaded .left .reveal-hero {
  animation: fadeUpHero 600ms ease both;
  animation-delay: calc(var(--reveal-stagger) * var(--i, 0));
}

@keyframes fadeUpHero {
  to {
    opacity: 1;
    transform: none;
  }
}

/* Accessibility: без анімацій, якщо так налаштовано в системі */
@media (prefers-reduced-motion: reduce) {

  .left .reveal-hero,
  .page-loaded .left .reveal-hero {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }

  .header {
    transform: translateX(-50%) !important;
    opacity: 1 !important;
    transition: none !important;
  }
}

/* === ПРАВА ЧАСТИНА HERO === */
.right {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  position: relative;
  z-index: 1;
  top: -80px;
}

.avatar-wrapper {
  position: relative;
  width: 460px;
  aspect-ratio: 1 / 1;
  z-index: 0;
}

.avatar {
  width: 460px;
  height: auto;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 2;
}

.rotating-circle {
  position: absolute;
  top: 0;
  left: 0;
  width: 1200px;
  height: 1200px;
  z-index: 1;
  pointer-events: none;
  animation: spin 9s linear infinite;
  filter: drop-shadow(5px 0 32.3px rgba(0, 0, 0, 0.05));
}

.full-width-container {
  /* твоя ширина */
  margin: 0 auto;
  box-sizing: border-box;
}

.portfolio-slider {
  margin-top: -64px;
  /* або скільки треба, якщо треба overlap */
  width: 100%;
  position: relative;
}

.slides {
  display: flex;
  gap: 32px;
  overflow-x: auto;
  scroll-behavior: smooth;
  width: 100%;
  padding-bottom: 8px;
  /* щоб не різав box-shadow на мобільному */
}

.slide {
  min-width: 320px;
  max-width: 450px;
  aspect-ratio: 16/9;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 32px -8px rgba(32, 39, 73, 0.13);
  overflow: hidden;
  display: flex;
  align-items: stretch;
  justify-content: center;
  transition: box-shadow 0.2s, border 0.2s, transform 0.2s;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.3s;
}

.badge-img {
  width: 460px;
  height: auto;
}

/* Базові властивості бейджа */
#badge.badge-swing {
  display: inline-block;
  transform-origin: 50% -80px;
  /* як маятник */
  will-change: transform, opacity;
  cursor: pointer;
}

/* Одноразове хитання (лише обертання, без зсувів, щоб не скакало) */
.swing {
  animation: swingOnce 1200ms ease-out;
}

/* Поважаємо налаштування користувача щодо анімацій */
@media (prefers-reduced-motion: reduce) {

  .swing,
  #badge {
    animation: none !important;
    transition: none !important;
  }
}

/* === МОБІЛЬНА АДАПТАЦІЯ === */
@media (max-width: 768px) {
  .hero .container {
    flex-direction: column;
    text-align: center;
  }

  .hero .right {
    order: -1;
  }

  .buttons {
    justify-content: center;
  }

  .tags {
    justify-content: center;
    flex-wrap: wrap;
  }
}

@keyframes dropInSwing {
  0% {
    transform: translateY(-60vw) rotate(-16deg);
  }

  20% {
    transform: translateY(0) rotate(10deg);
  }

  30% {
    transform: rotate(-8deg);
  }

  45% {
    transform: rotate(6deg);
  }

  60% {
    transform: rotate(-4deg);
  }

  75% {
    transform: rotate(3deg);
  }

  100% {
    transform: rotate(0deg);
    opacity: 1;
  }
}

/* Невелике маятникове хитання */
@keyframes swingOnce {
  0% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(5deg);
  }

  50% {
    transform: rotate(-5deg);
  }

  75% {
    transform: rotate(2.5deg);
  }

  100% {
    transform: rotate(0deg);
  }
}


:root {
  --pre-bg: #FAFAF5;
  --pre-fg: #000;

  --name-gap: 12px;

  --logo-in-ms: 450ms;
  --row-left-ms: 550ms;
  --name-delay: 880ms;
  --name-ms: 420ms;

  --pre-top-ease: cubic-bezier(.22, 1, .23, 1);
  --pre-slide-ms: 1200ms;
  --pre-slide-delay: 800ms;
}

/* overlay */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: var(--pre-bg);
  color: var(--pre-fg);
  transform: translateY(0);
  transition: transform var(--pre-slide-ms) var(--pre-top-ease) var(--pre-slide-delay);
  will-change: transform;
}

.preloader.to-top {
  transform: translateY(-100%);
}

.pl-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* РЯД: спочатку зсунутий вправо (JS ставить --row-shift), потім анімує до 0 */
.pl-row {
  display: inline-flex;
  align-items: center;
  transform: translateX(var(--row-shift, 0px));
  /* <-- задає JS */
  animation: rowShiftLeft var(--row-left-ms) ease-out var(--logo-in-ms) forwards;
}

/* ЛОГО поверх тексту, м'яка поява */
.pl-logo {
  z-index: 2;
  opacity: 0;
  transform: scale(.92);
  animation: logoIn var(--logo-in-ms) ease-out forwards;
}

/* Clip-зона праворуч від лого: забезпечує "виїзд з-під лого" + відступ */
.pl-name-clip {
  overflow: hidden;
  padding-left: var(--name-gap);
  /* відступ між лого і текстом */
}

/* Назва: старт під логотипом, виїзд праворуч */
.pl-name {
  font-family: 'MuseoModerno', sans-serif;
  font-weight: 700;
  font-size: clamp(24px, 5vw, 42px);
  letter-spacing: .02em;
  white-space: nowrap;
  transform: translateX(-100%);
  /* повністю під лого */
  opacity: 0;
  will-change: transform, opacity;
  animation: nameOut var(--name-ms) ease-out var(--name-delay) forwards;
}

/* KEYFRAMES */
@keyframes logoIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes rowShiftLeft {
  to {
    transform: translateX(0);
  }
}

@keyframes nameOut {
  0% {
    opacity: 0;
    transform: translateX(-100%);
  }

  20% {
    opacity: 1;
  }

  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {

  .pl-logo,
  .pl-row,
  .pl-name {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .preloader {
    transition: none !important;
  }
}

#badge {
  position: relative;
}

.status-led {
  position: absolute;
  left: 84px;
  /* підстрой під свою позицію */
  bottom: 78px;
  /* підстрой */
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #19C37D;
  box-shadow: 0 0 0 0 rgba(25, 195, 125, .45);
  animation: ledPulse 3s ease-out infinite;
}

.status-led::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 2px solid #06D428;
  opacity: .6;
  animation: ledRing 3s cubic-bezier(.19, 1, .22, 1) infinite;
}

@keyframes ledPulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(25, 195, 125, .45);
  }

  50% {
    transform: scale(1.08);
    box-shadow: 0 0 0 10px rgba(25, 195, 125, 0);
  }
}

@keyframes ledRing {
  0% {
    transform: scale(1);
    opacity: .6;
  }

  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}