:root {
    --bg-color: #f4f4f4;
    --text-color: #1a1a1a;
    --accent-color: #333;
    --nav-color: #666;
    --nav-active: #000;
    --heart-color: #e74c3c;
    --spacing-unit: 1rem;
    --content-width: 900px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;

    /* Protection: Prevent Text Selection */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* Paper Noise Overlay */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.site-wrapper {
    width: 100%;
    max-width: var(--content-width);
    padding: 4rem 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    background-color: transparent;
    /* Let body bg show through */
}

/* Typography */
header {
    text-align: center;
    margin-bottom: 3rem;
}

/* Utility Class */
.hidden {
    display: none !important;
}

.designer-name {
    font-family: 'Cinzel', serif;
    font-size: 3.5rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.designer-tagline {
    font-size: 1.2rem;
    /* Increased size */
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--nav-active);
    border-top: 1px solid #ccc;
    display: inline-block;
    padding-top: 0.8rem;
    width: auto;
    /* Allow natural width */
    min-width: 300px;
    /* Minimum width for aesthetics */
}

/* Navigation */
nav {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 4rem;
}

.nav-btn {
    background: none;
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    cursor: pointer;
    color: var(--nav-color);
    transition: color 0.3s ease;
    text-transform: uppercase;
    padding-bottom: 2px;
    border-bottom: 1px solid transparent;
}

.nav-btn:hover,
.nav-btn.active {
    color: var(--nav-active);
    border-bottom: 1px solid var(--nav-active);
}

/* Main Content Area */
main {
    flex-grow: 1;
    width: 100%;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.fade-out {
    opacity: 0;
}

/* Works Grid */
.works-grid {
    display: grid;
    /* Force 4 columns on larger screens, auto on smaller */
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    /* Very small gap */
    justify-content: center;
}

@media (max-width: 900px) {
    .works-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .works-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
    padding-bottom: 2rem;
}

.page-btn {
    background: transparent;
    border: 1px solid #ccc;
    color: #666;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.page-btn:hover {
    border-color: #000;
    color: #000;
}

.page-btn.active {
    background-color: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

.project-card {
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
}



.cover-wrapper {
    width: 100%;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background-color: #e5e5e5;
    /* Light gray background exposed on hover */
    box-shadow: none;
    /* Shadow moves to image on hover for book effect */
    margin-bottom: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    /* Force clickable */
}

.cover-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease-out, box-shadow 0.4s ease-out;
    transform: scale(1);
    transform-origin: center center;
    pointer-events: auto;
    /* Force clickable */
}

.project-card:hover .cover-wrapper img {
    transform: scale(0.7);
    box-shadow: 10px 20px 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.8s ease;
    /* Stronger 3D Book shadow */
}

/* Like button styles removed */

/* About Section */
.about-container {
    display: flex;
    gap: 4rem;
    align-items: center;
    max-width: 700px;
    margin: 0 auto;
    padding-top: 2rem;
}

.profile-img-wrapper {
    width: 250px;
    flex-shrink: 0;
    aspect-ratio: 1;
    border-radius: 50%;
    /* Circle or keep square? Request said "display designer photo", simpler is usually square but let's do soft rounded */
    object-fit: cover;
    overflow: hidden;
    filter: grayscale(100%);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.profile-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-text {
    font-size: 1rem;
    line-height: 1.6;
    color: #444;
}

/* Contact Section */
.contact-container {
    max-width: 500px;
    margin: 0 auto;
    padding-top: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: #666;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.8rem;
    background: transparent;
    border: 1px solid #ccc;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #333;
}

.form-textarea {
    height: 150px;
    resize: none;
}

.submit-btn {
    width: 100%;
    padding: 1rem;
    background-color: #1a1a1a;
    color: #fff;
    border: none;
    font-family: inherit;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: opacity 0.3s;
}

.submit-btn:hover {
    opacity: 0.9;
}

/* Footer */
footer {
    margin-top: 5rem;
    text-align: center;
    padding-bottom: 2rem;
}

.social-icons {
    margin-bottom: 1rem;
}

.social-icons a {
    color: #999;
    margin: 0 0.8rem;
    font-size: 1.2rem;
    transition: color 0.3s;
}

.social-icons a:hover {
    color: var(--nav-active);
}

footer p {
    font-size: 0.75rem;
    color: #aaa;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    /* Solid White - No Transparency */
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    width: 90%;
    max-width: 1000px;
    height: 90%;
    overflow-y: auto;
    position: relative;
    padding: 2rem;
    /* Hide scrollbar */
    scrollbar-width: none;
}

.modal-content::-webkit-scrollbar {
    display: none;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 2rem;
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    color: #333;
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

/* Modal Layout adjustments for larger screens */
@media (min-width: 768px) {
    .modal-body {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }

    .modal-gallery {
        grid-column: 1 / -1;
        /* Span full width at bottom */
        display: flex;
        justify-content: center;
        /* Center the image */
        margin-top: 2rem;
        width: 100%;
    }
}

.modal-gallery-img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    /* Optional polish */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.modal-main-img {
    width: 100%;
    height: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.modal-info h2 {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.modal-info p {
    font-size: 1rem;
    color: #555;
    margin-bottom: 2rem;
}

.meta-row {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    color: #444;
}

.meta-label {
    font-weight: 600;
    color: #222;
    margin-right: 0.5rem;
}

.year-row {
    margin-top: 1rem;
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    color: #1a1a1a;
    border-top: 1px solid #eee;
    padding-top: 0.5rem;
    display: inline-block;
}

.meta-description {
    margin-top: 1.5rem;
    line-height: 1.6;
    color: #666;
}

/* --- CLIENTS SECTION --- */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 4 logos per row */
    gap: 2rem;
    /* Closer spacing */
    padding: 2rem 0;
    max-width: 1200px;
    margin: 0 auto;
}

.client-card {
    background: transparent;
    /* No background */
    border: none;
    /* No border */
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 120px;
    /* Reduced from 200px */
}

.client-card:hover {
    transform: scale(1.05);
    /* Slight zoom on hover */
}

.client-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: grayscale(100%) brightness(0) !important;
    opacity: 0.7 !important;
    /* Normal: 70% */
    transition: all 0.3s ease;
}

.client-card:hover .client-logo,
.client-card:active .client-logo {
    opacity: 1 !important;
    /* Hover/Active: 100% */
    filter: grayscale(100%) brightness(0) !important;
}

.client-name-fallback {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    color: #333;
    text-align: center;
}

/* Publisher Detail View */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.back-link {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    letter-spacing: 1px;
    color: #666;
    text-transform: uppercase;
    padding: 0;
}

.back-link:hover {
    color: #000;
}

/* Smaller grid for publisher books */
.publisher-works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    /* Smaller thumbnails */
    gap: 1.5rem;
}

/* Reuse project card styles but override size if needed */
.publisher-works-grid .project-card {
    aspect-ratio: 2/3;
}


/* Responsive */
@media (max-width: 768px) {
    .designer-name {
        font-size: 2rem;
        line-height: 1.1;
    }

    .designer-tagline {
        font-size: 0.75rem;
        letter-spacing: 0.2em;
        line-height: 1.4;
        margin-top: 0.5rem;
        min-width: 200px;
    }

    /* Fix Navigation Layout */
    nav {
        gap: 0.5rem;
        /* Further reduced */
        flex-wrap: nowrap;
        /* Force one row */
        margin-bottom: 2rem;
        justify-content: space-between;
        /* Spread them out */
    }

    .nav-btn {
        font-size: 0.65rem;
        /* Slightly smaller to fit */
        letter-spacing: 0.05em;
        padding: 0.3rem 0;
        white-space: nowrap;
        /* Prevent text wrapping */
    }

    /* Fix Clients Grid for Mobile */
    .clients-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
        /* Reduced from 2rem */
        padding: 1rem;
    }

    .client_card {
        height: 100px !important;
        /* Further reduced for mobile */
    }

    /* Fix Publisher Detail Grid */
    .publisher-works-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .about-container {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    /* Fix Works Grid */
    .works-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}