:root {
    --needle: #2d1b17;
    --thread: #c2185b;
    --gold: #b8860b;
    --silk: #fffdf9;
    --glass: rgba(255, 255, 255, 0.98);
    --transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* --- BASE STYLES --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--needle);
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body.home {
    background-image: linear-gradient(rgba(255, 253, 249, 0.1), rgba(255, 253, 249, 0.1)),
        url('./images/background.png');
}

body.collections {
    background-image: linear-gradient(rgba(255, 253, 249, 0.85), rgba(255, 253, 249, 0.85)),
        url('./images/background1.png');
}

/* --- HEADER & NAV --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 8%;
    background: var(--glass);
    backdrop-filter: blur(15px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1.5px solid rgba(184, 134, 11, 0.2);
}

.brand-link,
.brand-container {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
}

.header-brand {
    font-family: 'Cinzel', serif;
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--gold);
    text-transform: uppercase;
    transition: var(--transition);
}

.brand-link:hover .header-brand {
    letter-spacing: 3px;
    text-shadow: 0 0 15px rgba(184, 134, 11, 0.4);
}

.nav-menu,
nav {
    display: flex;
    gap: 20px;
}

.nav-menu a,
.nav-link {
    text-decoration: none;
    color: var(--needle);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    transition: var(--transition);
}

.nav-menu a:hover,
.nav-link:hover,
.nav-link.active {
    color: var(--thread);
}

.nav-menu a::after,
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background: var(--thread);
    transition: var(--transition);
}

.nav-menu a:hover::after,
.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* --- HOME: DESIGNER HERO SECTION --- */
.hero-section {
    text-align: center;
    padding: 100px 5% 40px;
}

.lead-designer-tag {
    color: var(--gold);
    letter-spacing: 6px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.designer-name-stylish {
    font-family: 'Cinzel Decorative', cursive;
    font-size: 3.5rem;
    color: var(--gold);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    display: inline-block;
    cursor: pointer;
}

.designer-name-stylish:hover {
    transform: scale(1.05);
    color: var(--thread);
    text-shadow: 0 0 15px rgba(194, 24, 91, 0.6), 0 0 30px rgba(184, 134, 11, 0.4);
}

/* --- MODERNIZED BANNER --- */
.banner-container {
    width: 90%;
    margin: 20px auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    transition: var(--transition);
    position: relative;
    /* Removed max-height to let image dictate size */
}

.banner-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(184, 134, 11, 0.25);
}

.banner-img {
    width: 100%;
    height: auto;
    /* Scale proportionally */
    display: block;
    transition: transform 1.5s ease;
}

.banner-container:hover .banner-img {
    transform: scale(1.03);
}

.old-caption {
    max-width: 750px;
    margin: 20px auto;
    font-size: 1.3rem;
    line-height: 1.8;
    font-style: italic;
    opacity: 0.8;
    font-family: 'Playfair Display';
}

/* --- COLLECTIONS: HERO SECTION --- */
.hero-title-section {
    text-align: center;
    padding: 100px 5% 60px;
}

.highlight-title {
    font-family: 'Cinzel Decorative', cursive;
    font-size: clamp(2.5rem, 8vw, 4rem);
    background: linear-gradient(45deg, var(--needle), var(--gold), var(--thread), var(--gold));
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 5s linear infinite;
    transition: var(--transition);
    letter-spacing: 5px;
    margin: 0;
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

.gallery-caption {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1rem, 4vw, 1.3rem);
    font-style: italic;
    opacity: 0.8;
    margin-top: 15px;
    padding: 0 10%;
}

/* --- HOME: GALLERY --- */
.gallery {
    padding: 40px 8% 40px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 50px;
}

.card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.6);
    /* Glassmorphism border */
}

.card:hover {
    transform: translateY(-15px) scale(1.02);
    /* Stronger lift */
    border-color: var(--gold);
    box-shadow: 0 30px 60px rgba(184, 134, 11, 0.35);
    /* Stronger glow */
}

.video-wrapper {
    width: 100%;
    height: 500px;
    overflow: hidden;
    position: relative;
    background: #000;
}

video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.8);
    transition: 0.8s;
}

.card:hover video {
    transform: scale(1.1);
    filter: brightness(1.1);
}

.like-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transition: var(--transition);
}

.card:hover .like-overlay {
    opacity: 1;
}

.video-btn {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 30px;
    color: var(--thread);
    text-decoration: none;
    font-weight: 800;
    border: 2px solid var(--thread);
    border-radius: 5px;
    transition: var(--transition);
    text-transform: uppercase;
    font-size: 0.75rem;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* Stitching Effect: Dashed inner border */
.video-btn::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border: 1px dashed rgba(255, 255, 255, 0.8);
    opacity: 0;
    z-index: -1;
    transition: var(--transition);
}

.video-btn:hover {
    background: var(--thread);
    color: white;
    letter-spacing: 2px;
    /* Pulling thread effect */
    box-shadow: 0 5px 15px rgba(194, 24, 91, 0.4);
}

.video-btn:hover::before {
    opacity: 1;
}

/* --- COLLECTIONS: LAYOUT --- */
.collection-container {
    padding: 20px 10% 120px;
}

.design-row {
    display: flex;
    align-items: center;
    gap: 80px;
    margin-bottom: 100px;
}

.design-row:nth-child(even) {
    flex-direction: row-reverse;
}

.image-box {
    flex: 1.3;
    height: 80vh;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.15);
    border: 1.5px solid var(--gold);
    position: relative;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.2);
}

.image-box:hover {
    transform: scale(1.02);
    border-color: var(--thread);
}

.heart-like {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--needle);
    font-size: 1.2rem;
    transition: var(--transition);
    opacity: 0;
    cursor: pointer;
}

.image-box:hover .heart-like {
    opacity: 1;
}

.heart-like:hover {
    background: var(--thread);
    color: white;
    transform: scale(1.2);
}

.matter-box {
    flex: 1;
    padding: 20px;
}

.matter-box h2 {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.8rem, 5vw, 2.4rem);
    color: var(--needle);
    margin: 10px 0;
    border-bottom: 3px solid var(--gold);
    display: inline-block;
}

.matter-box p {
    font-size: clamp(1rem, 3vw, 1.15rem);
    line-height: 1.8;
    font-style: italic;
    font-family: 'Playfair Display', serif;
    color: #000;
    /* Darker text */
    text-shadow: none;
    /* Improve contrast */
    font-weight: 500;
}

.slideshow {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slideshow img {
    position: absolute;
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.slideshow img.active {
    opacity: 1;
    filter: brightness(1.05);
}

@media (max-width: 1024px) {

    .design-row,
    .design-row:nth-child(even) {
        flex-direction: column;
        text-align: center;
        gap: 30px;
        margin-bottom: 80px;
    }

    .image-box {
        width: 100%;
        height: 60vh;
    }
}

/* --- INQUIRY BUTTONS --- */
.inquiry-section {
    text-align: center;
    padding: 60px 5% 100px;
}

.luxury-btn {
    padding: 18px 45px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
    text-transform: uppercase;
    font-size: 0.9rem;
    color: white;
    margin: 10px;
    position: relative;
    overflow: hidden;
    border: none;
}

.wa-primary {
    background: #25D366;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.wa-primary:hover {
    background: #1ebd57;
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(37, 211, 102, 0.4);
}

.email-primary {
    background: var(--needle);
    box-shadow: 0 4px 15px rgba(45, 27, 23, 0.2);
}

.email-primary:hover {
    background: var(--thread);
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(194, 24, 91, 0.3);
}

.luxury-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: skewX(-25deg);
    transition: 0.5s;
}

.luxury-btn:hover::before {
    left: 150%;
}

/* --- AI ASSISTANT --- */
#ai-container {
    position: fixed;
    bottom: 35px;
    right: 35px;
    z-index: 2000;
}

.ai-launcher {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a237e, var(--thread));
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 15px 35px rgba(194, 24, 91, 0.4);
    transition: var(--transition);
    animation: ai-float 3s infinite ease-in-out;
}

@keyframes ai-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}

#ai-panel {
    display: none;
    width: 320px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 25px;
    position: absolute;
    bottom: 90px;
    right: 0;
    border: 1px solid var(--gold);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.ai-header {
    background: var(--needle);
    color: white;
    padding: 20px;
    font-family: 'Cinzel';
    text-align: center;
    font-weight: bold;
}

.ai-body {
    padding: 20px;
    height: 180px;
    overflow-y: auto;
    font-size: 0.9rem;
    color: #333;
}

.ai-footer {
    padding: 15px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-opt {
    background: none;
    border: 1.5px solid var(--gold);
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

.ai-opt:hover {
    background: var(--gold);
    color: white;
}

/* --- FOOTER --- */
footer {
    background: #0a0a0a;
    color: white;
    padding: 100px 20px;
    text-align: center;
}

.footer-brand {
    font-family: 'Cinzel Decorative', cursive;
    font-size: clamp(1.5rem, 6vw, 2.2rem);
    background: linear-gradient(to right, var(--gold), #fff, var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: var(--transition);
    letter-spacing: 5px;
    cursor: pointer;
    display: inline-block;
    margin-bottom: 25px;
}

.footer-brand:hover {
    letter-spacing: 10px;
    filter: drop-shadow(0 0 15px var(--gold));
    transform: scale(1.05);
}

.social-link {
    font-size: 2.8rem;
    margin: 0 20px;
    transition: var(--transition);
    display: inline-block;
    color: white;
}

.insta:hover {
    color: #E1306C;
    transform: translateY(-10px) rotate(10deg);
}

.yt:hover {
    color: #FF0000;
    transform: translateY(-10px) rotate(-10deg);
}

.consult-btn {
    display: inline-block;
    padding: 15px 40px;
    border: 2px solid var(--gold);
    color: var(--gold);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: var(--transition);
}

.consult-btn:hover {
    background: var(--gold);
    color: black;
    transform: translateY(-8px);
}

/* --- SCROLL ANIMATIONS --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- BACK TO TOP BUTTON --- */
#backToTop {
    display: none;
    position: fixed;
    bottom: 35px;
    left: 35px;
    z-index: 99;
    border: none;
    outline: none;
    background-color: var(--needle);
    color: white;
    cursor: pointer;
    padding: 15px;
    border-radius: 50%;
    font-size: 1.2rem;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

#backToTop:hover {
    background-color: var(--gold);
    transform: translateY(-5px);
}

/* --- STITCHING LOADING SCREEN --- */
/* --- STITCHING MACHINE LOADER --- */
#loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fffdf9;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    transition: opacity 1s ease-out;
}

.loader-content {
    position: relative;
    width: 150px;
    height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Machine Head (Top Block) */
.machine-head {
    width: 60px;
    height: 40px;
    background: #333;
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    z-index: 5;
}

/* Needle Assembly (Moves Up/Down) */
.needle-assembly {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 60px;
    animation: machine-stitch 0.15s infinite ease-in-out alternate;
    z-index: 4;
}

.needle-bar {
    width: 6px;
    height: 25px;
    background: #555;
    margin: 0 auto;
}

.needle {
    width: 2px;
    height: 35px;
    background: silver;
    margin: 0 auto;
}

/* Presser Foot (Static) */
.presser-foot {
    position: absolute;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 10px;
    border: 2px solid #444;
    border-top: none;
    border-radius: 0 0 5px 5px;
    z-index: 4;
}

/* Fabric (Moves Left to Right) */
.fabric-container {
    position: absolute;
    bottom: 40px;
    /* Just below presser foot */
    width: 100%;
    height: 10px;
    overflow: hidden;
    z-index: 3;
    border-bottom: 2px solid #ddd;
}

.moving-fabric {
    width: 200%;
    height: 100%;
    background: repeating-linear-gradient(90deg,
            var(--thread) 0,
            var(--thread) 10px,
            transparent 10px,
            transparent 20px);
    /* Dashed line effect */
    opacity: 0.6;
    animation: fabric-scroll 0.5s linear infinite;
}

@keyframes machine-stitch {
    0% {
        transform: translate(-50%, 0);
    }

    100% {
        transform: translate(-50%, 15px);
    }
}

@keyframes fabric-scroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50px);
    }
}

/* --- IMAGE ZOOM ON HOVER (Lens Effect) --- */
.image-box {
    /* Existing styles remain, ensuring overflow hidden */
    overflow: hidden;
    cursor: crosshair;
    /* Indicate zoom availability */
}

.image-box .slideshow img,
.image-box img {
    /* Ensure transitions don't fight with JS updates */
    transition: transform 0.1s ease-out, opacity 1.5s ease-in-out;
    transform-origin: center center;
}

.image-box:hover .slideshow img.active,
.image-box:hover img {
    /* Scale happens via JS, but we set a base here if needed, 
       though JS handles the dynamic transform origin */
    transform: scale(2);
}

/* --- LIGHTBOX GALLERY --- */
#lightbox {
    position: fixed;
    z-index: 10000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#lightbox.active {
    opacity: 1;
}

#lightbox img {
    max-width: 90%;
    max-height: 90%;
    border: 2px solid var(--gold);
    box-shadow: 0 0 50px rgba(184, 134, 11, 0.3);
    border-radius: 5px;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#lightbox.active img {
    transform: scale(1);
}

#lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    font-size: 3rem;
    color: white;
    cursor: pointer;
    transition: 0.3s;
}

#lightbox-close:hover {
    color: var(--gold);
    transform: rotate(90deg);
}

/* --- DARK MODE THEME --- */
body.dark-mode {
    --needle: #fffdf9;
    /* Invert text */
    --silk: #0f0f0f;
    /* Dark bg */
    --glass: rgba(10, 10, 10, 0.95);
    color: #e0e0e0;
}

body.dark-mode::before {
    /* Darken background image overlay */
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: -1;
    pointer-events: none;
}

body.dark-mode header {
    background: rgba(10, 10, 10, 0.95);
    border-bottom: 1px solid rgba(184, 134, 11, 0.4);
}

body.dark-mode .card,
body.dark-mode .image-box {
    background: rgba(30, 30, 30, 0.8);
    border-color: rgba(184, 134, 11, 0.3);
}

body.dark-mode .matter-box p,
body.dark-mode .old-caption {
    color: #ccc;
    text-shadow: none;
}

body.dark-mode .nav-menu a,
body.dark-mode .nav-link {
    color: #fff;
}

body.dark-mode .email-primary {
    color: var(--silk);
    /* Black text on white background */
    font-weight: 800;
}

body.dark-mode #ai-panel {
    background: var(--glass);
    border: 1px solid var(--gold);
}

body.dark-mode .ai-header {
    background: var(--needle);
    /* White background */
    color: var(--silk);
    /* Dark text */
    border-bottom: 1px solid var(--gold);
}

body.dark-mode .ai-body {
    color: var(--needle);
    /* White text */
}

body.dark-mode .ai-opt {
    color: var(--needle);
    border-color: var(--gold);
}

body.dark-mode .ai-opt:hover {
    background: var(--gold);
    color: var(--silk);
}

/* Theme Toggle Button */
#theme-toggle {
    position: fixed;
    bottom: 35px;
    right: 120px;
    /* Left of AI button */
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--glass);
    border: 1px solid var(--gold);
    color: var(--gold);
    z-index: 2000;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: 0.3s;
}

#theme-toggle:hover {
    transform: rotate(45deg);
    background: var(--gold);
    color: #fff;
}