:root {
    --bg-color: #0a0a0a;
    --text-color: #e0e0e0;
    --accent-color: #888;
    --font-serif: 'Cormorant Garamond', serif;
    --font-sans: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 1s ease;
}

header {
    padding: 4rem 2rem;
    text-align: center;
    animation: fadeIn 1.5s ease-out;
    max-width: 1600px;
    margin: 0 auto;
}

header h1 {
    font-family: var(--font-serif);
    font-size: 4rem;
    font-weight: 300;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

header p {
    color: var(--accent-color);
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Grid Layout for Model Showcase */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
    position: relative;
    /* Context for z-index */
}

.model-card {
    position: relative;
    aspect-ratio: 3 / 4;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease, filter 0.3s ease;
    border-radius: 4px;
}

.model-card.disabled {
    cursor: default;
}

.main-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    transition: transform 0.5s ease;
    z-index: 2;
    position: relative;
}

/* Sub Photos Container */
.sub-photos {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Let clicks pass through to card */
    z-index: 1;
}

.sub-photo {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60%;
    /* Smaller than main */
    height: auto;
    aspect-ratio: 3/4;
    object-fit: cover;
    transform: translate(-50%, -50%) scale(0.5) rotate(0deg);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Bouncy effect */
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

/* Hover Effects */

/* Dim other cards when one is active */
.gallery.has-active .model-card:not(.active) {
    opacity: 0.2;
    filter: grayscale(100%) blur(2px);
    transform: scale(0.95);
}

/* Active Card State */
.model-card.active {
    z-index: 100;
    /* Bring to front */
    transform: scale(1.1);
}

.model-card.active .main-photo {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

/* Fan Out Animation */
.model-card.active .sub-photo:nth-child(1) {
    opacity: 1;
    transform: translate(-140%, -80%) rotate(-15deg) scale(1);
}

.model-card.active .sub-photo:nth-child(2) {
    opacity: 1;
    transform: translate(40%, -80%) rotate(15deg) scale(1);
}

.model-card.active .sub-photo:nth-child(3) {
    opacity: 1;
    transform: translate(-140%, 20%) rotate(-5deg) scale(1);
}

.model-card.active .sub-photo:nth-child(4) {
    opacity: 1;
    transform: translate(40%, 20%) rotate(5deg) scale(1);
}

.photo-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem 1.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
    pointer-events: none;
    z-index: 3;
}

.model-card:hover .photo-info {
    opacity: 1;
    transform: translateY(0);
}

.photo-info h3 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 0.25rem;
    color: #fff;
}

.photo-info p {
    font-size: 0.85rem;
    color: #ccc;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 0px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
    letter-spacing: 0.05em;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 2rem;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-container {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.nav-brand {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    /* Initial larger font size */
    font-weight: 600;
    letter-spacing: 0.05em;
    transition: font-size 0.3s ease;
    /* Smooth transition */
}

.navbar.scrolled .nav-brand {
    font-size: 1.5rem;
    /* Scrolled font size */
}

.nav-brand a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-brand a:hover {
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -5px;
    left: 0;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.5rem;
    z-index: 1001;
}

.bar {
    display: block;
    width: 25px;
    height: 2px;
    margin: 5px auto;
    background-color: var(--text-color);
    transition: all 0.3s ease-in-out;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .nav-links {
        position: fixed;
        left: -100%;
        top: 0;
        gap: 0;
        flex-direction: column;
        background-color: rgba(10, 10, 10, 0.98);
        width: 100%;
        height: 100vh;
        text-align: center;
        transition: 0.3s;
        justify-content: center;
        backdrop-filter: blur(10px);
        padding-top: 4rem;
        /* Space for fixed header/hamburger */
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links li {
        margin: 2rem 0;
    }

    .nav-links a {
        font-size: 1.5rem;
    }
}

.hidden-section {
    display: none !important;
}

section {
    padding: 6rem 2rem 8rem 2rem;
    min-height: 100vh;
}

#home {
    padding-top: 8rem;
    /* Account for fixed navbar */
}

#about {
    padding: 6rem 2rem 8rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

#publications {
    padding: 8rem 2rem 8rem 2rem;
    min-height: 100vh;
}

#publications h2 {
    padding-top: 3rem;
}

#contact {
    padding: 6rem 2rem 8rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* Mobile specific adjustments */
@media (max-width: 768px) {
    #contact {
        padding: 8rem 2rem 10rem 2rem;
    }
}

.content-section {
    max-width: 1200px;
    margin: 0 auto;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

h2 {
    font-family: var(--font-serif);
    font-size: 3rem;
    font-weight: 300;
    margin-bottom: 2rem;
    text-align: center;
}

/* About Section */
.about-content p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: #ccc;
    line-height: 1.8;
}

/* Contact Section */
.contact-intro {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 1.2rem;
    color: var(--accent-color);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
}

@media (min-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.contact-info h3 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

.contact-info p {
    margin-bottom: 1rem;
    font-size: 1rem;
}

.contact-info a {
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    transition: border-color 0.3s ease;
}

.contact-info a:hover {
    border-color: #fff;
}

.contact-info .note {
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--accent-color);
    font-style: italic;
}

/* Form */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: #fff;
    font-family: var(--font-sans);
    transition: border-color 0.3s ease, background 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.btn-submit {
    display: inline-block;
    padding: 1rem 2rem;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 4px;
    font-family: var(--font-sans);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.1);
}

/* Footer */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
}

.footer-container {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-container p {
    font-size: 0.9rem;
    color: var(--accent-color);
}

.footer-container .social-links {
    display: flex;
    gap: 1.5rem;
}

.footer-container .social-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.2rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.footer-container .social-links a:hover {
    color: var(--accent-color);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
        text-align: center;
    }
}

/* Modal Gallery */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-content.gallery-modal {
    width: 90%;
    max-width: 1400px;
    height: 85vh;
    background: transparent;
    display: flex;
    flex-direction: column;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
    font-size: 2.5rem;
    margin: 0;
    text-align: left;
}

#close-modal {
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

#close-modal:hover {
    color: var(--accent-color);
}

.modal-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    overflow-y: auto;
    padding-right: 1rem;
    /* Space for scrollbar */
}

.modal-gallery-grid::-webkit-scrollbar {
    width: 6px;
}

.modal-gallery-grid::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

.modal-gallery-item {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    border-radius: 4px;
    transition: transform 0.3s ease;
}

.modal-gallery-item:hover {
    transform: scale(1.02);
}

.modal-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.98);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.visible {
    opacity: 1;
    pointer-events: auto;
}

#lightbox-img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    color: #fff;
    font-size: 3rem;
    cursor: pointer;
    z-index: 3001;
    transition: color 0.3s ease;
}

.lightbox-close:hover {
    color: var(--accent-color);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #fff;
    font-size: 2rem;
    padding: 1rem;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-color);
}

.lightbox-nav.prev {
    left: 20px;
}

.lightbox-nav.next {
    right: 20px;
}