/* ====================================
   CSS Variables & Root Styles - Cinematic Blue Theme
   ==================================== */
:root {
    /* Core Colors - Cinematic Blue Palette */
    --color-bg: #0a0e1a;
    --color-surface: #0f1419;
    --color-surface-light: #1a1f2e;
    --color-text: #e8eef5;
    --color-text-secondary: #8b9bb8;
    --color-accent: #64b5f6;
    --color-accent-hover: #42a5f5;
    --color-accent-dark: #1e88e5;
    --color-border: #1e2433;

    /* Typography */
    --font-display: 'Bebas Neue', sans-serif;
    --font-body: 'Work Sans', sans-serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;

    /* Effects */
    --border-radius: 4px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ====================================
   Reset & Base Styles
   ==================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ====================================
   Container & Layout
   ==================================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ====================================
   Hero Section with Background Video
   ==================================== */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: var(--spacing-xl) var(--spacing-md);
    overflow: hidden;
}

/* Background Video Container */
.hero-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    opacity: 0.15;
    /* Low opacity to not distract from content */
    filter: blur(3px);
    /* Slight blur for cinematic effect */
}

/* Video Overlay for Better Text Readability */
.hero-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
            rgba(10, 14, 26, 0.85) 0%,
            rgba(15, 20, 35, 0.7) 50%,
            rgba(10, 14, 26, 0.85) 100%);
    pointer-events: none;
}

/* Cinematic grain overlay */
.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
    opacity: 0.4;
    pointer-events: none;
    z-index: 1;
}

.hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-lg);
    max-width: 1400px;
    width: 100%;
    z-index: 2;
    position: relative;
}

.hero-text {
    animation: fadeInUp 1s ease-out;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 7rem);
    line-height: 0.9;
    letter-spacing: 0.02em;
    margin-bottom: var(--spacing-sm);
    background: linear-gradient(135deg, var(--color-text) 0%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(100, 181, 246, 0.2);
}

.title-line {
    display: block;
}

.hero-subtitle {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--color-accent);
    margin-bottom: var(--spacing-md);
    letter-spacing: 0.02em;
}

.hero-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-md);
    max-width: 600px;
    font-weight: 300;
    margin-left: auto;
    margin-right: auto;
}

.hero-skills {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
}

.skill-tag {
    padding: 0.5rem 1rem;
    background: rgba(100, 181, 246, 0.1);
    border: 1px solid rgba(100, 181, 246, 0.3);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: var(--transition);
    color: var(--color-accent);
}

.skill-tag:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-bg);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(100, 181, 246, 0.4);
}

.hero-cta {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
    justify-content: center;
}

.btn-primary,
.btn-secondary {
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    transition: var(--transition);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--color-accent);
    color: var(--color-bg);
    border-color: var(--color-accent);
}

.btn-primary:hover {
    background: var(--color-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(100, 181, 246, 0.5);
}

.btn-secondary {
    background: transparent;
    color: var(--color-text);
    border-color: var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-surface-light);
    border-color: var(--color-accent);
    transform: translateY(-2px);
}

.scroll-indicator {
    position: absolute;
    bottom: var(--spacing-md);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    animation: bounce 2s infinite;
    z-index: 2;
}

/* ====================================
   Portfolio Section
   ==================================== */
.portfolio {
    padding: var(--spacing-xl) 0;
    background: var(--color-bg);
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    text-align: center;
    margin-bottom: var(--spacing-sm);
    letter-spacing: 0.02em;
    color: var(--color-text);
}

.section-subtitle {
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 1.1rem;
    margin-bottom: var(--spacing-lg);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 2px solid var(--color-border);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background: rgba(100, 181, 246, 0.05);
}

.filter-btn.active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-bg);
    box-shadow: 0 5px 15px rgba(100, 181, 246, 0.3);
}

/* ====================================
   Video Grid
   ==================================== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.video-item {
    background: var(--color-surface);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    opacity: 1;
    transform: scale(1);
    border: 1px solid var(--color-border);
}

.video-item.hidden {
    display: none;
}

.video-item:hover {
    transform: translateY(-5px);
    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(100, 181, 246, 0.3);
    border-color: rgba(100, 181, 246, 0.5);
}

.video-wrapper {
    position: relative;
    aspect-ratio: 16/9;
    background: #000;
    overflow: hidden;
}

.video-thumbnail {
    position: absolute;
    inset: 0;
    cursor: pointer;
    z-index: 2;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: var(--transition);
    filter: drop-shadow(0 4px 12px rgba(100, 181, 246, 0.5));
}

.video-thumbnail:hover .play-button {
    transform: translate(-50%, -50%) scale(1.1);
}

.video-info {
    padding: var(--spacing-md);
}

.video-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
    letter-spacing: 0.05em;
    color: var(--color-text);
}

.video-description {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: var(--spacing-sm);
}

.video-meta {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.meta-tag {
    padding: 0.25rem 0.75rem;
    background: rgba(100, 181, 246, 0.15);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-accent);
    border: 1px solid rgba(100, 181, 246, 0.3);
}

.meta-duration {
    color: var(--color-text-secondary);
    font-size: 0.85rem;
}

/* ====================================
   Video Modal - Expanded View
   ==================================== */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-modal.active {
    display: flex;
    opacity: 1;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 26, 0.95);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    width: 95%;
    max-width: 1400px;
    max-height: 90vh;
    background: var(--color-surface);
    border-radius: var(--border-radius);
    overflow: hidden;
    z-index: 1001;
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(100, 181, 246, 0.2);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: rgba(10, 14, 26, 0.9);
    border: 1px solid rgba(100, 181, 246, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1002;
    transition: var(--transition);
    color: var(--color-text);
}

.modal-close:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
    transform: rotate(90deg);
}

.modal-body {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-video-container {
    position: relative;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.modal-youtube-player {
    width: 100%;
    height: 100%;
}

.modal-youtube-player iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.modal-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
}

.modal-title {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--color-text);
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-xs);
}

.modal-meta {
    display: flex;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
    margin-bottom: var(--spacing-sm);
}

.modal-description {
    color: var(--color-text-secondary);
    line-height: 1.8;
    font-size: 1rem;
}

/* ====================================
   Contact Section
   ==================================== */
.contact {
    padding: var(--spacing-xl) 0;
    background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-bg) 100%);
}

.contact-text {
    text-align: center;
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    max-width: 700px;
    margin: 0 auto var(--spacing-lg);
    line-height: 1.8;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 600;
}

.contact-link:hover {
    border-color: var(--color-accent);
    background: var(--color-surface-light);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(100, 181, 246, 0.2);
}

.contact-link svg {
    flex-shrink: 0;
}

/* ====================================
   Footer
   ==================================== */
.footer {
    padding: var(--spacing-lg) 0;
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    text-align: center;
    color: var(--color-text-secondary);
}

.footer-note {
    margin-top: var(--spacing-xs);
    font-size: 0.85rem;
    font-style: italic;
}

/* ====================================
   Animations
   ==================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(-10px);
    }

    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(30px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ====================================
   Responsive Design
   ==================================== */
@media (max-width: 1024px) {
    .modal-body {
        grid-template-columns: 1fr;
    }

    .modal-info {
        order: 2;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: var(--spacing-md);
    }
}

@media (max-width: 768px) {
    .hero {
        padding: var(--spacing-lg) var(--spacing-sm);
    }

    .hero-title {
        font-size: 3rem;
    }

    .hero-subtitle {
        font-size: 1.5rem;
    }

    .hero-cta {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        text-align: center;
    }

    .filter-buttons {
        gap: var(--spacing-xs);
    }

    .filter-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .video-grid {
        grid-template-columns: 1fr;
    }

    .contact-links {
        flex-direction: column;
        align-items: stretch;
    }

    .contact-link {
        justify-content: center;
    }

    .modal-content {
        width: 98%;
        max-height: 95vh;
    }

    .modal-body {
        padding: var(--spacing-sm);
        gap: var(--spacing-sm);
    }

    .modal-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero-skills {
        gap: 0.25rem;
    }

    .skill-tag {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .modal-close {
        width: 35px;
        height: 35px;
    }
}

/* ====================================
   Performance Optimizations
   ==================================== */
.video-player {
    will-change: auto;
}

.video-item {
    contain: layout style paint;
}

/* Ensure smooth video playback */
.hero-video {
    will-change: transform, opacity;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .hero-video {
        animation: none;
    }
}

/* ====================================
   Custom Scrollbar (Optional)
   ==================================== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--color-accent);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent-hover);
}

/* Spinner Animation */
.video-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 5px solid #64b5f6;
    border-top: 5px solid #000;
    /* Match your brand color */
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 0;
    /* Behind the player */
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.modal-youtube-player {
    position: relative;
    z-index: 1;
    /* Sits on top of the loader */
}

/* ====================================
   Contact Section Side-by-Side Layout
   ==================================== */

.contact-wrapper {
    display: flex;
    align-items: center;
    /* Vertically centers the content */
    gap: 4rem;
    /* Adds space between image and text */
    max-width: 1000px;
    /* Keeps the whole section neat */
    margin: 0 auto;
}

/* Left Side: Image Container */
.contact-image-side {
    flex-shrink: 0;
    /* Prevents image from getting squished */
    width: 300px;
    /* FIXED WIDTH - Change this if you want it wider/narrower */
}

/* The actual image styling */
.contact-photo {
    width: 100%;
    height: 400px;
    /* FIXED HEIGHT - Makes it portrait (vertical rectangle) */
    object-fit: cover;
    /* Important: Crops image nicely to fit the rectangle */
    border-radius: 8px;
    /* Rounded corners */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    /* Cinematic shadow */
    margin-top: 0;
    /* Resets any previous margins */
}

/* Right Side: Content Styling */
.contact-content-side {
    text-align: left;
    /* Aligns text to the left */
}

/* Override previous centered text styles */
.contact-content-side .section-title {
    text-align: left;
    margin-bottom: 1rem;
}

.contact-content-side .contact-text {
    text-align: left;
    margin-bottom: 2rem;
    max-width: 100%;
    /* Allows text to fill the right side */
}

.contact-links {
    justify-content: flex-start;
    /* Aligns buttons to the left */
    flex-wrap: wrap;
    /* Allows buttons to wrap on smaller screens */
}

/* ====================================
   Mobile Responsiveness
   ==================================== */
/* When screen is smaller than 768px (Tablets/Phones), stack them */
@media (max-width: 768px) {
    .contact-wrapper {
        flex-direction: column;
        /* Stack vertically */
        text-align: center;
        gap: 2rem;
    }

    .contact-image-side {
        width: 250px;
        /* Slightly smaller image on mobile */
        margin: 0 auto;
    }

    .contact-photo {
        height: 300px;
        /* Smaller height on mobile */
    }

    .contact-content-side,
    .contact-content-side .section-title,
    .contact-content-side .contact-text {
        text-align: center;
        /* Center text again for mobile */
    }

    .contact-links {
        justify-content: center;
        /* Center buttons again for mobile */
    }
}

/* --- Cinematic Background Wrapper --- */
.hero {
    position: relative;
    /* Ensure content stays on top */
    z-index: 1;
}

.cinematic-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    /* Puts it behind the text */
    background-color: var(--color-bg);
    /* Matches your dark theme */
}

/* --- Moving Soft Lights (The "Atmosphere") --- */
.moving-light {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    /* Creates the soft cinematic glow */
    opacity: 0.4;
    /* Subtle enough not to distract */
    animation: floatLight 15s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light 1: The Primary Blue Glow */
.light-1 {
    background: var(--color-accent-dark);
    width: 600px;
    height: 600px;
    top: -10%;
    left: -10%;
    animation-delay: 0s;
}

/* Light 2: A softer accent highlight */
.light-2 {
    background: var(--color-accent);
    width: 500px;
    height: 500px;
    bottom: -10%;
    right: -10%;
    animation-delay: -5s;
    /* Starts at a different time */
    opacity: 0.2;
}



@keyframes floatLight {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(100px, 50px) scale(1.1);
    }
}

/* ====================================
   Mobile Responsive Fixes
   ==================================== */
@media screen and (max-width: 768px) {

    /* 1. Adjust the container spacing */
    .hero {
        padding: 120px 0 60px 0;
        /* Less padding on top/bottom */
        min-height: auto;
        /* Remove strict full-screen height if it causes scrolling issues */
        display: flex;
        align-items: center;
    }

    .hero-content {
        width: 100%;
        padding: 0 20px;
        /* Ensure text doesn't touch screen edges */
        text-align: center;
        /* Center alignment usually looks cleaner on mobile */
    }

    /* 2. Scale down the massive title */
    .hero-title {
        font-size: 3.5rem;
        /* significantly smaller than desktop */
        line-height: 1.1;
        margin-bottom: 1rem;
    }

    /* 3. Adjust subtitle size and spacing */
    .hero-subtitle {
        font-size: 1.2rem;
        margin-bottom: 1.5rem;
    }

    /* 4. Make the description readable */
    .hero-description {
        font-size: 1rem;
        line-height: 1.6;
        max-width: 100%;
        /* Let it use the full mobile width */
        margin: 0 auto;
        /* Center the block */
    }
}
