:root {
    --primary: #d97706;
    --primary-hover: #c2660a;
    --bg: #ffffff;
    --section-bg: #f8fafc;
    --text: #1a1d23;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --card-bg: #ffffff;
    --contact-bg: #0f172a;
    --contact-text: #ffffff;
    --nav-bg: #0f172a;
    --nav-text: #f1f5f9;
    --logo-filter: none;
    --radius: 8px;
}

[data-theme="dark"] {
    --bg: #0b1220;
    --section-bg: #0f172a;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #1e293b;
    --card-bg: #111827;
    --contact-bg: #000000;
    --nav-bg: #000000;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;
    transition: background-color 0.3s, color 0.3s;
    -webkit-font-smoothing: antialiased;
}

/* --- PRISTUPAČNOST: vidljiv focus obrub za tipkovnicu --- */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: 4px;
}

/* --- NAVIGACIJA --- */
.navbar {
    background: linear-gradient(120deg, #0b1120 0%, #1a2438 55%, #12172a 100%);
    border-bottom: none;
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 1030;
    overflow: visible;
    transition: padding 0.3s ease, box-shadow 0.3s ease;
}

.navbar.scrolled {
    padding: 6px 0;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.navbar::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary) 35%, #f2b25c 50%, var(--primary) 65%, transparent);
    opacity: 0.85;
}

.brand-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: visible;
}

.navbar-brand {
    position: relative;
    overflow: visible;
}

/* Odvojen, veći sjaj iza loga - ne siječe se po rubovima slike */
.navbar-brand::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 160%;
    height: 220%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(217, 119, 6, 0.4) 0%, rgba(217, 119, 6, 0.15) 45%, transparent 72%);
    filter: blur(14px);
    opacity: 0.75;
    z-index: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    animation: logo-glow-pulse 3.2s ease-in-out infinite;
}

.navbar-brand:hover::before {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.12);
}

@keyframes logo-glow-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.9; }
}

.navbar-brand img {
    position: relative;
    z-index: 1;
    height: 70px;
    width: auto;
    transition: filter 0.4s ease, transform 0.3s ease, height 0.3s ease;
    filter: var(--logo-filter) drop-shadow(0 0 10px rgba(217, 119, 6, 0.35));
}

.navbar.scrolled .navbar-brand img {
    height: 46px;
}

.navbar-brand:hover img {
    transform: scale(1.06);
    filter: var(--logo-filter) drop-shadow(0 0 18px rgba(217, 119, 6, 0.65));
}

.motto-small {
    font-size: 0.42rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--nav-text);
    opacity: 0.55;
    margin-top: 2px;
}

.nav-link {
    color: var(--nav-text) !important;
    opacity: 0.85;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0 15px !important;
    transition: opacity 0.2s, color 0.2s;
}

.nav-link:hover {
    opacity: 1;
    color: var(--primary) !important;
}

#theme-toggle {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: var(--nav-text);
    padding: 8px 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#theme-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
}

#theme-toggle i {
    transition: transform 0.4s ease;
}

#theme-toggle:hover i {
    transform: rotate(20deg);
}

/* --- HERO --- */
.hero {
    background: linear-gradient(180deg, #0f172a 0%, #1c2333 100%);
    padding: 130px 0 90px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before,
.hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
}

.hero::before {
    width: 340px;
    height: 340px;
    background: rgba(217, 119, 6, 0.25);
    top: -120px;
    left: -80px;
}

.hero::after {
    width: 280px;
    height: 280px;
    background: rgba(59, 130, 246, 0.12);
    bottom: -100px;
    right: -60px;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: clamp(2.2rem, 7vw, 3.6rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 18px;
    color: #ffffff;
}

.hero span {
    color: var(--primary);
}

.hero p {
    color: #cbd5e1;
}

/* --- SEKCIJE --- */
section h2 {
    letter-spacing: -0.01em;
}

/* --- KARTICE --- */
.service-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 32px;
    height: 100%;
    border: 1px solid var(--border);
    transition: 0.25s;
}

.service-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.service-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: rgba(217, 119, 6, 0.1);
    font-size: 1.4rem;
    color: var(--primary);
    margin-bottom: 18px;
    transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.08) rotate(-4deg);
    background: var(--primary);
    color: #ffffff;
}

.service-card h4 {
    letter-spacing: -0.01em;
}

.service-card p {
    color: var(--text-muted);
}

/* --- PORTFOLIO --- */
.portfolio-item {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--border);
    border: 1px solid var(--border);
}

.portfolio-item img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
    transition: 0.4s;
}

.portfolio-item:hover img {
    transform: scale(1.06);
}

/* --- KONTAKT --- */
.contact-card {
    background: var(--contact-bg);
    color: #ffffff;
    border-radius: 16px;
    padding: 48px;
    margin-top: 40px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.contact-card .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.3);
    font-weight: 600;
}

.contact-card .btn-outline-light:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.contact-card a.h2 {
    color: var(--primary) !important;
}

.info-panel {
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius);
    padding: 25px;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.info-panel .text-primary {
    color: var(--primary) !important;
}

.info-panel .text-dark {
    color: #ffffff !important;
}

footer {
    background: var(--contact-bg);
    padding: 40px 0;
    color: #94a3b8;
    font-size: 0.8rem;
    text-align: center;
    margin-top: 40px;
}

/* --- ZABAVI SE: floating gumb --- */
#fun-fab {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1050;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 13px 20px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(217, 119, 6, 0.4);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    animation: fun-fab-pulse 2.4s ease-in-out infinite;
}

#fun-fab i {
    font-size: 1.05rem;
}

#fun-fab:hover {
    background: var(--primary-hover);
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 28px rgba(217, 119, 6, 0.55);
}

@keyframes fun-fab-pulse {
    0%, 100% { box-shadow: 0 8px 22px rgba(217, 119, 6, 0.4); }
    50% { box-shadow: 0 8px 26px rgba(217, 119, 6, 0.7); }
}

@media (max-width: 576px) {
    #fun-fab span { display: none; }
    #fun-fab { padding: 14px; border-radius: 50%; }
    #fun-fab i { font-size: 1.25rem; }
}

/* --- ZABAVI SE: popup modal --- */
#fun-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(6, 8, 12, 0.82);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    backdrop-filter: blur(3px);
}

#fun-modal.open {
    display: flex;
}

#fun-modal-inner {
    position: relative;
    width: 100%;
    max-width: 520px;
    height: min(80vh, 720px);
    background: #0c0d0f;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

#fun-modal-bar {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 8px 10px;
    background: #101114;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#fun-modal-frame {
    width: 100%;
    flex: 1 1 auto;
    border: none;
    display: block;
}

#fun-modal-close {
    position: relative;
    z-index: 5;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

#fun-modal-close:hover {
    background: var(--primary);
}

/* --- Dinamični gradient divider između sekcija --- */
.section-divider {
    height: 3px;
    max-width: 140px;
    margin: 0 auto;
    padding: 20px 0 0;
    background: linear-gradient(90deg, transparent, var(--primary), #f2b25c, var(--primary), transparent);
    background-clip: content-box;
    border-radius: 3px;
    opacity: 0.9;
}

/* --- Badge: godine iskustva --- */
.stat-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    margin-top: 24px;
}

.experience-badge {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    padding: 6px;
}

.experience-badge .broj {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--primary), var(--primary-hover));
    color: #ffffff;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    box-shadow: 0 8px 20px rgba(217, 119, 6, 0.35);
}

.experience-badge .tekst {
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 700;
    max-width: 120px;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* --- POSEBAN STIL ZA "USKORO" KARTICU --- */
.service-card-upcoming {
    background: linear-gradient(180deg, var(--card-bg) 0%, rgba(217, 119, 6, 0.04) 100%);
    border: 1px solid var(--primary) !important;
    position: relative;
    overflow: hidden;
}

.service-card-upcoming::after {
    content: 'USKORO';
    position: absolute;
    top: 18px;
    right: -34px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 1.2px;
    padding: 5px 38px;
    transform: rotate(35deg);
    box-shadow: 0 3px 10px rgba(217, 119, 6, 0.4);
}

.service-card-upcoming .service-icon {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(217, 119, 6, 0.35);
    animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(217, 119, 6, 0.3);
    }
    50% {
        transform: scale(1.06);
        box-shadow: 0 6px 22px rgba(217, 119, 6, 0.55);
    }
}

/* --- RASPORED ZA 5 KARTICA U JEDNOM REDU (Desktop) --- */
@media (min-width: 1200px) {
    .row-cols-xl-5 > * {
        flex: 0 0 auto;
        width: 20%;
    }
}

/* --- Scroll-reveal: lagano pojavljivanje elemenata kod skrolanja --- */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .reveal-on-scroll {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
