﻿/* Yellow/Gold Variant for Llaveros Card */
.card-3d-yellow {
    background: linear-gradient(135deg,
            rgba(35, 30, 10, 0.7) 0%,
            rgba(25, 20, 5, 0.8) 50%,
            rgba(15, 12, 0, 0.9) 100%);
    border-color: rgba(234, 179, 8, 0.25);
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(234, 179, 8, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.card-3d-yellow::before {
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(234, 179, 8, 0.5) 50%,
            transparent 100%);
}

.badge-yellow {
    background: rgba(234, 179, 8, 0.2);
    border-color: rgba(234, 179, 8, 0.3);
    color: #facc15;
}

.link-yellow {
    color: #facc15;
}

.link-yellow:hover {
    color: #fde047;
}

.icon-yellow {
    color: rgba(234, 179, 8, 0.15);
}

/* Highlight Title Section */
.highlight-heading-section {
    padding: 100px 0 60px;
    text-align: center;
    background: transparent !important;
}

.highlight-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
    color: #ffffff;
    /* Requested White */
    font-weight: 400;
    letter-spacing: -0.02em;
    /* Initial state for animation */
    opacity: 0;
    filter: blur(20px);
    transform: translateY(60px);
}

/* Animation keyframes */
@keyframes blurBounceIn {
    0% {
        opacity: 0;
        filter: blur(20px);
        transform: translateY(60px);
    }

    60% {
        opacity: 1;
        filter: blur(0px);
        transform: translateY(-15px);
    }

    80% {
        transform: translateY(8px);
    }

    100% {
        opacity: 1;
        filter: blur(0px);
        transform: translateY(0);
    }
}

/* Triggered state */
.highlight-title.animate-in {
    animation: blurBounceIn 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.highlight-title strong {
    color: #facc15;
    /* Vibrant Yellow matching card theme */
    font-weight: 800;
    display: block;
    /* Ensure visual break */
    margin-top: 8px;
}

/* Showcase Section Enhancements */
.showcase-section .showcase-overlay {
    background: radial-gradient(circle, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
}

.showcase-container {
    position: relative;
    z-index: 3;
    display: flex;
    justify-content: flex-end;
    padding: 0 5%;
    /* Use percentage for more flexible edge alignment */
    width: 100% !important;
    max-width: 100% !important;
    /* Break out of standard container width */
}

.showcase-content {
    max-width: 650px;
    color: #fff;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
    text-align: right;
    margin-right: 150px;
    /* Use margin instead of transform to avoid animation conflicts */
}

.showcase-label {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    color: var(--accent);
    margin-bottom: 24px;
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 12px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
    margin-left: auto;
}

.showcase-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    line-height: 1.1;
    margin-bottom: 24px;
    font-family: var(--font-display);
    color: #fff;
    font-weight: 400;
}

.showcase-title strong {
    color: var(--accent);
    font-weight: 800;
}

.showcase-description {
    font-size: clamp(1rem, 2vw, 1.25rem);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 48px;
    max-width: 550px;
}

@media (max-width: 768px) {
    .showcase-section {
        height: auto;
        min-height: 80vh;
        padding: 120px 24px;
    }

    .showcase-container {
        padding: 0;
    }

    .showcase-content {
        text-align: center;
        margin: 0 auto;
        transform: translateX(0);
    }
}

/* ===== Lenis Smooth Scroll Styles ===== */
html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-scrolling iframe {
    pointer-events: none;
}

/* Ensure smooth scroll doesn't break fixed elements */
html.lenis .header {
    will-change: transform;
}

/* Fallback for mobile - use native scroll */
html.no-smooth-scroll {
    scroll-behavior: smooth;
}

/* ===== Premium Reveal Animations ===== */
.reveal-init {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s cubic-bezier(0.2, 0.8, 0.2, 1),
        transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: opacity, transform;
}

.reveal-init.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered children reveal */
.reveal-stagger>* {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1),
        transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal-stagger.revealed>* {
    opacity: 1;
    transform: translateY(0);
}

.reveal-stagger.revealed>*:nth-child(1) {
    transition-delay: 0.1s;
}

.reveal-stagger.revealed>*:nth-child(2) {
    transition-delay: 0.2s;
}

.reveal-stagger.revealed>*:nth-child(3) {
    transition-delay: 0.3s;
}

.reveal-stagger.revealed>*:nth-child(4) {
    transition-delay: 0.4s;
}

/* ===== Magnetic Button Effect (CSS part) ===== */
.hero-cta,
.bento-cta,
.card-3d-link {
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.hero-cta::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300%;
    height: 300%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%) scale(0);
    border-radius: 50%;
    transition: transform 0.6s ease;
    z-index: -1;
}

.hero-cta:hover::after {
    transform: translate(-50%, -50%) scale(1);
}

/* ===== Highlight Section Premium Upgrade ===== */
.highlight-heading-section {
    overflow: hidden;
    background: none !important;
}

.highlight-title {
    perspective: 1000px;
}

.highlight-title span {
    display: inline-block;
    will-change: transform, opacity;
}

/* Glassmorphism for cards refinement */
.bento-card,
.timeline-card,
.card-3d-inner {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== Grainy Texture Overlay ===== */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    opacity: 0.03;
    z-index: 9999;
    pointer-events: none;
    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");
}

/* Page Hero Title Enhancement */
.page-hero h1 {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 20px;
    line-height: 1;
}

/* ===== Bento Cards Text Visibility Fix ===== */
.bento-card .bento-image-overlay h3,
.bento-card .bento-image-overlay p,
.bento-card .bento-subtitle,
.bento-card .bento-stat-desc,
.bento-card .bento-image-overlay .bento-stat-desc {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    opacity: 0.95;
}

/* Keep labels and accents yellow as requested */
.bento-label,
.text-accent,
.bento-stat-value.accent {
    color: var(--accent) !important;
}

/* Bento overlay - subtle bottom gradient for text readability */
.bento-image-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.3) 40%, transparent 70%) !important;
}

/* ===== Puzzle Animation for Bento Cards ===== */
.bento-container {
    perspective: 1500px;
}

/* Initial state - cards are hidden and positioned off-screen */
.bento-card.puzzle-init {
    opacity: 0;
    transform-origin: center center;
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
}

/* Different starting positions for puzzle effect */
/* Card 1 - Main card slides from left */
.bento-card.puzzle-init:nth-child(1) {
    transform: translateX(-80px) translateY(20px) rotate(-3deg) scale(0.9);
}

/* Card 2 - From top */
.bento-card.puzzle-init:nth-child(2) {
    transform: translateY(-60px) translateX(10px) rotate(2deg) scale(0.9);
}

/* Card 3 - From right */
.bento-card.puzzle-init:nth-child(3) {
    transform: translateX(70px) translateY(-15px) rotate(3deg) scale(0.9);
}

/* Card 4 - From bottom-left */
.bento-card.puzzle-init:nth-child(4) {
    transform: translateX(-50px) translateY(60px) rotate(-2deg) scale(0.9);
}

/* Card 5 - From bottom */
.bento-card.puzzle-init:nth-child(5) {
    transform: translateY(80px) rotate(1deg) scale(0.9);
}

/* Card 6 - Wide card from right */
.bento-card.puzzle-init:nth-child(6) {
    transform: translateX(100px) rotate(-1deg) scale(0.9);
}

/* Card 7 - From bottom-right */
.bento-card.puzzle-init:nth-child(7) {
    transform: translateX(60px) translateY(70px) rotate(2deg) scale(0.9);
}

/* When revealed - snap into place */
.bento-card.puzzle-init.puzzle-revealed {
    opacity: 1;
    transform: translateX(0) translateY(0) rotate(0deg) scale(1);
}

/* Staggered delays for puzzle effect */
.bento-card.puzzle-init.puzzle-revealed:nth-child(1) {
    transition-delay: 0s;
}

.bento-card.puzzle-init.puzzle-revealed:nth-child(2) {
    transition-delay: 0.1s;
}

.bento-card.puzzle-init.puzzle-revealed:nth-child(3) {
    transition-delay: 0.15s;
}

.bento-card.puzzle-init.puzzle-revealed:nth-child(4) {
    transition-delay: 0.2s;
}

.bento-card.puzzle-init.puzzle-revealed:nth-child(5) {
    transition-delay: 0.25s;
}

.bento-card.puzzle-init.puzzle-revealed:nth-child(6) {
    transition-delay: 0.3s;
}

.bento-card.puzzle-init.puzzle-revealed:nth-child(7) {
    transition-delay: 0.35s;
}

/* Subtle "click" effect when cards land */
@keyframes puzzleSnap {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

.bento-card.puzzle-init.puzzle-revealed {
    animation: puzzleSnap 0.3s ease-out forwards;
    animation-delay: inherit;
}



/* Back to Top Triangle Button */
#backToTop {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
    filter: drop-shadow(0 4px 15px rgba(255, 195, 0, 0.3));
}

#backToTop.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#backToTop:hover {
    transform: scale(1.15);
}

#backToTop svg {
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease;
}

#backToTop:hover svg {
    transform: translateY(-5px);
}