:root {
    --cursor-image: none;
}

@import url('variables.css');

body {
    background-color: var(--parchment-beige);
    color: var(--vintage-black);
    font-family: 'Lora', serif;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.haptic-texture::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 500;
    opacity: 0.15;
    background-image: url("https://www.transparenttextures.com/patterns/notebook.png");
    filter: contrast(110%) brightness(95%);
}

/* ----- NAVIGATION ----- */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    height: 110px;
    z-index: 1000;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(to bottom, rgba(245, 242, 232, 1) 0%, rgba(245, 242, 232, 0) 100%);
}

@media (min-width: 768px) {
    #main-nav {
        padding: 0 5rem;
    }
}

#main-nav.sticky {
    height: 80px;
    background: var(--parchment-beige) !important;
    border-bottom: 2px solid var(--vintage-black);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* Mobile Menu Styles */
#mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--parchment-beige);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transform: translateY(-100%);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobile-menu-overlay.active {
    transform: translateY(0);
}

.menu-close-btn {
    position: absolute;
    top: 30px;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2100;
    border: 2px solid var(--vintage-black);
    background: transparent;
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 1.5rem;
}

.mobile-nav-link {
    font-family: 'Londrina Solid', cursive;
    font-size: 3rem;
    color: var(--vintage-black);
    text-transform: uppercase;
    text-decoration: none;
}

.hamburger-btn {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    cursor: pointer;
    z-index: 2100;
}

/* Hamburger Line Colors - Default White for Dark Hero */
.hamburger-line {
    width: 100%;
    height: 2px;
    background-color: var(--parchment-beige);
    /* White/Beige on dark hero */
    transition: all 0.3s ease;
}

/* Sticky State - Switch properly to Black */
#main-nav.sticky .hamburger-line {
    background-color: var(--vintage-black);
}

/* Hamburger Animation */
.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
    background-color: var(--vintage-black);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
    background-color: var(--vintage-black);
}

.logo-container {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    /* Center vertically */
    height: 100%;
    pointer-events: none;
    z-index: 1100;
}

#nav-logo {
    height: 80px;
    /* Optimized for 110px navbar */
    width: auto;
    max-width: 80vw;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 15px 40px rgba(0, 0, 0, 0.3));
    pointer-events: auto;
    object-fit: contain;
}

#main-nav.sticky #nav-logo {
    height: 48px;
    filter: none;
}

.nav-link {
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.35em;
    font-size: 11px;
    font-weight: 900;
    color: var(--vintage-black);
}

/* ----- HERO SECTION ----- */
.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-image: url("../Hero.avif");
    background-size: cover;
    background-position: center top;
    /* Focus on top to potentially hide bottom stripes in image */
    z-index: -10;
}

.hero-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 9rem;
    text-align: center;
    position: relative;
}

@media (min-width: 768px) {
    .hero-container {
        padding-top: 11rem;
    }
}

.headline {
    font-family: 'Londrina Solid', cursive;
    font-size: clamp(3.5rem, 14vw, 13rem);
    line-height: 1.1;
    text-transform: uppercase;
    color: var(--white);
    z-index: 30;
    text-shadow: 0 10px 50px rgba(0, 0, 0, 0.7);
    margin-top: 2rem;
}

/* ----- STORY SECTION ----- */
.story-section {
    background-color: var(--parchment-beige);
    padding: 10rem 0;
    position: relative;
    z-index: 10;
    margin-top: 0;
}


.story-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    align-items: center;
}

@media (min-width: 1024px) {
    .story-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8rem;
        padding: 0 6rem;
    }
}

.story-title {
    font-family: 'Londrina Solid', cursive;
    font-size: clamp(3rem, 8vw, 7rem);
    line-height: 0.9;
    text-transform: uppercase;
    color: var(--bakery-red);
}

.story-image {
    width: 100%;
    border: 2px solid var(--vintage-black);
    box-shadow: 40px 40px 0px var(--bakery-gold);
}

.btn-solid {
    background: var(--white);
    color: var(--vintage-black);
    padding: 1.3rem 4rem;
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.35em;
    font-size: 11px;
    font-weight: 900;
    border: 2px solid var(--vintage-black);
    box-shadow: 10px 10px 0px var(--bakery-gold);
    transition: all 0.3s;
    margin-top: 6rem;
}

/* --- MASONRY LAYOUT (from Gallery) --- */
.masonry-container {
    columns: 1;
    column-gap: var(--space-sm);
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-sm);
    background-color: var(--parchment-beige);
    /* Keep background consistent */
}

@media (min-width: 640px) {
    .masonry-container {
        columns: 2;
        padding: var(--space-xl) var(--space-md);
    }
}

@media (min-width: 1024px) {
    .masonry-container {
        columns: 3;
        padding: var(--space-xl) var(--space-lg);
    }
}

@media (min-width: 1280px) {
    .masonry-container {
        columns: 4;
        padding: var(--space-xl) var(--space-xl);
    }
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 1rem;
    position: relative;
}

/* --- GALLERY LOGIC --- */
.gallery-card {
    border: 2px solid var(--vintage-black);
    /* Pure Black Border */
    background: white;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    display: block;
}

.masonry-item:hover .gallery-card {
    transform: translate(-4px, -4px);
    /* Correctly resets any rotate variable classes */
    box-shadow: 12px 12px 0px var(--bakery-gold);
    z-index: 50;
}

.masonry-item:hover {
    z-index: 50;
}

.img-zoom {
    transition: transform 1.5s ease;
    width: 100%;
    height: auto;
    display: block;
}

.masonry-item:hover .img-zoom {
    transform: scale(1.1);
}

.caption-note {
    font-family: 'Special Elite', monospace;
    font-size: 0.65rem;
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.8;
    color: var(--vintage-black);
}

.caption-note::before {
    content: "";
    width: 15px;
    height: 1px;
    background: #000000;
}

/* Reveal Logic */
@keyframes revealItem {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.reveal {
    opacity: 0;
}

.reveal.active {
    animation: revealItem 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.masonry-container .reveal {
    opacity: 1;
}

.masonry-container .reveal.active {
    animation: none;
}

.gallery-section-header {
    max-width: 1600px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-sm) 0;
    background-color: var(--parchment-beige);
}

@media (min-width: 768px) {
    .gallery-section-header {
        padding: var(--space-xl) var(--space-md) 0;
    }
}

.batch-title {
    font-family: 'Londrina Solid', cursive;
    font-size: clamp(3rem, 10vw, 7rem);
    line-height: 0.8;
    color: var(--bakery-red);
    text-transform: uppercase;
}

/* --- INSTAGRAM GRID (Custom Adapted) --- */
.insta-grid-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-sm);
}

.insta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

@media (min-width: 768px) {
    .insta-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--space-lg);
    }
}

@media (min-width: 1280px) {
    .insta-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: var(--space-xl);
    }
}

@media (max-width: 480px) {
    .insta-grid-wrapper {
        padding: var(--space-lg) var(--space-xs);
    }
    
    .insta-grid {
        gap: var(--space-sm);
    }
}

.insta-item {
    position: relative;
    aspect-ratio: 1;
    border: 2px solid var(--vintage-black);
    overflow: hidden;
    background: var(--white);
    box-shadow: 8px 8px 0px var(--bakery-gold);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: block;
}

.insta-item:hover {
    transform: translate(-4px, -4px);
    box-shadow: 12px 12px 0px var(--bakery-red);
    z-index: 20;
}

.insta-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.insta-item:hover img {
    transform: scale(1.1);
}

.insta-overlay {
    position: absolute;
    inset: 0;
    background: rgba(26, 26, 26, 0.9);
    /* vintage-black opacity */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-align: center;
}

.insta-item:hover .insta-overlay {
    opacity: 1;
}

.insta-icon {
    color: var(--bakery-gold);
    width: 24px;
    height: 24px;
    margin-bottom: 0.5rem;
    transform: translateY(10px);
    transition: transform 0.3s ease 0.1s;
}

.insta-caption {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    color: var(--parchment-beige);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    line-height: 1.4;
    transform: translateY(20px);
    transition: transform 0.3s ease 0.2s;
}

.insta-item:hover .insta-icon,
.insta-item:hover .insta-caption {
    transform: translateY(0);
}

/* ----- INSTAGRAM MODAL ----- */
        .insta-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(245, 242, 232, 0.95);
            /* Parchment overlay */
            z-index: 5000;
            display: none;
            justify-content: center;
            align-items: center;
            padding: var(--space-sm);
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .insta-modal.active {
            display: flex;
            opacity: 1;
        }

        .insta-modal-content {
            background: var(--white);
            border: 2px solid var(--vintage-black);
            box-shadow: 15px 15px 0px var(--bakery-gold);
            display: flex;
            max-width: 900px;
            width: 100%;
            max-height: 80vh;
            overflow: hidden;
            position: relative;
            flex-direction: column;
        }

        .insta-modal-image {
            width: 100%;
            height: auto;
            max-height: 60vh;
            object-fit: contain;
        }

        @media (max-width: 768px) {
            .insta-modal-content {
                max-height: 90vh;
            }
            
            .insta-modal-image {
                max-height: 50vh;
            }
        }

.insta-modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    color: var(--vintage-black);
    cursor: pointer;
    z-index: 10;
    line-height: 1;
}

.insta-modal-image {
    width: 60%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.insta-modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.insta-modal-text {
    width: 40%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.insta-modal-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 1rem;
}

.insta-modal-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--vintage-black);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.insta-modal-username {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
}

.insta-modal-caption {
    font-family: 'EB Garamond', serif;
    font-size: 1.1rem;
    line-height: 1.5;
    color: var(--vintage-black);
    white-space: pre-wrap;
}

@media (max-width: 768px) {
    .insta-modal-content {
        flex-direction: column;
        max-height: 90vh;
        overflow-y: auto;
    }

    .insta-modal-image {
        width: 100%;
        height: 50%;
    }

    .insta-modal-text {
        width: 100%;
        height: auto;
    }
}
    /* ===== CUSTOM CURSOR ===== */
.custom-cursor {
    display: none;
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid var(--bakery-red);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.1s ease, width 0.3s ease, height 0.3s ease;
    mix-blend-mode: difference;
    background-image: var(--cursor-image);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.custom-cursor--pretzel {
    --cursor-image: none;
}

.custom-cursor-follower {
    display: none;
    position: fixed;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(216, 67, 67, 0.3);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transition: transform 0.15s ease, width 0.3s ease, height 0.3s ease;
    mix-blend-mode: difference;
    background-image: var(--cursor-image);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(216, 67, 67, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(216, 67, 67, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
    display: block;
    pointer-events: none;
    z-index: 2;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(50px, 50px);
    }
}

/* ===== SCROLL PROGRESS INDICATOR ===== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--bakery-red), var(--bakery-gold));
    z-index: 10000;
    transition: width 0.1s linear;
}

