nav {
    z-index: 100 !important;
}

/* Quote section decorative positioning (not in default Tailwind) */
.-right-55 {
    right: -13.75rem;
}
.bottom-70 {
    bottom: 17.5rem;
}

/* Josefin Slab font utility */
.font-josefin-slab {
    font-family: 'Josefin Slab', serif;
}

/* Square animation */
.square-animate.show {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Hover glow effect */
.square-animate > div:first-child {
    transition: all 0.3s ease;
}

.square-animate:hover > div:first-child {
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.8);
}

#darwin-quote blockquote,
#darwin-quote cite,
#darwin-quote .text-8xl {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

#darwin-quote.quote-visible blockquote {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.2s;
}

#darwin-quote.quote-visible cite {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.6s;
}

#darwin-quote.quote-visible .text-8xl:first-child {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0s;
}

#darwin-quote.quote-visible .text-8xl:last-of-type {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.4s;
}

/* Smooth transitions */
#main-content {
    position: relative;
}

#main-content > div:first-child {
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center center;
    /* Ensure proper scaling */
    min-width: 0;
    flex-shrink: 1;
}

#theme-container {
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Initial state - large logo centered */
#main-content.initial-state > div:first-child {
    position: absolute;
    left: 50%;
    /* Use width instead of scale to avoid Safari blur */
    transform: translate3d(-50%, 0, 0);
    -webkit-transform: translate3d(-50%, 0, 0);
    width: min(70vw, 1020px); /* Responsive size, equivalent to 1.7x scale */
    max-width: 1020px;
    /* Prevent blur in Safari */
    -webkit-font-smoothing: antialiased;
}

#main-content.initial-state #theme-container {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* After click - normal state */
#main-content:not(.initial-state) > div:first-child {
    position: relative;
    left: 0;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    width: 100%;
    /* Prevent blur in Safari */
    -webkit-font-smoothing: antialiased;
}

#main-content:not(.initial-state) #theme-container {
    opacity: 1;
    width: 100%;
}

@media (min-width: 1024px) {
    #main-content:not(.initial-state) #theme-container {
        width: 50%;
    }
}
/* Sequential glow animation - each circle glows in-out-in (double pulse) with smooth transitions */
/* Total cycle: 14s for 7 circles = 2s per circle (14.28% each) */
@keyframes sequential-glow {
    0% {
        filter: none;
        opacity: 1;
    }
    /* First pulse: smooth in */
    0.2% {
        filter: url(#glow-filter);
        opacity: 0.9;
    }
    0.5% {
        filter: url(#glow-filter);
        opacity: 0.95;
    }
    0.8% {
        filter: url(#glow-filter);
        opacity: 0.98;
    }
    1.2% {
        filter: url(#glow-filter-strong);
        opacity: 0.99;
    }
    1.6% {
        filter: url(#glow-filter-strong);
        opacity: 1;
    }
    2% {
        filter: url(#glow-filter-strong);
        opacity: 1;
    }
    2.2% {
        filter: url(#glow-filter-strong);
        opacity: 1;
    }
    /* First pulse: smooth out */
    2.5% {
        filter: url(#glow-filter-strong);
        opacity: 0.99;
    }
    2.8% {
        filter: url(#glow-filter);
        opacity: 0.98;
    }
    3.2% {
        filter: url(#glow-filter);
        opacity: 0.95;
    }
    3.6% {
        filter: url(#glow-filter);
        opacity: 0.9;
    }
    4% {
        filter: none;
        opacity: 0.95;
    }
    4.5% {
        filter: none;
        opacity: 1;
    }
    /* Second pulse: smooth in */
    5% {
        filter: url(#glow-filter);
        opacity: 0.9;
    }
    5.3% {
        filter: url(#glow-filter);
        opacity: 0.95;
    }
    5.6% {
        filter: url(#glow-filter);
        opacity: 0.98;
    }
    6% {
        filter: url(#glow-filter-strong);
        opacity: 0.99;
    }
    6.4% {
        filter: url(#glow-filter-strong);
        opacity: 1;
    }
    6.8% {
        filter: url(#glow-filter-strong);
        opacity: 1;
    }
    7% {
        filter: url(#glow-filter-strong);
        opacity: 1;
    }
    /* Second pulse: smooth out */
    7.2% {
        filter: url(#glow-filter-strong);
        opacity: 0.99;
    }
    7.5% {
        filter: url(#glow-filter);
        opacity: 0.98;
    }
    7.8% {
        filter: url(#glow-filter);
        opacity: 0.95;
    }
    8.2% {
        filter: url(#glow-filter);
        opacity: 0.9;
    }
    8.6% {
        filter: none;
        opacity: 0.95;
    }
    9% {
        filter: none;
        opacity: 1;
    }
    14.28%, 100% {
        filter: none;
        opacity: 1;
    }
}

/* Fix Safari blur on SVG container - remove problematic properties */
#logo_container {
    width: 100%;
    height: 100%;
    /* Ensure proper scaling */
    display: flex;
    align-items: center;
    justify-content: center;
}

#logo_container svg {
    width: 100%;
    height: 100%;
    /* Prevent Safari blur - use auto rendering */
    image-rendering: auto;
    -webkit-image-rendering: auto;
    /* Force hardware acceleration */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    /* Prevent subpixel rendering issues */
    -webkit-font-smoothing: antialiased;
    shape-rendering: geometricPrecision;
}

/* Make hint circles visible with white stroke - NO FILTERS to prevent Safari blur */
circle.hint-circle {
    stroke: white;
    stroke-width: 2;
    fill: none;
    cursor: pointer !important;
    /* Optimize for GPU acceleration */
    will-change: filter, opacity;
    /* Ultra-smooth transitions */
    transition: filter 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    /* Fix Safari rendering */
    shape-rendering: geometricPrecision;
    /* Force hardware acceleration */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Apply sequential glow to each circle with staggered timing */
circle.hint-circle[data-circle-index="0"] {
    animation: sequential-glow 14s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
    animation-delay: 0s;
}

circle.hint-circle[data-circle-index="1"] {
    animation: sequential-glow 14s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
    animation-delay: 2s; /* 14s / 7 circles = 2s */
}

circle.hint-circle[data-circle-index="2"] {
    animation: sequential-glow 14s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
    animation-delay: 4s;
}

circle.hint-circle[data-circle-index="3"] {
    animation: sequential-glow 14s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
    animation-delay: 6s;
}

circle.hint-circle[data-circle-index="4"] {
    animation: sequential-glow 14s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
    animation-delay: 8s;
}

circle.hint-circle[data-circle-index="5"] {
    animation: sequential-glow 14s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
    animation-delay: 10s;
}

circle.hint-circle[data-circle-index="6"] {
    animation: sequential-glow 14s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
    animation-delay: 12s;
}

/* Hover effect with stronger glow */
circle.hint-circle:hover {
    filter: url(#glow-filter-strong) !important;
    animation: none !important;
}
.consortium-animate.show {
    opacity: 1 !important;
    transform: translateY(0) !important;
}
@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

html {
    scroll-behavior: auto; /* отключаем глобально */
}


.animate-scroll {
    animation: scroll 20s linear infinite;
}

.animate-scroll:hover {
    animation-play-state: paused;
}

.person-card {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s, transform 0.3s;
}

.person-card.show {
    opacity: 1;
    transform: scale(1);
}

.filter-btn.active {
    background-color: #37505F;
}

/* Publication filter buttons */
.pub-filter-btn.active {
    background-color: #37505F;
}

/* Publication card animations */
.publication-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s, transform 0.4s;
}

.publication-card.show {
    opacity: 1;
    transform: translateY(0);
}

.publication-card .publication {
    transition: all 0.3s ease;
}

.publication-card.expanded .publication {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.pub-abstract {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus states for keyboard navigation */
.btn:focus,
.filter-btn:focus,
a:focus {
    outline: 3px solid #79ACB3;
    outline-offset: 2px;
}

circle.hint-circle:focus {
    outline: 3px solid white;
    outline-offset: 4px;
}

/* Improve button and link hover states */
.btn:hover,
.btn:focus {
    background-color: rgba(121, 172, 179, 0.1);
}

.filter-btn:focus-visible {
    outline: 3px solid #E2EFF1;
    outline-offset: 2px;
}

/* Remove old stroke-based glow approach - using SVG filters instead */
circle.cls-7.hint-circle {
    transition: filter 0.2s ease, opacity 0.2s ease;
}

/* News card animations */
.news-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.news-card.show {
    opacity: 1;
    transform: translateY(0);
}

.news-card img {
    transition: transform 0.3s ease;
}

.news-card:hover img {
    transform: scale(1.05);
}

/* News placeholder animation */
#news-placeholder {
    animation: fadeIn 0.5s ease;
}
