/* 
   Cinematic Portfolio - Final Refinement
   Somewhere Studio 
*/

:root {
    /* Colors */
    --bg-color: #fcfcfc;
    --text-color: #1a1a1a;
    --text-muted: #4a4a4a;

    /* Spacing */
    --spacing-sm: 2rem;
    --spacing-md: 4rem;
    --spacing-lg: 8rem;

    /* Typography */
    /* Strict Split: Display (Serif) vs UI (Sans) */
    --font-display: 'DM Serif Display', serif;
    --font-ui: 'DM Sans', system-ui, -apple-system, sans-serif;

    /* Animations */
    --ease-cinematic: cubic-bezier(0.19, 1, 0.22, 1);
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-ui);
    /* Default to Sans for UI/Body */
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Typography Utilities */
h1 {
    font-family: var(--font-display);
    /* Only H1 gets Serif (Hero) */
    font-weight: 400;
}

h2,
h3,
h4,
h5,
h6,
p,
a,
span {
    font-family: var(--font-ui);
    /* Force Sans for everything else */
}

a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s ease;
}

/* ---------------------------------------------------------
   HEADER & NAVIGATION 
   --------------------------------------------------------- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
    padding: 0 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

/* Logo - EXCEPTION: Serif */
.nav-logo {
    font-family: var(--font-display);
    font-size: 3.6rem;
    letter-spacing: -0.02em;
    color: var(--text-color);
    line-height: normal;
    display: flex;
    align-items: center;
    font-weight: 400;
}

/* Desktop Nav */
.nav-right {
    display: flex;
    gap: 3rem;
    align-items: center;
    height: 100%;
}

.nav-link {
    font-family: var(--font-ui);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-color);
    position: relative;
    display: inline-block;
    padding-bottom: 4px;
    opacity: 0.55;
    transition: opacity 0.25s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
    opacity: 0.7;
}

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

.nav-link:hover::after,
.nav-link.is-current::after {
    transform: scaleX(1);
}

/* Social / Instagram icon */
.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.45s ease, transform 0.45s var(--ease-cinematic);
}

.social-link:hover {
    opacity: 0.55;
    transform: scale(0.96);
}

.social-icon {
    width: 24px;
    height: 24px;
    color: var(--text-color);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: var(--text-color);
    height: 100%;
    align-items: center;
    justify-content: center;
}

/* ---------------------------------------------------------
   BREADCRUMB / VIEW LAYOUT
   --------------------------------------------------------- */
main {
    min-height: 100vh;
    padding-top: 150px;
}

/* Subtle Section Divider Label + Brand Motif */
.section-label {
    font-family: var(--font-ui);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 3rem;
    opacity: 0.6;
    font-weight: 500;
}

.section-label::before {
    content: '';
    display: block;
    width: 24px;
    height: 1px;
    background: rgba(0, 0, 0, 0.18);
    margin: 0 auto 12px;
}

/* ---------------------------------------------------------
   MOBILE MENU OVERLAY
   --------------------------------------------------------- */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: white;
    z-index: 200;
    display: flex;
    flex-direction: column;
    padding: 2.5rem 3rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all 0.5s var(--ease-cinematic);
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4rem;
    height: 60px;
}

.mobile-menu-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-links {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    flex: 1;
    justify-content: center;
    align-items: center;
}

.mobile-link {
    font-family: var(--font-ui);
    font-size: 2rem;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    position: relative;
    display: inline-block;
    padding-bottom: 6px;
    opacity: 0.55;
    transition: opacity 0.25s ease;
}

.mobile-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
    opacity: 0.7;
}

.mobile-link:hover,
.mobile-link.is-current {
    opacity: 1;
}

.mobile-link:hover::after,
.mobile-link.is-current::after {
    transform: scaleX(1);
}

.mobile-menu-footer {
    display: flex;
    justify-content: center;
    padding-bottom: 2rem;
}

/* Brand motif in mobile menu */
.mobile-menu-footer::before {
    content: '';
    display: block;
    width: 24px;
    height: 1px;
    background: rgba(0, 0, 0, 0.12);
    margin: 0 auto 2rem;
}

/* ---------------------------------------------------------
   RESPONESIVE BREAKPOINT (900px)
   --------------------------------------------------------- */
@media (max-width: 900px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .site-header {
        padding: 0 2rem;
        height: 80px;
    }

    .nav-logo {
        font-size: 2.2rem;
    }
}

/* ---------------------------------------------------------
   HERO SECTION
   --------------------------------------------------------- */
.hero-section {
    position: relative;
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
    /* Soft, warm tonal background for desktop and tablet */
    background: linear-gradient(180deg, #161412 0%, #110f0e 100%);
}

/* --- Hero Video Grid --- */
.hero-videos {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 12px;
    padding: 0;
    z-index: 1;
}

.hero-video-slot {
    flex: 1;
    max-width: 420px;
    border-radius: 12px;
    overflow: hidden;
    opacity: 1;
    position: relative; /* Container for absolute videos */
}

.hero-video-slot.fading {
    opacity: 0;
}

.hero-video-slot video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.5s var(--ease-cinematic);
}

.hero-video-slot video.active {
    opacity: 1;
    z-index: 1;
}

/* Center video — subtle visual dominance */
.hero-video-center {
    transform: scale(1.0);
    z-index: 2;
}

/* Side videos — slightly reduced presence */
.hero-video-left,
.hero-video-right {
    opacity: 0.88;
    transform: scale(0.94);
}

.hero-video-left.fading,
.hero-video-right.fading {
    opacity: 0;
}

/* --- Gradient Overlay --- */
.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.25));
    pointer-events: none;
}

/* --- Hero Content (over videos) --- */
.hero-content {
    position: relative;
    z-index: 4;
    padding: 0 2rem;
}

.hero-content h1 {
    font-family: var(--font-display);
    font-size: clamp(2.6rem, 5.5vw, 5.5rem);
    line-height: 1.15;
    margin-bottom: 2rem;
    letter-spacing: -0.03em;
    color: #fff;
}

.hero-content .subtitle {
    font-family: var(--font-ui);
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
    font-style: normal;
    letter-spacing: 0.02em;
}

/* --- Category Navigation --- */
.hero-categories {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    align-items: center;
    margin-top: 3.5rem;
}

.hero-cat-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 0.75rem; /* +1px visually up from 0.72rem default */
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5); /* inactive opacity ~0.5 */
    padding: 0;
    padding-bottom: 4px;
    position: relative;
    transition: color 0.35s ease;
}

.hero-cat-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: rgba(255, 255, 255, 1);
    transition: width 0.4s var(--ease-cinematic);
}

.hero-cat-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

.hero-cat-btn.active {
    color: rgba(255, 255, 255, 1);
}

.hero-cat-btn.active::after {
    width: 100%;
}

/* --- Hero Responsive: Tablet (768–1023px) --- */
@media (max-width: 1023px) {
    .hero-section {
        min-height: 75vh;
    }

    .hero-video-left {
        display: none;
    }

    .hero-videos {
        padding: 0;
        gap: 12px;
    }

    .hero-video-slot {
        max-width: none;
    }

    .hero-video-center {
        flex: 0 0 58%;
        transform: scale(1.0);
    }

    .hero-video-right {
        flex: 0 0 42%;
        transform: scale(0.94);
    }

    .hero-categories {
        gap: 1.8rem;
        margin-top: 2.5rem;
    }

    .hero-cat-btn {
        font-size: 0.7rem;
    }
}

/* --- Hero Responsive: Mobile (<768px) --- */
@media (max-width: 767px) {
    .hero-section {
        min-height: 65vh;
        background: var(--bg-color); /* Light background for mobile */
    }

    .hero-video-left,
    .hero-video-right,
    .hero-video-center {
        display: block;
        max-width: 100%;
        border-radius: 0;
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        opacity: 0;
        transform: none; /* Disable scaling logic on mobile */
        transition: opacity 0.6s var(--ease-cinematic);
    }
    
    .hero-video-slot.mobile-active {
        opacity: 1;
        z-index: 2; /* Bring active to top */
    }

    .hero-content h1 {
        font-size: clamp(2rem, 8vw, 2.7rem); /* Reduced slightly from 3rem */
    }

    .hero-content .subtitle {
        font-size: 0.9rem;
    }

    .hero-categories {
        margin-top: 2rem;
        gap: 1.5rem;
        flex-wrap: wrap;
    }

    .hero-cat-btn {
        font-size: 0.65rem;
    }
}

/* ---------------------------------------------------------
   WORK (GRID) SECTION
   --------------------------------------------------------- */
.work-section {
    padding: 0 4rem var(--spacing-lg) 4rem;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 2rem;
    width: 100%;
}

@media (min-width: 768px) {
    .project-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .project-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.project-item {
    display: block;
    cursor: pointer;
    position: relative;
    width: 100%;
}

.project-media {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    position: relative;
    background-color: #f0f0f0;
}

.placeholder-media {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    /* Removed conflicting transition/transform */
}

.placeholder-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;

    /* Explicit Initial State for Smoothness */
    transform: scale(1);
    transform-origin: center;
    will-change: transform;

    /* Cinematic Slow Zoom */
    transition: transform 2.2s cubic-bezier(0.19, 1, 0.22, 1);
}

.project-item:hover .placeholder-media img {
    transform: scale(1.03);
}

/* Hover Effects - Editorial */
.hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.25);
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    align-items: flex-end;
    /* Bottom alignment */
    justify-content: center;
    /* Bottom Centered as preferred possibility */
    padding-bottom: 2.5rem;
    padding-left: 2rem;
    padding-right: 2rem;
}



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

.hover-info {
    text-align: center;
    color: white;
    transform: translateY(10px);
    transition: transform 0.4s ease;
}

.project-item:hover .hover-info {
    transform: translateY(0);
}

.project-title {
    font-family: var(--font-ui);
    font-size: 1.4rem;
    margin-bottom: 0.4rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.project-desc {
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 400;
    opacity: 0.9;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    /* Keeping uppercase for descriptors usually looks good */
}

/* ---------------------------------------------------------
   ABOUT SECTION
   --------------------------------------------------------- */
.about-section {
    min-height: 60vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    text-align: center;
    padding: 0 20%;
    padding-top: 5rem;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.big-text {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    line-height: 1.4;
    margin-bottom: 3rem;
    color: var(--text-color);
    letter-spacing: -0.02em;
}

.about-details {
    font-family: var(--font-ui);
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 650px;
    margin: 0 auto 4rem auto;
    line-height: 1.7;
}

.about-emphasis {
    font-weight: 500;
    display: block;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-size: 1.25rem;
}

.about-normal {
    font-weight: 400;
}

/* Brand motif above about contact */
.about-contact::before {
    content: '';
    display: block;
    width: 24px;
    height: 1px;
    background: rgba(0, 0, 0, 0.18);
    margin: 0 auto 2.5rem;
}

.about-contact p {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-weight: 500;
}

.email-link {
    font-family: var(--font-ui);
    font-size: 1.5rem;
    color: var(--text-color);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-weight: 400;
}

/* ---------------------------------------------------------
   FOOTER
   --------------------------------------------------------- */
.site-footer {
    padding: 4rem 4rem;
    text-align: center;
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: #999;
}

/* Brand motif above footer */
.site-footer::before {
    content: '';
    display: block;
    width: 24px;
    height: 1px;
    background: rgba(0, 0, 0, 0.12);
    margin: 0 auto 2.5rem;
}

.footer-note {
    margin-top: 0.5rem;
    opacity: 0.7;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
}

/* ---------------------------------------------------------
   ANIMATIONS
   --------------------------------------------------------- */
.fade-in {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.6s var(--ease-cinematic) forwards;
    animation-delay: 0.2s;
}

.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease-out, transform 1s var(--ease-cinematic);
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 {
    transition-delay: 0.1s;
}

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

@media (max-width: 900px) {
    .work-section {
        padding: 0 1.5rem var(--spacing-lg) 1.5rem;
    }

    .about-section {
        padding: 0 6%;
        padding-top: 2rem;
    }
}

/* ---------------------------------------------------------
   MOBILE TOUCH DEVICES - SCROLL ACTIVE STATE
   --------------------------------------------------------- */
@media (hover: none) {
    .hover-overlay {
        opacity: 0;
        pointer-events: none;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.3) 40%, rgba(0, 0, 0, 0.1) 100%);
    }

    .project-item:hover .hover-overlay,
    .project-item:active .hover-overlay {
        opacity: 0;
    }
    
    .project-item:hover .placeholder-media img,
    .project-item:active .placeholder-media img {
        transform: scale(1);
    }
    
    .project-item:hover .hover-info,
    .project-item:active .hover-info {
        transform: translateY(10px);
    }

    .project-item.is-active .hover-overlay {
        opacity: 1;
    }
    
    .project-item.is-active .placeholder-media img {
        transform: scale(1.03);
    }
    
    .project-item.is-active .hover-info {
        transform: translateY(0);
    }
}