:root {
  --bg: #080818;
  --text: #f3f4f8;
  --muted: #a4a8bd;
  --line: rgba(255, 255, 255, 0.1);
  --glass: rgba(12, 13, 32, 0.62);
  --accent: #ff9a2e;
  --accent-soft: rgba(255, 154, 46, 0.12);
  --accent-line: rgba(255, 154, 46, 0.34);
  --accent-ink: #1c1000;

  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Unbounded", var(--font);

  /* Pola sirine kombi-slike na sirokom ekranu; JS postavlja tacnu vrednost */
  --img-half: 31vh;
  --gutter: 16px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, p { margin: 0; }
ol { margin: 0; padding: 0; list-style: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Pozadina: kombi frejmovi ---------- */

.stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  display: block;
  z-index: 0;
}

.no-js .stage { display: none; }
.no-js body {
  background: var(--bg) url("../frames/f000.webp") center top / cover no-repeat fixed;
}

/* ---------- Gornja traka ---------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top)) var(--gutter) 12px;
  background: linear-gradient(to bottom, rgba(8, 8, 24, 0.75), rgba(8, 8, 24, 0));
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--accent);
  border-radius: 11px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: rgba(8, 8, 24, 0.5);
}

.brand__word {
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.is-scrolled .brand__word {
  opacity: 1;
  transform: none;
}

@media (max-width: 350px) {
  .brand__word { display: none; }
}

.topbar__cta {
  padding: 9px 16px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: rgba(8, 8, 24, 0.45);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.topbar__cta:hover { background: var(--accent-soft); }

/* ---------- Hero sa scroll animacijom ---------- */

.hero {
  position: relative;
  z-index: 1;
  /* 350vh = ~2.5 ekrana skrola za celu animaciju */
  height: 350vh;
}

.hero__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.intro {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  top: max(78px, 11svh);
  text-align: center;
  will-change: opacity, transform;
}

.intro__eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.intro__title {
  margin-top: 10px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(38px, min(12.5vw, 8.5vh), 104px);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

/* Na telefonu "Kombi" i "Majstori" idu u dva reda */
.intro__title span { display: block; }

.intro__lead {
  margin-top: 14px;
  font-size: clamp(15px, 4vw, 19px);
  color: var(--muted);
}

.scrollhint {
  position: absolute;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.scrollhint i {
  position: relative;
  width: 1.5px;
  height: 38px;
  overflow: hidden;
  background: var(--line);
}

.scrollhint i::after {
  content: "";
  position: absolute;
  left: 0;
  top: -40%;
  width: 100%;
  height: 40%;
  background: var(--accent);
  animation: hint 1.8s ease-in-out infinite;
}

@keyframes hint {
  to { top: 100%; }
}

/* ---------- Usluge ---------- */

.services {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.svc {
  /* --e: ulazak 0..1, --x: izlazak 0..1 (postavlja JS) */
  --e: 0;
  --x: 0;
  --dx-in: -110%;
  --dx-out: -24px;

  position: absolute;
  /* uže od ekrana, da se vidi smena levo/desno */
  width: min(340px, calc(100% - 2 * var(--gutter) - 36px));
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--glass);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  opacity: calc(var(--e) - var(--x));
  transform:
    translate3d(calc(var(--dx-in) * (1 - var(--e)) + var(--dx-out) * var(--x)), 0, 0)
    scale(calc(0.94 + 0.06 * var(--e)));
  will-change: transform, opacity;
}

.svc.is-off {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* Mobilni: kartice idu na nebo (gore) i na put (dole), pored kombija nema mesta */
.svc--l { left: var(--gutter); }
.svc--r { right: var(--gutter); --dx-in: 110%; --dx-out: 24px; }
.svc--top { top: max(76px, 10svh); }
.svc--bottom { bottom: calc(max(28px, 5svh) + env(safe-area-inset-bottom)); }

.svc__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.svc__icon svg,
.send svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.svc__num {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.svc__title {
  margin-top: 2px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.25;
}

.svc__text {
  margin-top: 4px;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--muted);
}

/* Sirok ekran: kombi u sredini, kartice izleću sa njegovih strana */
@media (min-aspect-ratio: 11/10) and (min-width: 820px) {
  .intro__title {
    font-size: clamp(40px, min(7vw, 10vh), 112px);
  }

  .intro__title span { display: inline; }

  .svc {
    top: 50%;
    bottom: auto;
    width: clamp(260px, 28vw, 380px);
    translate: 0 -50%;
  }

  .svc--l {
    left: 5vw;
    right: auto;
    --dx-in: -90px;
    --dx-out: -40px;
  }

  .svc--r {
    right: 5vw;
    left: auto;
    --dx-in: 90px;
    --dx-out: 40px;
  }

  .svc--top { top: 40%; }
  .svc--bottom { top: 60%; }
}

@media (min-aspect-ratio: 11/10) and (min-width: 820px) and (max-height: 520px) {
  .svc__icon { display: none; }
  .intro__lead { display: none; }
}

.no-js .hero { height: auto; }
.no-js .hero__sticky { position: static; height: auto; overflow: visible; padding: 90px var(--gutter) 40px; }
.no-js .intro,
.no-js .services,
.no-js .svc { position: static; }
.no-js .services { display: grid; gap: 12px; margin-top: 40vh; }
.no-js .svc { --e: 1; width: auto; transform: none; translate: none; }
.no-js .scrollhint { display: none; }

/* ---------- Kontakt: chat ---------- */

.contact {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 18vh var(--gutter) 0;
  background: linear-gradient(
    to bottom,
    rgba(8, 8, 24, 0) 0,
    rgba(8, 8, 24, 0.6) 22vh,
    rgba(8, 8, 24, 0.72) 100%
  );
}

.contact__inner {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  flex: 1;
}

.insta {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 44px;
  padding: 18px;
  border: 1px solid var(--accent-line);
  border-radius: 22px;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(255, 154, 46, 0.16), rgba(255, 154, 46, 0) 60%),
    rgba(13, 14, 34, 0.84);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--text);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s, border-color 0.2s;
}

.insta:active { transform: scale(0.985); }
.insta:hover { border-color: var(--accent); }
.insta:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

.insta__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffb347, #ff6a3d 55%, #d6249f);
  color: #fff;
}

.insta__icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.insta__icon circle:last-child { fill: currentColor; }

.insta__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.insta__eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.insta__title {
  margin-top: 2px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.25;
}

.insta__text {
  margin-top: 6px;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--muted);
}

.insta__handle {
  margin-top: 10px;
  max-width: 100%;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}

.insta__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 12px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 15px;
  font-weight: 700;
}

.insta__btn i { font-style: normal; }

.contact__title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(28px, 8vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-align: center;
}

.contact__title span {
  display: block;
  color: var(--accent);
}

.contact__sub {
  margin-top: 12px;
  text-align: center;
  color: var(--muted);
}

.chat {
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(13, 14, 34, 0.84);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  overflow: hidden;
}

.chat__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.chat__avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
}

.chat__name { font-weight: 700; }

.chat__status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.chat__status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3ddc84;
  box-shadow: 0 0 0 3px rgba(61, 220, 132, 0.18);
}

.chat__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 14px 16px;
  min-height: 200px;
}

.msg {
  max-width: 86%;
  padding: 10px 14px;
  font-size: 15.5px;
  line-height: 1.45;
}

.msg--in {
  align-self: flex-start;
  border-radius: 18px 18px 18px 6px;
  background: rgba(255, 255, 255, 0.08);
}

.msg--out {
  align-self: flex-end;
  border: 1px solid var(--accent-line);
  border-radius: 18px 18px 6px 18px;
  background: var(--accent-soft);
}

.msg__meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.msg__meta svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.msg__action {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent);
  font-weight: 700;
}

/* Poruke se pojavljuju jedna po jedna kad se chat prikaže */
.js [data-seq] { display: none; }
.js [data-seq].is-shown {
  display: block;
  animation: pop 0.38s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.js .composer.is-shown { display: grid; }

@keyframes pop {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
}

.typing {
  display: none;
  align-self: flex-start;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 18px 18px 18px 6px;
  background: rgba(255, 255, 255, 0.08);
}

.typing.is-on { display: flex; }

.typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: dot 1.1s infinite ease-in-out;
}

.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes dot {
  0%, 60%, 100% { transform: none; opacity: 0.45; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Forma kao odgovor u chatu */
.composer {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  margin-top: 6px;
  padding: 16px;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.field em {
  font-style: normal;
  font-weight: 500;
  color: var(--muted);
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field textarea {
  resize: vertical;
  min-height: 92px;
}

.field input::placeholder,
.field textarea::placeholder { color: rgba(164, 168, 189, 0.6); }

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 154, 46, 0.2);
}

.send {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  margin-top: 4px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, filter 0.15s;
}

.send svg { stroke-width: 1.8; }
.send:hover { filter: brightness(1.08); }
.send:active { transform: scale(0.98); }
.send:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

.composer__note {
  font-size: 12.5px;
  text-align: center;
  color: var(--muted);
}

.footer {
  padding: 48px 0 calc(24px + env(safe-area-inset-bottom));
  font-size: 13px;
  text-align: center;
  color: var(--muted);
}

@media (min-width: 820px) {
  :root { --gutter: 28px; }
  .contact { padding-top: 22vh; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .svc { --dx-in: 0px !important; --dx-out: 0px !important; }
  .scrollhint i::after,
  .typing i { animation: none; }
  .js [data-seq].is-shown { animation: none; }
}
