:root {
    --border-color: #000000;
    --border-width: 25px;
    --text-color: #ffffff;
    --bg-color: #0a0a0a;
    --accent: #f0f0f0;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--border-color); /* The black border color */
    color: var(--text-color);
    height: 100vh;
    overflow: hidden; /* Prevent scrolling on the body to keep borders fixed */
}

/* Global wrapper for the black borders */
.site-wrapper {
    position: relative;
    width: calc(100vw - (var(--border-width) * 2));
    height: calc(100vh - (var(--border-width) * 2));
    margin: var(--border-width);
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Navigation */
header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 35px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    mix-blend-mode: difference; /* Makes text visible over any background */
}

.logo a {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.logo-main {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.logo-sub {
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 6px;
    text-transform: uppercase;
    opacity: 0.7;
    margin-top: 2px;
}

nav {
    display: flex;
    gap: 40px;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    padding-bottom: 5px;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: var(--text-color);
    transition: width 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

nav a:hover::after {
    width: 100%;
}

/* Home Slider */
.home-main {
    flex: 1;
    display: flex;
    width: 100%;
    height: 100%;
}

.slider-container {
    display: flex;
    width: 100%;
    height: 100%;
}

.slide {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: flex 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.slide:hover {
    flex: 1.6;
}

.slide-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 1.2s cubic-bezier(0.25, 1, 0.5, 1), filter 0.8s ease;
    filter: brightness(0.4) grayscale(80%);
}

.slide:hover .slide-background {
    transform: scale(1.08);
    filter: brightness(0.8) grayscale(0%);
}

/* Placeholders - User can replace these URLs with their own */
.placeholder-bg-art {
    background-image: url('assets/REEL1.gif');
    background-color: #3a2a4c;
}

.placeholder-bg-motion {
    background-image: url('assets/HRBGlaciers.gif');
    background-color: #1a3a4c;
}

.slide-content {
    position: relative;
    z-index: 10;
    text-align: center;
}

.slide-content h2 {
    font-size: 6vw;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 8px;
    opacity: 0.7;
    transition: opacity 0.4s ease, transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    transform: translateY(20px);
}

.slide:hover .slide-content h2 {
    opacity: 1;
    transform: translateY(0);
}

/* Sub-pages layout */
.page-main {
    flex: 1;
    padding: 140px 60px 80px 60px;
    overflow-y: auto; /* Allow scrolling inside the bordered area */
    -webkit-overflow-scrolling: touch; /* Smooth inertia scrolling on mobile devices */
    scrollbar-width: none; /* Firefox */
}

.page-main::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.page-title {
    font-size: 5rem;
    margin-bottom: 3rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.content-section {
    max-width: 1400px;
    margin: 0 auto;
}

/* Work Grid */
.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 40px;
}

.work-item {
    aspect-ratio: 4/3;
    background: #1a1a1a;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    border-radius: 4px;
}

.work-item-bg {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    opacity: 0.8;
}

.work-item:hover .work-item-bg {
    transform: scale(1.05);
    opacity: 1;
}

.work-item-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.6) 50%, rgba(0,0,0,0) 100%);
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.work-item:hover .work-item-info {
    transform: translateY(0);
    opacity: 1;
}

.work-item-title {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 5px;
}

.work-item-category {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.work-item-meta {
    font-size: 0.85rem;
    color: #aaa;
    font-style: italic;
    font-weight: 300;
}

.work-item-description {
    font-size: 0.95rem;
    color: #e0e0e0;
    margin-top: 10px;
    line-height: 1.5;
    font-weight: 300;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s ease 0.1s;
}

.work-item:hover .work-item-description {
    opacity: 1;
    transform: translateY(0);
}

/* About Layout */
.about-layout {
    display: flex;
    gap: 80px;
    align-items: center;
}

.about-image {
    flex: 1;
    aspect-ratio: 4/5;
    background: #1a1a1a url('https://images.unsplash.com/photo-1534528741775-53994a69daeb?q=80&w=1964&auto=format&fit=crop') center/cover;
    border-radius: 4px;
}

.about-content {
    flex: 1.2;
}

.about-text {
    font-size: 1.4rem;
    line-height: 1.8;
    color: #dddddd;
    font-weight: 300;
}

.about-text p {
    margin-bottom: 2rem;
}

.contact-info {
    margin-top: 4rem;
    display: flex;
    gap: 30px;
}

.contact-info a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    border-bottom: 1px solid rgba(255,255,255,0.3);
    padding-bottom: 4px;
    transition: border-color 0.3s ease;
}

.contact-info a:hover {
    border-color: #fff;
}

/* Responsive */
@media (max-width: 900px) {
    :root {
        --border-width: 15px;
    }
    
    header {
        padding: 25px;
    }
    
    .slider-container {
        flex-direction: column;
    }
    
    .slide-content h2 {
        font-size: 4rem;
    }
    
    .slide-background {
        filter: brightness(0.6) grayscale(30%); /* Brighter and more colorful on mobile by default */
    }
    
    .about-layout {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 40px;
    }
    
    .about-image {
        width: 100%;
        max-width: 450px;
    }
    
    .page-main {
        padding: 130px 25px 60px 25px;
    }
    
    .page-title {
        font-size: 3rem;
        margin-bottom: 2rem;
        text-align: center;
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: var(--bg-color);
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.modal-media-list {
    width: 100%;
    max-height: 50vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #000;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    /* Custom Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #555 #111;
}

.modal-media-list::-webkit-scrollbar {
    width: 8px;
}

.modal-media-list::-webkit-scrollbar-track {
    background: #111;
}

.modal-media-list::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.modal-media-list img,
.modal-media-list video,
.modal-media-list iframe {
    width: 100%;
    height: auto;
    border-radius: 4px;
    background: #111;
}

.modal-info {
    padding: 30px;
    background: #111;
}

.modal-info h2 {
    font-size: 2rem;
    margin-bottom: 5px;
    font-weight: 500;
}

.modal-category {
    font-size: 0.9rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.modal-meta {
    font-size: 0.95rem;
    color: #aaa;
    font-style: italic;
    margin-bottom: 15px;
    font-weight: 300;
}

.modal-desc {
    font-size: 1.1rem;
    color: #ddd;
    line-height: 1.6;
    font-weight: 300;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    color: white;
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    z-index: 10;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #ccc;
}

@media (min-width: 900px) {
    .modal-content {
        flex-direction: row;
        max-width: 80%;
        max-height: 85vh;
    }
    
    .modal-media-list {
        width: 65%;
        max-height: 85vh;
    }
    
    .modal-info {
        width: 35%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 800;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 50;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: bounce 2s infinite;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.scroll-indicator.visible {
    opacity: 1;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) translateX(-50%); }
    40% { transform: translateY(-10px) translateX(-50%); }
    60% { transform: translateY(-5px) translateX(-50%); }
}

@media (min-width: 900px) {
    .scroll-indicator {
        left: 32.5%; /* Center of the 65% width media list */
    }
}

/* Timeline Layout */
.timeline-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 0 60px;
}

.timeline {
    position: relative;
    border-left: 2px solid rgba(255, 255, 255, 0.2);
    margin-left: 20px;
    padding-left: 40px;
    margin-top: 40px;
}

.timeline-item {
    position: relative;
    margin-bottom: 60px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -49px;
    top: 5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-color);
    border: 2px solid var(--text-color);
    transition: background 0.3s ease;
}

.timeline-item:hover::before {
    background: var(--text-color);
}

.timeline-date {
    font-size: 1rem;
    color: #aaa;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
    font-weight: 300;
}

.timeline-title {
    font-size: 2rem;
    font-weight: 500;
    margin-bottom: 5px;
    color: #fff;
}

.timeline-company {
    font-size: 1.2rem;
    color: #ddd;
    margin-bottom: 15px;
    font-weight: 300;
}

.timeline-desc {
    font-size: 1.05rem;
    color: #bbb;
    line-height: 1.6;
    font-weight: 300;
}
/* Modal Navigation */
.modal-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    z-index: 1100;
    padding: 20px;
    transition: all 0.3s ease;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.2);
    border-radius: 50%;
    width: 80px;
    height: 80px;
}

.modal-nav:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.prev-project {
    left: 20px;
}

.next-project {
    right: 20px;
}

@media (max-width: 900px) {
    .modal-nav {
        top: auto;
        bottom: 20px;
        transform: none;
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .prev-project {
        left: 30px;
    }
    
    .next-project {
        right: 30px;
    }
}

/* Mobile-Specific Overrides to fix header navigation and layouts */
@media (max-width: 600px) {
    :root {
        --border-width: 8px; /* Thinner border to maximize viewport real estate */
    }

    header {
        flex-direction: column;
        gap: 12px;
        padding: 15px 10px;
        align-items: center;
        text-align: center;
    }

    .logo-main {
        font-size: 16px;
        letter-spacing: 2px;
    }

    .logo-sub {
        font-size: 8px;
        letter-spacing: 3px;
        margin-top: 1px;
    }

    nav {
        gap: 15px; /* Narrow gaps so all 4 tabs (Art, Motion, Work, About) fit easily */
        justify-content: center;
        width: 100%;
    }

    nav a {
        font-size: 12px;
        letter-spacing: 1px;
        padding-bottom: 2px;
    }

    .page-main {
        padding: 110px 15px 40px 15px; /* Adjust top padding for stacked header */
    }

    .page-title {
        font-size: 2.2rem;
        margin-bottom: 1.5rem;
    }

    .work-grid {
        grid-template-columns: 1fr; /* Stack items vertically */
        gap: 20px;
    }
    
    .work-item-info {
        transform: translateY(0); /* Make project info visible on mobile tap instead of relying on hover */
        opacity: 1;
        padding: 20px;
        background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.8) 70%, rgba(0,0,0,0.4) 100%);
    }
    
    .work-item-description {
        opacity: 1;
        transform: translateY(0);
        font-size: 0.85rem;
    }

    .timeline {
        margin-left: 5px;
        padding-left: 20px;
        margin-top: 25px;
    }

    .timeline-item {
        margin-bottom: 40px;
    }

    .timeline-item::before {
        left: -26px; /* Align correctly with the smaller padding */
        top: 6px;
        width: 10px;
        height: 10px;
    }

    .timeline-title {
        font-size: 1.3rem;
    }

    .timeline-company {
        font-size: 1rem;
        margin-bottom: 8px;
    }

    .timeline-desc {
        font-size: 0.9rem;
    }

    .about-layout {
        gap: 25px;
    }

    .about-text {
        font-size: 1rem;
        line-height: 1.6;
        text-align: left;
    }

    .about-text p {
        margin-bottom: 1.2rem;
    }

    .contact-info {
        margin-top: 2rem;
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }
    
    .contact-info a {
        font-size: 0.95rem;
        padding-bottom: 2px;
    }
}
