html {
    scroll-behavior: smooth;
}

/* Ensure sections don't hide under the mobile header when scrolling */
section {
    scroll-margin-top: 80px;
}

:root {
    --font-main: 'Inter', sans-serif;
    --sidebar-width: 250px;
    
    /* Dark Theme Colors */
    --bg-color: #101010;
    --text-heading: #F2F2F3; /* Hex for rgb(242, 242, 243) */
    --text-body: #94979E;    /* Hex for rgb(148, 151, 158) */
    --border-white: rgba(255, 255, 255, 0.1);
    --button-border: #525252;
    --button-hover-border: rgba(242, 242, 243, 0.8);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    color: var(--text-body);
    background-color: var(--bg-color);
    display: flex;
    min-height: 100vh;
}

/* --- SIDEBAR & NAV --- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    display: flex;
    flex-direction: column;
    padding: 40px;
    background-color: var(--bg-color);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 50px;
}

.site-title {
    color: var(--text-heading);
    transition: opacity 0.2s;
}

.site-title span {
    font-size: 20px;
    font-weight: 600;
}

.site-title:hover, .site-title:active {
    opacity: 0.8; /* 80% opacity on hover/click */
}

.nav-menu ul { list-style: none; }
.nav-menu ul li { margin-bottom: 20px; }

.nav-menu ul li a {
    font-size: 16px;
    font-weight: 400;
    color: var(--text-heading);
    transition: opacity 0.2s;
}

.nav-menu ul li a:hover, .nav-menu ul li a:active {
    opacity: 0.8;
}

.menu-toggle { 
    display: none; 
    background: none; 
    border: none; 
    font-size: 20px; 
    cursor: pointer; 
    color: var(--text-heading);
}

/* --- CONTENT --- */
/* --- CONTENT AREA FIX --- */
.content {
    margin-left: var(--sidebar-width); /* Matches sidebar width */
    padding: 40px;
    width: calc(100% - var(--sidebar-width)); /* Explicitly sets the remaining width */
    min-height: 100vh;
}

.content-wrapper {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    /* This prevents any child (like the image) from leaking out */
    box-sizing: border-box; 
}

/* --- IMAGE FIX --- */
.hero-image-full {
    max-width: 100%; /* Ensures it never exceeds the 800px wrapper */
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 32px;
    display: block;
}

/* --- MOBILE FIX --- */
@media (max-width: 768px) {
    .content {
        margin-left: 0;
        width: 100%; /* Reset to full width when sidebar moves to top */
        padding: 20px;
    }
}

/* Container to hold the buttons under your text */
.social-links-wrapper {
    display: flex;
    gap: 12px;
    margin-top: 20px; /* Space between description and buttons */
    justify-content: flex-start;
}

.social-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px; /* Narrower padding for that "pill" look */
    border: 1px solid var(--border-white);
    border-radius: 50px;
    text-decoration: none;
    color: #ffffff;
    font-size: 13px; /* Slightly smaller for a refined look */
    font-weight: 500;
    transition: all 0.25s ease-in-out;
    background: transparent;
}

/* Specifically nudge the YouTube icon down slightly */
.social-pill i.fa-youtube {
    transform: translateY(1px); /* Adjust this to 1px or 2px until it looks right to your eye */
    line-height: 0; /* Prevents the icon's "box" from affecting the pill height */
}

/* Ensure the Instagram icon stays put */
.social-pill i.fa-instagram {
    transform: translateY(0);
    line-height: 0;
}

/* The Hover State */
.social-pill:hover {
    background-color: transparent; /* Ensure background doesn't turn white */
    border-color: rgba(242, 242, 243, 1); /* Border turns solid white */
}

/* Brand Colors for Icons (only before hover) */
.social-pill i.fa-youtube { color: #FF0000; }
.social-pill i.fa-instagram { color: #E1306C; }



/* --- SHOWREEL SECTION --- */
.showreel-section {
    margin-top: 64px;
}

.showreel-section h2 {
    font-size: 14px;
    text-transform: uppercase;
    color: var(--text-body);
    margin-bottom: 24px;
}

.video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    isolation: isolate;
    transform: translateZ(0);
}

.video-container mux-player {
    position: absolute;
    /* Move it slightly top-left and make it slightly larger than 100% */
    top: -2px;
    left: -2px;
    width: calc(100% + 4px); 
    height: calc(100% + 4px);
    
    /* Ensure the internal video content fills the player */
    --media-object-fit: cover;
    --media-object-position: center;
    
    /* Force rounded corners on the player itself as a backup */
    border-radius: 8px;
}

.mux-player {
    display: block;
    width: 100%;
    height: 100%;
}

.video-caption {
    margin-top: 12px;           /* Space between video and text */
    font-size: 10px;            /* Small and clean */
    text-transform: uppercase;   /* High-end "label" look */
    letter-spacing: 0.1em;      /* Elegant breathing room */
    color: rgba(255, 255, 255, 0.5); /* Faded white so it's subtle */
    font-weight: 500;
    text-align: left;           /* Aligns with the video edge */
    line-height: 1.7em;
}

/* Force-hide captions and the CC button */
mux-player::part(captions) {
    display: none !important;
}

mux-player::part(captions-button) {
    display: none !important;
}

/* 1. Hide the Mux Shadow Parts */
mux-player::part(captions) {
    display: none !important;
    opacity: 0 !important;
    height: 0 !important;
}

/* 2. Target the actual cues/text inside the media layer */
mux-player::part(media) ::cue {
    display: none !important;
    color: transparent !important;
    background: transparent !important;
}

/* 3. A generic catch-all for any track elements */
mux-player track {
    display: none !important;
}

.social-grid-section {
    padding: 80px 0;
    width: 100%;
}

.social-grid {
    display: grid;
    /* This creates 3 equal columns, but drops to 1 if they get thinner than 250px */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
}


/* Apply to both .video-container and .video-container.vertical */
.video-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: black; /* Switch from red to black once you're happy! */
}

/* Specific ratios for each */
.video-container:not(.vertical) {
    aspect-ratio: 16 / 9;
}

.video-container.vertical {
    aspect-ratio: 9 / 16;
}

/* The "Absolute Stretch" for all players */
.video-container mux-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

/* Ensure the internal content covers the area */
mux-player::part(video), 
mux-player::part(poster) {
    object-fit: cover !important;
    width: 100% !important;
    height: 100% !important;
}

/* Force the player to expand to the full width of your grid column */
mux-player {
    display: block;
    width: 100% !important; 
    height: 100% !important;
    --media-object-fit: cover;
}

/* When the screen is 1024px wide or smaller */
@media (max-width: 1024px) {
    .social-grid .video-container:nth-child(2), .social-grid .video-container:nth-child(3) {
        display: none;
    }
    
    /* Adjust the grid to strictly show 2 columns instead of auto-filling */
    .social-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* When we get down to mobile (optional but recommended) */
@media (max-width: 600px) {
    .social-grid {
        grid-template-columns: 1fr; /* Go to 1 column for phones */
    }
    
    /* You could even hide the 2nd video here if you only want 1 featured short on mobile */
    /* .social-grid .video-container:nth-child(2) { display: none; } */
}



h1 { 
    font-size: 32px; 
    margin-bottom: 16px; 
    color: var(--text-heading);
}

.intro-text { 
    font-size: 16px; 
    line-height: 1.6; 
    color: var(--text-body); 
}

/* --- LOGO GRID --- */
.clients-section { margin-top: 64px; }

h2 { 
    font-size: 14px; 
    text-transform: uppercase; 
    color: var(--text-body); 
    margin-bottom: 24px; 
}

/* --- LOGO GRID UPDATES --- */
.logo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.logo-item {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    border: 1px solid var(--border-white);
    background-color: transparent;
    /* Use 'all' to ensure the border-color transition is captured */
    transition: all 0.4s ease-in-out; 
}

.logo-item img {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    filter: brightness(0) invert(0.6); 
    opacity: 0.7;
    /* Match the duration (0.4s) and timing function exactly */
    transition: all 0.4s ease-in-out;
}

/* Hover States */
.logo-item:hover {
    border-color: var(--text-heading);
}

.logo-item:hover img {
    filter: brightness(0) invert(1);
    opacity: 1;
}

/* --- HOVER STATES --- */
.logo-item:hover {
    border-color: var(--text-heading); /* Border turns heading color */
}

.logo-item:hover img {
    /* 2. Turn logo "White" (Heading color #F2F2F3) on hover */
    filter: brightness(0) invert(1);
    opacity: 1;
}

/* Tablet/Mobile adjustment */
@media (max-width: 768px) {
    .logo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .logo-item {
        padding: 20px; /* Slightly less padding on smaller screens */
    }
}

/* --- CONTACT SECTION --- */
.contact-section {
    margin-top: 16px;
    padding-bottom: 0px; /* Space at the very bottom of the page */
    margin-bottom: 120px;
}

.contact-intro {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-body);
    margin-bottom: 32px; /* Space before the form starts */
    max-width: 600px;    /* Keeps the line length readable */
}

.form-container {
    width: 100%;
    /* Tally forms are responsive, but this ensures the iframe 
       stays clean within your 800px wrapper */
    overflow: hidden;
}

/* Ensure the H2 in this section matches your Client section style */
.contact-section h2 {
    font-size: 24px; 
    margin-bottom: 16px; 
    color: var(--text-heading);
    text-transform: none;
}


/* --- BUTTON --- */
.pill-button {
    display: inline-block;
    margin-top: 64px;
    padding: 12px 32px;
    border: 1px solid var(--button-border);
    border-radius: 50px;
    font-size: 14px;
    color: var(--text-heading); /* Header color for text in all states */
    text-decoration: none;
    background: transparent;
    transition: all 0.2s;
}

.pill-button:hover, .pill-button:active { 
    border-color: var(--button-hover-border);
    color: var(--text-heading); 
}

/* --- SOCIALS --- */
.social-links { display: flex; gap: 20px; font-size: 18px; color: var(--text-heading); }
.desktop-only { margin-top: auto; }
.mobile-only { display: none; }

/* --- GLOBAL LINK RESET --- */
a {
    text-decoration: none;
    color: inherit;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}


.form-container {
    width: 100%;
    /* We use a negative margin to pull the iframe outward */
    /* and overflow hidden to clip the actual padding area */
    margin-left: -8px; 
    width: calc(100% + 16px);
    overflow: hidden;
}

.form-container iframe {
    display: block;
    width: 100%;
}

.email-pill {
    display: inline-flex;
    align-items: center; /* Vertically centers everything */
    gap: 12px;           /* Space between icon, email, and "Copy" tag */
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-white);
    border-radius: 50px; /* Perfect pill shape */
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

/* Remove the old .email-text::after block and replace with this */
.email-text::after {
    /* Type your actual email here inside the quotes */
    content: "stefan" "@" "stefanguy.com"; 
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
}

/* The "Copy" label - styled like a subtle tag */
.copy-status {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.4;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 10px;
    transition: opacity 0.3s ease;
}

.email-pill:hover {
    border-color: rgba(242, 242, 243, 1);
}

.email-pill:hover .copy-status {
    opacity: 1;
}

.site-footer {
    margin-top: auto;
    width: 100%;
}

.footer-content {
    max-width: 1200px; /* Match your site's main container width */
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-end; /* Aligns text to the bottom of the flex box */
}

.footer-credit, .footer-copy {
    margin: 0;
    line-height: 1; /* Removes extra vertical space from text box */
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
    text-transform: uppercase;
}

/* Responsive Tweak */
@media (max-width: 600px) {
    .footer-content {
        /* This ensures they stay on one line instead of stacking */
        flex-direction: row; 
        font-size: 10px; /* Slightly smaller text to prevent overlap on tiny screens */
    }

    .footer-credit {
        text-align: left;
    }

    .footer-copy {
        text-align: right;
    }
}

/* --- MOBILE --- */
@media (max-width: 768px) {
    body { flex-direction: column; }
    
    .sidebar {
        width: 100%; 
        height: auto; 
        position: sticky; 
        top: 0;
        padding: 20px; 
        z-index: 100; 
        background: var(--bg-color); 
        border-bottom: 1px solid var(--border-white);
    }
    
    .sidebar-header { margin-bottom: 0; width: 100%; }
    .menu-toggle { display: block; }
    
  .nav-menu {
        position: fixed;
        top: 65px; /* Height of the top bar */
        right: -85%; /* Start off-screen */
        width: 80%; /* Only covers 80% of the screen */
        height: calc(100vh - 65px);
        
        /* Dark theme styling */
        background-color: rgba(16, 16, 16, 0.95); 
        backdrop-filter: blur(10px); /* Blurs the content behind the menu */
        -webkit-backdrop-filter: blur(10px);
        
        padding: 40px;
        transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1); /* Smoother "springy" slide */
        border-left: 1px solid var(--border-white);
        z-index: 1000;
    }
    
    .nav-menu.active { right: 0; }
    .content { margin-left: 0; padding: 40px 20px; }
    .logo-grid { grid-template-columns: repeat(2, 1fr); }
    .desktop-only { display: none; }
    .mobile-only { 
        display: flex; 
        margin-top: auto; 
        justify-content: center; 
        padding: 50px 0 20px; 
    }
}