/* KAV hero – šarka na skrol. Sve klase počinju s .kh- da se ne sudaraju s ostatkom sajta. */
.kh {
  --kh-bg: #0b0c0e;
  --kh-fg: #eceef0;
  --kh-muted: #9aa0a7;
  --kh-line: #2a2d32;
  --kh-red: #e2231a;
  --kh-red-hover: #ff3a30;
  --kh-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --kh-body: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --kh-gutter: max(24px, env(safe-area-inset-left, 0px));
  position: relative;
  height: 520vh;               /* dužina skrola: više = sporija animacija */
  background: var(--kh-bg);
  color: var(--kh-fg);
  font-family: var(--kh-body);
  line-height: 1.55;
}
.kh *, .kh *::before, .kh *::after { box-sizing: border-box; }
.kh-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }

/* Poster je LCP slika (odmah vidljiva); canvas ga prekrije kad se učita prvi kadar */
.kh-poster, .kh-canvas { position: absolute; display: block; }
.kh-canvas { inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .3s; }
.kh.is-ready .kh-canvas { opacity: 1; }
.kh-poster {
  right: 0; top: 50%; transform: translateY(-50%);
  height: 102%; width: auto; aspect-ratio: 1; max-width: none;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 42%);
          mask-image: linear-gradient(to right, transparent 0, #000 42%);
}

.kh-phase {
  position: absolute; left: var(--kh-gutter); top: 50%;
  transform: translateY(-50%);
  width: min(520px, 42vw);
  opacity: 0; pointer-events: none;
}
.kh-phase.is-on { pointer-events: auto; }
.kh-phase:first-of-type { opacity: 1; }
.kh-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--kh-muted); margin: 0 0 18px; display: flex; align-items: center; gap: 10px; }
.kh-eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--kh-red); }
.kh-title { font-family: var(--kh-display); font-weight: 600; line-height: .95; letter-spacing: -0.01em; margin: 0; text-wrap: balance; text-transform: uppercase; color: var(--kh-fg); font-size: clamp(40px, 5vw, 76px); }
.kh-title--xl { font-size: clamp(48px, 6.4vw, 96px); }
.kh-lead { font-size: 18px; color: var(--kh-muted); margin: 22px 0 0; max-width: 40ch; }
.kh-lead strong { color: var(--kh-fg); font-weight: 500; }

.kh-parts { list-style: none; margin: 28px 0 0; padding: 0; border-top: 1px solid var(--kh-line); max-width: 420px; }
.kh-parts li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--kh-line); font-size: 15px; }
.kh-parts span { font-family: var(--kh-display); font-weight: 600; color: var(--kh-red); letter-spacing: .04em; }

.kh-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.kh-btn { display: inline-flex; align-items: center; padding: 15px 22px; font-family: var(--kh-body); font-weight: 600; font-size: 15px; text-decoration: none; border-radius: 2px; border: 1px solid transparent; }
.kh-btn--red { background: var(--kh-red); color: #fff; }
.kh-btn--red:hover { background: var(--kh-red-hover); color: #fff; }
.kh-btn--ghost { border-color: var(--kh-line); color: var(--kh-fg); background: rgba(11,12,14,.5); }
.kh-btn--ghost:hover { border-color: var(--kh-muted); color: var(--kh-fg); }
.kh-btn:focus-visible { outline: 2px solid var(--kh-fg); outline-offset: 3px; }
.kh-phone { margin: 16px 0 0; font-size: 14px; color: var(--kh-muted); font-variant-numeric: tabular-nums; }
.kh-phone a { color: inherit; text-decoration: none; }

.kh-hint { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--kh-muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.kh-hint i { width: 1px; height: 38px; background: linear-gradient(var(--kh-muted), transparent); animation: kh-drip 1.8s ease-in-out infinite; transform-origin: top; }
@keyframes kh-drip { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* Telefon / uspravni ekran */
@media (max-aspect-ratio: 1/1), (max-width: 760px) {
  .kh { --kh-gutter: max(16px, env(safe-area-inset-left, 0px)); height: 460vh; }
  .kh-poster {
    top: 40px; left: 50%; right: auto; transform: translateX(-50%);
    width: min(120vw, 78svh); height: auto;
    -webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent 100%);
            mask-image: linear-gradient(to bottom, #000 45%, transparent 100%);
  }
  .kh-phase { top: auto; bottom: 40px; transform: none; width: auto; right: max(16px, env(safe-area-inset-right, 0px)); }
  .kh-title { font-size: clamp(34px, 9.5vw, 56px); }
  .kh-title--xl { font-size: clamp(40px, 11vw, 64px); }
  .kh-lead { font-size: 16px; margin-top: 14px; }
  .kh-parts { margin-top: 18px; }
  .kh-parts li { padding: 8px 0; font-size: 14px; }
  .kh-ctas { margin-top: 20px; }
  .kh-btn { padding: 13px 18px; font-size: 14px; }
  .kh-hint { display: none; }
}

/* Bez animacija: hero se skraćuje na jedan ekran, ostaje poster i prva poruka */
@media (prefers-reduced-motion: reduce) {
  .kh { height: auto; }
  .kh-stage { position: relative; }
  .kh-canvas, .kh-hint { display: none; }
  .kh-phase { display: none; }
  .kh-phase:first-of-type { display: block; opacity: 1; }
}
