/**
 * ============================================================
 * SCOTT-TECH STUDIOS
 * COMPONENTS ENGINE
 * V20 CLEAN EDITION - GLOBAL SIDE MENU FIX
 * ============================================================
 *
 * Handles:
 *  - Global Slide-Out Navigation (Desktop & Mobile)
 *  - Hero sections
 *  - Interior page headers
 *  - Cards
 *  - Global Footer & Socials
 *
 */

/* ============================================================
   GLOBAL NAVIGATION (TOP BAR)
   ============================================================ */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%; /* Stays 100% at all times */
    padding: var(--space-md) max(5%, 1.5rem);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10000;
    background: rgba(6, 6, 6, 0.65);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background-color var(--transition-smooth), padding var(--transition-smooth), border-color var(--transition-smooth);
}

.logo {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-main {
    color: var(--white);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 2px;
}

.brand-sub {
    color: var(--accent);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 5px;
    margin-top: 0.2rem;
}

/* ============================================================
   HAMBURGER TOGGLE (NOW VISIBLE GLOBALLY)
   ============================================================ */

.menu-toggle {
    display: flex; 
    background: transparent;
    border: 0;
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
    padding: 0.5rem;
    z-index: 12000; /* Stays above the sliding menu */
    position: relative;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--white);
    transition: transform var(--transition-smooth), opacity var(--transition-smooth);
    transform-origin: left center;
}

/* Hamburger Morphing Animation */
.nav-open .menu-toggle span:nth-child(1) {
    transform: rotate(45deg) translate(2px, -2px);
}
.nav-open .menu-toggle span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.nav-open .menu-toggle span:nth-child(3) {
    transform: rotate(-45deg) translate(2px, 2px);
}

/* ============================================================
   RIGHT-HAND SLIDE OUT MENU (GLOBAL)
   ============================================================ */

.nav-links {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    height: 100svh;
    width: 400px; /* Desktop width */
    max-width: 100vw;
    box-sizing: border-box;
    background: var(--surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-xl) var(--space-lg);
    gap: var(--space-md);
    list-style: none;
    /* Hides it perfectly off screen to the right */
    transform: translateX(100%); 
    transition: transform var(--transition-smooth);
    z-index: 11000;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Slides into place perfectly */
.nav-open .nav-links {
    transform: translateX(0);
}

.nav-links a {
    position: relative;
    color: var(--muted);
    text-decoration: none;
    font-size: 1.5rem; 
    font-weight: 600;
    padding: 0.5rem 0;
    transition: color var(--transition-fast);
}

.nav-links a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--transition-smooth);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--white);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* ============================================================
   GLOBAL OVERLAY
   ============================================================ */

.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(4px);
    z-index: 9000;
    display: block !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-smooth);
}

.nav-open .mobile-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* ============================================================
   MENU VIDEO ACCENT (CADDY-CORNER) - NOW GLOBAL
   ============================================================ */

.menu-video-wrapper {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 220px;     
    z-index: -1;       
    pointer-events: none; 
    opacity: 0.45;     
}

.menu-bg-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    mix-blend-mode: screen; 
}

.menu-video-fade {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: linear-gradient(to bottom, var(--surface), transparent);
    z-index: 1;
}

/* ============================================================
   MOBILE RESPONSIVENESS
   ============================================================ */

@media (max-width: 768px) {
    .navbar {
        padding: var(--space-sm) max(5%, 1.5rem);
    }
    .nav-links {
        width: 280px; /* Menu shrinks neatly on mobile */
        padding: var(--space-xl) var(--space-md);
    }
    .hero-buttons {
        width: 100%;
        max-width: 380px;
        flex-direction: column;
    }
    .button, .button-outline {
        margin-top: 20px;
        width: 100%;
    }
}

/* Prevent horizontal jumping */
body {
    overflow-x: hidden;
}

/* ============================================================
   HERO SECTION
   ============================================================ */

.hero {
    min-height: 100svh;
    min-height: 800px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    isolation: isolate;
    padding: var(--space-xl) max(5%, 1.5rem) var(--space-lg);
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(6,6,6,.35), var(--background)), url("/assets/images/hero/hero.jpg") center/cover no-repeat;
    z-index: -1;
    opacity: .85;
}

.hero-content {
    max-width: 880px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 6vw, 4.75rem);
    font-weight: 800;
    margin-bottom: var(--space-md);
    text-shadow: var(--shadow-lg);
}

.hero-content p {
    max-width: 680px;
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    margin-bottom: var(--space-lg);
    opacity: .9;
}

/* ============================================================
   INTERIOR PAGE HEADER
   ============================================================ */

.page-header {
    height: 60vh; 
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-bottom: var(--space-lg);
    isolation: isolate;
}

.page-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent, var(--background)), url("xxxx") center/cover no-repeat;
    z-index: -1;
}

.page-title {
    width: 100%;
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: max(5%, 1.5rem);
}

.page-title h1 {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: var(--space-xs);
}

/* ============================================================
   CARDS
   ============================================================ */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-md);
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center; 
    text-align: center;  
    height: 100%;        
    position: relative;
    overflow: hidden;    
    transition: border-color var(--transition-smooth), transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.card:hover {
    border-color: var(--border-hover);
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
}

.card h3 {
    margin-bottom: var(--space-sm);
    transition: color var(--transition-fast);
}

.card:hover h3 {
    color: var(--accent);
}

.card p {
    color: var(--muted);
    flex-grow: 1;
    justify-content: center;
}

.card-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    transition: transform var(--transition-smooth); 
}

.card:hover .card-thumbnail {
    transform: scale(1.05);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45); 
    backdrop-filter: blur(4px) saturate(120%);
    -webkit-backdrop-filter: blur(4px) saturate(120%);
    z-index: -1;
    transition: 
        backdrop-filter var(--transition-smooth), 
        -webkit-backdrop-filter var(--transition-smooth), 
        background var(--transition-smooth);
}

.card:hover::before {
    backdrop-filter: blur(0px) saturate(100%);
    -webkit-backdrop-filter: blur(0px) saturate(100%);
    background: rgba(0, 0, 0, 0.25); 
}

.card h3, 
.card p, 
.card a {
    position: relative;
    z-index: 1;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9), 0 4px 12px rgba(0, 0, 0, 0.7);
}

/* ============================================================
   VIDEO CARDS
   ============================================================ */

.video-card {
    overflow: hidden;
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.video-card img,
.video-card video {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--space-md);
    background: linear-gradient(transparent, rgba(0,0,0,.85));
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   GLOBAL FOOTER
   ============================================================ */

.global-footer {
    width: 100%;
    border-top: 1px solid var(--border);
    padding: var(--space-md) 0;
    margin-top: auto;
    background-color: var(--background);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    color: var(--muted);
    font-size: 0.85rem;
    max-width: var(--max-width); 
    margin: 0 auto;              
    padding: 0 5%;               
}

.footer-copyright { display: flex; align-items: center; font-weight: 500; }
.footer-legal-nav { display: flex; align-items: center; gap: var(--space-sm); }
.footer-legal-nav a { color: var(--muted); text-decoration: none; transition: color var(--transition-fast); }
.footer-legal-nav a:hover { color: var(--white); }
.footer-separator { opacity: 0.3; }

.footer-socials { display: flex; align-items: center; gap: 1.25rem; }
.footer-socials a {
    color: var(--muted);
    display: flex;
    align-items: center;
    transition: color var(--transition-fast), transform var(--transition-fast);
}
.footer-socials a:hover { color: var(--white); transform: translateY(-2px); }
.footer-socials a img { width: 20px; height: 20px; stroke: currentColor; fill: none; display: block; }
.footer-socials a svg[viewBox="0 0 16 16"] { fill: currentColor; stroke: none; }

@media (min-width: 769px) {
    .footer-content {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        text-align: left;
    }
    .footer-copyright { justify-content: flex-start; }
    .footer-socials { justify-content: center; }
    .footer-legal-nav { justify-content: flex-end; }
}

/* ============================================================
   FORMS & INPUTS
   ============================================================ */

.form-group { margin-bottom: var(--space-md); text-align: left; }
.form-group label { display: block; margin-bottom: var(--space-xs); font-size: 0.9rem; font-weight: 600; color: var(--white); }
.form-group input,
.form-group select,
.form-group textarea { width: 100%; padding: 0.95rem var(--space-sm); background-color: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text); font-family: inherit; font-size: 1rem; transition: border-color var(--transition-fast), box-shadow var(--transition-fast); }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-group textarea { min-height: 150px; resize: vertical; }
.contact { max-width: 600px; margin-inline: auto; }

/* ============================================================
   PINNED ALPHA VIDEO SECTION (SCALED & CLEAN)
   ============================================================ */

.pinned-section {
    position: relative;
    padding: 4rem 5%; 
    margin: 2rem 0 6rem; 
}
.video-sticky-wrapper {
    position: absolute;
    top: -100px;   
    left: 0;  
    width: 100%;
    height: calc(100% + 150px); 
    z-index: -1;
    pointer-events: none; 
}
.pinned-video {
    position: sticky;
    top: 2vh; 
    width: 100%;
    height: 45vh; 
    object-fit: cover; 
    opacity: 0.6; 
    mix-blend-mode: screen;
}
.content-layer {
    position: relative;
    z-index: 2; 
    max-width: 800px; 
    margin: 0 auto; 
}
.content-layer .section-title,
.content-layer p {
    background: transparent;
    padding: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    margin-bottom: 1rem;
    color: var(--white); 
    text-shadow: 0 2px 10px rgba(0,0,0,0.8); 
}

/* ============================================================
   PRICING BUTTON FIX
   ============================================================ */

.button, .button-outline { position: relative; z-index: 10; }
.button-outline:hover { background-color: var(--text); color: var(--background); border-color: var(--text); transform: translateY(-2px); }

/* ============================================================
   FOOTER BACKGROUND REVEAL ENGINE
   ============================================================ */

.footer-video-container { position: relative; width: 100%; margin-top: auto; overflow: hidden; }
.footer-video-container .global-footer { position: relative; z-index: 2; background-color: transparent !important; backdrop-filter: none !important; padding: var(--space-xl) 0; }
.footer-video-container .video-wrapper { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.footer-video-container .bottom-bg-video { width: 100%; height: 100%; object-fit: cover; opacity: 0.35; mix-blend-mode: multiply; }