@font-face {
    font-family: 'Girassol';
    src: url('fonts/Girassol-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body {
    font-family: 'Girassol', Helvetica, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    /* CHANGED: Set to pure black background */
    background: #000000;
    color: #FFFFFF;
    position: relative;
    font-weight: normal;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.chrome-text {
    background: linear-gradient(45deg, #A0A0A0, #FFFFFF, #C0C0C0, #333333);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(255, 255, 255, 0.2);
    animation: chromeShine 4s infinite ease-in-out;
}

.toplogo-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 56px;
    background: linear-gradient(180deg, rgba(20, 20, 20, 0.9), rgba(40, 40, 40, 0.8));
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem 0;
    z-index: 1200;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
}

.toplogo-container img {
    height: 48px;
    width: auto;
    transition: transform 0.3s ease-in-out;
}

.toplogo-container img:hover {
    transform: scale(1.05);
}

.topbar {
    position: fixed;
    top: 56px;
    left: 0;
    width: 100%;
    background: linear-gradient(180deg, rgba(20, 20, 20, 0.9), rgba(40, 40, 40, 0.8));
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1100;
    padding: 0.75rem 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
    transition: transform 3s cubic-bezier(0.4, 0.0, 0.2, 1), opacity 3s cubic-bezier(0.4, 0.0, 0.2, 1);
    opacity: 0;
    transform: translateY(-100%);
}

.topbar.visible {
    opacity: 1;
    transform: translateY(0);
}

.topbar.hidden {
    opacity: 0;
    transform: translateY(-100%);
}

.topbar-nav {
    display: flex;
    align-items: center;
}

.topbar-nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: center;
}

.topbar-nav a {
    font-family: 'Girassol', Helvetica, sans-serif;
    font-size: 0.95rem;
    font-weight: normal;
    color: #E0E0E0;
    text-decoration: none;
    text-transform: uppercase;
    position: relative;
    transition: color 0.5s ease-in-out, transform 0.3s ease-in-out;
}

.topbar-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: #C0C0C0;
    transition: width 0.5s ease-in-out;
}

.topbar-nav a:hover::after {
    width: 100%;
}

.topbar-nav a:hover {
    color: #FFFFFF;
    transform: scale(1.1);
}

.hamburger {
    display: none;
    font-size: 1.5rem;
    color: #E0E0E0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.language-switcher {
    display: flex;
    gap: 0.5rem;
}

.language-button {
    background: transparent;
    border: none;
    color: #E0E0E0;
    font-family: Helvetica, sans-serif;
    font-size: 0.8rem;
    font-weight: normal;
    cursor: pointer;
    padding: 0.3rem 0.6rem;
    transition: color 0.3s ease-in-out;
}

.language-button:hover {
    color: #C0C0C0;
}

.language-button.active {
    color: #C0C0C0;
    border-bottom: 1px solid #C0C0C0;
}

.flag-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: transparent;
}

.flag-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 50%, rgba(0, 0, 0, 0.7));
    z-index: 1;
}

.flag-container img {
    width: 70vw;
    height: 70vh;
    object-fit: contain;
    transform: translateX(40%) translateY(0%);
    filter: contrast(1.2) brightness(1.1);
    opacity: 1;
    transition: transform 0.6s ease-in-out, opacity 0.6s ease-in-out;
}

.flag-container img.lang-ru {
    transform: translateX(90%);
    opacity: 1;
}

.hero {
    height: 90vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    position: relative;
    z-index: 2;
    color: #FFFFFF;
    padding-left: 2rem;
    margin-top: 88px;
    background: transparent;
}

.hero-content h1 {
    font-family: 'Girassol', Helvetica, sans-serif;
    font-size: 6rem;
    font-weight: normal;
    text-transform: uppercase;
    animation: fadeInUp 1.5s ease-in-out;
}

.hero-content p {
    font-family: 'Girassol', Helvetica, sans-serif;
    font-size: 2.5rem;
    margin: 3rem 1rem;
    color: #E0E0E0;
    font-weight: normal;
}

.hero-content .cta-button {
    background: linear-gradient(45deg, #A0A0A0, #FFFFFF, #C0C0C0);
    color: #333333;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-family: 'Girassol', Helvetica, sans-serif;
    font-weight: normal;
    border-radius: 50px;
    border: none;
    text-transform: uppercase;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3), 0 2px 6px rgba(255, 255, 255, 0.2);
    filter: brightness(1.1);
}

#canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    opacity: 0.8;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.glassmorphic {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 1rem;
  padding: 2rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.glassmorphic.visible {
    opacity: 1;
}

/* FIXED: Gallery background now fits within the items' borders */
.gallery-grid {
    display: flex;
    flex-direction: column;
    gap: 6rem;
    padding: 6rem 2rem; /* Added horizontal padding */
    background: rgba(255, 255, 255, 0.2);
    z-index: 1;
    border-radius: 0; /* Remove border radius for now */
    margin: 0 auto; /* Center the container */
    max-width: 1400px; /* Match container width */
}

.gallery-item {
    display: flex;
    align-items: center;
    width: 100%;
    position: relative;
    cursor: pointer;
    opacity: 1;
    transform: translateY(00);
}

.portrait-centered {
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center center;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-item:hover .image {
    /* transform: scale(1.02); */
}

.gallery-item:nth-child(odd) {
    flex-direction: row;
}

.gallery-item:nth-child(even) {
    flex-direction: row-reverse;
}

.gallery-item .image {
    width: 50%;
    height: 450px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
    border-radius: 12px;
    overflow: hidden;
}

.gallery-item .image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.4), transparent);
    opacity: 0;
}

.gallery-item .info {
    width: 50%;
    padding: 3rem;
    text-align: left;
}

.gallery-item .info h3 {
    font-family: 'Girassol', Helvetica, sans-serif;
    font-size: 2.4rem;
    font-weight: normal;
    text-transform: uppercase;
    margin-bottom: 1rem;
}


.gallery-item .info p {
    font-family: 'Girassol', Helvetica, sans-serif;
    font-size: 1.5rem;
    color: #E0E0E0;
    font-weight: normal;
    line-height: 1.5;
}

.technologies {
    background: linear-gradient(180deg, rgba(20, 20, 20, 0.7), rgba(40, 40, 40, 0.6));
    padding: 3rem 0;
    backdrop-filter: blur(12px);
    z-index: 1;
    transition: opacity 1.5s ease-out;
    opacity: 1;
}

.technologies.visible {
    opacity: 1;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 2rem;
}

@media (min-width: 1024px) {
    .tech-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.tech-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    text-align: center;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.4s ease-in-out, box-shadow 0.4s ease-in-out;
    opacity: 1;
    
    /* 4:3 aspect ratio - STRICT */
    width: 100%;
    aspect-ratio: 4 / 3;
    
    /* Content container with padding */
    padding: 2rem;
    overflow: hidden; /* Prevent content from breaking ratio */
    
    /* Flexbox for content alignment */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.tech-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.tech-card h3 {
    font-family: 'Girassol', Helvetica, sans-serif;
    font-size: 1.8rem;
    font-weight: normal;
    text-transform: uppercase;
    margin-bottom: 0;
    flex-shrink: 0;
    max-width: 100%;
}

.tech-card p {
    font-family: 'Girassol', Helvetica, sans-serif;
    font-size: 1.2rem;
    color: #E0E0E0;
    font-weight: normal;
    line-height: 1.5;
    margin: 0;
    flex-grow: 0; /* Don't let text push boundaries */
    display: flex;
    align-items: center;
    max-width: 100%;
    overflow: hidden; /* Hide overflow text */
    text-overflow: ellipsis;
}

.more-information {
    background: linear-gradient(180deg, rgba(20, 20, 20, 0.7), rgba(40, 40, 40, 0.6));
    padding: 3rem 0;
    backdrop-filter: blur(12px);
    z-index: 1;
    transition: opacity 1.5s ease-out;
    opacity: 1;
}

.more-information.visible {
    opacity: 1;
}

.more-information .glassmorphic h2 {
    font-family: 'Girassol', Helvetica, sans-serif;
    font-size: 2.5rem;
    font-weight: normal;
    text-transform: uppercase;
    margin-bottom: 2rem;
    text-align: center;
    cursor: pointer;
    user-select: none;
}

.more-information .glassmorphic h2:hover {
    opacity: 0.8;
}

.more-information .glassmorphic .accordion-content {
    max-height: 100px;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out;
}

.more-information .glassmorphic p,
.more-information .glassmorphic ul {
    font-family: 'Girassol', Helvetica, sans-serif;
    font-size: 1.1rem;
    color: #E0E0E0;
    font-weight: normal;
    line-height: 1.6;
}

.more-information .glassmorphic ul {
    list-style-position: inside;
}

.cta-button {
    background: linear-gradient(45deg, #A0A0A0, #FFFFFF, #C0C0C0);
    color: #333333;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-family: 'Girassol', Helvetica, sans-serif;
    font-weight: normal;
    border-radius: 50px;
    border: none;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3), 0 2px 6px rgba(255, 255, 255, 0.2);
    filter: brightness(1.1);
    transition: transform 0.3s ease-in-out, filter 0.3s ease-in-out;
}

.cta-button:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
}

.toggle-arrow {
    display: inline-block;
    transition: transform 0.3s ease-in-out;
    margin-left: 0.5rem;
}

.toggle-arrow.rotated {
    transform: rotate(180deg);
}

.media-player {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
}

.media-player.active {
    display: flex;
}

.media-player-content {
    width: 90%;
    max-width: 1200px;
    height: 80vh;
    display: flex;
    background: rgba(20, 20, 20, 0.9);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    position: relative;
}

.media-player-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    color: #FFFFFF;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.3s ease-in-out;
}

.media-player-close:hover {
    transform: scale(1.2);
}

.media-player-image {
    width: 60%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
}

.media-player-info {
    width: 40%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #FFFFFF;
}

.media-player-info h3 {
    font-family: 'Girassol', Helvetica, sans-serif;
    font-size: 2rem;
    font-weight: normal;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

/* INCREASED: Media player description font size */
.media-player-info p {
    font-family: 'Girassol', Helvetica, sans-serif;
    font-size: 1.3rem; /* Increased from 1.1rem */
    color: #E0E0E0;
    font-weight: normal;
    line-height: 1.6;
}

#contact {
    background: linear-gradient(180deg, rgba(20, 20, 20, 0.7), rgba(40, 40, 40, 0.6));
    padding: 3rem 0;
    backdrop-filter: blur(12px);
    z-index: 1;
    transition: opacity 1.5s ease-out;
    opacity: 1;
}

#contact.visible {
    opacity: 1;
}

#contact .glassmorphic h2 {
    font-family: 'Girassol', Helvetica, sans-serif;
    font-size: 2.5rem;
    font-weight: normal;
    text-transform: uppercase;
    margin-bottom: 0;
    text-align: center;
}

#contactToggle {
    user-select: none;
}

#contactContent {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out;
}

#contactContent p {
    color: white;
}

.contact-arrow {
    transition: transform 0.3s ease-in-out;
    vertical-align: middle;
}

.chrome-text {
    background: linear-gradient(45deg, #a0a0a0, #ffffff, #c0c0c0, #333333);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Ensure chrome-text works on links */
a.chrome-text {
    background: linear-gradient(45deg, #a0a0a0, #ffffff, #c0c0c0, #333333);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: underline;
    text-decoration-color: #C0C0C0;
    text-underline-offset: 4px;
}

a.chrome-text:hover {
    background: linear-gradient(45deg, #C0C0C0, #FFFFFF, #E0E0E0, #555555);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer {
    background: linear-gradient(180deg, rgba(20, 20, 20, 0.7), rgba(40, 40, 40, 0.6));
    padding: 3rem 0;
    color: #FFFFFF;
    backdrop-filter: blur(12px);
    z-index: 1;
    transition: opacity 1.5s ease-out;
    opacity: 1;
}

.footer.visible {
    opacity: 1;
}

.footer .container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    justify-items: center;
}

.footer h3 {
    font-family: 'Girassol', Helvetica, sans-serif;
    font-size: 1.2rem;
    font-weight: normal;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.footer ul {
    list-style: none;
    padding: 0;
    text-align: center;
}

.footer ul li {
    margin-bottom: 0.5rem;
}

/* INCREASED: Footer link font size */
.footer a {
    color: #E0E0E0;
    text-decoration: none;
    font-family: 'Girassol', Helvetica, sans-serif;
    font-size: 1.1rem; /* Increased from 1rem */
    font-weight: normal;
    transition: color 0.3s ease-in-out;
}

.footer a:hover {
    color: #C0C0C0;
}

.legal-text {
    font-family: 'Girassol', Helvetica, sans-serif;
    font-size: 0.9rem;
    color: #E0E0E0;
    margin-top: 2rem;
    text-align: center;
    font-weight: normal;
}

.footer-logo {
    display: flex;
    justify-content: center;
}

.footer-logo img {
    height: 48px;
    width: auto;
    transition: transform 0.3s ease-in-out;
}

.footer-logo img:hover {
    transform: scale(1.05);
}

.error-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 0, 0, 0.8);
    color: #FFFFFF;
    padding: 1rem;
    border-radius: 8px;
    z-index: 3000;
    display: none;
}

.error-message.active {
    display: block;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(50px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1024px) {
    .flag-container {
        width: 100vw;
        height: 80vh;
    }

    .flag-container img {
        width: 50vw;
        height: 37vh;
        transform: translateX(75%);
    }

    .hero-content h1 {
        font-size: 4.8rem;
    }

    .hero-content p {
        font-size: 1.3rem;
    }

    .gallery-item .image {
        height: 450px;
    }

    .gallery-item .info {
        padding: 2rem;
    }

    .gallery-item .info h3 {
        font-size: 2rem;
    }

    /* INCREASED: Gallery descriptions on tablets */
    .gallery-item .info p {
        font-size: 1.5rem; /* Increased from 1.2rem */
    }

    .tech-card h3 {
        font-size: 1.6rem;
    }

    .footer h3 {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .toplogo-container {
        height: 48px;
    }

    .toplogo-container img {
        height: 40px;
    }

    .topbar {
        top: 48px;
        padding: 0.4rem 0.8rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .hamburger {
        display: block;
        font-size: 1.3rem;
        padding: 0.3rem;
    }

    .topbar-nav {
        width: 100%;
        display: none;
    }

    .topbar-nav.active {
        display: block;
    }

    .topbar-nav ul {
        flex-direction: column;
        gap: 0.8rem;
        width: 100%;
        padding: 0.8rem 0;
    }

    .topbar-nav a {
        font-size: 0.85rem;
        padding: 0.4rem 0;
    }

    .language-switcher {
        margin-top: 0.4rem;
        gap: 0.3rem;
    }

    .language-button {
        font-size: 0.7rem;
        padding: 0.15rem 0.4rem;
    }

    .flag-container {
        width: 100vw;
        height: 70vh;
    }

    .flag-container img {
        width: 60vw;
        height: 30vh;
        transform: translateX(50%);
    }

    .hero {
        height: 60vh;
        padding-left: 1rem;
        margin-top: 80px;
    }

    .hero-content h1 {
        font-size: 3.5rem;
    }

    .hero-content p {
        font-size: 1.1rem;
        max-width: 90%;
    }

    .hero-content .cta-button {
        padding: 0.8rem 2rem;
        font-size: 0.95rem;
    }

    /* FIXED: Gallery grid padding for mobile */
    .gallery-grid {
        padding: 4rem 1rem;
    }

    .gallery-item {
        flex-direction: column !important;
        width: 100%;
    }

    .gallery-item .image {
        width: 100%;
        height: 350px;
        background-position: center center;
        overflow: hidden;
    }

    .gallery-item .info {
        width: 100%;
        text-align: center;
        padding: 3.5rem 1.5rem;
    }

    .gallery-item .info h3 {
        font-size: 1.8rem;
    }

    .gallery-item .info p {
        font-size: 1.2rem; /* Increased from 0.95rem */
        line-height: 1.6;
    }

    .tech-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .tech-card {
        padding: 1.5rem;
    }

    .tech-card h3 {
        font-size: 1.5rem;
    }

    .media-player-content {
        flex-direction: column;
        height: 90vh;
    }

    .media-player-image {
        width: 100%;
        height: 55%;
    }

    .media-player-info {
        width: 100%;
        height: 45%;
        padding: 1.5rem;
    }

    .media-player-info h3 {
        font-size: 1.6rem;
    }

    /* INCREASED: Media player descriptions on mobile */
    .media-player-info p {
        font-size: 1.1rem; /* Increased from 0.9rem */
    }

    .footer .container {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .footer h3 {
        font-size: 1rem;
    }

    /* INCREASED: Footer links on mobile */
    .footer a {
        font-size: 1rem; /* Increased from 0.85rem */
    }

    .legal-text {
        font-size: 0.8rem;
    }

    .footer-logo img {
        height: 40px;
    }
}

@media (max-width: 480px) {
    .toplogo-container {
        height: 40px;
    }

    .toplogo-container img {
        height: 36px;
    }

    .topbar {
        top: 40px;
        padding: 0.3rem 0.6rem;
    }

    .hamburger {
        font-size: 1.2rem;
        padding: 0.2rem;
    }

    .topbar-nav a {
        font-size: 0.75rem;
        padding: 0.3rem 0;
    }

    .language-button {
        font-size: 0.65rem;
        padding: 0.1rem 0.3rem;
    }

    .flag-container {
        width: 100vw;
        height: 60vh;
    }

    .flag-container img {
        width: 70vw;
        height: 28vh;
        transform: translateX(45%);
    }

    .hero-content h1 {
        font-size: 2.8rem;
    }

    .hero-content p {
        font-size: 1.25rem;
    }

    .hero-content .cta-button {
        padding: 0.7rem 1.8rem;
        font-size: 0.85rem;
    }

    .gallery-item .image {
        height: 300px;
        overflow: hidden;
    }

    .gallery-item .info h3 {
        font-size: 1.5rem;
    }

    /* INCREASED: Gallery descriptions on small mobile */
    .gallery-item .info p {
        font-size: 1.1rem; /* Increased from 0.85rem */
    }

    .tech-card h3 {
        font-size: 1.4rem;
    }

    .media-player-info h3 {
        font-size: 1.4rem;
    }
}

.hero-logo {
    max-width: 400px;
    width: 100%;
    height: auto;
    animation: fadeInUp 1.5s ease-in-out;
}