/* ==========================================================================
   HERO — Figma node 1:6 "Desktop - 8"
   Kartica 1325.483×742.933 @ radius 24, sadržaj centriran, mere @1440px.
   ========================================================================== */

.hero {
  /* Figma: kartice ispod hera počinju 20px nakon hero kartice (862.5 → 882.5) */
  padding: clamp(4.5rem, 6vw, 5.5rem) var(--gutter) 1.25rem;
}

/* ---- Kartica sa pozadinom ------------------------------------------------ */
.hero__card {
  position: relative;
  isolation: isolate;
  max-width: var(--container);
  margin-inline: auto;
  width: 100%;                 /* definitivna širina — bez nje min/max-height preko aspect-ratio razvuče i širinu */
  aspect-ratio: 1325.483 / 742.933;
  min-height: 30rem;
  /* Kontejner je 1824px, pa bi aspect-ratio iz Figme dao karticu preko 1000px
     visine. Ovim hero uvek ostaje unutar ekrana. */
  max-height: 72svh;
  --hero-radius: var(--radius-card);
  border-radius: var(--hero-radius);
  overflow: hidden;
  /* Safari na iOS-u ne seče WebGL canvas i animirane slojeve po border-radius-u
     (uglovi ostanu oštri). clip-path seče pouzdano, i to u istom radijusu. */
  clip-path: inset(0 round var(--hero-radius));
}

.hero__bg-wrap,
.hero__smoke,
.hero__grain,
.hero__veil {
  position: absolute;
  inset: 0;
  z-index: -1;
}

/* Slika je snimljen kadar WebGL svetla (posebno za telefon i desktop), pa
   kad se canvas upali preko nje, prelaz se ne primećuje. Bez WebGL-a ostaje
   kao statična pozadina. */
.hero__bg-wrap picture {
  display: contents;
}

.hero__bg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- Svetlo (WebGL, hero-bg.js) ------------------------------------------
   Klasa je ostala .hero__smoke iz ranije verzije (dim). Canvas je u 40%
   rezolucije; browser ga razvuče, što omekša svetlo. Dok se prvi kadar ne
   iscrta, vidi se slika ispod (isti kadar). */
.hero__smoke {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.hero__card.has-smoke .hero__smoke {
  opacity: 1;
}

/* Filmsko zrno preko dima — SVG šum, statičan, u punoj rezoluciji */
.hero__grain {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  mix-blend-mode: overlay;
  opacity: 0.75;
  pointer-events: none;
}

.hero__veil {
  background-color: var(--c-veil);
}

/* ---- Sadržaj ------------------------------------------------------------- */
.hero__content {
  display: flex;
  flex-flow: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding-inline: 1.5rem;
  text-align: center;
  color: var(--c-white);
}

/* Naslov — Figma: 72/78, tracking -1.44px (-0.02em), bold, max 582.296px */
.hero__title {
  max-width: 582.296px;
  /* Optička korekcija: linija fonta ima ~0.17em praznog prostora iznad
     velikih slova, pa je vidljiv razmak gore bio veći nego ispod dugmadi
     (156 vs 144px). Ovim su gore i dole isti. */
  margin-top: -0.17em;
  margin-bottom: clamp(0.625rem, 0.83vw, 0.75rem);
  font-size: clamp(2.25rem, 5vw, 4.5rem);
  font-weight: 700;
  line-height: 1.0833;
  letter-spacing: -0.02em;
}

/* Podnaslov — Figma: 18/22, max 445.337px */
.hero__lead {
  max-width: 445.337px;
  margin-bottom: clamp(1.5rem, 2.22vw, 2rem);
  font-size: clamp(1rem, 1.25vw, 1.125rem);
  line-height: 1.2222;
  text-wrap: pretty;
}

/* CTA — Figma: razmak 12px */
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

/* ---- Desktop: visinu određuje sadržaj + 144px gore i dole ---------------
   Umesto aspect-ratio iz Figme i max-height: 72svh (odluka 29.9.2026). */
@media screen and (min-width: 768px) {
  .hero__card {
    aspect-ratio: auto;
    min-height: 0;
    max-height: none;
  }

  .hero__content {
    height: auto;
    padding-block: 144px;
  }
}

/* ---- Mobilni ------------------------------------------------------------- */
@media screen and (max-width: 767px) {
  /* Kartica ispunjava ekran ispod headera: 100svh minus gornji padding
     sekcije (4.5rem) i donji (1.25rem). Radijus kao ostale kartice na
     telefonu (portfolio, usluge) — 24px je na 350px širine delovao preveliko. */
  .hero__card {
    display: flex;
    flex-flow: column;
    aspect-ratio: auto;
    min-height: max(30rem, calc(100svh - 5.75rem));
    max-height: none;
    --hero-radius: 16px;
  }

  /* height: 100% ne radi uz min-height roditelja, pa flex: 1 — sadržaj
     ispunjava karticu i ostaje vertikalno centriran */
  .hero__content {
    flex: 1;
    height: auto;
    padding: 3rem 1rem;
  }

  /* Tipografija — dva nivoa: naslov (dominantan) i telo (podnaslov i dugmad
     iste veličine) */
  .hero__title {
    margin-bottom: 1rem;
    font-size: clamp(1.875rem, 9.6vw, 2.625rem);   /* 30.7 @320 → 37.4 @390 → 41.3 @430 */
    line-height: 1.05;
    letter-spacing: -0.03em;
  }

  .hero__lead {
    max-width: 30ch;
    margin-bottom: 2.25rem;
    font-size: 1rem;                   /* 16px */
    line-height: 1.45;
    color: rgb(255 255 255 / 0.78);
  }

  .hero__actions {
    flex-flow: column;
    align-self: stretch;
    gap: 8px;
  }

  .hero__actions .btn {
    width: 100%;
    padding-inline: 16px;
    font-size: 1rem;                   /* 16px — isto kao podnaslov */
    white-space: normal;
    text-align: center;
  }
}
