@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&family=Manrope:wght@200;300;400;500;600;700;800&display=swap');

:root {
    --bg-primary: #050505;
    --bg-secondary: #1C1C1C;
    --text-primary: #EAEAEA;
    --text-secondary: #9CA3AF;
    --accent: #D4AF37;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Manrope', sans-serif;
    overflow-x: hidden;
    overscroll-behavior: none;
}

.font-serif {
    font-family: 'Cormorant Garamond', serif;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

/* Grain Overlay */
.grain-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.1;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='3' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Fixed Navigation Styles */
.fixed-nav {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 250px;
    z-index: 80;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 3rem;
    pointer-events: none;
}

.fixed-nav a {
    pointer-events: auto;
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-weight: 300;
    margin-bottom: 3rem;
    color: var(--text-secondary);
    transition: color 0.15s ease, padding-left 0.15s ease;
}

.fixed-nav a.active {
    color: var(--accent);
    padding-left: 1rem;
}

.fixed-nav a:hover {
    color: var(--text-primary);
}

.fixed-nav a:last-child {
    margin-bottom: 0;
}

/* Vertical Presentation */
.sections-wrapper {
    position: relative;
    width: 100%;
}

section {
    width: 100%;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Reveal Animations */
.reveal-img {
    clip-path: inset(100% 0 0 0);
    transition: clip-path 1.5s cubic-bezier(0.77, 0, 0.175, 1);
}

.reveal-img.active {
    clip-path: inset(0 0 0 0);
}

/* Horizontal Scroll Layout - Responsive */
.horizontal-wrap {
    width: 100%;
    height: auto;
    position: relative;
    display: block;
    padding-bottom: 4rem;
    /* Space for content */
}

.horizontal-content {
    display: flex;
    flex-direction: column;
    height: auto;
    width: 100%;
    padding: 0;
    gap: 4rem;
}

.horizontal-item {
    flex: 0 0 auto;
    width: 100%;
}

/* TABLET PORTRAIT (768px - 1023px) - GRID LAYOUT for Portfolio */
@media (min-width: 768px) and (max-width: 1023px) {
    #portfolio .horizontal-content {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
        padding: 0 2rem;
    }

    #portfolio .horizontal-item:first-child {
        grid-column: 1 / -1;
        /* Intro block full width */
        margin-bottom: 2rem;
        width: 100%;
        min-width: 0;
    }

    #portfolio .horizontal-item {
        width: auto;
        /* Reset fixed width */
        min-width: 0;
        margin: 0;
    }
}

/* DESKTOP (>= 1024px) - HORIZONTAL SCROLL */
@media (min-width: 1024px) {
    .horizontal-wrap {
        height: 100vh;
        width: calc(100% - 250px);
        position: absolute;
        top: 0;
        left: 250px;
        display: flex;
        align-items: center;
        overflow: hidden;
        padding-bottom: 0;
    }

    .horizontal-content {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        height: 100%;
        width: fit-content;
        /* Ensure container grows with content for GSAP calc */
        align-items: center;
        padding: 0 5vw;
        gap: 4vw;
    }

    .horizontal-item {
        width: auto;
    }
}

/* Progress Bar */
.progress-container {
    position: absolute;
    bottom: 4rem;
    left: 250px;
    right: 4rem;
    height: 2px;
    background: rgba(255, 255, 255, 0.05);
    z-index: 10;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 0.1s ease-out;
}

.section-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto;
    padding: 10vh 8vw;
}

.portfolio-item,
.service-item {
    width: 100%;
    margin-bottom: 15vh;
    display: flex;
    flex-direction: column;
}

#portfolio .section-content,
#services .section-content {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 4rem;
}

.portfolio-item:nth-child(1) {
    grid-column: 1 / 13;
}

.portfolio-item:nth-child(2) {
    grid-column: 1 / 7;
}

.portfolio-item:nth-child(3) {
    grid-column: 7 / 13;
    margin-top: 10vh;
}

.service-item:nth-child(1) {
    grid-column: 1 / 13;
}

.service-item:nth-child(2) {
    grid-column: 1 / 7;
}

.service-item:nth-child(3) {
    grid-column: 7 / 13;
}

/* Service Cards - Editorial Glass Design */
.glass-card {
    background: linear-gradient(135deg, rgba(28, 28, 28, 0.4) 0%, rgba(5, 5, 5, 0.8) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden !important;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.glass-card:hover {
    border-color: rgba(212, 175, 55, 0.3);
    transform: translateY(-10px);
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.8),
        0 0 40px -10px rgba(212, 175, 55, 0.1);
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.1),
            transparent);
    transition: 0.8s;
}

.glass-card:hover::before {
    left: 100%;
}

.decorative-number {
    position: absolute;
    right: -2rem;
    top: -2rem;
    font-size: 15rem;
    line-height: 1;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    color: white;
    opacity: 0.03;
    pointer-events: none;
    transition: transform 1.2s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 0;
}

.glass-card:hover .decorative-number {
    transform: translate(-20px, 20px) scale(1.05);
    opacity: 0.05;
}

.accent-shine {
    position: absolute;
    bottom: 0px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    transform: scaleX(0);
    transition: transform 0.6s ease;
    z-index: 20;
}

.glass-card:hover .accent-shine {
    transform: scaleX(1);
}

.list-marker {
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
    margin-right: 12px;
    display: inline-block;
    vertical-align: middle;
    box-shadow: 0 0 10px var(--accent);
}

/* =========================================
   RESPONSIVE NAVIGATION STYLES
   ========================================= */

/* TABLET LANDSCAPE (1024px - 1439px) */
@media (min-width: 1024px) and (max-width: 1439px) and (orientation: landscape) {
    .fixed-nav {
        background: rgba(5, 5, 5, 0.8);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        width: 250px;
    }

    .fixed-nav a {
        font-size: 0.7rem;
        margin-bottom: 2.5rem;
    }
}

/* MOBILE LANDSCAPE (480px - 1023px) */
@media (min-width: 480px) and (max-width: 1023px) and (orientation: landscape) {
    .fixed-nav {
        width: 120px;
        /* Adjusted width per docs */
        background: rgba(5, 5, 5, 0.9);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding-left: 0;
        align-items: center;
    }

    .fixed-nav a {
        font-size: 1rem;
        margin-bottom: 2rem;
        padding-left: 0 !important;
        /* Override active padding */
        text-align: center;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .nav-number {
        display: block;
        font-family: 'Cormorant Garamond', serif;
        font-size: 1.5rem;
    }

    .nav-label {
        display: none;
    }
}

/* BOTTOM NAV STYLES (Portrait) */
.bottom-nav {
    transform: translateZ(0);
    /* GPU accel */
    padding-bottom: env(safe-area-inset-bottom, 20px);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.bottom-nav.hidden-nav {
    transform: translateY(100%);
}

.bottom-nav .nav-item {
    color: var(--text-secondary);
    transition: color 0.3s ease, transform 0.2s ease;
    flex: 1;
    position: relative;
    padding: 8px 0;
}

.bottom-nav .nav-item.active {
    color: var(--accent);
}

.bottom-nav .nav-item.active svg {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

/* Active Indicator for Bottom Nav */
.bottom-nav .nav-item.active::before {
    content: '';
    position: absolute;
    top: 5px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    left: 50%;
    transform: translateX(-50%);
}

/* HERO OPTIMIZATIONS */
#hero-lightpass {
    will-change: contents;
}

.hero-card {
    will-change: transform;
    transform: translateZ(0);
}

/* SERVICES RESPONSIVE OPTIMIZATIONS */

/* Tablet & Mobile Layout Adjustment */
@media (max-width: 1023px) {
    #services .horizontal-content {
        display: flex;
        flex-direction: column;
        padding-bottom: 6rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) {

    /* Always show accent shine on touch devices */
    .glass-card .accent-shine {
        transform: scaleX(1);
        opacity: 0.8;
    }

    /* Disable lift effect on touch */
    .glass-card:hover {
        transform: none;
        box-shadow: none;
        border-color: rgba(255, 255, 255, 0.08);
    }
}