/* --- THEME & CONFIGURATION --- */
:root {
    --color-onyx: #000000;
    --text-color: #ffffff;
    --star-color: red;
    --color-divider: rgba(255, 255, 255, .06);
    --font-main: 'Helvetica', sans-serif;
    --spacing-m: 16px;
    --spacing-l: 24px;
    --spacing-xl: 48px;
    --spacing-xxl: 80px;
    --border-radius: 12px;
    --transition-duration: 300ms;
}

/* --- GLOBAL RESETS --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 100%; }

body {
    background-color: var(--color-onyx);
    font-family: var(--font-main);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    color: var(--text-color);
    flex-direction: column;
}

/* 
██████████████████████████████████████████████████
██   THE CRITICAL FIX IS HERE   ██
██████████████████████████████████████████████████
*/
main {
    flex-grow: 1; /* Allows the main content to fill the page */
    position: relative; /* Establish stacking context for content */
    z-index: 1; /* Place main content above the global star background */
}
/* 
██████████████████████████████████████████████████
*/


/* --- TYPOGRAPHY --- */
h1, .site-title {
    font-family: var(--font-main);
    font-weight: bold;
    font-size: 100px;
    color: var(--text-color);
    line-height: 1.4;
}

.highlight-text {
    color: #df0505; /* Solid red color */
}

h2 {
    font-family: var(--font-main);
    font-weight: normal;
    font-size: 35px;
    color: var(--text-color);
}

p {
    font-family: var(--font-main);
    font-weight: normal;
    font-size: 30px;
    color: var(--text-color);
    max-width: 65ch; /* Default max-width for readability */
}

a { color: var(--text-color); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- HEADER & FOOTER --- */
.site-header {
    position: sticky;
    top: 0;
    width: 100%;
    padding: var(--spacing-m) 5%;
    background-color: rgba(11, 13, 16, 0.85);
    backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid var(--color-divider);
}
.site-footer-bottom {
    text-align: center;
    padding: var(--spacing-xl) 5%;
    border-top: 1px solid var(--color-divider);
    font-size: 0.9rem;
    color: var(--text-color);
}

/* --- NAVIGATION --- */
.site-nav {
    position: relative; /* For logo positioning */
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 60px; /* Ensure header has height for logo */
}
.site-header .site-title {
    font-size: 35px;
}
.nav-links {
    display: flex;
    gap: var(--spacing-l);
    list-style: none;
}

.nav-logo-link {
    display: none; /* Hidden on mobile to avoid overlapping the centered title */
}
.nav-logo-link img {
    height: 50px; /* Adjust logo size as needed */
    display: block;
}

/* --- HERO SECTION --- */
.hero {
    min-height: 100vh;
    position: relative; /* Positioning context for children */
    padding: 0;
    background-color: var(--color-onyx); /* Fallback for when video doesn't load */
    overflow: hidden; /* Contain the video */
}

.hero-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Prevents user interaction with the background video */
    z-index: 1; /* Position above stars (z-index: 0) and below the overlay (z-index: 2) */
}

.hero-video {
    width: 100%;
    height: 100%;
    /* object-fit is not supported on iframes, the video will letterbox to fit */
}

.hero-text-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Aligns text to the top */
    align-items: center; /* Centers text horizontally */
    padding-top: var(--spacing-xl); /* Pushes text down from the top edge */
    text-align: center;
    z-index: 5; /* Ensure text is above video AND subsequent content */
    will-change: transform; /* Performance hint for scrolling animation */
}

.hero-fade-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20vh; /* Reduced from 30vh to show more video */
    background: linear-gradient(to top, var(--color-onyx) 60%, transparent);
    z-index: 3; /* Above video and stars, below text */
    pointer-events: none; /* Allow clicks to pass through */
}

/* --- GENERAL LAYOUT & CARDS --- */
.content-section { 
    width: 90%; 
    max-width: 1200px; 
    margin-left: auto; 
    margin-right: auto; 
    padding-top: var(--spacing-xxl); 
    padding-bottom: var(--spacing-xxl); 
    text-align: center; 
    position: relative; /* Establish stacking context */
    z-index: 4; /* Position below hero text but above hero video */
    /* Sections are transparent to show the global star background */
}
.content-section > h2 { margin-bottom: var(--spacing-xl); }
.divider { width: 90%; max-width: 1200px; margin: 0 auto; height: 1px; background: var(--color-divider); }
.site-footer-bottom p { max-width: none; } /* Override default p width for footer */

/* --- PORTFOLIO SECTION --- */
.client-logo {
    max-height: 70px;
    margin-bottom: var(--spacing-l);
    filter: brightness(0) invert(1); /* Makes placeholder logos white */
}

.client-name {
    /* Uses global h2 styles */
    margin-bottom: var(--spacing-m);
}

.client-description {
    font-size: 20px;
    max-width: 70ch;
    margin: 0 auto var(--spacing-xxl);
    color: #ccc; /* A slightly dimmer white for secondary text */
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-l);
    width: 100%;
}

.portfolio-item {
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: transform var(--transition-duration) ease-out, box-shadow var(--transition-duration) ease-out;
}

.portfolio-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.portfolio-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* --- CLIENT MARQUEE SECTION --- */
.client-marquee-section {
    padding-top: 0; /* Reduce top padding for a tighter feel */
    background: linear-gradient(to bottom, var(--color-onyx), #df0505, var(--color-onyx));
    /* Override .content-section width constraints to make the background full-width */
    width: 100%;
    max-width: none;
}

.marquee-title {
    margin-bottom: var(--spacing-xl);
}

.client-marquee {
    width: 100vw;
    overflow: hidden;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    -webkit-mask-image: linear-gradient(to right, transparent, black 20%, black 80%, transparent);
    mask-image: linear-gradient(to right, transparent, black 20%, black 80%, transparent);
}

.marquee-track {
    display: flex;
    align-items: center; /* Vertically center logos in the track */
    gap: var(--spacing-m);
    animation: marquee-scroll 90s linear infinite;
    width: fit-content;
}

.client-marquee-logo {
    height: 200px; /* Increased size for more impact */
    width: auto;
    opacity: 1;
    transition: opacity var(--transition-duration);
    flex-shrink: 0; /* Prevent logos from shrinking if the track is constrained */
}

/* --- Shooting Star Background --- */
#starry-background {
    position: fixed; /* Global background effect */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Allows clicks to pass through */
    z-index: 0; /* Position behind all main content */
    overflow: hidden;
}

.shooting-star {
    position: absolute;
    height: 4px;
    background: linear-gradient(-45deg, var(--star-color), rgba(255, 0, 0, 0));
    border-radius: 999px;
    filter: drop-shadow(0 0 8px var(--star-color));
    animation-name: shooting-star-anim;
    animation-timing-function: ease-in;
    animation-iteration-count: infinite;
}

@keyframes shooting-star-anim {
    0% { transform: translate(0, 0); width: 0; opacity: 0; }
    30% { width: 4px; opacity: 1; }
    100% { transform: translate(400px, 400px); width: 250px; opacity: 0; }
}

@keyframes marquee-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}


/* --- RESPONSIVE DESIGN --- */
.site-title { flex-grow: 1; text-align: center; }
.nav-links { display: none; }

@media (min-width: 768px) {
    .site-title {
        flex-grow: 0;
        text-align: left;
    }
    .nav-links { display: flex; }
    .nav-logo-link {
        display: block;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
    }
}

/* --- (Other minor styles for completeness) --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 300ms ease-out, transform 300ms ease-out;
    will-change: transform, opacity; /* Hint to the browser for smoother animation */
}
.animate-on-scroll.is-visible { opacity: 1; transform: translateY(0); }

/* --- NEW CLIENT SECTION STYLING --- */
.client-section {
    min-height: 100vh;
    width: 100%;
    padding: 4rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--color-divider);
}

/* --- PLACEHOLDER STYLES --- */
.video-slider, .slider-container, .videos-column, .photos-column, .slider-column, .grid-item {
    background-color: #333; /* Darker placeholder for dark theme */
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #999;
    border: 1px dashed #555;
}
.video-slider::after, .slider-container::after, .videos-column::after, .photos-column::after, .slider-column::after, .grid-item::after {
    content: 'Slider/Video Placeholder';
}

/* --- LAYOUT HELPERS --- */
.text-overlay {
    position: absolute;
    color: white;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 1.5rem;
    border-radius: 8px;
}
.bottom-left {
    bottom: 2rem;
    left: 2rem;
    text-align: left;
}
.centered-overlay {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}
.client-logo-overlay {
    max-width: 150px;
    margin-bottom: 1rem;
    filter: brightness(0) invert(1);
}
.client-logo-stacked {
    max-width: 250px;
    margin-bottom: 1.5rem;
    filter: brightness(0) invert(1);
}

/* --- 1. WASCO & 9. HAPPY BRUSH --- */
#wasco .video-slider, #happy-brush .video-slider {
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
}

/* --- 2. J THAI --- */
#j-thai.two-column-layout {
    flex-direction: row;
    padding: 0;
}
.column-60 { flex: 0 0 60%; }
.column-40 { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 2rem; }

/* --- 3. J CLASSICS --- */
#j-classics.centered-layout .centered-slider {
    width: 70%;
    height: 50vh;
    margin: 2rem 0;
}

/* --- 4. JAMBU JAMBU --- */
#jambu-jambu.overlapping-layout {
    justify-content: flex-start; /* Align content to the top */
}
.offset-slider {
    height: 60vh;
    margin-top: 5vh;
}
.text-card {
    background-color: var(--color-onyx);
    padding: 2rem;
    border: 1px solid var(--color-divider);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    width: 60%;
    max-width: 700px;
    margin-top: -10vh; /* Overlap */
    position: relative; /* To be on top of the flow */
    z-index: 1;
}

/* --- 5. RAHSIA --- */
#rahsia.card-frame-layout {
    background-color: #111; /* Slightly lighter black */
}
.card-frame {
    background-color: var(--color-onyx);
    border: 1px solid var(--color-divider);
    padding: 2rem;
    width: 80%;
    height: 70vh;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.floating-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-color);
    background-color: rgba(0, 0, 0, 0.8);
    padding: 1.5rem;
    border-radius: var(--border-radius);
}

/* --- 6. BAGHEERA --- */
#bagheera.full-width-overlay-layout .slider-container,
#bagheera.full-width-overlay-layout .dark-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
#bagheera .dark-overlay {
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1;
}
#bagheera .text-content {
    position: relative;
    z-index: 2;
    color: white;
}

/* --- 7. SBD --- */
#sbd.two-column-layout {
    flex-direction: row;
    padding: 0;
    gap: 0.5rem;
}
.videos-column, .photos-column {
    flex: 1;
}

/* --- 8. SAC --- */
#sac.three-column-layout {
    flex-direction: row;
    align-items: center;
    gap: 2rem;
}
.logo-column, .text-column, .slider-column {
    flex: 1;
}
.slider-column {
    height: 60vh;
}

/* --- 10. LIVE STREAM --- */
#live-stream.hero-style-layout .video-slider {
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
}

/* --- 11. PFBD --- */
#pfbd.mixed-layout {
    justify-content: space-around;
}
.top-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 3rem;
    text-align: left;
}
.slider-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    width: 100%;
    height: 40vh;
}

/* Responsive adjustments for new layouts */
@media (max-width: 768px) {
    #j-thai.two-column-layout,
    #sbd.two-column-layout,
    #sac.three-column-layout {
        flex-direction: column;
    }
    #j-thai.two-column-layout .column-60,
    #j-thai.two-column-layout .column-40 {
        flex-basis: auto;
        width: 100%;
    }
    #j-thai.two-column-layout .column-60 {
        height: 50vh;
    }
    .slider-grid {
        grid-template-columns: 1fr;
    }
    .top-content {
        flex-direction: column;
        text-align: center;
    }
}