@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;600&display=swap');

:root {
    /* New Palette - Karen Identity */
    --color-mustard: #FFE15C;
    --color-teal-deep: #152C32;
    --color-teal-med: #468793;
    --color-charcoal: #1A1A1A;
    --color-cream: #D7D0C6;

    /* Typography */
    --font-display: 'Grappa Two Variable Black', serif;
    --font-heading: 'Perpetua Bold', serif;
    --font-body: 'Manrope', sans-serif;

    /* Spacing */
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;
}

/* Font Face Declarations */
@font-face {
    font-family: 'Grappa Two Variable Black';
    src: url('../assets/fonts/GrappaTwo-Black.woff2') format('woff2'),
        url('../assets/fonts/GrappaTwo-Black.otf') format('opentype'),
        url('../assets/fonts/GrappaTwo-Black.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Perpetua Bold';
    src: url('../assets/fonts/perpetua-bold.woff2') format('woff2'),
        url('../assets/fonts/perpetua-bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
    height: 100vh;
    overflow-y: scroll;
}

body {
    background-color: var(--color-charcoal);
    color: var(--color-cream);
    /* Cream for all body text */
    font-family: var(--font-body);
    line-height: 1.6;
    font-weight: 300;
    /* Light/Elegant feel for Manrope */

    /* Content Protection */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Allow selection in form inputs */
input,
textarea {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
}

a {
    color: var(--color-mustard);
    text-decoration: none;
    transition: text-decoration 0.3s ease;
}

a:hover {
    text-decoration: underline;
}

/* Typography Utilities */
h1 {
    font-family: var(--font-heading);
    color: var(--color-mustard);
    /* Mustard for H1 */
    font-weight: 700;
    text-transform: uppercase;
}

h2,
h3 {
    font-family: var(--font-heading);
    color: var(--color-teal-med);
    /* Light Teal for H2/Subtitles */
    font-weight: 700;
    text-transform: uppercase;
}

/* Header/Nav */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: var(--spacing-md);
    z-index: 100;
    display: flex;
    justify-content: flex-end;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: var(--spacing-md);
}

.nav-links a {
    color: var(--color-cream);
    text-decoration: none;
    font-family: var(--font-body);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    color: var(--color-mustard);
    border-color: var(--color-mustard);
    text-decoration: none;
    /* Keep nav clean */
}

/* Hamburger Menu */
.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    z-index: 101;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--color-cream);
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Main Layout - Full Page Sections */
main {
    width: 100%;
}

section {
    min-height: 100vh;
    /* Changed from height: 100vh to allow growth */
    width: 100%;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* overflow: hidden; Removed to prevent clipping */
    background-color: var(--color-charcoal);
    padding: var(--spacing-lg) 0;
    /* Added padding for spacing */
}

footer {
    scroll-snap-align: end;
    width: 100%;
    margin-top: var(--spacing-xl);
    text-align: center;
    padding-bottom: var(--spacing-md);
}

.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1000;
    background: url('../assets/images/noise.png');
    opacity: 0.15;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    width: 100%;
}

/* Hero Section */
#hero {
    background-image: url('../assets/images/background-img02.png');
    background-size: cover;
    background-position: center;
    color: var(--color-mustard);
    height: 100vh;
    /* Keep Hero full screen */
    padding: 0;
}

.hero-content {
    position: absolute;
    bottom: 40px;
    left: 40px;
    z-index: 10;
}

.hero-title {
    font-family: var(--font-display);
    /* Grappa for Hero */
    font-size: clamp(4rem, 10vw, 8rem);
    line-height: 0.9;
    color: var(--color-mustard);
    text-shadow: 3px 3px 0px rgba(0, 0, 0, 0.8);
}

.hero-title span {
    display: block;
}

.hero-title .surname {
    margin-top: 20px;
}

/* Project Hero specific styles */
.project-hero {
    height: 60vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding: var(--spacing-md);
}

.project-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    /* Overlay for better text readability */
    z-index: 1;
}

.project-hero .container {
    position: relative;
    z-index: 2;
}

.project-hero-subtitle {
    margin-top: 1rem;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-cream);
}

/* Unified Section Styling (About, Projects, Contact) */
#about,
#projects,
#contact {
    background-color: var(--color-charcoal);
    /* Enforce Charcoal */
    color: var(--color-cream);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    align-items: center;
}

.section-title {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    color: var(--color-teal-med);
    text-align: center;
}

.about-text p {
    margin-bottom: var(--spacing-md);
    font-size: 1.1rem;
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
    text-align: left;
    /* Reset alignment for cards */
}

.project-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(215, 208, 198, 0.1);
    padding: var(--spacing-md);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--color-mustard);
}

.project-title {
    font-family: var(--font-heading);
    /* Perpetua */
    font-size: 2rem;
    margin: var(--spacing-md) 0 0.5rem;
    color: var(--color-teal-med);
    /* H2/Subtitle Rule */
    font-weight: 700;
}

.project-desc {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-cream);
    /* Body Rule */
}

.project-thumbnail {
    height: 180px;
    background: #111;
    opacity: 0.8;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Contact Section */
.contact-form {
    max-width: 700px;
    /* Restored size */
    width: 100%;
    margin: 0 auto;
    text-align: left;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(215, 208, 198, 0.2);
    color: var(--color-cream);
    font-family: var(--font-body);
    font-size: 1rem;
    /* Ensure readability */
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-mustard);
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-top: 5px;
    margin-bottom: 0;
    cursor: pointer;
}

.checkbox-group label {
    font-size: 0.9rem;
    color: var(--color-cream);
    line-height: 1.5;
}

.checkbox-group label a {
    text-decoration: underline;
}

.btn-submit {
    background: transparent;
    color: var(--color-mustard);
    padding: 1rem 3rem;
    border: 1px solid var(--color-mustard);
    font-family: var(--font-heading);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: var(--spacing-md);
}

.btn-submit:hover {
    background: var(--color-mustard);
    color: var(--color-charcoal);
}

/* Gallery Section */
#gallery {
    background-color: var(--color-charcoal);
    color: var(--color-cream);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(215, 208, 198, 0.1);
    transition: all 0.3s ease;
    aspect-ratio: 1 / 1;
    /* Square thumbnails */
}

.gallery-item:hover {
    border-color: var(--color-mustard);
    transform: scale(1.02);
}

.gallery-item-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.75);
    color: var(--color-cream);
    padding: 0.5rem;
    font-size: 0.85rem;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-item-caption {
    opacity: 1;
}

.folheto-preview {
    display: flex;
    width: 100%;
    height: 100%;
}

.folheto-preview img {
    width: 50%;
    height: 100%;
    object-fit: cover;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.lightbox-content {
    max-width: 90%;
    max-height: 80vh;
    border: 2px solid var(--color-charcoal);
    /* Graphite border */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.lightbox-multiple {
    display: none;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-sm);
    max-width: 95%;
    max-height: 80vh;
}

.lightbox-multi-img {
    max-width: 48%;
    max-height: 80vh;
    object-fit: contain;
    border: 2px solid var(--color-charcoal);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

#lightbox-caption {
    margin-top: 1rem;
    color: var(--color-cream);
    font-family: var(--font-body);
    font-size: 1.1rem;
    text-align: center;
    max-width: 80%;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: var(--color-mustard);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 1001;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

/* Scroll to Top Button */
#scrollToTop {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99;
    border: none;
    outline: none;
    background-color: transparent;
    background-image: url('../assets/icon/cat_idle.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
    width: 60px;
    height: 60px;
    transition: transform 0.3s ease;
}

#scrollToTop:hover {
    transform: translateY(-5px);
}

#scrollToTop:active {
    background-image: url('../assets/icon/cat_scared.png');
    /* Optional interaction */
}

/* Responsive */
@media (max-width: 768px) {
    .main-header {
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
    }

    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background-color: var(--color-charcoal);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.3s ease;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
        z-index: 100;
    }

    .nav-links.nav-active {
        right: 0;
    }

    .nav-links a {
        font-size: 1.5rem;
        padding: 1rem;
    }

    .hero-content {
        bottom: 80px;
        left: 20px;
    }

    .hero-title {
        font-size: clamp(3rem, 12vw, 5rem);
        /* Adjusted for mobile */
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .about-visual div {
        height: 300px !important;
        /* Adjust height for mobile */
    }

    .section-title {
        font-size: 2rem;
    }

    .projects-grid,
    .gallery-grid {
        grid-template-columns: 1fr;
        /* Stack cards */
    }

    .container {
        padding: 0 var(--spacing-sm);
    }

    .form-group input,
    .form-group textarea {
        font-size: 16px;
        /* Prevent zoom on iOS */
    }
}

/* About Social Links */
.about-social {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
    align-items: center;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-mustard);
    text-decoration: none;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.social-link img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.social-link:hover {
    text-decoration: underline;
}