/* =========================================================
   COOLKOKI — stilovi stranice
   Boje su varijable odmah ispod. Prekidač Hlađenje / Grijanje
   mijenja samo boje iz skupine "način rada".
   ========================================================= */

/* Stranica je uvijek svijetla. */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --ink: #0c2a35;
  --muted: #4c6b78;
  --line: #d2e1e7;
  --unit: #ffffff;
  --unit-edge: #d6e4ea;
  --night: #0c2a35;
  --night-text: #e8f2f5;
  --night-muted: #a7c1ca;
  --display: #062029;
  --photo-bg: #dfeaee;
  --heat: #ff8a2a;           /* glavni gumb */
  --heat-hover: #ff9c4a;
  --on-heat: #0c2a35;
  /* način rada: hlađenje (ljetni dan) */
  --frost: #eef4f6;          /* zid u ilustraciji, zaglavlje, radovi */
  --accent: #139fc1;
  --accent-text: #0a7591;
  --led: #4fd6f2;
  --flow: #18a3c4;
  --sky-a: #bfe3f2;
  --sky-b: #e9f6fb;
  --sun: #ffe3a3;
  --sea: #4aa3c6;
  --island: #8db5a5;
  --island-far: #b7d0c6;

  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
/* način rada: grijanje (zimska večer) */
:root[data-mode="heat"] {
  --frost: #f7eee7;
  --accent: #ec7418;
  --accent-text: #a84b07;
  --led: #ffb066;
  --flow: #ff8a2a;
  --sky-a: #f2c4a0;
  --sky-b: #fde9d6;
  --sun: #ffb36b;
  --sea: #6b97ad;
  --island: #a48b83;
  --island-far: #c8b3a9;
}

/* ---------- osnova ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  font-weight: 420;
  font-stretch: 100%;
  line-height: 1.6;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent-text); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 {
  margin: 0;
  font-stretch: 118%;
  font-weight: 760;
  line-height: 1.06;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.wrap {
  width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
.skip {
  position: absolute; left: -9999px; top: 10px; z-index: 100;
  background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 8px; text-decoration: none;
}
.skip:focus { left: 10px; }

/* boje koje se mijenjaju s načinom rada prelaze glatko */
.top, .hero, #radovi { transition: background-color 0.6s ease; }
.services svg, .num, .display { transition: color 0.6s ease, border-color 0.6s ease; }

/* ---------- gumbi ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px;
  border: 1.5px solid transparent; border-radius: 999px;
  font: inherit; font-weight: 650; font-stretch: 106%; line-height: 1;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 0.2s ease, transform 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 19px; height: 19px; flex: none; }
.btn-heat { background: var(--heat); color: var(--on-heat); }
.btn-heat:hover { background: var(--heat-hover); }
.btn-line { background: transparent; color: var(--ink); border-color: currentColor; }
.btn-line:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.btn-sm { min-height: 42px; padding: 0 18px; }

/* ---------- zaglavlje ---------- */
body::before {
  content: ""; position: fixed; inset: 0 0 auto; z-index: 31;
  height: env(safe-area-inset-top, 0px);
  background: var(--frost);
}
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30;
  background: var(--frost);
  background: color-mix(in srgb, var(--frost) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.3) blur(12px);
  backdrop-filter: saturate(1.3) blur(12px);
}
.top-in { display: flex; align-items: center; gap: 30px; min-height: 68px; }
.brand {
  margin-right: auto;
  color: var(--ink); text-decoration: none;
  font-size: 1.32rem; font-weight: 860; font-stretch: 125%; letter-spacing: 0.02em; line-height: 1;
}
.nav { display: none; gap: 28px; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 540; }
.nav a:hover { color: var(--accent-text); }
@media (min-width: 860px) { .nav { display: flex; } }
@media (max-width: 400px) {
  .top-in { gap: 12px; }
  .brand { font-size: 1.12rem; }
  .top .btn-sm { padding: 0 14px; }
}

/* =========================================================
   NASLOVNI DIO — ilustracija sobe s klimom u pozadini
   ========================================================= */
.hero { position: relative; overflow: hidden; background: var(--frost); transition: background-color 0.6s ease; }
.scene { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; }
.scene .s-wall { fill: var(--frost); }
.scene .sky-a { stop-color: var(--sky-a); }
.scene .sky-b { stop-color: var(--sky-b); }
.scene .s-sun { fill: var(--sun); }
.scene .s-sea { fill: var(--sea); }
.scene .s-island { fill: var(--island); }
.scene .s-island-far { fill: var(--island-far); }
.scene .s-led { fill: var(--led); }
.scene .flow path { fill: none; stroke: var(--flow); stroke-width: 4; stroke-linecap: round; opacity: 0.6; }
.scene .s-wall, .scene .s-sun, .scene .s-sea, .scene .s-island, .scene .s-island-far, .scene .s-led { transition: fill 0.6s ease, opacity 0.4s ease; }
.scene stop { transition: stop-color 0.6s ease; }
.scene .flow path { transition: stroke 0.6s ease; }
.hero-in { position: relative; z-index: 2; padding-block: 6px 56px; }
@media (min-width: 600px) { .scene { aspect-ratio: 16 / 7; } }
@media (min-width: 1100px) {
  .hero { display: flex; align-items: center; min-height: clamp(600px, 44vw, 720px); }
  .scene { position: absolute; right: 0; bottom: 0; width: min(1180px, 88%); height: auto; aspect-ratio: 2 / 1; overflow: visible; }
  .hero-in { padding-block: 48px calc(min(1180px, 88vw) * 0.075 + 40px); }
  .hero-text { max-width: min(620px, 46vw); }
}

.unit-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 12px;
  margin-bottom: clamp(24px, 3.4vw, 36px);
}
.display {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 8px 14px 8px 12px; border-radius: 12px;
  background: var(--display); color: var(--led);
  font-size: 1.15rem; font-weight: 640; font-stretch: 72%;
  font-variant-numeric: tabular-nums; line-height: 1;
  text-shadow: 0 0 12px color-mix(in srgb, var(--led) 55%, transparent);
  transition: opacity 0.5s ease, color 0.6s ease;
}
.display-icon { width: 16px; height: 16px; }
.led {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--led); box-shadow: 0 0 8px var(--led);
  transition: background-color 0.6s ease, box-shadow 0.6s ease, opacity 0.4s ease;
}

.modes {
  display: inline-flex; padding: 4px; gap: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}
.mode {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 40px; padding: 0 16px 0 13px;
  border: 0; border-radius: 999px; background: transparent;
  color: var(--muted); font: inherit; font-size: 0.95rem; font-weight: 600; font-stretch: 104%;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}
.mode svg { width: 17px; height: 17px; }
.mode:hover { color: var(--ink); }
.mode[aria-pressed="true"] {
  background: var(--unit); color: var(--ink);
  box-shadow: 0 1px 2px rgba(12, 42, 53, 0.12), 0 4px 12px -6px rgba(12, 42, 53, 0.25);
}
.mode[aria-pressed="true"] svg { color: var(--accent); }

.hero h1 {
  font-size: clamp(2.2rem, 1.2rem + 2.6vw, 3.1rem);
  font-stretch: 116%; font-weight: 790;
  line-height: 1.04; letter-spacing: -0.018em;
}
.hero h1 span { display: block; }
.tagline {
  margin-top: 20px; max-width: 30ch;
  font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.6rem);
  font-weight: 600; font-stretch: 106%; line-height: 1.3;
  text-wrap: balance;
}
.lead {
  margin-top: 14px; max-width: 46ch;
  color: var(--muted);
  font-size: clamp(1.08rem, 1rem + 0.45vw, 1.32rem); line-height: 1.5;
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

/* uključivanje pri učitavanju (samo s JavaScriptom) */
.js .hero:not(.on) .display { opacity: 0.3; }
.js .hero:not(.on) .led, .js .hero:not(.on) .scene .s-led { opacity: 0; }
.scene .flow.blow path { animation: puhni 1.6s cubic-bezier(.3, .7, .3, 1) both; }
.scene .flow.blow path:nth-child(2) { animation-delay: .08s; }
.scene .flow.blow path:nth-child(3) { animation-delay: .16s; }
.scene .flow.blow path:nth-child(4) { animation-delay: .24s; }
.scene .flow.blow path:nth-child(5) { animation-delay: .32s; }
@keyframes puhni { from { stroke-dasharray: 220; stroke-dashoffset: 220; } to { stroke-dasharray: 220; stroke-dashoffset: 0; } }
.js .scene .flow:not(.blow) path { opacity: 0; }

@media (max-width: 560px) {
  .mode { padding: 0 13px 0 11px; font-size: 0.9rem; }
  .actions .btn { width: 100%; }
}

/* =========================================================
   SEKCIJE
   ========================================================= */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section-tight { padding-top: 0; }
.head { display: grid; gap: 12px 48px; align-items: end; }
.section h2 { font-size: clamp(1.95rem, 1.3rem + 2.1vw, 3rem); }
.intro { max-width: 46ch; color: var(--muted); text-wrap: pretty; }
@media (min-width: 900px) {
  .head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .head .intro { justify-self: end; text-align: right; text-wrap: balance; }
}

/* usluge */
.services {
  margin-top: clamp(36px, 5vw, 60px);
  display: grid; gap: 40px 44px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
}
.services svg { width: 44px; height: 44px; color: var(--accent); }
.services h3 { margin-top: 18px; font-size: 1.24rem; font-stretch: 110%; line-height: 1.2; }
.services p { margin-top: 8px; color: var(--muted); }

/* marke uređaja */
.brands {
  margin-top: clamp(56px, 7vw, 96px); padding-top: clamp(28px, 4vw, 40px);
  border-top: 1px solid var(--line);
}
.brands h3 { font-size: clamp(1.35rem, 1.1rem + 0.9vw, 1.75rem); font-stretch: 112%; }
.brands-intro { margin-top: 8px; color: var(--muted); max-width: 62ch; }
.brand-grid {
  margin-top: 24px;
  display: grid; gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.brand-grid li {
  display: grid; place-items: center; min-height: 76px; padding: 12px 10px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--bg);
  text-align: center;
  font-size: clamp(1.15rem, 1rem + 0.7vw, 1.45rem);
  font-weight: 780; font-stretch: 122%; letter-spacing: -0.005em; line-height: 1.1;
  color: #23434f;
}
.brand-grid .brand-more {
  border-style: dashed; color: var(--muted);
  font-size: 1rem; font-weight: 500; font-stretch: 100%; letter-spacing: 0;
}
@media (min-width: 640px) { .brand-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 900px) { .brand-grid li { min-height: 92px; } }

/* koraci */
.steps {
  margin-top: clamp(36px, 5vw, 60px);
  display: grid; gap: 30px;
  counter-reset: korak;
}
.steps li { position: relative; padding-left: 64px; }
.num {
  position: absolute; left: 0; top: -4px;
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 50%;
  border: 2px solid var(--accent); color: var(--accent);
  background: var(--bg);
  font-weight: 760; font-stretch: 112%; font-size: 1.1rem;
}
.steps li:not(:last-child)::before {
  content: ""; position: absolute; left: 22px; top: 46px; bottom: -30px;
  width: 2px; background: var(--line);
}
.steps h3 { font-size: 1.2rem; font-stretch: 110%; line-height: 1.25; padding-top: 7px; }
.steps p { margin-top: 6px; color: var(--muted); max-width: 40ch; }
@media (min-width: 900px) {
  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
  .steps li { padding-left: 0; padding-top: 70px; }
  .num { top: 0; }
  .steps li:not(:last-child)::before { left: 62px; right: -18px; top: 22px; bottom: auto; width: auto; height: 2px; }
  .steps h3 { padding-top: 0; }
}

/* radovi */
#radovi { background: var(--frost); }
.jobs {
  margin-top: clamp(36px, 5vw, 56px);
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
}
.job-open {
  position: relative; display: block; width: 100%;
  aspect-ratio: 1 / 1; padding: 0;
  border: 0; border-radius: 18px; overflow: hidden;
  background: var(--photo-bg);
  color: #fff; text-align: left; font: inherit;
  cursor: zoom-in;
}
.job-open img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.job-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: grid; gap: 2px;
  padding: 56px 18px 16px;
  background: linear-gradient(to top, rgba(4, 18, 24, 0.86), rgba(4, 18, 24, 0.55) 45%, transparent);
}
.job-title { font-size: 1.12rem; font-weight: 700; font-stretch: 108%; line-height: 1.25; }
.job-meta { font-size: 0.93rem; color: rgba(255, 255, 255, 0.82); }
.job-count {
  position: absolute; right: 12px; top: 12px;
  padding: 5px 11px; border-radius: 999px;
  background: rgba(4, 18, 24, 0.7); color: #fff;
  font-size: 0.82rem; font-weight: 600; line-height: 1.2;
}
@media (min-width: 900px) {
  .jobs { grid-auto-flow: dense; }
  .jobs.featured > li:first-child { grid-column: span 2; grid-row: span 2; }
  .jobs.featured > li:first-child .job-open { height: 100%; aspect-ratio: auto; }
  .jobs.featured > li:first-child .job-title { font-size: 1.45rem; }
}
.jobs-more { margin-top: 36px; }
.jobs-note { margin-top: 28px; color: var(--muted); }

/* o nama */
.about { display: grid; gap: 40px; }
.prose h2 { margin-bottom: 24px; }
.prose p { max-width: 60ch; }
.prose p + p { margin-top: 1em; }
.night-card {
  position: relative; margin: 0; overflow: hidden;
  display: flex; align-items: flex-end; min-height: 300px;
  padding: clamp(28px, 4vw, 48px);
  border-radius: 28px;
  background: var(--night); color: var(--night-text);
}
.night-sky { position: absolute; inset: 0; width: 100%; height: 100%; }
.night-sky .moon { fill: #f3e7c3; }
.night-sky .moon-cut { fill: var(--night); }
.night-sky .star { fill: #f3e7c3; }
.night-card blockquote { position: relative; margin: 0; }
.night-card blockquote p {
  font-size: clamp(1.75rem, 1.2rem + 1.9vw, 2.7rem);
  font-weight: 760; font-stretch: 116%; letter-spacing: -0.012em; line-height: 1.08;
  text-wrap: balance;
}
@media (min-width: 900px) {
  .about { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 72px; align-items: center; }
}

/* kontakt */
.night { background: var(--night); color: var(--night-text); }
.night .intro { color: var(--night-muted); }
.night a { color: inherit; }
.contact { display: grid; gap: 48px; align-items: end; }
.phone-big {
  display: inline-block; margin-top: 30px;
  font-size: clamp(2.1rem, 1.1rem + 4.3vw, 4.5rem);
  font-weight: 780; font-stretch: 118%; letter-spacing: -0.01em; line-height: 1;
  text-decoration: none; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.phone-big:hover { color: var(--heat); }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.night .btn-line { color: var(--night-text); }
.night .btn-line:hover { background: rgba(255, 255, 255, 0.08); }
.contact-list { margin: 0; display: grid; gap: 22px; }
.contact-list dt { color: var(--night-muted); font-size: 0.92rem; }
.contact-list dd { margin: 2px 0 0; font-weight: 560; font-size: 1.1rem; }
@media (min-width: 900px) {
  .contact { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .contact-list { padding-left: 40px; border-left: 1px solid rgba(255, 255, 255, 0.14); }
}

.foot { background: var(--night); color: var(--night-muted); padding: 0 0 36px; font-size: 0.92rem; }
.foot-in {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.foot-in p { min-width: 0; }
.impresum { line-height: 1.7; }
.impresum strong { color: var(--night-text); font-weight: 650; }
.foot a { color: inherit; }

/* =========================================================
   PREGLED FOTOGRAFIJA
   ========================================================= */
.viewer {
  width: min(100vw - 20px, 1080px);
  max-width: none; max-height: calc(100dvh - 20px);
  padding: 0; border: 0; border-radius: 18px;
  background: var(--bg); color: var(--ink);
  overflow: hidden;
}
.viewer[open] { display: flex; flex-direction: column; }
.viewer::backdrop { background: rgba(3, 16, 22, 0.86); }
.viewer-stage {
  position: relative; flex: 1 1 auto; min-height: 0;
  height: min(70dvh, 720px);
  background: #041219;
  touch-action: pan-y;
}
.viewer-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: scale-down; }
.viewer-btn {
  position: absolute; display: grid; place-items: center;
  width: 46px; height: 46px; border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, 0.92); color: #0c2a35;
  cursor: pointer;
}
.viewer-btn:hover { background: #fff; }
.viewer-btn svg { width: 22px; height: 22px; }
.viewer-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.viewer-next { right: 12px; top: 50%; transform: translateY(-50%); }
.viewer-close { right: 12px; top: 12px; }
.viewer-info { padding: 18px 22px 22px; display: grid; gap: 4px; }
.viewer-info h3 { font-size: 1.2rem; font-stretch: 108%; line-height: 1.25; }
.viewer-meta { color: var(--muted); font-size: 0.97rem; }
.viewer-desc { margin-top: 6px; max-width: 70ch; }
.viewer-count { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
  .viewer { width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .viewer-stage { height: auto; }
}

/* bez animacija za one koji ih ne žele */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .scene .flow:not(.blow) path { opacity: 0.6; }
}
@media (prefers-reduced-motion: no-preference) {
  .viewer[open] { animation: otvori 0.22s ease-out; }
}
@keyframes otvori { from { opacity: 0; transform: scale(0.97); } }
