:root {
    --bg-dark: #0a0a0a;
    --bg-secondary: #0f0f0f;
    --wine-red: #720e1c;
    --wine-red-hover: #9c1527;
    --wine-red-glow: rgba(114, 14, 28, 0.4);
    --gold-accent: #c29b6d;
    /* Derived from the logo */
    --gold-glow: rgba(194, 155, 109, 0.2);
    --text-white: #ffffff;
    --text-light: #e0e0e0;
    --text-dim: #a0a0a0;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    cursor: none;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://grainy-gradients.vercel.app/noise.svg');
    opacity: 0.04;
    pointer-events: none;
    z-index: 9999;
}

h1,
h2,
h3,
.logo {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
}

span {
    color: var(--wine-red);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--wine-red);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--wine-red-hover);
}

/* Custom Cursor */
.cursor {
    width: 8px;
    height: 8px;
    background: var(--wine-red);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 100001;
    transform: translate(-50%, -50%);
}

.cursor-follower {
    width: 40px;
    height: 40px;
    border: 1px solid var(--wine-red);
    background: radial-gradient(circle, rgba(114, 14, 28, 0.15) 0%, transparent 80%);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 100000;
    transform: translate(-50%, -50%);
}

.cursor.hidden,
.cursor-follower.hidden {
    opacity: 0;
}

/* Hover States for Cursor */
.cursor.active {
    transform: translate(-50%, -50%) scale(0.5);
    background-color: var(--text-white);
}

.cursor-follower.active {
    width: 80px;
    height: 80px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 80%);
}

.cursor-follower.hero-active {
    background: radial-gradient(circle, rgba(114, 14, 28, 0.3) 0%, transparent 70%);
    border-color: rgba(114, 14, 28, 0.6);
    width: 60px;
    height: 60px;
}

/* Hide custom cursor over videos and on touch devices to avoid issues */
@media (hover: none) and (pointer: coarse) {

    .cursor,
    .cursor-follower {
        display: none !important;
    }

    body {
        cursor: auto !important;
    }
}

body:has(.video-wrapper:hover) .cursor,
body:has(.video-wrapper:hover) .cursor-follower,
.video-wrapper:hover~.cursor,
.video-wrapper:hover~.cursor-follower {
    opacity: 0 !important;
}

.video-wrapper:hover {
    cursor: auto !important;
}

/* Header & Nav */
header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 30px 10%;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    height: 40px;
    display: flex;
    align-items: center;
}

.logo img {
    height: 100%;
    width: auto;
    object-fit: contain;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 40px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dim);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--wine-red);
    transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-white);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 18px;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle .bar {
    width: 100%;
    height: 2px;
    background-color: var(--text-white);
    transition: var(--transition);
}

.menu-toggle.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.menu-toggle.active .bar:nth-child(2) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.preloader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 200px;
}

.preloader-logo {
    height: 30px;
    margin-bottom: 30px;
}

.preloader-logo img {
    height: 100%;
    filter: brightness(0.8);
}

.preloader-bar-container {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.preloader-bar {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--wine-red);
    animation: loading-bar 2s cubic-bezier(0.1, 0, 0.3, 1) infinite;
}

.preloader-text {
    margin-top: 15px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--text-dim);
    font-family: 'Outfit', sans-serif;
}

@keyframes loading-bar {
    0% {
        left: -100%;
    }

    50% {
        left: 0;
    }

    100% {
        left: 100%;
    }
}

/* Sections Global */
section {
    padding: 100px 10%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Hero Section - Cinematic Style */
.hero.cinematic {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at center, #1a0508 0%, var(--bg-dark) 80%);
}

.hero-bg-text {
    position: absolute;
    font-size: clamp(5rem, 10vw, 12rem);
    /* Larger, more cinematic scale */
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.05);
    /* Subtle stroke */
    z-index: 0;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    letter-spacing: -5px;
    /* Clean, premium spacing */
    animation: bg-text-float 90s linear infinite;
    opacity: 0.6;
    /* Reduced opacity */
    transition: var(--transition);
}

.hero-bg-text span {
    color: rgba(114, 14, 28, 0.1);
    /* Subtle highlighted fill */
    -webkit-text-stroke: 1.5px var(--wine-red);
    /* Stronger wine-red outline */
    filter: drop-shadow(0 0 20px var(--wine-red-glow));
    /* Highlight glow */
}

.hero-content-centered {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 0;
    /* Centered now that owl is gone */
}

.hero-visual-main {
    position: relative;
    margin-top: 50px;
    /* Push down to ensure head is visible */
    margin-bottom: 10px;
    z-index: 15;
    /* Bring owl to front */
}

.hero-owl-large {
    width: clamp(150px, 20vw, 300px);
    /* Smaller size for better fit */
    height: auto;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.6));
    animation: floating-premium 6s ease-in-out infinite;
}

.light-beam {
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    height: 100%;
    background: radial-gradient(circle at center, rgba(114, 14, 28, 0.15) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

.hero-text-overlay {
    position: relative;
    z-index: 10;
    padding: 0 20px;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.1;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(30px);
}

.hero h1 span {
    font-family: 'Outfit', sans-serif;
    color: var(--wine-red);
    display: block;
    font-size: 0.7em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 12px;
    margin-top: 15px;
    font-style: normal;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-dim);
    max-width: 600px;
    margin: 0 auto 40px;
    opacity: 0;
    transform: translateY(30px);
    transition: color 0.4s ease, transform 0.4s ease;
}

.hero:hover p {
    color: var(--text-light);
}

.hero:hover .reveal-text span {
    filter: drop-shadow(0 0 15px var(--wine-red-glow));
    letter-spacing: 14px;
    transition: all 0.8s cubic-bezier(0.2, 1, 0.3, 1);
}

@keyframes bg-text-float {
    0% {
        transform: translateX(50%);
    }

    100% {
        transform: translateX(-150%);
    }
}

@keyframes floating-premium {

    0%,
    100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }

    50% {
        transform: translateY(-30px) rotate(2deg) scale(1.02);
    }
}

@media (max-width: 768px) {
    .hero.cinematic {
        padding-top: 80px;
    }

    .hero-bg-text {
        display: none;
    }

    .hero-visual-main {
        margin-bottom: 0px;
    }

    .hero-owl-large {
        width: 280px;
    }
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 15px 40px;
    text-decoration: none;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.8rem;
    border-radius: 0;
    transition: var(--transition);
    position: relative;
}

.btn-primary {
    background: var(--wine-red);
    color: var(--text-white);
}

.btn-primary:hover {
    background: var(--wine-red-hover);
    box-shadow: 0 0 20px var(--wine-red-glow);
}

.btn-secondary {
    border: 1px solid var(--gold-accent);
    color: var(--gold-accent);
}

.btn-secondary:hover {
    background: var(--gold-accent);
    color: var(--bg-dark);
}

/* Portfolio Section */
.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 3rem;
    margin-bottom: 15px;
}

.title-line {
    width: 80px;
    height: 3px;
    background: var(--wine-red);
    margin: 0 auto;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 50px;
}

.filter-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 400;
    cursor: pointer;
    padding: 10px 20px;
    transition: var(--transition);
    border-bottom: 1px solid transparent;
}

.filter-btn:hover,
.filter-btn.active {
    color: var(--wine-red);
    border-bottom: 1px solid var(--wine-red);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 30px;
    width: 100%;
}

.portfolio-item-cover {
    position: relative;
    aspect-ratio: 4/5;
    background: var(--bg-secondary);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.6s cubic-bezier(0.2, 1, 0.3, 1), box-shadow 0.6s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    will-change: transform, opacity;
}

.portfolio-item-cover:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 30px 60px rgba(114, 14, 28, 0.25);
    border-color: rgba(114, 14, 28, 0.5);
}

.portfolio-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 1s cubic-bezier(0.2, 1, 0.3, 1), filter 0.6s ease;
    image-rendering: -webkit-optimize-contrast;
}

.portfolio-item-cover:hover .portfolio-img {
    transform: scale(1.1) rotate(1deg);
    filter: brightness(1.1) contrast(1.05);
}

.item-info-cover {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 40px;
    background: linear-gradient(to top, rgba(10, 10, 10, 0.95) 0%, rgba(10, 10, 10, 0.8) 40%, transparent 100%);
    color: var(--text-white);
    z-index: 10;
    transform: translateY(20px);
    transition: transform 0.6s cubic-bezier(0.2, 1, 0.3, 1), background 0.6s ease;
}

.portfolio-item-cover:hover .item-info-cover {
    transform: translateY(0);
    background: linear-gradient(to top, rgba(114, 14, 28, 0.9) 0%, rgba(10, 10, 10, 0.8) 60%, transparent 100%);
}

.item-info-cover span {
    font-family: 'Outfit', sans-serif;
    color: var(--wine-red);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 2px;
    display: block;
    margin-bottom: 10px;
    transition: color 0.4s ease;
}

.portfolio-item-cover:hover .item-info-cover span {
    color: var(--text-white);
}

.item-info-cover h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    transform: translateY(10px);
    transition: transform 0.6s cubic-bezier(0.2, 1, 0.3, 1);
}

.portfolio-item-cover:hover .item-info-cover h3 {
    transform: translateY(0);
}

.item-info-cover p {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.2, 1, 0.3, 1);
}

.portfolio-item-cover:hover .item-info-cover p {
    opacity: 1;
    transform: translateY(0);
}

.view-project-btn {
    font-family: 'Outfit', sans-serif;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--gold-accent);
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.6s cubic-bezier(0.2, 1, 0.3, 1);
    transition-delay: 0.1s;
}

.portfolio-item-cover:hover .view-project-btn {
    opacity: 1;
    transform: translateX(0);
}

.category-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    color: rgba(114, 14, 28, 0.3);
}

/* Project Overlay Session */
.project-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    overflow-y: auto;
    transition: var(--transition);
}

.project-overlay.active {
    opacity: 1;
    visibility: visible;
}

.overlay-close {
    position: fixed;
    top: 30px;
    right: 40px;
    font-size: 1.5rem;
    color: var(--text-white);
    cursor: pointer;
    z-index: 10100;
}

.overlay-content {
    padding: 120px 5%;
    max-width: 1600px;
    margin: 0 auto;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 100px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 40px;
}

.header-left h2 {
    font-size: clamp(2.5rem, 6vw, 5rem);
    line-height: 1;
    margin-bottom: 15px;
}

.header-left p {
    color: var(--wine-red);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    letter-spacing: 5px;
    text-transform: uppercase;
}

.header-right {
    text-align: right;
    max-width: 400px;
}

.header-right p {
    color: var(--text-dim);
    font-size: 1rem;
    line-height: 1.6;
}

.project-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.project-gallery.featured-layout {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

.gallery-item {
    width: 100%;
    margin-bottom: 60px;
    display: flex;
    justify-content: center;
    background: transparent;
    border: none;
    perspective: 1000px;
}

.featured-layout .gallery-item {
    margin-bottom: 0px;
}

.gallery-item img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 4px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.8s cubic-bezier(0.2, 1, 0.3, 1), box-shadow 0.8s ease, filter 0.8s ease;
    filter: brightness(0.95);
    image-rendering: -webkit-optimize-contrast;
}

.gallery-item:hover img {
    transform: translateY(-10px) rotateX(2deg) scale(1.01);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 0 10px 20px rgba(114, 14, 28, 0.2);
    filter: brightness(1.05);
}

.video-item {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    background: #000;
    border: 2px solid rgba(114, 14, 28, 0.6);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-item:hover .video-wrapper {
    border-color: var(--wine-red);
    box-shadow: 0 0 20px var(--wine-red-glow), 0 30px 60px rgba(0, 0, 0, 0.8);
    transform: translateY(-8px);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

@media (max-width: 768px) {
    .project-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 30px;
    }

    .header-right {
        text-align: left;
    }

    .project-gallery {
        grid-template-columns: 1fr;
    }

    .gallery-item:nth-child(3n) {
        grid-column: span 1;
    }
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--bg-secondary);
    border: 1px solid var(--wine-red);
    color: var(--text-white);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--wine-red);
    transform: translateY(-5px);
}

/* Footer */
footer {
    padding: 60px 10%;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.footer-logo {
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.footer-logo img {
    height: 100%;
    width: auto;
    object-fit: contain;
}



footer p {
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* Responsive */
@media (max-width: 1024px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    header {
        padding: 20px 5%;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: var(--bg-dark);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: var(--transition);
        z-index: 1000;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        margin: 20px 0;
    }

    .nav-links a {
        font-size: 1.5rem;
    }

    section {
        padding: 80px 5%;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero h1 span {
        letter-spacing: 6px;
    }

    .hero p {
        font-size: 1rem;
    }

    .category-grid {
        grid-template-columns: 1fr !important;
    }

    .portfolio-item-cover {
        aspect-ratio: 16/9;
    }

    .section-title h2 {
        font-size: 2.2rem;
    }

    .project-header {
        margin-bottom: 50px;
    }

    .project-gallery.featured-layout {
        grid-template-columns: 1fr;
    }

    .overlay-close {
        top: 20px;
        right: 20px;
    }

    .header-left h2 {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero-cta .btn {
        width: 100%;
        text-align: center;
    }
}

/* Masonry / Puzzle Layout for Branding */
.project-gallery.masonry-layout {
    display: grid;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 15px;
    grid-auto-rows: 350px;
    grid-auto-flow: dense;
}

.masonry-layout .gallery-item {
    margin-bottom: 0;
    height: 100%;
    width: 100%;
    background: var(--bg-secondary);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.masonry-layout .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    transition: transform 0.5s ease;
}

.masonry-layout .gallery-item:hover img {
    transform: scale(1.03);
}

/* Puzzle Pattern for 5 items */
/* Item 1: Large Square (Top Left) - 2x2 */
.masonry-layout .gallery-item:nth-child(1) {
    grid-column: span 2;
    grid-row: span 2;
}

/* Item 2: Small Square (Top Right) - 1x1 */
.masonry-layout .gallery-item:nth-child(2) {
    grid-column: span 1;
    grid-row: span 1;
}

/* Item 3: Small Square (Middle Right) - 1x1 */
.masonry-layout .gallery-item:nth-child(3) {
    grid-column: span 1;
    grid-row: span 1;
}

/* Item 4: Wide Rectangle (Bottom Left) - 2x1 */
.masonry-layout .gallery-item:nth-child(4) {
    grid-column: span 2;
    grid-row: span 1;
}

/* Item 5: Small Square (Bottom Right) - 1x1 */
.masonry-layout .gallery-item:nth-child(5) {
    grid-column: span 1;
    grid-row: span 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .project-gallery.masonry-layout {
        grid-template-columns: 1fr !important;
        grid-auto-rows: auto;
    }

    .masonry-layout .gallery-item:nth-child(n) {
        grid-column: auto;
        grid-row: auto;
    }
}