/* =============================================================
   DAKI PLAST — CORE (tokeni, reset, tipografija, nav, footer,
   dugmad, floating CTA, reveal sistem). Deli se na svim stranama.
   ============================================================= */

:root {
    /* Brand */
    --accent: #37AAE2;
    --accent-2: #8ED3F4;
    --accent-ink: #15709E;        /* tekst-akcenat na svetloj pozadini (kontrast 5:1) */
    --gold: #B8924A;
    --on-accent: #05111F;

    /* Svetla tema — topli papir + tamno teget tekst */
    --bg: #F7F5F0;
    --bg-alt: #EFEBE3;
    --card: #FFFFFF;
    --ink: #0D1526;
    --ink-2: #444F63;
    --muted: #5F6B7E;
    --line: rgba(13, 21, 38, .11);
    --line-strong: rgba(13, 21, 38, .2);
    --deep: #0A1222;               /* tamne sekcije u obe teme */
    --deep-2: #101B33;
    --shadow-sm: 0 1px 2px rgba(13,21,38,.05), 0 6px 18px rgba(13,21,38,.05);
    --shadow-md: 0 2px 6px rgba(13,21,38,.05), 0 18px 44px rgba(13,21,38,.10);
    --shadow-lg: 0 30px 80px rgba(13,21,38,.18);
    --logo-filter: none;

    /* Tipografija */
    --font-display: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
    --font-ui: 'Manrope', system-ui, sans-serif;
    --font-body: 'Outfit', system-ui, sans-serif;

    --text-sm: clamp(.97rem, .93rem + .18vw, 1.08rem);
    --text-base: clamp(1.05rem, 1rem + .22vw, 1.18rem);
    --text-lg: clamp(1.15rem, 1.05rem + .5vw, 1.4rem);
    --text-h2: clamp(2.5rem, 1.6rem + 4.2vw, 5rem);
    --text-h1: clamp(3.2rem, 1.6rem + 7vw, 7.5rem);

    --nav-h: 84px;
    --wrap: 1240px;
    --gutter: clamp(1.25rem, 5vw, 3rem);
    --section-y: clamp(5rem, 11vw, 9.5rem);
    --radius: 20px;
    --radius-sm: 12px;
    --ease: cubic-bezier(.22, 1, .36, 1);
    --ease-io: cubic-bezier(.65, 0, .35, 1);
}

[data-theme="dark"] {
    --bg: #0A1120;
    --bg-alt: #0E172B;
    --card: #111C34;
    --ink: #EEF2F8;
    --ink-2: #AAB6CB;
    --muted: #8C99B0;
    --line: rgba(255, 255, 255, .09);
    --line-strong: rgba(255, 255, 255, .18);
    --accent-ink: #6CC4EE;
    --gold: #D4B06A;
    --deep: #060B16;
    --deep-2: #0C1528;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25);
    --shadow-md: 0 2px 6px rgba(0,0,0,.3), 0 18px 44px rgba(0,0,0,.35);
    --shadow-lg: 0 30px 80px rgba(0,0,0,.5);
    --logo-filter: brightness(0) invert(1);
    color-scheme: dark;
}

/* ---------- Reset ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.7;
    color: var(--ink);
    background: var(--bg);
    padding-top: var(--nav-h);
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
body.is-home { padding-top: 0; }
body.menu-open { overflow: hidden; }
img, svg, picture { max-width: 100%; display: block; }
img { height: auto; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
section { padding: var(--section-y) var(--gutter); position: relative; }
.wrap { max-width: var(--wrap); margin: 0 auto; }

.skip-link {
    position: fixed; top: -100px; left: 1rem; z-index: 3000;
    background: var(--ink); color: var(--bg); padding: .7rem 1.2rem; border-radius: 999px;
    font: 700 .8rem var(--font-ui); transition: top .25s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* ---------- Tipografija ---------- */
h1, h2, .section-title { font-family: var(--font-display); font-weight: 400; letter-spacing: -.015em; line-height: 1.02; }
h3, h4, h5 { font-family: var(--font-ui); font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
.section-title { font-size: var(--text-h2); color: var(--ink); text-wrap: balance; }
.section-title em, h1 em { font-style: italic; color: var(--accent-ink); }
.eyebrow {
    display: inline-flex; align-items: center; gap: .85rem;
    font: 700 .82rem/1 var(--font-ui); letter-spacing: .24em; text-transform: uppercase;
    color: var(--accent-ink); margin-bottom: 1.4rem;
}
.eyebrow::before { content: ''; width: 34px; height: 1px; background: var(--gold); }
.section-head { margin-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.section-head.center { text-align: center; margin-inline: auto; }
.section-head.center .eyebrow { justify-content: center; }
.section-head.center .eyebrow::after { content: ''; width: 34px; height: 1px; background: var(--gold); }
.lede { font-size: var(--text-lg); color: var(--ink-2); font-weight: 300; max-width: 60ch; }

/* Reč po reč reveal (JS obmotava reči) */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .14em; margin-bottom: -.14em; }
.w > span { display: inline-block; }
.js [data-split] .w > span { transform: translateY(110%); transition: transform 1s var(--ease); transition-delay: calc(var(--i, 0) * 55ms + var(--base, 0ms)); }
.js [data-split].is-in .w > span { transform: none; }

/* ---------- Grain tekstura (samo tamne sekcije) ---------- */
.grain { position: relative; isolation: isolate; }
.grain::before {
    content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .06; mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Reveal sistem ---------- */
.js [data-reveal] {
    opacity: 0; transform: translateY(32px);
    transition: opacity .9s var(--ease), transform .9s var(--ease);
    transition-delay: var(--d, 0ms);
}
.js [data-reveal="left"]  { transform: translateX(-40px); }
.js [data-reveal="right"] { transform: translateX(40px); }
.js [data-reveal="zoom"]  { transform: scale(.94); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

.img-reveal { overflow: hidden; border-radius: var(--radius); }
.js .img-reveal { clip-path: inset(0 0 100% 0 round var(--radius)); transition: clip-path 1.3s var(--ease-io); }
.js .img-reveal img { transform: scale(1.25); transition: transform 1.6s var(--ease); }
.js .img-reveal.is-in { clip-path: inset(0 0 0 0 round var(--radius)); }
.js .img-reveal.is-in img { transform: scale(1); }

/* ---------- Spotlight (prati kursor) ---------- */
.spot { position: relative; }
.spot::after {
    content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(55,170,226,.14), transparent 60%);
    opacity: 0; transition: opacity .4s;
}
.spot:hover::after { opacity: 1; }

/* ---------- Dugmad ---------- */
.btn {
    position: relative; overflow: hidden; isolation: isolate;
    display: inline-flex; align-items: center; justify-content: center; gap: .65rem;
    height: 54px; padding: 0 2rem; border-radius: 999px;
    font: 700 .88rem/1 var(--font-ui); letter-spacing: .1em; text-transform: uppercase;
    border: 1.5px solid transparent; white-space: nowrap;
    transition: transform .35s var(--ease), background-color .3s, color .3s, border-color .3s, box-shadow .35s;
}
.btn::before {
    content: ''; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%);
    transform: translateX(-130%); transition: transform .8s var(--ease);
}
.btn:hover::before { transform: translateX(130%); }
.btn .ph, .btn .ph-fill { font-size: 1.25em; transition: transform .35s var(--ease); }
.btn:hover .ph-arrow-right, .btn:hover .ph-arrow-up-right { transform: translateX(4px); }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 10px 30px -8px rgba(55,170,226,.6); }
.btn-primary:hover { background: var(--accent-2); box-shadow: 0 16px 40px -8px rgba(55,170,226,.75); }
.btn-secondary { color: #fff; border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.06); backdrop-filter: blur(8px); }
.btn-secondary:hover { background: #fff; color: var(--on-accent); border-color: #fff; }
.btn-dark { background: var(--ink); color: var(--bg); }
.btn-dark:hover { background: var(--accent); color: var(--on-accent); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .7; pointer-events: none; }

/* ---------- Navigacija ---------- */
nav {
    --nav-fg: var(--ink);
    position: fixed; inset: 0 0 auto 0; z-index: 1000; height: var(--nav-h);
    display: flex; align-items: center; gap: 2rem; padding: 0 var(--gutter);
    color: var(--nav-fg);
    transition: height .45s var(--ease), color .3s;
}
nav.scrolled { height: 68px; }
nav::before {
    content: ''; position: absolute; inset: 0; z-index: -1;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5);
    border-bottom: 1px solid var(--line);
    transition: opacity .35s;
}
nav.nav-transparent { --nav-fg: #fff; --logo-filter: brightness(0) invert(1); }
nav.nav-transparent::before { opacity: 0; }
body.menu-open nav.nav-transparent { --nav-fg: var(--ink); --logo-filter: none; }
body.menu-open nav.nav-transparent::before { opacity: 1; }
[data-theme="dark"] body.menu-open nav.nav-transparent { --logo-filter: brightness(0) invert(1); }

.scroll-progress {
    position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; z-index: 1;
    background: linear-gradient(90deg, var(--accent), var(--gold));
    transform: scaleX(var(--p, 0)); transform-origin: left; pointer-events: none;
}
.logo-link { display: flex; align-items: center; flex-shrink: 0; order: 0; }
.logo-link img { height: 52px; width: auto; filter: var(--logo-filter); transition: height .45s var(--ease), filter .3s; }
nav.scrolled .logo-link img { height: 42px; }

nav ul { order: 1; margin-left: auto; display: flex; align-items: center; gap: clamp(1.1rem, 2.2vw, 2.1rem); }
nav ul a {
    position: relative; display: inline-flex; align-items: center; gap: .45rem; padding: .5rem 0;
    font: 600 .84rem/1 var(--font-ui); letter-spacing: .14em; text-transform: uppercase;
    opacity: .82; transition: opacity .25s, color .25s;
}
nav ul a::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor;
    transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease);
}
nav ul a:hover, nav ul a.active { opacity: 1; }
nav ul a:hover::after, nav ul a.active::after { transform: scaleX(1); transform-origin: left; }
nav ul a.active { color: var(--accent-ink); }
nav.nav-transparent ul a.active { color: #fff; }
.nav-blog-badge {
    background: var(--gold); color: #1a1204; font: 800 .65rem/1 var(--font-ui);
    padding: 3px 6px; border-radius: 999px; letter-spacing: .08em;
}
.nav-right { order: 2; display: flex; align-items: center; gap: .8rem; }

.theme-toggle {
    position: relative; width: 42px; height: 42px; border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--nav-fg) 28%, transparent);
    display: grid; place-items: center; overflow: hidden;
    transition: background-color .3s, border-color .3s, transform .4s var(--ease);
}
.theme-toggle:hover { background: color-mix(in srgb, var(--nav-fg) 10%, transparent); transform: rotate(18deg); }
.theme-toggle svg { grid-area: 1 / 1; width: 19px; height: 19px; transition: transform .6s var(--ease), opacity .4s; }
.theme-toggle .i-sun { transform: translateY(150%) rotate(-90deg); opacity: 0; }
[data-theme="dark"] .theme-toggle .i-sun { transform: none; opacity: 1; }
[data-theme="dark"] .theme-toggle .i-moon { transform: translateY(-150%) rotate(90deg); opacity: 0; }

.hamburger {
    display: none; position: relative; width: 42px; height: 42px; border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--nav-fg) 28%, transparent);
    z-index: 5;
}
.hamburger span { position: absolute; left: 12px; right: 12px; height: 1.5px; background: currentColor; border-radius: 2px; transition: transform .5s var(--ease), opacity .3s; }
.hamburger span:nth-child(1) { top: 15px; }
.hamburger span:nth-child(2) { top: 20px; }
.hamburger span:nth-child(3) { top: 25px; }
.hamburger.active span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 960px) {
    :root { --nav-h: 72px; }
    .hamburger { display: block; }
    .nav-right { margin-left: auto; }
    nav ul {
        position: fixed; inset: 0; z-index: -1; margin: 0; padding: calc(var(--nav-h) + 2rem) var(--gutter) 3rem;
        flex-direction: column; align-items: flex-start; justify-content: center; gap: .3rem;
        background: var(--bg); overflow-y: auto;
        clip-path: circle(0% at calc(100% - 2.4rem) 2.2rem);
        transition: clip-path .8s var(--ease-io); visibility: hidden;
    }
    nav ul.active { clip-path: circle(150% at calc(100% - 2.4rem) 2.2rem); visibility: visible; }
    nav ul li { overflow: hidden; width: 100%; }
    nav ul a {
        font: 400 clamp(2.2rem, 9vw, 3.4rem)/1.15 var(--font-display); letter-spacing: -.01em; text-transform: none;
        opacity: 1; padding: .35rem 0; color: var(--ink);
        transform: translateY(110%); transition: transform .8s var(--ease), color .25s;
    }
    nav ul.active a { transform: none; transition-delay: calc(.12s + var(--i, 0) * 50ms); }
    nav ul a::after { display: none; }
    nav ul a.active, nav.nav-transparent ul a.active { color: var(--accent-ink); }
    nav ul a:hover { color: var(--accent-ink); }
}

/* ---------- Footer ---------- */
footer { background: var(--deep); color: #B9C4D8; padding: clamp(4rem, 8vw, 6.5rem) var(--gutter) 2rem; }
.footer-grid {
    max-width: var(--wrap); margin: 0 auto; display: grid; gap: 3rem 4rem;
    grid-template-columns: 1.5fr 1fr 1.2fr 1fr 1fr; padding-bottom: 3.5rem;
}
.footer-logo { height: 46px; width: auto; filter: brightness(0) invert(1); margin-bottom: 1.4rem; }
.footer-tag { font-family: var(--font-display); font-size: 1.7rem; line-height: 1.2; color: #fff; max-width: 18ch; }
footer .footer-title { font: 700 .8rem/1 var(--font-ui); letter-spacing: .22em; text-transform: uppercase; color: var(--gold); margin-bottom: 1.4rem; }
footer p:not(.footer-title), footer li { font-size: .95rem; line-height: 1.9; color: #A9B5CB; }
footer a { transition: color .25s; }
footer a:hover { color: #fff; }
.footer-partner img { height: 30px; width: auto; filter: brightness(0) invert(1); opacity: .8; }
.footer-bottom {
    max-width: var(--wrap); margin: 0 auto; padding-top: 1.6rem; border-top: 1px solid rgba(255,255,255,.1);
    display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.footer-bottom p { font-size: .89rem; color: #7F8CA5; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Floating CTA ---------- */
.floating-cta {
    position: fixed; right: 24px; bottom: 24px; z-index: 900;
    display: inline-flex; align-items: center; gap: .75rem; height: 56px; padding: 0 1.5rem 0 .5rem;
    border-radius: 999px; background: var(--ink); color: var(--bg);
    font: 700 .84rem/1 var(--font-ui); letter-spacing: .1em; text-transform: uppercase;
    box-shadow: var(--shadow-lg);
    opacity: 0; transform: translateY(24px) scale(.9); pointer-events: none;
    transition: opacity .5s var(--ease), transform .5s var(--ease), background-color .3s, color .3s;
}
.floating-cta.show { opacity: 1; transform: none; pointer-events: auto; }
.floating-cta i {
    position: relative; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
    background: var(--accent); color: var(--on-accent); font-size: 1.2rem;
}
.floating-cta i::after {
    content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent);
    animation: pulse 2.4s var(--ease) infinite;
}
.floating-cta:hover { background: var(--accent); color: var(--on-accent); }
.floating-cta:hover i { background: var(--on-accent); color: var(--accent); }
.floating-cta:hover i::after { border-color: var(--on-accent); }
@keyframes pulse { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.9); opacity: 0; } }
@media (max-width: 560px) { .floating-cta { padding: 0; width: 56px; justify-content: center; right: 16px; bottom: 16px; } .floating-cta i { width: 56px; height: 56px; } .floating-cta span { display: none; } }

/* ---------- Smanjeno kretanje ---------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0ms !important; }
    .js [data-reveal], .js .img-reveal, .js .img-reveal img, .js [data-split] .w > span { opacity: 1 !important; transform: none !important; clip-path: none !important; }
}
html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after { transition: background-color .45s, color .45s, border-color .45s, fill .45s !important; }
