/* Cross-browser reset and normalization */
* {
    margin: 0;
    padding: 0;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
}

/* Background image */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: #1e2a38;
    overflow: hidden;
}

.background-image {
    width: 100%;
    height: 100%;
    position: relative;
    background-image: url('images/unigair%20taustapilt.png');
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.contact-link {
    color: inherit;
    text-decoration: none;
}

.contact-link:hover {
    text-decoration: underline;
}

/* White Overlay */
.contact-overlay {
    position: relative;
    z-index: 1;
    background: #FFFFFF;
    -webkit-border-radius: 32px;
    -moz-border-radius: 32px;
    border-radius: 32px;
    max-width: 1100px;
    width: 90%;
    margin: 5vh auto;
    padding: 50px 60px;
    -webkit-box-shadow: 0 25px 70px rgba(0, 0, 0, 0.4);
    -moz-box-shadow: 0 25px 70px rgba(0, 0, 0, 0.4);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.4);
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    min-height: 75vh;
    -webkit-transition: height 0.5s ease, min-height 0.5s ease;
    -moz-transition: height 0.5s ease, min-height 0.5s ease;
    -o-transition: height 0.5s ease, min-height 0.5s ease;
    transition: height 0.5s ease, min-height 0.5s ease;
    overflow: hidden;
}

.page-content {
    -webkit-will-change: opacity;
    will-change: opacity;
    -webkit-transition: opacity 0.8s ease-out;
    -moz-transition: opacity 0.8s ease-out;
    -o-transition: opacity 0.8s ease-out;
    transition: opacity 0.8s ease-out;
}

/* Header */
.overlay-header {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-justify-content: space-between;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    margin-bottom: 50px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.logo-top {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 12px;
}

.unigair-logo {
    color: #1a2838;
    width: 40px;
    height: 40px;
}

.logo-text {
    font-size: 24px;
    font-weight: 600;
    color: #1a2838;
    letter-spacing: -0.02em;
}

.top-nav {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    gap: 24px;
}

.nav-button {
    font-size: 16px;
    color: #1a2838;
    text-decoration: none;
    font-weight: 500;
    -webkit-transition: opacity 0.3s ease;
    -moz-transition: opacity 0.3s ease;
    -o-transition: opacity 0.3s ease;
    transition: opacity 0.3s ease;
    padding: 8px 16px;
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    border-radius: 8px;
}

.nav-button:hover {
    opacity: 0.7;
    background-color: #f5f5f5;
}

.nav-button.active {
    background-color: #1a2838;
    color: #FFFFFF;
    opacity: 1;
}

.nav-button.active:hover {
    background-color: #2a3a4a;
    opacity: 1;
}

/* Main Content */
.overlay-content {
    display: -ms-grid;
    display: grid;
    -ms-grid-columns: 1fr 1fr;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    -ms-flex: 1;
    flex: 1;
    margin-bottom: 40px;
}

/* Works Page */
.works-main-content {
    flex: 1;
    margin-bottom: 40px;
}

.works-heading {
    font-size: 32px;
    font-weight: 600;
    color: #1a2838;
    margin-bottom: 40px;
    letter-spacing: -0.02em;
}

.works-grid {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    gap: 24px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: #c0c0c0 #f0f0f0;
    -webkit-overflow-scrolling: touch;
}

.works-grid::-webkit-scrollbar {
    height: 8px;
}

.works-grid::-webkit-scrollbar-track {
    background: #f0f0f0;
    -webkit-border-radius: 4px;
    border-radius: 4px;
}

.works-grid::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    -webkit-border-radius: 4px;
    border-radius: 4px;
}

.works-grid::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

.work-card {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-flex-shrink: 0;
    -ms-flex-negative: 0;
    flex-shrink: 0;
    -webkit-border-radius: 12px;
    -moz-border-radius: 12px;
    border-radius: 12px;
    overflow: hidden;
}

.work-card-image {
    width: 400px;
    height: 300px;
    background-color: #e0e0e0;
    -webkit-border-radius: 12px;
    -moz-border-radius: 12px;
    border-radius: 12px;
    -o-object-fit: cover;
    object-fit: cover;
    display: block;
    cursor: pointer;
    -webkit-transition: -webkit-transform 0.2s ease, opacity 0.2s ease;
    -moz-transition: -moz-transform 0.2s ease, opacity 0.2s ease;
    -o-transition: -o-transform 0.2s ease, opacity 0.2s ease;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.work-card-image:hover {
    -webkit-transform: scale(1.02);
    -moz-transform: scale(1.02);
    -ms-transform: scale(1.02);
    -o-transform: scale(1.02);
    transform: scale(1.02);
    opacity: 0.9;
}


/* Contact Form Section */
.contact-form-section {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
}

.section-heading {
    font-size: 32px;
    font-weight: 600;
    color: #1a2838;
    margin-bottom: 32px;
    letter-spacing: -0.02em;
}

.contact-form {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    gap: 28px;
}

.form-group {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    gap: 12px;
}

.form-label {
    font-size: 16px;
    color: #1a2838;
    font-weight: 500;
}

.form-input {
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    -webkit-border-radius: 12px;
    -moz-border-radius: 12px;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    color: #1a2838;
    background: #FFFFFF;
    -webkit-transition: border-color 0.3s ease;
    -moz-transition: border-color 0.3s ease;
    -o-transition: border-color 0.3s ease;
    transition: border-color 0.3s ease;
    outline: none;
    width: 100%;
    max-width: 400px;
}

.form-input:focus {
    border-color: #1a2838;
}

.form-textarea {
    resize: vertical;
    min-height: 140px;
    font-family: inherit;
    max-width: 400px;
}

.form-submit {
    padding: 14px 32px;
    background-color: #1a2838;
    color: #FFFFFF;
    border: none;
    -webkit-border-radius: 12px;
    -moz-border-radius: 12px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    -webkit-transition: background-color 0.3s ease, -webkit-transform 0.2s ease;
    -moz-transition: background-color 0.3s ease, -moz-transform 0.2s ease;
    -o-transition: background-color 0.3s ease, -o-transform 0.2s ease;
    transition: background-color 0.3s ease, transform 0.2s ease;
    -webkit-align-self: flex-start;
    -ms-flex-item-align: start;
    align-self: flex-start;
    margin-top: 8px;
}

.form-submit:hover {
    background-color: #2a3a4a;
    -webkit-transform: translateY(-1px);
    -moz-transform: translateY(-1px);
    -ms-transform: translateY(-1px);
    -o-transform: translateY(-1px);
    transform: translateY(-1px);
}

.form-submit:active {
    -webkit-transform: translateY(0);
    -moz-transform: translateY(0);
    -ms-transform: translateY(0);
    -o-transform: translateY(0);
    transform: translateY(0);
}

/* Contact Info Section */
.contact-info-section {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
}

.contact-details {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    gap: 20px;
}

.contact-item {
    font-size: 16px;
    color: #1a2838;
    line-height: 1.6;
}

/* Footer */
.overlay-footer {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

.logo-bottom {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 12px;
}

/* Responsive Design */
@media (max-width: 968px) {
    .overlay-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .works-grid {
        gap: 20px;
    }
    
    .work-card-image {
        width: 300px;
        height: 225px;
    }
    
    .contact-overlay {
        padding: 30px 30px;
        width: 95%;
    }
    
    .overlay-header {
        -webkit-flex-direction: column;
        -ms-flex-direction: column;
        flex-direction: column;
        -webkit-box-align: start;
        -webkit-align-items: flex-start;
        -ms-flex-align: start;
        align-items: flex-start;
        gap: 20px;
    }
    
    .top-nav {
        width: 100%;
        -webkit-justify-content: flex-start;
        -ms-flex-pack: start;
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .contact-overlay {
        padding: 24px 20px;
        margin: 2vh auto;
        min-height: auto;
    }
    
    .section-heading,
    .works-heading {
        font-size: 24px;
        margin-bottom: 24px;
    }
    
    .overlay-header {
        margin-bottom: 30px;
    }
    
    .works-grid {
        gap: 16px;
    }
    
    .work-card-image {
        width: 250px;
        height: 187px;
    }
}

/* Lightbox Modal */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-animation: fadeIn 0.2s ease;
    -moz-animation: fadeIn 0.2s ease;
    -o-animation: fadeIn 0.2s ease;
    animation: fadeIn 0.2s ease;
}

.lightbox-modal.is-open {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
}

@-webkit-keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@-moz-keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.lightbox-image {
    max-width: 90%;
    max-height: 90%;
    -o-object-fit: contain;
    object-fit: contain;
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    border-radius: 8px;
    -webkit-box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    -moz-box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    -webkit-animation: zoomIn 0.3s ease;
    -moz-animation: zoomIn 0.3s ease;
    -o-animation: zoomIn 0.3s ease;
    animation: zoomIn 0.3s ease;
}

@-webkit-keyframes zoomIn {
    from {
        -webkit-transform: scale(0.8);
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        -webkit-transform: scale(1);
        transform: scale(1);
        opacity: 1;
    }
}

@-moz-keyframes zoomIn {
    from {
        -moz-transform: scale(0.8);
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        -moz-transform: scale(1);
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        -webkit-transform: scale(0.8);
        -moz-transform: scale(0.8);
        -ms-transform: scale(0.8);
        -o-transform: scale(0.8);
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        -webkit-transform: scale(1);
        -moz-transform: scale(1);
        -ms-transform: scale(1);
        -o-transform: scale(1);
        transform: scale(1);
        opacity: 1;
    }
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #ffffff;
    font-size: 48px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    -webkit-transition: opacity 0.3s ease, -webkit-transform 0.2s ease;
    -moz-transition: opacity 0.3s ease, -moz-transform 0.2s ease;
    -o-transition: opacity 0.3s ease, -o-transform 0.2s ease;
    transition: opacity 0.3s ease, transform 0.2s ease;
    z-index: 10000;
}

.lightbox-close:hover {
    opacity: 0.7;
    -webkit-transform: scale(1.1);
    -moz-transform: scale(1.1);
    -ms-transform: scale(1.1);
    -o-transform: scale(1.1);
    transform: scale(1.1);
}

@media (max-width: 640px) {
    .lightbox-close {
        top: 20px;
        right: 20px;
        font-size: 36px;
    }
    
    .lightbox-image {
        max-width: 95%;
        max-height: 85%;
    }
}

