/* ============================================================
   hero.css - landing hero (full-bleed photo banner) and the inner
   page hero used by works.html / work.html / reviews.html.
   ============================================================ */

/* ----- Landing hero -----
   A full-bleed photo slideshow only. It fills the whole viewport
   (minus the sticky header, which it extends behind): at the top of
   the page the photo covers the entire screen. dvh is the mobile
   fallback for the shifting address-bar height. */

.hero {
  position: relative;
  background: var(--dark);
  overflow: hidden; /* keeps the scaled bg images inside */
  margin-top: -64px; /* extends the banner up behind the sticky header */
  height: 100vh;
  height: 100dvh;
}

/* Full-bleed background: a blurred, scaled photo over a gradient
   fallback (which still shows while a photo is missing). */
.hero__bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.55);
  background: linear-gradient(135deg, #2a3140, #10141c),
    repeating-linear-gradient(45deg, #394153 0 14px, #2a3140 14px 28px);
  background-blend-mode: overlay;
  text-transform: uppercase;
}

/* The static background photo of the work page hero (work.js puts a
   single direct img here). Slides of the landing slideshow are nested
   deeper and keep their own styles below. */
.hero__bg > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(4px) brightness(0.75);
  transform: scale(1.05); /* hides the transparent blur edges */
}

/* ----- Landing hero slideshow -----
   All photos are stacked inside .hero__bg; only the active one is
   visible. JS rotates them every 2 s and plays a random Ken Burns
   zoom (start/finish keyframes) on the active slide. */
.hero-slideshow {
  position: absolute;
  inset: 0;
}

.hero-slideshow__slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.7); /* slightly darkened so the overlay pops */
  opacity: 0;
  transition: opacity 0.6s ease;
}

/* Only the visible slide promotes its own layer (the zoom animation
   runs on transform); hidden slides stay cheap. */
.hero-slideshow__slide.is-active {
  opacity: 1;
  will-change: transform, opacity;
}

/* ----- Hero content -----
/* Two independent layers over the slideshow:
   - .hero__subline: the Caveat sub-slogan, exactly centred just
     below the sticky header (the owners asked to keep it separate
     from the rest of the composition);
   - .hero__content: the logo on top and the Dela Gothic One tagline
     below it, 15% below the vertical middle of the hero and 10% off
     the left edge.
   The hero itself is click-through; only the slideshow is there.
   On phones (<=600px) the same blocks are restyled in
   responsive.css. */

.hero__subline {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 15%; /* just below the sticky header */
  z-index: 2;
  margin: 0;
  font-family: "Caveat", "Segoe UI", Roboto, Arial, sans-serif;
  font-weight: 600;
  font-size: clamp(24px, 6.4vw, 48px);
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 1);
  text-align: center;
  pointer-events: none;
  width: 100%;
}

.hero__content {
  position: absolute;
  left: 10%;
  top: 70%;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  max-width: min(1280px, calc(90vw - 48px));
  pointer-events: none;
}

/* Deliberately without a frame; the darkened slides carry the
   readability. Dela Gothic One is a very wide display face (a glyph
   runs ~0.72em), so the tagline caps at 36px: at that size the
   slogan fits the wide field in two lines instead of one word per
   line. */
.hero__content-logo {
  width: 300px;
  max-width: 100%;
  height: auto;
}

.hero__content-title {
  margin: 0;
  font-family: "Dela Gothic One", "IBM Plex Sans", sans-serif;
  font-weight: 400;
  font-size: clamp(26px, 2.6vw, 36px);
  line-height: 1.25;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}

/* ----- Inner page hero (works / work / reviews) ----- */

.page-hero {
  position: relative;
  color: #fff;
  background: var(--dark);
  overflow: hidden; /* keeps the blurred, scaled photo inside */
  margin-top: -64px; /* extends the banner up behind the sticky header */
}

.page-hero__inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 20px 0; /* +64px header height */
  min-height: 300px;
  text-align: center;
}

/* Frosted title plate: the work/reviews page name over the photo. */
.page-hero__title {
  padding: 30px 48px;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: rgba(20, 26, 36, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 38px;
  letter-spacing: 4px;
}

/* Inner pages stack the title plate and the subtitle below it. */
.page-hero__inner {
  flex-direction: column;
  gap: 16px;
}

/* Decorative count line under the plate (filled by works.js /
   reviews.js), e.g. "25 проектов под ключ". */
.page-hero__sub {
  font-size: 14px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #cfd4dd;
}

/* ----- Hero preloader -----
   Fullscreen dark screen with a progress bar that blocks the page while
   the landing slideshow is still loading its photos. Hidden via the
   .preloader--hidden class (js/hero-slideshow.js). */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--dark);
  opacity: 1;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.preloader--hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader__spinner {
  width: 48px;
  height: 48px;
  margin-bottom: 28px;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: preloader-spin 0.8s linear infinite;
}

@keyframes preloader-spin {
  to {
    transform: rotate(360deg);
  }
}

.preloader__progress {
  width: min(420px, 80%);
}

.preloader__progress-bar {
  display: block;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.preloader__progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  transition: width 0.25s ease;
}

.preloader__progress-label {
  margin-top: 12px;
  text-align: center;
  color: #aab2c0;
  font-size: 14px;
}

/* Tiny, barely visible byte/speed detail under the main caption. */
.preloader__progress-detail {
  margin-top: 6px;
  text-align: center;
  color: rgba(255, 255, 255, 0.32);
  font-size: 11px;
}



