body {
    display: flex;
    flex-direction: column;
    height: auto;
    margin: 0;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden; /* This completely disables scrolling left-to-right */
    position: relative;
}

h2 {
    font-family: 'Gelasio';
}

.nav-container {
    width: 100%;
    height: 50px;
    z-index: 9999999;
    margin-top: 10px;

    position: fixed;
    display: flex;
    justify-content: center;
}

.nav {
    /* Your existing layout properties */
    width: calc-size(auto, size + 50px);
    height: 100%;
    display: flex;
    justify-content: center;
    gap: 30px;
    align-items: center;
    border-radius: 20px;

    /* Initial State: Transparent and no shadows */
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;

    /* Smooth the transition between states */
    transition: background 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
    
    animation: fadeIn 1s ease-out forwards;
}

/* The State when the user has scrolled down */
.nav.scrolled {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: url(#glass-refraction);
    -webkit-backdrop-filter: blur(3px);
    box-shadow: 
        inset 2px 2px 1px 0 rgba(255, 255, 255, 0.3),
        inset -2px -2px 2px 1px rgba(255, 255, 255, 0.3), 
        0 4px 8px 0 rgba(0, 0, 0, 0.2);
}

.nav button {
    border: none;
    padding: 5px;
    border-radius: 16px;
    font-family: 'Gelasio', serif;
    color: rgba(0, 0, 0, 0.8); /* Changed to black for visibility on white-ish glass */
    cursor: pointer;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;

    /* The "White Glass" Foundation */
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.35); /* Milky White Tint */
    cursor: pointer;
    outline: none;

    /* The SVG Backdrop Magic */
    /* Saturate and Brightness keep the "White" from looking muddy over dark images */
    backdrop-filter: url(#glass-refraction) blur(4px) saturate(160%) brightness(110%);
    -webkit-backdrop-filter: blur(4px) saturate(160%) brightness(110%);

    /* Depth: Inner shine and outer soft shadow */
    box-shadow: 
        inset 0.5px 0.5px 0.5px rgba(255, 255, 255, 0.7),
        
}

.nav button:hover {
    font-weight: bold;
    transform: scale(1.05);
}

/* Keeps the text sharp while the background distorts */
.nav button::after {
    display: block;
    content: attr(data-text);
    font-weight: bold;
    height: 0;
    overflow: hidden;
    visibility: hidden;
}

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

.white-background {
    background-color: white;
}

.product-display-container {
    width: 100%;
    height: 700px;
    background-color: clear;
    margin-top: 100px;

    display: flex;
    flex-direction: column;
    justify-content: top;
    align-items: center;
}

.product-display-container img {
    margin-top: 200px;
    position: absolute;
}

.slogan {
    font-size: 20px;
    opacity: 0;
    transform: translateY(100px);

    animation: rizeUpSlogan 0.9s ease-out 0.8s forwards;
}

@keyframes rizeUpSlogan {
    from {
        transform: translateY(200px);
        opacity: 0;
    }
    to {
        transform: translateY(120px);
        opacity: 1;
    }
}

.logo-anim {
    animation: dropIn 0.9s ease-out forwards;
}

@keyframes dropIn {
    from {
        transform: translateY(-500px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.product-display-container img.serum-anim {
    width: 300px;
    height: auto;
    animation: riseUp 1s ease-out forwards;
}

@keyframes riseUp {
    from {
        transform: translateY(500px) rotate(50deg);
        opacity: 0;
    }
    to {
        transform: translateY(0) rotate(30deg);
        opacity: 1;
    }
}

#logo {
    margin-top: -15px;
    height: auto;
    width: 1000px;
}

.gradient {
    width: 100%;
    height: 300px;
    margin-top: -150px;
    position: relative;
    background: linear-gradient(to top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 100%);
}

.black-container {
    width: 100%;
    height: 800px;
    background-color: black;

    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: top;
    text-align: center;
}

.black-container h2 {
    font-optical-sizing: auto;
    font-weight: 700;

    color: white;
    font-size: 35px;
    margin-top: 80px;

    /* background: linear-gradient(to bottom, transparent 50%, #6758FC 50%);
    display: inline;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone; */
}

.quiz {
    width: 100%;
    height: 500px;
    margin-top: 50px;
    background-color: transparent;

    display: flex;
    flex-direction: row;
    justify-content: left;
    gap: clamp(10px, 4vw, 100px);
}

.quiz-left {
    width: 1000px;
    height: 500px;
    background-color: #f0f0f0;
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;

    text-align: left;

    background-image: url('White\ Hair.webp');
    background-size: cover;
}

.quiz-left h2 {
    margin-left: clamp(10px, 4vw, 100px);
    padding-right: 25px;
    color: #000000;
}

.quiz-left mark {
    background-color: white;
    padding: 5px;

    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15); 
}

.quiz-right {
    width: 400px;
    min-width: 350px;
    margin-right: 30px;
    height: 500px;
    border-radius: 8px;
    background-color: #f0f0f0;

    display: flex;
    flex-direction: column;
    justify-content: top;
    align-items: left;
    text-align: left;
    gap: 50px;

    position: relative;
    z-index: 1;
}

.quiz-right::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    z-index: -1;

  /* CHROME + AMBER GLOW */
    box-shadow:
        0 0 12px rgba(255,255,255,0.35),   /* soft chrome highlight */
        0 0 28px rgba(255,255,255,0.25),   /* subtle bloom */
        0 0 45px rgba(255,170,0,0.25),     /* gentle amber glow */
        0 0 80px rgba(255,140,0,0.20);     /* wide warm halo */
}

.quiz-right h2 {
    margin-left: 50px;
    margin-top: 40px;
    margin-bottom: 0px;
    font-size: 30px;
    color: black;
    transition: opacity 0.4s ease;
    opacity: 1;
}

.quiz-right h2.hidden {
    pointer-events: none;
    opacity: 0;
}

.quiz-right img {
    cursor: pointer;
}

.quiz-buttons {
    display: flex;
    flex-direction: column;
    justify-content: top;
    align-items: center;
    gap: 40px;
}

.quiz-buttons button {
    width: 90%;
    height: 80px;
    border: none;
    border-radius: 6px;
    background-color: #f0f0f0; /* stays white */
    position: relative; 
    cursor: pointer;/* same as .quiz-right */
    font-size: 15px;

    box-shadow:
        0 0 8px rgba(0, 0, 0, 0.15),
        0 0 18px rgba(0, 0, 0, 0.12);

        transition: transform 0.25s ease, opacity 1.2s ease; /* Added opacity */
        opacity: 1
}

.quiz-buttons button:hover {
    transform: scale(1.02) translateY(-2px);
    background-color: white;
}

.quiz-buttons button:active {
    transform: scale(1.02) translateY(-2px);

    box-shadow: 
        inset 0 0 8px rgba(0, 0, 0, 0.15),
        inset 0 0 18px rgba(0, 0, 0, 0.12);
}

.quiz-buttons button.hidden {
    opacity: 0;
    pointer-events: none; 
}

/* Forces the separate dots element to align exactly in the middle of the article */
.loading-dots {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px; /* Big, clean dots */
    font-weight: bold;
    letter-spacing: 4px; /* Gives nice spacing between each dot */
    line-height: 1;
    color: #9034db; /* Styled to match your branding tint */
    
    /* Prevents users from clicking or selecting the text layout */
    user-select: none;
    pointer-events: none;
}

.quiz-result-wrapper {
    display: none; /* Takes up NO space while quiz is running */
    opacity: 0;
    transition: opacity 3s ease-in-out, transform 3s ease-out;
    transform: translateY(-100px);
    
    margin: 20px auto;
    text-align: left;
}

/* This class will be added by JS to trigger the show */
.quiz-result-wrapper.is-visible {
    display: block; /* Becomes part of the layout */
    opacity: 1;
}

.quiz-result-wrapper img {
    width: auto;
    height: 300px;
    cursor: pointer;
}


.quiz-result-top {
    width: 100%;
    height: 350px;

    display: flex;
    align-items: center;
    justify-content: center;
}

.quiz-result:hover {
    cursor: pointer;
}  

.quiz-result-bottom h3:hover {
    text-decoration: underline; /* Adds underline on hover */
    cursor: pointer;
} 

.image-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    line-height: 0; /* Removes extra spacing below the image */
}
  
/* The actual image size */
.image-container img {
    width: 100px; /* Adjust this to your desired size */
    height: auto;
}
  
/* The infinite line */
.image-container::before {
    content: "";
    position: absolute;
    bottom: 50%;       /* Starts at the top edge of the image */
    left: 52%;          /* Centers it horizontally */
    
    width: 2px;         /* Thickness of the line */
    height: 500vh;      /* Massive height to ensure it stays "infinite" */
    background: black;  /* Change to 'white' or a hex code if needed */
    pointer-events: none;
}
  


.blank-container {
    width: 100%;
    height: 800px;
    position: relative; /* Acts as the anchor for the bg-layer */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0px;
    overflow: hidden; /* Prevents the background from leaking out */
}

/* The Image Wrapper */
#bg-layer {
    position: absolute;
    inset: 0;         /* Fills the 800px height of .blank-container */
    z-index: -2;      /* Sits behind the left/right divs */
    pointer-events: none; /* Allows clicks to pass through to buttons */
}

#bg-layer img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures the pattern fills the space nicely */
}

/* Ensure these are transparent so you can actually see the background */
.blank-container-left, 
.blank-container-right,
.blank-container-left-top,
.blank-container-left-bottom {
    background-color: transparent !important;
}


.blank-container article {
    width: 80%;
    height: 85%;
    background-color: white;
    border-radius: 12px;
    overflow: hidden;

    box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.3); /* 20px blur radius */

    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    container-type: inline-size;
}

.blank-container article img {
    width: auto;
    height: 85%;

    transform: translateY(0) rotate(30deg);
}

.blank-container article h2 {
    position: absolute;
    font-size: clamp(24px, 3.5cqw + 12px, 40px);

    text-shadow: 5px 5px 10px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.rectangle {
    height: 80px;
    width: 170%;
    background-color: black;
    position: absolute;
    transform: translateY(0) rotate(30deg);
    color: white;

    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 30px;
    z-index: 2;
}

.quiz-title-small {
    color: rgb(199, 199, 199);
    display: none;
}

.blank-container button {
    /* Position & Size */
    padding: 15px 35px;
    border-radius: 30px;
    position: absolute !important;
    bottom: 20px !important;  /* Distance from the bottom edge */
    right: 20px !important;   /* Distance from the right edge */
    z-index: 10;

    /* Typography */
    font-family: 'Glasio', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.8);
    
    /* The "White Glass" Foundation */
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.35); /* Milky White Tint */
    cursor: pointer;
    outline: none;

    /* The SVG Backdrop Magic */
    /* Saturate and Brightness keep the "White" from looking muddy over dark images */
    backdrop-filter: url(#glass-refraction) blur(4px) saturate(160%) brightness(110%);
    -webkit-backdrop-filter: blur(4px) saturate(160%) brightness(110%);

    /* Depth: Inner shine and outer soft shadow */
    box-shadow: 
        inset 1px 1px 1px rgba(255, 255, 255, 0.7),
        inset -1px -1px 1px rgba(0, 0, 0, 0.05),
        0 10px 20px rgba(0, 0, 0, 0.15);

    /* Smooth Hover Animation */
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.5);
}

.blank-container button:hover {
    transform: scale(1.06) translateY(-2px);
    background: rgba(255, 255, 255, 0.45);
    box-shadow: 
        inset 1px 1px 1px rgba(255, 255, 255, 0.9),
        0 15px 25px rgba(0, 0, 0, 0.2);
}

.blank-container button:active {
    transform: scale(0.98);
}

.blank-container-left {
    width: 50vw;
    height: 800px;
    background-color: transparent;

    display: flex;
    flex-direction: column;
    align-items: center;
}

.blank-container-left-top {
    width: 100%;
    height: 400px;
    background-color: transparent;

    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.blank-container-left-bottom {
    width: 100%;
    height: 400px;
    background-color: transparent;

    display: flex;
    align-items: center;
    justify-content: center;
}

.blank-container-right {
    width: 50vw;
    height: 800px;
    background-color: transparent;

    display: flex;
    justify-content: center;
    align-items: center;
}

.blank-container-right-box {
    width: 600px;
    max-width: 75%;
    height: 200px;
    background-color: white;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.blank-container-right-image h2 {
    position: absolute;
    transform: rotate(90deg);
    margin-top: 300px;
    font-size: 100px;
}
.blank-container-right-image p {
    position: absolute;
    transform: rotate(90deg);
    margin-top: 300px;
    font-size: 110px;
    font-weight: 400px;
    color: white;
}

.blank-container-right-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.black-container2 {
    width: 100%;
    height: 800px;
    background-color: black;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    overflow: hidden; 
}

.carousel-track {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 50px; 
    width: 100%;
}

.card {
    width: 400px;
    height: 600px;
    background-color: #6758FC;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
    flex-shrink: 0; 
}

/* Ensures images perfectly fit inside your cards */
.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Highlight layer hidden or reset since 3D mouse tracking is removed */
.card .highlight {
    display: none;
}

.footer {
    width: 100%;
    height: 70px;
    background-color: black;
    color: white;

    display: flex;
    align-items: top;
    justify-content: center;
}

/* --- PHONE STYLES --- */
/* This kicks in only if the screen is 768px wide or smaller */
@media screen and (max-width: 768px) {
    *, *::before, *::after {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
    }
    
    html, body {
        margin: 0 !important;
        padding: 0 !important;
        top: 0;
    }

    .sidebar {
        display: none; /* Hide the sidebar to save space on mobile */
    }

    .nav-container {
        width: 100vw;          /* Forces it to be exactly the viewport width */
        left: 0;               /* Pins it perfectly to the left edge */
        right: 0;              /* Pins it perfectly to the right edge */
        justify-content: space-around; /* Distributes links evenly instead of jamming them in the center */
        padding: 0 15px;       /* Adds a little breathing room on the edges */
        box-sizing: border-box; /* Ensures padding doesn't accidentally increase the width */
    }

    .blank-container-right, 
    .blank-container-right-box {
        display: none !important; /* Temporary test: hides them completely to see if the blank space goes away */
    }

    .product-display-container img.serum-anim {
        width: 200px;
    }

    #logo {
        width: 500px;
        margin-top: 50px;
    }


    @keyframes rizeUpSlogan {
        from {
            transform: translateY(200px);
            opacity: 0;
        }
        to {
            transform: translateY(120px);
            opacity: 1;
        }
    }

    .gradient {
        margin-top: -250px; /* Adjusts the overlap perfectly on smaller screens */
        transform: none;    /* Removes the transform that leaves the 200px ghost gap */
    }

    .black-container h2 {
        font-size: 20px;
    }

    .blank-container-left {
        width: 100vw;
    }

    .blank-container-left-top article button {
        /* Reset desktop margins completely */
        margin-left: 0;
        margin-top: 0;
        
        /* Pin to the bottom right corner */
        position: absolute;
        bottom: 20px;   /* Distance from the bottom edge */
        right: 20px;    /* Distance from the right edge */
        left: auto;     /* Ensures it doesn't stretch or pull to the left */
    }

    .blank-container article h2 {
        /* Forces the text to stay on exactly one row */
        white-space: nowrap; 
        
        /* Auto-adjusts the font size based on the mobile screen width */
        /* It stays around 6.5% of the screen width, but won't drop below 20px or exceed 32px */
        font-size: clamp(20px, 6.5vw, 32px); 
        
        /* Ensures it centers nicely inside the card boundaries */
        max-width: 90%;
        text-align: center;
    }

    .blank-container-right {
        display: none !important;
    }

    .blank-container {
        /* Adjusts layout properties now that the right column is gone */
        justify-content: center;
        gap: 0;
    }

    .quiz-left {
        display: none !important;
    }

    .quiz {
        /* Optional: Adjusts layout flow since the left panel is gone */
        justify-content: center; 
        gap: 0;
    }

    .quiz-right {
        width: 90% !important;        /* Forces the container to take up 90% of the viewport width */
        max-width: 450px;
        margin: 0 auto;               /* Centers the 90% container horizontally on the screen */
        align-items: flex-start;      /* Aligns structural child elements to the left */
        text-align: left;             /* Ensures content text aligns to the left */
    }

    .quiz-right h2 {
        margin-left: 30px !important; /* Sets the explicit 30px gap from the left edge */
        margin-top: 30px;             /* Clean top spacing for mobile layout */
    }
    
    .quiz-buttons {
        width: 100%;                  /* Ensures button container spans the full 90% box width */
    }

    .quiz-title-small {
        display: block;
    }

    .rectangle {
        height: 50px;
    }

    /*Carousel*/
    .black-container2 {
        height: 500px;            
        justify-content: flex-start; 
        overflow: hidden; /* Safely hides cards sliding off-screen */
    }

    .carousel-track {
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 20px;                 
        width: max-content;
        
        /* Smooth, automatic infinite scrolling animation */
        animation: rouletteScroll 25s linear infinite; 
    }

    .card {
        width: 240px;              
        height: 360px;
        flex-shrink: 0; 
    }

    /* Keyframes to smoothly pull track from right to left */
    @keyframes rouletteScroll {
        0% {
            transform: translateX(0);
        }
        100% {
            transform: translateX(calc(-50% - 10px)); /* Shifts track by half its width minus layout gap */
        }
    }

}

/* ==========================================
   PC CAROUSEL TRACK (Auto Scale if Smaller)
   ========================================== */
   @media screen and (min-width: 769px) and (max-width: 1750px) { 
    
    /*Carousel*/
    .black-container2 {
        height: auto !important; 
        padding: 40px 0 !important;           
        justify-content: flex-start; 
        overflow: hidden; /* Safely hides cards sliding off-screen */
    }

    .carousel-track {
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center; /* Aligns them nicely along the center line based on their content */
        
        gap: 2vw !important;                 
        width: max-content;
        
        /* Smooth, automatic infinite scrolling animation */
        animation: rouletteScroll 25s linear infinite; 
    }

    .card {
        /* Math: (100vw total width - 6vw for the 3 visible gaps) / 4 cards = 23.5vw per card. */
        width: 23.5vw !important;              
        
        /* CHANGED: Forces the card to scale its height strictly to its own internal image/content */
        height: max-content !important; 
        min-height: auto !important; 
        
        flex-shrink: 0; 
    }

    /* Optional: Ensures the image inside the card scales its height proportionally with the fluid width */
    .card img {
        width: 100% !important;
        height: auto !important;
        display: block;
    }

    /* Keyframes to smoothly pull track from right to left */
    @keyframes rouletteScroll {
        0% {
            transform: translateX(0);
        }
        100% {
            transform: translateX(calc(-50% - 1vw)); 
        }
    }
}