/* CUBICUS d.o.o. - shared styles */
:root {
  --bg: #F4F1EC;
  --bg-soft: #ECE8E0;
  --ink: #0F1614;
  --ink-soft: #4A524F;
  --accent: #0C8C8C;
  --accent-deep: #076B6B;
  --line: rgba(15, 22, 20, 0.12);
  --card: #FFFFFF;
  --radius: 18px;
  --font-display: "Fraunces", serif;
  --font-body: "DM Sans", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.container { width: min(1180px, 92%); margin: 0 auto; }

h1, h2, h3, .display { font-family: var(--font-display); font-weight: 500; line-height: 1.08; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.6rem, 5.6vw, 4.6rem); }
h2 { font-size: clamp(2rem, 3.6vw, 3rem); }
h3 { font-size: 1.35rem; line-height: 1.25; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--ink-soft); max-width: 58ch; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent-deep);
  margin-bottom: 18px;
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--accent); }

/* ---------- Navigation ---------- */
.nav-wrap {
  position: sticky; top: 0; z-index: 60;
  background: rgba(244, 241, 236, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0;
}
.brand { font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; letter-spacing: 0.02em; }
.brand span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; }
.nav-links a { font-size: 0.94rem; font-weight: 500; color: var(--ink-soft); transition: color 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a.active { position: relative; }
.nav-links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 2px; background: var(--accent); border-radius: 2px;
}
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--accent); color: #FFFFFF !important;
  font-weight: 600; font-size: 0.95rem;
  padding: 12px 26px; border-radius: 999px;
  border: 1px solid var(--accent);
  transition: background 0.25s, transform 0.25s;
}
.btn:hover { background: var(--accent-deep); transform: translateY(-2px); }
.btn.ghost { background: transparent; color: var(--ink) !important; border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); background: transparent; }
.btn.on-dark { background: #FFFFFF; color: var(--ink) !important; border-color: #FFFFFF; }
.btn.on-dark:hover { background: var(--bg); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 6px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; transition: 0.3s; }

/* ---------- Hero ---------- */
.hero { padding: clamp(60px, 9vw, 110px) 0 clamp(40px, 6vw, 70px); position: relative; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; }
.hero h1 em { font-style: italic; color: var(--accent-deep); }
.hero-actions { display: flex; gap: 16px; margin-top: 34px; flex-wrap: wrap; }
.hero-side { position: relative; }
.hero-side img { border-radius: var(--radius); aspect-ratio: 4 / 5; object-fit: cover; }

/* Spinning ISO chip */
.spin-chip {
  position: absolute; bottom: -34px; left: -34px;
  width: 128px; height: 128px; z-index: 5;
}
.spin-chip svg { width: 100%; height: 100%; animation: spin 16s linear infinite; }
.spin-chip .chip-core {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
}
.spin-chip .chip-core svg { width: 44px; height: 44px; animation: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spin-chip svg { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Wide feature image + floating stats ---------- */
.feature-band { padding: clamp(30px, 5vw, 60px) 0 110px; }
.feature-media { position: relative; }
.feature-media > img {
  width: 100%; height: clamp(320px, 46vw, 520px);
  object-fit: cover; border-radius: var(--radius);
}
.float-cards {
  position: absolute; left: 4%; right: 4%; bottom: -64px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.stat-card {
  background: var(--card); border-radius: var(--radius);
  padding: 26px 28px; box-shadow: 0 18px 44px rgba(15, 22, 20, 0.12);
  border: 1px solid var(--line);
}
.stat-card .num { font-family: var(--font-display); font-size: 2.2rem; font-weight: 600; color: var(--accent-deep); }
.stat-card .lbl { font-size: 0.92rem; color: var(--ink-soft); margin-top: 4px; }

/* ---------- Logo marquee ---------- */
.marquee-section { padding: 54px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; }
.marquee-label { text-align: center; font-size: 0.8rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 30px; }
.marquee { overflow: hidden; position: relative; }
.marquee::before, .marquee::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 110px; z-index: 2; pointer-events: none;
}
.marquee::before { left: 0; background: linear-gradient(90deg, var(--bg), transparent); }
.marquee::after { right: 0; background: linear-gradient(270deg, var(--bg), transparent); }
.marquee-track { display: flex; align-items: center; gap: 74px; width: max-content; animation: scroll 32s linear infinite; }
.marquee-track img { height: 44px; width: auto; opacity: 0.85; filter: grayscale(18%); transition: 0.3s; }
.marquee-track img:hover { opacity: 1; filter: none; }
@keyframes scroll { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; flex-wrap: wrap; width: auto; justify-content: center; } }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 8vw, 110px) 0; }
.section-head { max-width: 640px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head.center .eyebrow { justify-content: center; }
.section-head p { margin-top: 16px; }

/* Services grid */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.service-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 34px 30px; display: flex; flex-direction: column; gap: 14px;
  transition: transform 0.3s, box-shadow 0.3s;
}
.service-card:hover { transform: translateY(-6px); box-shadow: 0 20px 40px rgba(15, 22, 20, 0.1); }
.service-card .icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: rgba(12, 140, 140, 0.1); color: var(--accent-deep);
  display: flex; align-items: center; justify-content: center;
}
.service-card p { color: var(--ink-soft); font-size: 0.97rem; flex: 1; }
.card-link { font-weight: 600; font-size: 0.93rem; color: var(--accent-deep); display: inline-flex; align-items: center; gap: 8px; }
.card-link svg { transition: transform 0.25s; }
.service-card:hover .card-link svg { transform: translateX(5px); }

/* Kako radimo: three equal cards */
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.how-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px 30px; }
.how-card .icon {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; margin-bottom: 20px;
}
.how-card p { color: var(--ink-soft); font-size: 0.97rem; margin-top: 10px; }

/* Detail blocks with sticky aside */
.detail-block { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(36px, 6vw, 80px); align-items: start; }
.detail-block.flip { grid-template-columns: 1.1fr 0.9fr; }
.detail-aside { position: sticky; top: 110px; }
.detail-aside img { border-radius: var(--radius); aspect-ratio: 4 / 4.6; object-fit: cover; }
.detail-body h2 { margin-bottom: 18px; }
.detail-body p { color: var(--ink-soft); margin-bottom: 18px; }
.detail-body h3 { margin: 30px 0 12px; }
.check-list { list-style: none; margin: 8px 0 20px; }
.check-list li {
  position: relative; padding-left: 34px; margin-bottom: 12px; color: var(--ink-soft);
}
.check-list li::before {
  content: ""; position: absolute; left: 0; top: 4px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(12, 140, 140, 0.14);
}
.check-list li::after {
  content: ""; position: absolute; left: 6px; top: 9px;
  width: 8px; height: 5px;
  border-left: 2px solid var(--accent-deep); border-bottom: 2px solid var(--accent-deep);
  transform: rotate(-45deg);
}

/* Inline positions row (Usluge) */
.positions-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 20px; }
.positions-row span {
  background: var(--card); border: 1px solid var(--line);
  padding: 8px 18px; border-radius: 999px; font-size: 0.88rem; font-weight: 500;
}

/* Timeline */
.timeline { border-left: 2px solid rgba(12, 140, 140, 0.3); margin: 10px 0 10px 8px; padding-left: 34px; }
.timeline-item { position: relative; padding-bottom: 34px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ""; position: absolute; left: -43px; top: 6px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); border: 4px solid var(--bg);
}
.timeline-item .year { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; color: var(--accent-deep); }
.timeline-item p { color: var(--ink-soft); margin-top: 6px; }

/* Testimonial */
.testimonial-section { background: var(--bg-soft); }
.testimonial {
  max-width: 800px; margin: 0 auto; text-align: center;
}
.testimonial blockquote {
  font-family: var(--font-display); font-size: clamp(1.4rem, 2.6vw, 2rem);
  line-height: 1.35; font-style: italic;
}
.testimonial .who { margin-top: 26px; font-size: 0.95rem; color: var(--ink-soft); }
.testimonial .who strong { color: var(--ink); font-weight: 600; display: block; }
.quote-mark { color: var(--accent); font-family: var(--font-display); font-size: 3.6rem; line-height: 1; display: block; margin-bottom: 10px; }

/* Stats band */
.stats-band { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; text-align: center; }
.stats-band .num { font-family: var(--font-display); font-size: clamp(2.4rem, 4.4vw, 3.6rem); font-weight: 600; color: var(--accent-deep); }
.stats-band .lbl { color: var(--ink-soft); font-size: 0.95rem; margin-top: 6px; }

/* ---------- Dark CTA ---------- */
.cta-section { padding: 0 0 clamp(64px, 8vw, 110px); }
.cta-inner {
  background: linear-gradient(135deg, #0F1614 0%, #123A38 55%, #0C8C8C 130%);
  color: #F4F1EC; border-radius: 26px;
  padding: clamp(50px, 7vw, 90px) clamp(28px, 6vw, 80px);
  text-align: center; position: relative; overflow: hidden;
}
.cta-inner::before {
  content: ""; position: absolute; right: -120px; top: -120px;
  width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(12, 140, 140, 0.35), transparent 70%);
}
.cta-inner h2 { margin-bottom: 16px; }
.cta-inner p { color: rgba(244, 241, 236, 0.72); max-width: 56ch; margin: 0 auto 34px; }

/* ---------- Page hero (subpages) ---------- */
.page-hero { padding: clamp(56px, 8vw, 96px) 0 clamp(30px, 4vw, 50px); }
.page-hero .lead { margin-top: 18px; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(36px, 5vw, 64px); align-items: start; }
.contact-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; margin-bottom: 18px;
}
.contact-card h3 { margin-bottom: 8px; display: flex; align-items: center; gap: 12px; }
.contact-card h3 svg { color: var(--accent-deep); flex: none; }
.contact-card p, .contact-card a { color: var(--ink-soft); }
.contact-card a:hover { color: var(--accent-deep); }
.legal-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.legal-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal-table td:first-child { font-weight: 600; white-space: nowrap; width: 38%; }
.legal-table td:last-child { color: var(--ink-soft); }

/* ---------- Footer ---------- */
footer { background: var(--ink); color: rgba(244, 241, 236, 0.8); padding: 64px 0 30px; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 40px; margin-bottom: 46px; }
footer .brand { color: #fff; }
footer h4 { color: #fff; font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 16px; }
footer ul { list-style: none; }
footer li { margin-bottom: 10px; font-size: 0.94rem; }
footer a:hover { color: #fff; }
.footer-legal {
  border-top: 1px solid rgba(244, 241, 236, 0.15);
  padding-top: 24px; font-size: 0.8rem; color: rgba(244, 241, 236, 0.55);
  display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: space-between;
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- Visual enhancements ---------- */

/* Buttons — depth & shadow */
.btn:not(.ghost):not(.on-dark) { box-shadow: 0 4px 16px rgba(12,140,140,0.22); }
.btn:not(.ghost):not(.on-dark):hover { box-shadow: 0 8px 28px rgba(12,140,140,0.32); }
.btn { transition: background 0.25s, transform 0.25s, box-shadow 0.25s; }

/* Focus rings for accessibility */
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* Nav scroll shadow (class added by JS) */
.nav-wrap.scrolled { box-shadow: 0 4px 24px rgba(15,22,20,0.09); }

/* Hero image — premium shadow */
.hero-side img { box-shadow: 0 40px 80px rgba(15,22,20,0.2), 0 8px 24px rgba(15,22,20,0.1); }

/* Feature band image */
.feature-media > img { box-shadow: 0 20px 48px rgba(15,22,20,0.12); }

/* Stat cards — top accent + deeper shadow */
.stat-card { border-top: 3px solid var(--accent); box-shadow: 0 24px 60px rgba(15,22,20,0.16); }
.stat-card .num { font-size: 2.5rem; }

/* Service cards — accent top bar on hover */
.service-card {
  border-top: 3px solid transparent;
  transition: transform 0.35s cubic-bezier(0.25,0.46,0.45,0.94), box-shadow 0.35s, border-color 0.35s;
}
.service-card:hover { border-top-color: var(--accent); box-shadow: 0 24px 48px rgba(15,22,20,0.12); }

/* Staggered service card reveals */
.services-grid .service-card:nth-child(2) { transition-delay: 0.08s; }
.services-grid .service-card:nth-child(3) { transition-delay: 0.16s; }
.services-grid .service-card:nth-child(4) { transition-delay: 0.06s; }
.services-grid .service-card:nth-child(5) { transition-delay: 0.14s; }
.services-grid .service-card:nth-child(6) { transition-delay: 0.22s; }

/* How-cards — step watermark + hover lift */
.how-grid { counter-reset: step-counter; }
.how-card {
  position: relative; overflow: hidden;
  counter-increment: step-counter;
  transition: transform 0.3s, box-shadow 0.3s;
}
.how-card::after {
  content: counter(step-counter);
  position: absolute; bottom: -14px; right: 18px;
  font-family: var(--font-display); font-size: 7rem; font-weight: 600; line-height: 1;
  color: rgba(12,140,140,0.07); pointer-events: none; user-select: none;
}
.how-card:hover { transform: translateY(-4px); box-shadow: 0 18px 36px rgba(15,22,20,0.09); }
.how-grid .how-card:nth-child(2) { transition-delay: 0.1s; }
.how-grid .how-card:nth-child(3) { transition-delay: 0.2s; }

/* Detail aside — shadow + subtle zoom on hover */
.detail-aside img {
  box-shadow: 0 24px 56px rgba(15,22,20,0.14);
  transition: transform 0.5s cubic-bezier(0.25,0.46,0.45,0.94), box-shadow 0.5s;
}
.detail-aside:hover img { transform: scale(1.015); box-shadow: 0 32px 64px rgba(15,22,20,0.18); }

/* Timeline dots — glow ring */
.timeline-item::before { box-shadow: 0 0 0 5px rgba(12,140,140,0.14); transition: box-shadow 0.3s; }
.timeline-item:hover::before { box-shadow: 0 0 0 9px rgba(12,140,140,0.18); }

/* Positions row — tinted accent pills */
.positions-row span {
  background: rgba(12,140,140,0.07); border-color: rgba(12,140,140,0.22); color: var(--accent-deep);
  transition: background 0.2s, border-color 0.2s;
}
.positions-row span:hover { background: rgba(12,140,140,0.14); border-color: rgba(12,140,140,0.4); cursor: default; }

/* Testimonial — card treatment */
.testimonial {
  background: var(--card); border: 1px solid var(--line); border-radius: 28px;
  padding: clamp(36px,5vw,64px) clamp(28px,5vw,72px);
  box-shadow: 0 8px 32px rgba(15,22,20,0.06);
}

/* Stats band — subtle dividers */
.stats-band > div { position: relative; padding: 20px 12px; border-radius: var(--radius); }
.stats-band > div:not(:last-child)::after {
  content: ""; position: absolute; right: 0; top: 15%; bottom: 15%;
  width: 1px; background: var(--line);
}
@media (max-width: 980px) { .stats-band > div::after { display: none; } }

/* CTA — depth shadow */
.cta-inner { box-shadow: 0 28px 64px rgba(15,22,20,0.2); }

/* Contact cards — hover lift */
.contact-card { transition: box-shadow 0.3s, transform 0.3s; }
.contact-card:hover { box-shadow: 0 12px 32px rgba(15,22,20,0.1); transform: translateY(-2px); }

/* Footer — accent top border */
footer { border-top: 3px solid var(--accent); }

/* Page hero — bottom separator */
.page-hero { border-bottom: 1px solid var(--line); }

/* Section head — tighter heading margin */
.section-head h2 { margin-top: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid, .detail-block, .detail-block.flip, .contact-grid { grid-template-columns: 1fr; }
  .detail-aside { position: static; }
  .services-grid, .how-grid { grid-template-columns: 1fr 1fr; }
  .float-cards { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .stats-band { grid-template-columns: 1fr 1fr; gap: 34px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: flex-start; gap: 0;
    padding: 10px 4%; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 13px 0; font-size: 1.05rem; }
  .nav-links a.active::after { display: none; }
  .nav-links li:last-child { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; padding-bottom: 6px; }
  .nav-links .btn { width: 100%; justify-content: center; border-radius: 12px; padding: 13px 20px; box-shadow: none; }
  .nav-toggle { display: block; }
  .services-grid, .how-grid { grid-template-columns: 1fr; }
  .float-cards { position: static; margin-top: 18px; grid-template-columns: 1fr; }
  .feature-band { padding-bottom: 40px; }
  .spin-chip { width: 100px; height: 100px; bottom: -20px; left: -12px; }
  .footer-grid { grid-template-columns: 1fr; }
}
