:root {
    --color-primary: #111111;
    /* Dark Grey Background */
    --color-secondary: #FFFFFF;
    /* White Text/Borders */
    --color-accent: #00E5FF;
    /* Cyan Accent */
    --color-bg: #222222;
    --border-width: 4px;
    --shadow-offset: 8px;
    --font-heading: 'Avenir', 'Avenir Next', sans-serif;
    --font-body: 'Space Mono', monospace;
    --ease-cinematic: cubic-bezier(0.19, 1, 0.22, 1);
}

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

body {
    background-color: var(--color-primary);
    color: var(--color-secondary);
    font-family: var(--font-body);
    overflow-x: hidden;
}

/* Grid Layout */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 33.33vh;
    /* 3 rows fill the screen height approx */
    width: 100vw;
    min-height: 100vh;
    border: var(--border-width) solid var(--color-secondary);
    position: relative;
    perspective: 1000px;
}

.grid-item {
    border: var(--border-width) solid var(--color-secondary);
    background-color: #000;
    position: relative;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    overflow: hidden;
}

.grid-item video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover !important;
    filter: grayscale(100%) contrast(120%);
    transition: filter 0.2s ease-in-out;
}

.grid-item:hover video {
    filter: grayscale(0%) contrast(100%);
}

.grid-item:hover {
    transform: translate(-4px, -4px);
    box-shadow: 4px 4px 0px var(--color-secondary);
}

.item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 229, 255, 0.8);
    /* Cyan overlay */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.grid-item:hover .item-overlay {
    opacity: 1;
}

.item-overlay span {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    text-transform: uppercase;
    border: 2px solid var(--color-secondary);
    padding: 0.5rem 1rem;
    background: var(--color-bg);
    box-shadow: 4px 4px 0px var(--color-secondary);
}

/* Hero Block */
/* Hero Block - Liquid Glass Effect */
/* Hero Block - Pill Shape & Tight Typography */
.hero-block {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transform-style: preserve-3d;
    animation: float-rotate 8s ease-in-out infinite alternate;

    background: var(--color-secondary);
    /* White background */
    border: 2px solid var(--color-primary);
    /* Black border */
    box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.2);
    /* Offset shadow */

    padding: 1.5rem 4rem;
    text-align: center;
    z-index: 10;
    min-width: auto;
    max-width: 90vw;
    border-radius: 100px;
    /* Pill shape */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-block h1 {
    font-family: var(--font-heading);
    font-size: 4.5rem;
    font-weight: 900;
    line-height: 0.9;
    margin-bottom: 0.2rem;
    letter-spacing: -0.08em;
    /* Very tight spacing */
    color: var(--color-primary);
    /* Black text */
    text-shadow: none;
}

.hero-block h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 500;
    font-style: italic;
    margin-bottom: 1.5rem;
    letter-spacing: -0.04em;
    color: var(--color-primary);
    text-shadow: none;
    opacity: 1;
}

.hero-nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.hero-nav a {
    text-decoration: none;
    color: var(--color-primary);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    letter-spacing: -0.02em;
}

.hero-nav a:hover {
    border-bottom: 2px solid var(--color-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 50vh;
    }

    .hero-block {
        width: 90vw;
        padding: 2rem;
    }

    .hero-block h1 {
        font-size: 2.5rem;
    }

    .hero-block h2 {
        font-size: 1rem;
    }
}

@keyframes float-rotate {
    0% {
        transform: translate(-50%, -50%) rotateX(-5deg) rotateY(-5deg);
    }

    100% {
        transform: translate(-50%, -50%) rotateX(5deg) rotateY(5deg);
    }
}

/* Contact Form Styles */
.contact-block {
    padding: 2rem 3rem;
    /* Slightly less padding to fit form */
    min-width: 40vw;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 400px;
    margin-bottom: 1.5rem;
}

.form-group {
    width: 100%;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    background: transparent;
    border: 2px solid var(--color-primary);
    padding: 0.8rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--color-primary);
    outline: none;
    border-radius: 0;
    /* Brutalist sharp edges for inputs */
    transition: all 0.2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    background: var(--color-primary);
    color: var(--color-secondary);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: rgba(17, 17, 17, 0.6);
}

.contact-form button {
    background: var(--color-primary);
    color: var(--color-secondary);
    border: none;
    padding: 1rem;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid var(--color-primary);
}

.contact-form button:hover {
    background: transparent;
    color: var(--color-primary);
}

/* Top Navigation */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: var(--color-primary);
    /* Default Solid Black */
    transition: background 0.8s var(--ease-cinematic);
    /* Smooth transition */
}

.top-nav.scrolled {
    background: transparent;
    /* Transparent on scroll */
}

.top-nav.hidden-by-video {
    transform: translateY(-100%);
    transition: transform 0.3s ease-in;
}

.nav-brand {
    font-family: 'Archivo Black', sans-serif;
    /* Match hero h1 */
    font-size: 1.5rem;
    font-weight: 900;
    color: #fff;
    text-transform: lowercase;
    letter-spacing: -0.05em;
}

.nav-links {
    display: flex;
    gap: 3rem;
}

.nav-link {
    color: #fff;
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.6;
    transition: opacity 0.3s;
    mix-blend-mode: difference;
    /* Always blend for visibility */
}

.nav-link:hover,
.nav-link.active {
    opacity: 1;
}

/* 2x2 Grid Layout */
.project-grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 50vh;
    /* Allow infinite rows */
    width: 100vw;
    min-height: 100vh;
    /* Allow growing */
    background: #000;
}

.project-tile {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.8s var(--ease-cinematic);
    /* Slower, smoother transition */
    border: 1px solid rgba(255, 255, 255, 0.1);
    filter: blur(0);
    /* Initialize blur for transition */
    /* Ensure these properties can animate */
    top: 0;
    left: 0;
}

.video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%) contrast(110%);
    transition: all 0.8s var(--ease-cinematic);
    transform: scale(1.05);
}

.project-tile:hover .video-wrapper video {
    filter: grayscale(0%) contrast(100%);
    transform: scale(1);
}

/* Tile Overlay (Default State) */
.tile-overlay {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    z-index: 2;
    pointer-events: none;
    mix-blend-mode: difference;
}

.tile-overlay h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    line-height: 0.9;
    color: #fff;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.tile-overlay .category {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s var(--ease-cinematic);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 80vw;
    height: 80vh;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    overflow: hidden;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.4s var(--ease-cinematic);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-video-wrapper {
    width: 100%;
    height: 100%;
    background: #000;
}

.modal-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-info {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
    overflow-y: auto;
}

.modal-info h1 {
    font-family: var(--font-heading);
    font-size: 3rem;
    line-height: 0.9;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.modal-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--color-accent);
    text-transform: uppercase;
}

.modal-info p {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    opacity: 0.8;
}

.modal-credits {
    margin-bottom: 3rem;
    font-family: var(--font-body);
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0.6;
}

.close-modal-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.close-modal-btn:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .modal-content {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr;
        width: 90vw;
        height: 90vh;
    }

    .modal-info h1 {
        font-size: 2rem;
    }
}

/* Shorts Page Styles */
.shorts-container {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    background: #000;
    overflow: hidden;
}

.shorts-reel {
    display: flex;
    gap: 2rem;
    padding: 0 5vw;
    overflow-x: auto;
    width: 100%;
    height: 70vh;
    align-items: center;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
    cursor: grab;
}

.shorts-reel::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.short-tile {
    position: relative;
    min-width: 300px;
    aspect-ratio: 9/16;
    height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.5s var(--ease-cinematic);
    flex-shrink: 0;
}

.short-tile:hover {
    transform: scale(1.05);
    z-index: 10;
    border-color: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.short-tile .video-wrapper {
    width: 100%;
    height: 100%;
    background-color: #333;
    /* Fallback color */
}

.short-tile .video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%) contrast(110%);
    transition: all 0.5s var(--ease-cinematic);
}

.short-tile:hover .video-wrapper video {
    filter: grayscale(0%) contrast(100%);
    transform: scale(1.1);
}

.short-tile .tile-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    transform: translateY(100%);
    transition: transform 0.4s var(--ease-cinematic);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.short-tile:hover .tile-overlay {
    transform: translateY(0);
}

.short-tile .tile-overlay h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: #fff;
    margin: 0;
    text-transform: uppercase;
}

.short-tile .tile-overlay .category {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}



.project-tile.expanded .video-wrapper video {
    filter: grayscale(0%) brightness(0.4);
    transform: scale(1);
}

.project-tile.expanded .tile-overlay {
    opacity: 0;
    transition: opacity 0.3s;
}

/* Hidden State (for non-expanded tiles) - Focus Pull Effect */
.project-tile.hidden {
    opacity: 0;
    pointer-events: none;
    filter: blur(20px);
    /* Strong blur for depth */
    transform: scale(0.95);
    /* Slight push back */
}

/* Details Content (Expanded State) */
.tile-details {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s 0.3s;
    /* Delay fade in */
}



@media (max-width: 768px) {
    .project-grid-2x2 {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 25vh);
    }

    .tile-overlay h2 {
        font-size: 1.5rem;
    }

    .details-content h1 {
        font-size: 3rem;
    }

    .credits {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Contact / About Page Styles */
.about-container {
    width: 100vw;
    height: 100vh;
    background: #000;
    padding-top: 80px;
    /* Space for fixed nav */
    overflow-y: auto;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    height: calc(100vh - 80px);
    width: 100%;
}

.about-grid .grid-item {
    position: relative;
    padding: 4rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Align to top */
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.5s var(--ease-cinematic);
    overflow: hidden;
}

.about-grid .grid-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
}

.content-wrapper {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
}

.grid-item h1 {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    /* Reduced from 5rem */
    font-weight: 900;
    /* Match hero */
    letter-spacing: -0.05em;
    /* Tight spacing */
    margin-bottom: 1.5rem;
    color: transparent;
    -webkit-text-stroke: 2px #fff;
    opacity: 0.5;
    /* Increased visibility */
    transition: all 0.5s var(--ease-cinematic);
}

.grid-item:hover h1 {
    opacity: 1;
    -webkit-text-stroke: 2px var(--color-accent);
    transform: translateX(10px);
}

/* Quadrant Specifics */
.about-me p {
    font-size: 1.1rem;
    /* Reduced from 1.5rem */
    line-height: 1.6;
    color: #ccc;
    max-width: 90%;
}

.service-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.service-list li {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    text-transform: uppercase;
    color: #fff;
    opacity: 0.7;
    transition: opacity 0.3s;
    letter-spacing: 0.03em;
}

.service-list li:hover {
    opacity: 1;
    color: var(--color-accent);
}

.social-icons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.social-link {
    font-size: 1.8rem;
    /* Reduced from 2.5rem */
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    text-transform: uppercase;
    transition: all 0.3s;
}

.social-link:hover {
    color: var(--color-accent);
    transform: translateX(20px);
}

/* Allow content to show in grid items */
.about-grid .grid-item.contact,
.about-grid .grid-item.services {
    overflow: visible;
}

/* Contact Form Grid Style */
.contact-form-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-form-grid input,
.contact-form-grid textarea {
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    padding: 0.8rem 0;
    font-family: var(--font-body);
    font-size: 1rem;
    /* Reduced from 1.2rem */
    color: #fff;
    outline: none;
    transition: border-color 0.3s;
}

.contact-form-grid input:focus,
.contact-form-grid textarea:focus {
    border-color: var(--color-accent);
}

.contact-form-grid textarea {
    resize: none;
    min-height: 60px;
}

.contact-form-grid button {
    background: #fff;
    color: #000;
    border: none;
    padding: 0.8rem 1.5rem;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    align-self: flex-start;
    margin-top: 0.5rem;
    transition: all 0.3s;
}

.contact-form-grid button:hover {
    background: var(--color-accent);
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        height: auto;
        overflow-y: auto;
    }

    .grid-item {
        padding: 3rem 1.5rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .grid-item h1 {
        font-size: 3rem;
    }
}

/* Page Transition Overlay */
#page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9999;
    opacity: 1;
    pointer-events: all;
    transition: opacity 0.5s var(--ease-cinematic), backdrop-filter 0.5s var(--ease-cinematic);
}

#page-transition.fade-out {
    opacity: 0;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    pointer-events: none;
}

/* Static Index Grid (Background Only) */
.portfolio-grid .grid-item {
    pointer-events: none;
    /* Disable clicks */
    cursor: default;
}

.portfolio-grid .grid-item:hover {
    transform: none;
    box-shadow: none;
}

.portfolio-grid .grid-item:hover video {
    filter: grayscale(100%) contrast(120%);
    /* Prevent color change on hover */
}

.portfolio-grid .item-overlay {
    display: none;
    /* Hide titles permanently */
}