@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Anton&family=Overpass+Mono:wght@600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #ff6b6b; 
    --secondary: #4ecdc4;
    --accent: #ffe66d;
    --dark: #2d3436;
    --light: #ddd;
    --purple: #a29bfe;
    --orange: #fd79a8;
    --green: #55efc4;
    --font-heading: 'Anton', sans-serif;
    --font-body: 'Overpass Mono', monospace;
    --carousel-accent: rgb(8, 42, 123);
}

body {
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1.6;
    color: var(--dark);
    overflow-x: hidden;
    background: #0a0a0a;
}

.error-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #e74c3c;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    z-index: 10000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
    max-width: 350px;
}

.error-notification.show {
    transform: translateX(0);
}

.error-notification .close-btn {
    background: none;
    border: none;
    color: white;
    float: right;
    font-size: 18px;
    cursor: pointer;
    margin-left: 10px;
}

.font-fallback {
    font-family: 'Arial', 'Helvetica', sans-serif !important;
}

.cursor {
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transition: all 0.3s ease;
    mix-blend-mode: difference;
    display: none;
}

.cursor-follower {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    transition: all 0.1s ease;
    display: none;
}

@media (min-width: 1024px) and (pointer: fine) {
    .cursor, .cursor-follower {
        display: block;
    }
}

.page-header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    z-index: 1000;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 107, 107, 0.3);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.logo {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent);
}

.nav__list {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 0;
}

.nav__item a {
    color: white;
    display: block;
    text-decoration: none;
    padding: 12px 20px;
    font-family: var(--font-body);
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.nav__item a:hover,
.nav__item a:focus {
    color: var(--accent);
    text-decoration: underline;
    text-shadow: 0 0 10px var(--accent);
}

.nav__item--cta {
    margin-left: 20px;
}

.nav__item--cta a {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    text-transform: uppercase;
    color: black;
    background: var(--accent);
    border-radius: 6px;
    min-width: 180px;
    text-align: center;
    padding: 12px 20px;
}

.nav__item--cta a:hover,
.nav__item--cta a:focus {
    background: #e6cf5f;
    text-decoration: none;
}

.nav-toggle {
    display: none;
    color: var(--accent);
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
}

.nav__overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.nav__overlay.active {
    opacity: 1;
    pointer-events: all;
}

.hero {
    position: relative;
    color: #fff;
    background: #0a0a0a;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hero__bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero__bg::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: radial-gradient(rgba(0, 0, 0, 0.6) 70%, rgba(0, 0, 0, 1));
    opacity: 0.8;
    transition: opacity 4000ms;
}

.hero.is-visible .hero__bg::after {
    opacity: 0.6;
}

.hero__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
}

.hero__img-fallback {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    display: none;
}

.hero__content {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    z-index: 2;
}

.hero__text {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    text-shadow: 0 0.1em 15px rgba(0, 0, 0, 0.25);
}

.hero__title {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 8vw, 6rem);
    margin-bottom: 0;
    width: 100%;
    z-index: 1;
    background: linear-gradient(45deg, var(--primary), var(--accent), var(--secondary), var(--purple));
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease infinite;
}

.hero__intro {
    font-family: var(--font-body);
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: var(--accent);
    width: 100%;
    z-index: 1;
    margin-bottom: 2rem;
}

.hero__footprint {
    opacity: 0.3;
    position: absolute;
    width: 150%;
    height: 150%;
    object-fit: contain;
    object-position: center;
    z-index: 0;
}

.math-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.floating-math {
    position: absolute;
    font-size: 1.2rem;
    font-weight: 300;
    opacity: 0.3;
    animation: floatMath 8s ease-in-out infinite;
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent);
}

.floating-math:nth-child(1) { top: 10%; left: 10%; animation-delay: 0s; color: var(--primary); }
.floating-math:nth-child(2) { top: 20%; right: 15%; animation-delay: 2s; color: var(--secondary); }
.floating-math:nth-child(3) { bottom: 30%; left: 20%; animation-delay: 4s; color: var(--purple); }
.floating-math:nth-child(4) { top: 60%; right: 10%; animation-delay: 6s; color: var(--green); }
.floating-math:nth-child(5) { bottom: 10%; right: 30%; animation-delay: 1s; color: var(--orange); }

.section {
    color: white;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: 80px;
}

.section__header {
    display: none;
    position: sticky;
    top: 80px;
    left: 0;
    padding: 20px;
    color: var(--light);
    height: 80px;
    flex: 0 0 auto;
    z-index: 2;
    align-items: center;
    width: 300px;
    clip-path: polygon(0 0, 100% 0, 80% 100%, 0 100%);
    background: linear-gradient(135deg, #1a1a1a, #0a0a0a);
}

@media (min-width: 60em) {
    .section__header {
        display: flex;
    }
}

.section__title {
    font-family: var(--font-heading);
    font-size: 22px;
    letter-spacing: 0.03rem;
    margin: 0;
}

.section__content {
    --pad: 20px;
    padding: var(--pad);
    flex-grow: 1;
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

@media (min-width: 60em) {
    .section__content {
        --pad: 40px;
        display: grid;
        grid-template-columns: 4fr 3fr 1fr 4fr 2fr 2fr 4fr 1fr 3fr 4fr;
        grid-template-rows: minmax(0, 1fr) repeat(6, minmax(40px, auto)) minmax(0, 1fr);
        gap: 20px;
    }
}

.section__content > * {
    opacity: 0;
    transform: translate3d(0, 4rem, 0);
    transition: opacity 800ms var(--delay, 0ms), transform 800ms cubic-bezier(0.13, 0.07, 0.26, 0.99) var(--delay, 0ms);
}

.is-visible .section__content > * {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.is-visible .section__img {
    opacity: 0.75;
}

.section__main-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 4rem);
    width: 100%;
    text-align: center;
    background: linear-gradient(45deg, var(--primary), var(--accent), var(--secondary));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

@media (min-width: 60em) {
    .section__main-title {
        text-align: left;
    }
}

.section__main-title--left {
    grid-column: 2 / -2;
    grid-row: 4 / 6;
}

.section__main-title--right {
    grid-column: 2 / -2;
    grid-row: 4 / 6;
}

.section__img {
    max-width: 300px;
    margin-bottom: 30px;
    grid-column: 4 / -1;
    grid-row: 1 / -1;
    border-radius: 8px;
}

@media (min-width: 60em) {
    .section__img {
        margin-bottom: 0;
        max-width: none;
    }
}

.section__img--left {
    grid-column: 1 / -4;
}

.section__intro {
    font-family: var(--font-body);
    text-align: center;
    max-width: 50ch;
    color: #d0d0d0;
    line-height: 1.7;
}

@media (min-width: 60em) {
    .section__intro {
        text-align: left;
    }
}

.section__intro a {
    text-decoration: underline;
    color: var(--accent);
}

.section__intro a:hover,
.section__intro a:focus {
    opacity: 0.7;
}

.research {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
}

.research__intro {
    grid-column: 3 / 6;
    grid-row: 6 / 8;
}

.tech {
    background: radial-gradient(circle at 30% 70%, var(--purple) 0%, transparent 50%), 
                radial-gradient(circle at 70% 30%, var(--orange) 0%, transparent 50%), 
                linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
}

.tech__intro {
    grid-column: -6 / -3;
    grid-row: 6 / 8;
}

.tim {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
}

.tim-container {
    width: 100%;
    padding: 0 20px; /* Osnovni padding za sve uređaje */
}

/* Desktop verzija ostaje ista */
.tim .section__content {
    padding: 60px 0; /* Uklonjen horizontalni padding jer ga kontroliše tim-container */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 140px);
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

@media (min-width: 60em) {
    .tim-container {
        padding: 0 40px; /* Više padding-a za desktop */
    }
    
    .tim .section__content {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 80px 0; /* Samo vertikalni padding */
        gap: 0;
    }
}


.about-title {
    font-family: var(--font-heading);
    font-size: clamp(4rem, 7.5vw, 7.5rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    margin-bottom: 2rem;
    pointer-events: none;
    white-space: nowrap;
    background: linear-gradient(45deg, var(--primary), var(--accent), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

.carousel-container {
    width: 100%;
    max-width: 1200px;
    height: 450px;
    position: relative;
    perspective: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.carousel-track {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card {
    position: absolute;
    width: 280px;
    height: 380px;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card.center {
    z-index: 10;
    transform: scale(1.1) translateX(0) translateZ(0) !important;
}

.card.left-2 {
    z-index: 1;
    transform: translateX(-450px) scale(0.8) translateZ(-350px) !important;
    opacity: 0.7;
}

.card.left-2 img {
    filter: grayscale(100%);
}

.card.left-1 {
    z-index: 5;
    transform: translateX(-225px) scale(0.9) translateZ(-150px) !important;
    opacity: 0.9;
}

.card.left-1 img {
    filter: grayscale(100%);
}

.card.right-1 {
    z-index: 5;
    transform: translateX(225px) scale(0.9) translateZ(-150px) !important;
    opacity: 0.9;
}

.card.right-1 img {
    filter: grayscale(100%);
}

.card.right-2 {
    z-index: 1;
    transform: translateX(450px) scale(0.8) translateZ(-350px) !important;
    opacity: 0.7;
}

.card.right-2 img {
    filter: grayscale(100%);
}

.card.hidden {
    opacity: 0;
    pointer-events: none;
}

.member-info {
    text-align: center;
    margin-top: 40px;
    transition: all 0.5s ease-out;
    color: var(--light);
}

.member-name {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
    color: var(--accent);
}

.member-name::before,
.member-name::after {
    content: "";
    position: absolute;
    top: 100%;
    width: 100px;
    height: 2px;
    background: var(--accent);
}

.member-name::before {
    left: -120px;
}

.member-name::after {
    right: -120px;
}

.member-role {
    font-family: var(--font-body);
    font-size: 1.5rem;
    font-weight: 500;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 10px 0;
    margin-top: -15px;
    position: relative;
    color: var(--light);
}

.dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 60px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 107, 107, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background: var(--primary);
    transform: scale(1.2);
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 107, 107, 0.6);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.3s ease;
    font-size: 1.5rem;
    border: none;
    outline: none;
    padding-bottom: 4px;
}

.nav-arrow:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.nav-arrow.left {
    left: 10px;
}

.nav-arrow.right {
    right: 10px;
}

.footer {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    color: white;
    padding: 4rem 0 2rem 0;
    border-top: 1px solid rgba(255, 107, 107, 0.3);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 2rem;
}

.footer-section h4 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--accent);
}

.footer-section a {
    color: #b0b0b0;
    text-decoration: none;
    display: block;
    margin-bottom: 0.8rem;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    font-family: var(--font-body);
}

.footer-section a:hover {
    color: var(--primary);
    transform: translateX(5px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #808080;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes floatMath {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(5deg); }
    50% { transform: translateY(-10px) rotate(-5deg); }
    75% { transform: translateY(-30px) rotate(3deg); }
}

@media (max-width: 1024px) {
    .tim-container {
        padding: 0 15px; /* Manji padding za mobilne */
    }
    
    /* Tim sekcija na mobilnim uređajima */
    .tim .section__content {
        padding: 40px 0; /* Samo vertikalni padding */
        min-height: calc(100vh - 120px);
    }
    
    /* Povećan padding za karusel kontejner na mobilnim */
    .carousel-container {
        height: 350px;
        margin: 0 auto;
        padding: 0 10px; /* Dodatni unutarnji padding */
    }
}

@media (max-width: 1024px) {
    .nav-toggle {
        display: block;
    }

    .nav__list {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: rgba(0, 0, 0, 0.95);
        padding: 1rem;
        text-align: center;
        list-style: none;
    }

    .nav__list.active {
        display: flex;
    }

    .nav__item {
        margin: 0.5rem 0;
    }

    .nav__item a {
        font-size: 1.3rem;
        padding: 0.5rem;
    }

    .hero__content {
        text-align: center;
    }

    .hero__title {
        font-size: clamp(2.5rem, 6vw, 4rem);
    }

    .hero__intro {
        font-size: clamp(1rem, 2vw, 1.5rem);
    }

    .section__content {
        flex-direction: column;
        align-items: center;
    }

    .section__main-title {
        text-align: center;
    }

    .section__img {
        max-width: 200px;
        margin: 0 auto 20px;
    }

    .section__intro {
        text-align: center;
    }

    .cursor, .cursor-follower {
        display: none;
    }

    .about-title {
        font-size: clamp(2.5rem, 4.5vw, 4.5rem);
    }

    .carousel-container {
        height: 350px;
        margin: 0 auto;
    }

    .card {
        width: 200px;
        height: 280px;
    }

    .card.left-2 {
        transform: translateX(-250px) scale(0.8) translateZ(-300px);
    }

    .card.left-1 {
        transform: translateX(-120px) scale(0.9) translateZ(-100px);
    }

    .card.right-1 {
        transform: translateX(120px) scale(0.9) translateZ(-100px);
    }

    .card.right-2 {
        transform: translateX(250px) scale(0.8) translateZ(-300px);
    }

    .member-name {
        font-size: 2rem;
    }

    .member-role {
        font-size: 1.2rem;
    }

    .member-name::before,
    .member-name::after {
        width: 50px;
    }

    .member-name::before {
        left: -70px;
    }

    .member-name::after {
        right: -70px;
    }

    .nav-arrow {
        width: 30px;
        height: 30px;
        font-size: 1.2rem;
    }

    .nav-arrow.left {
        left: 5px;
    }

    .nav-arrow.right {
        right: 5px;
    }

    /* Tim sekcija na mobilnim uređajima */
    .tim .section__content {
        padding: 140px 20px;
        min-height: calc(100vh - 120px);
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .floating-math, .carousel-track, .card, .card img, .member-info, .dot {
        animation: none !important;
        transition: none !important;
    }
}