/* Home Page Specific Styles (index.css) */

/* Hero Section Refinements */
.hero {
    height: 100vh;
    min-height: 700px;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    perspective: 2000px;
    /* Enable deep 3D space */
}

.hero-bg {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 140%;
    background-image: url('hero-bg-premium.png');
    background-size: cover;
    background-position: center;
    z-index: -2;
    transform-origin: center;
    will-change: transform, filter;
    animation: heroBgIn 4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-grain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    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");
    opacity: 0.05;
    pointer-events: none;
    z-index: 1;
}

.hero-light {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(207, 168, 104, 0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    mix-blend-mode: screen;
}

@keyframes heroBgIn {
    0% {
        transform: scale(1.1);
        filter: brightness(0.6);
    }

    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

/* Reduced overhead for mobile devices */
@media (max-width: 991px) {
    .hero {
        perspective: none;
    }
    
    .hero-bg {
        animation: heroBgInMobile 3s ease-out forwards;
        will-change: transform;
    }

    @keyframes heroBgInMobile {
        0% { transform: scale(1.1); }
        100% { transform: scale(1); }
    }

    .hero-content > * {
        animation: fadeInMobile 1.2s ease-out forwards;
        transform: none !important;
    }

    @keyframes fadeInMobile {
        from { opacity: 0; transform: translateY(20px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .hero-grain, .hero-light {
        display: none; /* Filters and radial gradients are heavy on mobile GPUs */
    }

    .hero-3d-elements {
        display: none; /* Remove floating elements for pure performance */
    }
}

.hero .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            rgba(26, 28, 22, 0.45) 0%,
            rgba(59, 66, 49, 0.8) 100%);
    opacity: 0;
    animation: fadeIn 2s ease forwards 0.5s;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: var(--color-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 4rem;
    transform-style: preserve-3d;
}

/* 3D Staggered reveals for text */
.hero-content>* {
    opacity: 0;
    transform: translateZ(250px) translateY(80px) rotateX(20deg);
    animation: text3dReveal 2.2s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    will-change: transform, opacity;
}

.hero-content .subtitle {
    animation-delay: 1.2s;
}

.hero-content h1 {
    animation-delay: 1.4s;
}

.hero-content .hero-subtext {
    animation-delay: 1.6s;
}

.hero-content .hero-btns {
    animation-delay: 1.8s;
}

@keyframes text3dReveal {
    100% {
        opacity: 1;
        transform: translateZ(0) translateY(0) rotateX(0deg);
    }
}

.hero-3d-elements { display: none; }

/* Element styles removed per user request */

@keyframes herbFloat {

    0%,
    100% {
        transform: translate3d(0, 0, 0) rotate(var(--rot, 45deg)) rotateY(0deg);
    }

    33% {
        transform: translate3d(30px, -40px, 100px) rotate(calc(var(--rot, 45deg) + 20deg)) rotateY(180deg);
    }

    66% {
        transform: translate3d(-30px, 40px, -100px) rotate(calc(var(--rot, 45deg) - 20deg)) rotateY(360deg);
    }
}

.hero-content h1 {
    color: var(--color-secondary);
    margin: 1.5rem 0;
    text-shadow: 0 5px 30px rgba(0, 0, 0, 0.4);
}

.hero-subtext {
    color: var(--color-secondary);
    font-size: 1.25rem;
    font-weight: 300;
    opacity: 0.9;
    max-width: 600px;
    margin-bottom: 3rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hero-btns {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    justify-content: center;
}

/* Mobile Refinements for Index */
@media (max-width: 768px) {
    .hero {
        height: calc(100vh - 60px); /* Adjust for mobile browser UI */
        min-height: 500px;
    }

    .hero-bg {
        width: 110%;
        left: -5%;
    }

    .hero-content h1 {
        font-size: 2.4rem;
        line-height: 1.2;
        margin: 1rem 0;
    }

    .hero-subtext {
        font-size: 0.95rem;
        margin-bottom: 2rem;
        padding: 0 10px;
    }

    .hero-btns {
        flex-direction: column;
        width: 100%;
        gap: 0.8rem;
    }

    .hero-btns .btn {
        width: 100%;
        padding: 1rem;
    }

    .features-grid {
        gap: 1.5rem;
    }
}

/* Features Section Refinements */
.features {
    background: linear-gradient(0deg, #3d4433 1%, transparent 100%);
    /* Ensure it clearly separates from hero */
    position: relative;
    z-index: 2;
    /* Sits above parallax hero */
    perspective: 1200px;
    /* Enable 3D space */
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4rem;
    transform-style: preserve-3d;
}

.feature-card {
    text-align: center;
    padding: 3rem 2rem;
    background: rgb(255, 255, 255);
    /* Slight frosted glass feel */
    border: 1px solid rgba(59, 66, 49, 0.05);
    border-radius: 8px;
    /* Very subtle rounding */
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
    transform-style: preserve-3d;
    will-change: transform, box-shadow;
}

.feature-card:hover {
    /* Fallback if JS tile fails */
    transform: translateY(-10px) rotateX(2deg) rotateY(2deg);
    box-shadow: -10px 20px 40px rgba(59, 66, 49, 0.08);
}

.feature-card>* {
    /* Inner elements pop out in 3D */
    transform: translateZ(30px);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background-color: var(--color-primary);
    color: var(--color-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Experience Section Refinements */
.experience {
    /* Uses .section-dark and .split-layout from global.css */
    position: relative;
    overflow: hidden;
}

.experience::before {
    content: '';
    position: absolute;
    top: 135px;
    right: 20px;
    width: 96vw;
    height: 127%;
    background: linear-gradient(180deg, rgb(195 146 65 / 90%) -43%, transparent 50%);
    pointer-events: none;
    border-radius: 20px;
}

/* Preview Gallery (Home specific 3D layout) */
.preview-gallery {
    perspective: 1500px;
    background-color: var(--color-secondary);
    overflow: hidden;
}

.gallery-3d-wrapper {
    width: 100%;
    transform-style: preserve-3d;
    transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    transform-style: preserve-3d;
    padding: 2rem 0;
}

.g-item {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    aspect-ratio: 4/5;
    /* Taller, elegant portrait ratio */
    cursor: pointer;
    box-shadow: 0 15px 35px rgba(59, 66, 49, 0.1);
    transform-origin: center;
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), filter 0.8s ease, box-shadow 0.8s ease;
}

/* Base 3D staggered rotation */
.g-item:nth-child(1) {
    transform: translateZ(-50px) rotateY(5deg);
}

.g-item:nth-child(2) {
    transform: translateZ(50px) scale(1.05);
    z-index: 2;
}

.g-item:nth-child(3) {
    transform: translateZ(-50px) rotateY(-5deg);
}

.g-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.5s cubic-bezier(0.16, 1, 0.3, 1), filter 0.8s ease;
    filter: brightness(0.85) grayscale(0.3);
}

.g-item:hover {
    transform: translateZ(100px) rotateY(0deg) scale(1.05) !important;
    box-shadow: 0 30px 60px rgba(59, 66, 49, 0.2);
    z-index: 10;
}

.g-item:hover img {
    transform: scale(1.1);
    filter: brightness(1) grayscale(0);
}

/* Final CTA Section (Home specific layout) */
.final-cta {
    position: relative;
    padding: 12rem 0;
    /* massive padding */
    overflow: hidden;
    background-color: var(--color-primary-dark);
}

.cta-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://images.unsplash.com/photo-1414235077428-338989a2e8c0?q=80&w=1470&auto=format&fit=crop');
    /* The plated dish */
    background-size: cover;
    background-position: center;
    z-index: 1;
    opacity: 0.4;
    /* Slightly more visible for a richer feel */
    animation: ctaKenBurns 30s ease-in-out infinite alternate;
}

@keyframes ctaKenBurns {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.15);
    }
}

.cta-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            rgba(26, 28, 22, 0.7) 0%,
            var(--color-primary-dark) 100%);
    z-index: 2;
}

.final-cta .btn-gold {
    box-shadow: 0 0 0 0 rgba(207, 168, 104, 0);
    animation: goldGlow 3s infinite;
}

@keyframes goldGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(207, 168, 104, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(207, 168, 104, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(207, 168, 104, 0);
    }
}

.final-cta .container {
    position: relative;
    z-index: 3;
    /* Above overlays */
}

/* Responsive specific to Home */
@media (max-width: 991px) {
    .features-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-bg {
        background-attachment: scroll;
    }

    /* Disable heavy parallax on mobile */
}

@media (max-width: 768px) {
    .experience::before {
        content: '';
        position: absolute;
        top: 55px;
        right: 8px;
        width: 96vw;
        height: 100%;
        background: linear-gradient(180deg, rgb(195 146 65 / 90%) -43%, transparent 50%);
        pointer-events: none;
        border-radius: 20px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .hero-btns {
        flex-direction: column;
        width: 100%;
    }

    .hero-btns .btn {
        width: 100%;
        margin: 0 0 1rem 0;
    }

    .g-item {
        aspect-ratio: 16/9;
    }

    .final-cta {
        padding: 6rem 0;
    }
}