@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@400;700&family=Shippori+Mincho:wght@400;700&family=Cormorant+Garamond:ital,wght@0,400;1,500&display=swap');

:root {
    --brand-base: #FAF7F2;
    --brand-wood: #4A3728;
    --brand-leaf: #5D634F;
    --brand-accent: #C68E5E;
    --brand-subtle: #E8E2D9;
}

body {
    background-color: var(--brand-base);
    color: var(--brand-wood);
    overflow-x: hidden;
    font-family: 'Noto Serif JP', serif;
    /* Default cursor restored */
}

/* Smooth Scroll Setup */
html.lenis {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

/* Loading Animation */
#loader {
    position: fixed;
    inset: 0;
    background: var(--brand-base);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* WebGL Background */
#webgl-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.5;
}

/* UI Elements */
.reveal-container {
    overflow: hidden;
    display: inline-block;
}

.reveal-item {
    display: inline-block;
    transform: translateY(105%);
}

.char {
    display: inline-block;
    transform: translateY(100%);
    opacity: 0;
}

.img-mask {
    position: relative;
    overflow: hidden;
    clip-path: inset(0 100% 0 0);
    border-radius: 4px;
}

.parallax-img {
    transform: scale(1.2);
    transition: transform 0.5s ease-out;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: currentColor;
    transition: width 0.4s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--brand-base);
}

::-webkit-scrollbar-thumb {
    background: var(--brand-wood);
    border-radius: 10px;
}

.tag-pill {
    margin-bottom: 1rem;
    padding: 0.25rem 0.75rem;
    border: 1px solid rgba(74, 55, 40, 0.2);
    border-radius: 9999px;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    display: inline-block;
}

/* Video Gallery Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, 300px);
    gap: 1.5rem;
}

.bento-item {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    cursor: pointer;
}

.bento-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.bento-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(74, 55, 40, 0.6), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.bento-item:hover::after {
    opacity: 1;
}

.bento-content {
    position: absolute;
    bottom: 0;
    left: 0;
    padding: 1.5rem;
    z-index: 10;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.bento-item:hover .bento-content {
    opacity: 1;
    transform: translateY(0);
}

.bento-item.large {
    grid-column: span 2;
    grid-row: span 2;
}

.bento-item.tall {
    grid-row: span 2;
}

.video-overlay {
    position: fixed;
    inset: 0;
    background: rgba(45, 41, 38, 0.95);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
}

.video-container {
    width: 90%;
    max-width: 1000px;
    aspect-ratio: 16/9;
    background: #000;
    position: relative;
}

.close-video {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .bento-item,
    .bento-item.large,
    .bento-item.tall {
        grid-column: span 1;
        grid-row: span 1;
        height: 250px;
    }
}

/* --- Instagram Section Refinements --- */
.insta-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.insta-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(74, 55, 40, 0.08);
}

/* Custom Scrollbar for Instagram Cards */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(198, 142, 94, 0.2);
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(198, 142, 94, 0.4);
}

/* Hide default horizontal scroll if any */
.insta-card iframe {
    max-width: 100% !important;
    width: 100% !important;
}

/* --- Horizontal Scroll Section --- */
.horizontal-scroll-section {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.horizontal-scroll-container {
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    /* Removed sticky and top:0 as GSAP handles pinning */
}

.horizontal-scroll-content {
    display: flex;
    gap: 4rem;
    padding: 0 10vw;
    width: max-content;
    height: 100%;
    align-items: center;
    will-change: transform;
}

.bakery-card {
    width: 400px;
    flex-shrink: 0;
    position: relative;
}

@media (max-width: 768px) {
    .bakery-card {
        width: 85vw;
    }
}

/* --- Magnetic Button Utility --- */
.magnetic {
    display: inline-block;
    transition: transform 0.1s linear;
}

.magnetic-wrap {
    display: inline-block;
}

/* --- Typography Refinements --- */
h1 {
    letter-spacing: 0.15em;
    line-height: 1.1;
}

h2 {
    letter-spacing: 0.1em;
    line-height: 1.3;
}

p {
    line-height: 2;
    letter-spacing: 0.05em;
}

/* --- Mobile Adjustments --- */
@media (max-width: 1024px) {
    body {
        cursor: auto;
    }

    .cursor-dot,
    .cursor-outline {
        display: none;
    }
}

/* --- Lightbox Styles --- */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 23, 20, 0.98);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(15px);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.lightbox-content-wrapper {
    max-width: 90%;
    max-height: 85%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-content-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #FAF7F2;
    font-size: 3rem;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.3s ease, color 0.3s ease;
}

.lightbox-close:hover {
    color: #C68E5E;
    transform: rotate(90deg);
}