/* —— Hero —— */

.hero {
  position: relative;
  min-height: calc(100dvh - var(--header-h) - var(--safe-top));
  min-height: calc(100svh - var(--header-h) - var(--safe-top));
  display: grid;
  place-items: center;
  color: var(--c-text-inverse);
  background:
    radial-gradient(circle at 20% 20%, rgba(141, 110, 99, 0.35), transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(62, 39, 35, 0.55), transparent 50%),
    linear-gradient(160deg, #2c1b18 0%, #3e2723 45%, #5d4037 100%);
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background-color: #1f1a17;
  pointer-events: none;
}

.hero__media-img {
  position: absolute;
  left: 0;
  right: 0;
  top: -7%;
  width: 100%;
  height: 114%;
  object-fit: cover;
  object-position: center;
}

/* Віньєтка + читабельність тексту поверх будь-якого фото */
.hero__media::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse 72% 62% at 50% 42%,
      rgba(31, 26, 23, 0.12) 0%,
      rgba(31, 26, 23, 0.32) 52%,
      rgba(31, 26, 23, 0.68) 100%
    ),
    linear-gradient(
      180deg,
      rgba(31, 26, 23, 0.38) 0%,
      rgba(31, 26, 23, 0.14) 42%,
      rgba(31, 26, 23, 0.55) 100%
    );
}

.hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-5);
  padding:
    max(var(--space-6), var(--safe-top))
    max(var(--space-4), var(--safe-left))
    var(--space-8)
    max(var(--space-4), var(--safe-right));
  max-width: 42rem;
}

/* Staggered entrance */

.hero__reveal {
  opacity: 0;
  animation: hero-fade-up 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero__reveal--1 { animation-delay: 0ms; }
.hero__reveal--2 { animation-delay: 200ms; }
.hero__reveal--3 { animation-delay: 400ms; }
.hero__reveal--4 { animation-delay: 600ms; }
.hero__reveal--5 { animation-delay: 800ms; }

@keyframes hero-fade-up {
  from {
    opacity: 0;
    transform: translate3d(0, 1.25rem, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* Печатка: обертання + світловий blend */

.hero__logo-wrap {
  display: grid;
  place-items: center;
  width: min(12.5rem, 52vw);
}

.hero__logo {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 50%;
  /* Біла печатка на темному hero (PNG — чорна графіка) */
  filter: brightness(0) invert(1) drop-shadow(0 10px 28px rgba(0, 0, 0, 0.4));
  animation: hero-spin 28s linear infinite;
  will-change: transform;
  -webkit-user-drag: none;
  user-select: none;
}

/* На фото: screen прибирає білий квадрат, печатка як світловий відбиток */
.hero--has-image .hero__logo {
  filter: invert(1) drop-shadow(0 10px 28px rgba(0, 0, 0, 0.4));
  mix-blend-mode: screen;
}

@keyframes hero-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.hero__title {
  margin: 0;
  color: var(--c-text-inverse);
  font-family: var(--ff-display);
  font-size: clamp(2.35rem, 6.5vw, 3.75rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.35),
    0 12px 40px rgba(0, 0, 0, 0.45);
}

.hero__text {
  margin: 0;
  max-width: 28rem;
  color: rgba(253, 251, 247, 0.8);
  font-family: var(--ff-base);
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  line-height: 1.55;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

/* CTA: Premium cream + стрілка завжди видима */

.hero__cta {
  margin-top: var(--space-3);
  gap: 0.65rem;
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(253, 251, 247, 0.35);
  background: var(--c-bg);
  color: var(--c-primary);
  font-family: var(--ff-base);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition:
    background 300ms ease,
    color 300ms ease,
    border-color 300ms ease,
    box-shadow 300ms ease,
    transform 300ms ease;
}

.hero__cta-arrow {
  display: inline-block;
  opacity: 1;
  transform: translateX(0);
  font-weight: 600;
  transition: transform 300ms ease;
}

.hero__cta:hover,
.hero__cta:focus-visible {
  background: linear-gradient(135deg, #5d4037 0%, #3e2723 55%, #2c1b18 100%);
  border-color: transparent;
  color: var(--c-text-inverse);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.38);
  transform: translateY(-1px);
}

.hero__cta:hover .hero__cta-arrow,
.hero__cta:focus-visible .hero__cta-arrow {
  transform: translateX(4px);
}

.hero__cta:active {
  transform: translateY(0);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

/* Scroll: вертикальна лінія з відблиском */

.hero__scroll {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: max(1.25rem, calc(var(--safe-bottom) + 0.75rem));
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 3.5rem;
  transform: translateX(-50%);
  color: rgba(253, 251, 247, 0.7);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.hero__scroll:focus-visible {
  outline: 2px solid rgba(253, 251, 247, 0.75);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

.hero__scroll-track {
  position: relative;
  display: block;
  width: 1px;
  height: 48px;
  overflow: hidden;
  background: rgba(253, 251, 247, 0.28);
  border-radius: 1px;
}

.hero__scroll-fill {
  position: absolute;
  top: -45%;
  left: 0;
  width: 100%;
  height: 42%;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(253, 251, 247, 0.95) 50%,
    transparent 100%
  );
  animation: hero-scroll-fill 2.2s ease-in-out infinite;
}

@keyframes hero-scroll-fill {
  0% {
    transform: translateY(0);
    opacity: 0;
  }

  20% {
    opacity: 1;
  }

  80% {
    opacity: 1;
  }

  100% {
    transform: translateY(220%);
    opacity: 0;
  }
}

/* Tablet */

@media (max-width: 900px) {
  .hero__logo-wrap {
    width: min(10.5rem, 48vw);
  }

  .hero__content {
    gap: var(--space-4);
  }
}

/* Mobile + iOS Safari */

@media (max-width: 640px) {
  .hero {
    min-height: calc(100svh - var(--header-h) - var(--safe-top));
  }

  .hero__logo-wrap {
    width: min(9.25rem, 46vw);
  }

  .hero__title {
    font-size: clamp(2rem, 9vw, 2.5rem);
    letter-spacing: 0.03em;
  }

  .hero__text {
    font-size: 1rem;
    max-width: 22rem;
  }

  .hero__cta {
    min-height: 2.875rem;
    width: auto;
    max-width: 100%;
    padding-inline: 1.35rem;
  }

  .hero__scroll-track {
    height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__reveal {
    opacity: 1;
    animation: none;
  }

  .hero__logo {
    animation: none;
  }

  .hero__scroll-fill {
    animation: none;
    top: 30%;
    opacity: 0.85;
  }

  .hero__cta,
  .hero__cta-arrow {
    transition: none;
  }

  .hero__cta:hover,
  .hero__cta:focus-visible {
    transform: none;
  }

  .hero__cta:hover .hero__cta-arrow,
  .hero__cta:focus-visible .hero__cta-arrow {
    transform: none;
  }
}
