/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    --primary-color: #1a1a1a;       /* Dark Charcoal */
    --secondary-color: #f4f4f4;     /* Off-white background */
    --accent-color: #c4a484;        /* Soft Gold/Beige for accents */
    --text-color: #333333;
    --font-heading: 'Playfair Display', serif; /* Elegant Serif */
    --font-body: 'Lato', sans-serif;           /* Clean Sans-serif */
    --transition-speed: 0.5s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--secondary-color);
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 400;
    color: var(--primary-color);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

/* =========================================
   2. NAVIGATION (Desktop)
   ========================================= */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 5%;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: transparent; /* Transparent at top */
    transition: all 0.3s ease;
}

/* Navigation Over Hero State (Home Page Only) */
.home-page .main-nav:not(.scrolled) {
    color: #fff;
}

.home-page .main-nav:not(.scrolled) .logo a, 
.home-page .main-nav:not(.scrolled) .desktop-menu li a {
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.home-page .main-nav:not(.scrolled) .bar {
    background-color: #fff;
}

/* White hover border when on hero background */
.home-page .main-nav:not(.scrolled) .magnetic-btn:hover {
    border-color: #fff;
}

/* Scrolled State (Override to Dark) */
.main-nav.scrolled {
    background: rgba(244, 244, 244, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 5%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.main-nav.scrolled .logo a, 
.main-nav.scrolled .desktop-menu li a {
    color: var(--primary-color);
    text-shadow: none;
}

.main-nav.scrolled .bar {
    background-color: var(--primary-color);
}

.logo a {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    letter-spacing: 1px;
    font-weight: bold;
}

.desktop-menu {
    display: flex;
    gap: 3rem;
}

.desktop-menu li a {
    position: relative;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 10px 20px;
    display: inline-block; /* Required for transform */
}

/* Magnetic Button Base Style */
.magnetic-btn {
    border: 1px solid transparent;
    border-radius: 50px;
    transition: border-color 0.3s ease;
}

.magnetic-btn:hover {
    border-color: var(--primary-color);
}

/* =========================================
   3. MOBILE MENU & OVERLAY
   ========================================= */
.hamburger-menu {
    display: none; /* Hidden on Desktop */
    cursor: pointer;
    z-index: 1001;
}

.bar {
    width: 25px;
    height: 2px;
    background-color: var(--primary-color);
    margin: 6px 0;
    transition: 0.4s;
}

/* Hamburger to X Animation */
.change .bar1 {
    transform: translate(0, 8px) rotate(-45deg);
}
.change .bar2 {
    opacity: 0;
}
.change .bar3 {
    transform: translate(0, -8px) rotate(45deg);
}

/* Fullscreen Overlay */
.mobile-overlay {
    height: 0%;
    width: 100%;
    position: fixed;
    z-index: 999; /* Behind hamburger */
    top: 0;
    left: 0;
    background-color: var(--primary-color);
    overflow-y: hidden;
    transition: 0.5s ease-in-out; /* "Barn Door" slide effect */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.overlay-content {
    text-align: center;
    width: 100%;
}

.mobile-link {
    padding: 15px;
    text-decoration: none;
    font-size: 2rem;
    color: #fff; /* White text on dark background */
    display: block;
    transition: 0.3s;
    font-family: var(--font-heading);
    opacity: 0; /* Hidden initially for staggered reveal */
    transform: translateY(20px);
}

.mobile-link:hover {
    color: var(--accent-color);
}

/* =========================================
   4. HERO SECTION
   ========================================= */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    background-color: #1a1a1a; /* Dark fallback */
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    opacity: 0; /* Start hidden */
    animation: videoFadeIn 2s ease forwards;
    animation-delay: 0.5s; /* Wait for page transition curtain */
}

@keyframes videoFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4); /* Subtle dark tint */
    z-index: 2;
}

.hero-content {
    z-index: 3;
    padding: 0 20px;
    color: #fff;
}

.hero-content h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    line-height: 1.1;
    color: #fff; /* Ensure h1 is white on hero */
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    font-weight: 300;
}

.cta-button {
    display: inline-block;
    padding: 15px 40px;
    background-color: var(--primary-color);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.8rem;
    transition: background 0.3s ease;
}

.cta-button:hover {
    background-color: var(--accent-color);
    color: var(--primary-color);
}

.center-btn {
    text-align: center;
    margin-top: 50px;
}

.cta-link-padded {
    padding: 15px;
    display: inline-block;
}

/* =========================================
   5. GENERAL SECTIONS & GRID
   ========================================= */
.section-padding {
    padding: 100px 5%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
}

/* Page Header Specific Alignment */
.page-header-text {
    text-align: center;
}

.page-header-text .section-title {
    text-align: inherit;
}

/* Portfolio Filter Bar */
.filter-container {
    position: relative;
    margin-bottom: 50px;
    width: 100vw; /* Full Viewport Width */
    margin-left: calc(-50vw + 50%); /* Break out of container */
    left: 0;
}

/* Base style for fade hints */
.filter-container::before,
.filter-container::after {
    content: '';
    position: absolute;
    top: 0;
    width: 80px; /* Wider fade */
    height: 100%;
    pointer-events: none;
    z-index: 2;
    opacity: 0; 
    transition: opacity 0.3s ease;
}

/* Left Fade */
.filter-container::before {
    left: 0;
    background: linear-gradient(to right, var(--secondary-color) 20%, transparent);
}

/* Right Fade */
.filter-container::after {
    right: 0;
    background: linear-gradient(to left, var(--secondary-color) 20%, transparent);
}

/* State Classes */
.filter-container.show-left-fade::before {
    opacity: 1;
}

.filter-container.show-right-fade::after {
    opacity: 1;
}

.filter-nav {
    display: flex;
    justify-content: flex-start; /* Default align start for scroll logic */
    gap: 20px;
    overflow-x: auto;
    white-space: nowrap;
    padding: 10px calc(50vw - 600px + 20px); /* Align with 1200px container */
    -ms-overflow-style: none;
    scrollbar-width: none;
    cursor: grab;
    user-select: none;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

@media screen and (max-width: 1240px) {
    .filter-nav {
        padding: 10px 5%; /* Fallback for smaller screens */
    }
}

.filter-nav::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome, Safari, Opera */
}

.filter-nav:active {
    cursor: grabbing;
}

@media screen and (max-width: 768px) {
    .filter-nav {
        justify-content: flex-start; /* Align left on mobile for scrolling start */
    }
}

.filter-btn {
    background: #e8e8e8; /* Light Gray for inactive items */
    border: 1px solid #ddd;
    padding: 8px 24px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.3s ease;
    color: #666; /* Softer text for inactive */
}

.filter-btn:hover {
    background-color: #ddd;
    border-color: #ccc;
    color: var(--primary-color);
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

/* Home Page Staggered Grid (3 items) */
.staggered-works-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.staggered-works-grid .portfolio-card:nth-child(2) {
    margin-top: 40px; /* Original stagger amount */
}

@media screen and (max-width: 768px) {
    .staggered-works-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .staggered-works-grid .portfolio-card:nth-child(2) {
        margin-top: 0;
    }
}

.portfolio-card {
    position: relative;
    overflow: hidden;
    background-color: #eee;
    border-radius: 4px;
    cursor: pointer;
    height: 450px;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.portfolio-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.portfolio-card:hover img {
    transform: scale(1.05);
}

/* Portfolio Hover Overlay */
.portfolio-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    color: #fff;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    transform: translateY(20px); /* Start slightly hidden */
    opacity: 0;
    transition: all 0.4s ease;
}

.portfolio-card:hover .portfolio-info {
    transform: translateY(0);
    opacity: 1;
}

.portfolio-info h3 {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 5px;
    font-family: var(--font-heading);
}

.portfolio-info p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Filter Hide/Show Animation */
.portfolio-card.hide {
    display: none !important;
}

.portfolio-card.animate-in {
    animation: fadeUp 0.6s ease forwards;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Scrolly Track (Long Scroll Area) */
.scrolly-track {
    height: 250vh; /* Adjust length of scroll experience here */
    position: relative;
}

/* Sticky Wrapper */
.sticky-wrapper {
    position: -webkit-sticky;
    position: sticky;
    top: 15vh; /* Center vertically */
    display: flex;
    gap: 60px;
    align-items: flex-start;
    z-index: 10; /* Ensure on top */
    width: 100%;
}

.col-left {
    flex: 1;
    min-width: 300px; /* Prevent collapse */
    position: relative; /* Context */
}

.col-left img {
    width: 100%; /* Ensure it fills container */
    max-width: 400px; /* Limit max size */
    height: auto;
    display: block;
    margin: 0 auto;
    animation: zeroGravity 6s ease-in-out infinite; /* Continuous float */
}

@keyframes zeroGravity {
    0% {
        transform: translateY(0) rotate(0deg);
    }
    33% {
        transform: translateY(-10px) rotate(1deg); /* Float up, slight tilt right */
    }
    66% {
        transform: translateY(5px) rotate(-1deg); /* Float down, slight tilt left */
    }
    100% {
        transform: translateY(0) rotate(0deg);
    }
}

.col-right {
    width: 100%;
    order: 2;
    flex: 1.2;
}

/* 3D Fold Blog Reveal */
.perspective-container {
    perspective: 1000px; /* Essential for 3D effect */
}

.reveal-3d-fold {
    opacity: 0;
    transform: rotateX(20deg) translateY(50px) scale(0.95);
    transform-origin: top center;
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); /* Smooth eased finish */
    will-change: transform, opacity;
}

.reveal-3d-fold.is-visible {
    opacity: 1;
    transform: rotateX(0) translateY(0) scale(1);
}

/* Scroll Reveal Class (Standard) */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Mask Reveal (Line-by-Line Effect) */
.reveal-mask {
    overflow: hidden;
    display: block;
    margin-bottom: 1rem;
}

.reveal-mask > * {
    display: block;
    transform: translateY(110%);
    transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

.reveal-mask.is-visible > * {
    transform: translateY(0);
}

/* Scrubbing Text Styles */
.reveal-scrub {
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.reveal-scrub span {
    opacity: 0.15; /* Ghost opacity */
    transition: opacity 0.2s ease;
}

.reveal-scrub span.is-visible {
    opacity: 1;
}

/* Flower Dot Animation */
.flower-i {
    position: relative;
    display: inline-block;
}

.flower-wrapper {
    position: absolute;
    top: -0.4em; /* Adjust vertical position of the dot */
    left: 50%;
    transform: translateX(-50%); /* Center horizontally relative to 'ı' */
    width: 0.6em;
    height: 0.6em;
    pointer-events: none;
}

.flower-dot {
    width: 100%;
    height: 100%;
    fill: var(--accent-color);
    display: block;
    
    /* Animation sequence */
    animation: 
        bloomEffect 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
        spinSmooth 10s linear infinite 1.5s; /* Delay spin until bloom ends */
    transform-origin: center center;
}

@keyframes bloomEffect {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes spinSmooth {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Contact Form Styles */
.contact-form {
    background: #ffffff;
    padding: 50px;
    border-radius: 12px; /* Softer corners */
    box-shadow: 0 20px 50px rgba(0,0,0,0.08); /* Deeper, softer shadow */
    max-width: 100%; /* Fill container, let grid handle width */
    width: 100%;
    margin-top: 20px;
}

.form-group {
    margin-bottom: 30px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    color: #888; /* Softer label color */
    transition: color 0.3s ease;
}

.form-group:focus-within label {
    color: var(--primary-color);
}

.form-group input, 
.form-group textarea, 
.form-group select {
    width: 100%;
    padding: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #f9f9f9;
    color: var(--primary-color);
}

.form-group input:focus, 
.form-group textarea:focus, 
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.submit-btn {
    width: 100%;
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 20px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 0.85rem;
    font-weight: bold;
    border-radius: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.submit-btn:hover {
    background: var(--accent-color);
    color: var(--primary-color);
    transform: translateY(-3px); /* Lift effect */
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

/* Blog Teaser Styles */
.blog-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: all 0.4s ease;
    border: 1px solid #eee;
}

.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    border-color: var(--accent-color);
}

.blog-card-content {
    padding: 40px;
}

.blog-tag {
    display: inline-block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-color);
    font-weight: bold;
    margin-bottom: 15px;
}

.blog-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    line-height: 1.3;
}

.blog-card p {
    color: #666;
    margin-bottom: 25px;
    font-size: 0.95rem;
}

/* =========================================
   6. PAGE TRANSITION (CURTAIN)
   ========================================= */
.page-transition-curtain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    z-index: 9999;
    transform: translateY(100%); /* Start hidden below by default */
    transition: transform 0.6s cubic-bezier(0.77, 0, 0.175, 1);
    pointer-events: none;
}

.page-transition-curtain.active {
    transform: translateY(0); /* Slide up to cover (Exit) */
    pointer-events: all;
}

/* Specific for Portfolio Load Reveal */
.page-transition-curtain.load-reveal {
    transform: translateY(-100%); /* Slide UP to reveal */
    pointer-events: none;
}

/* =========================================
   7. HORIZONTAL GALLERY (DETAILS PAGE)
   ========================================= */
.horizontal-scroll-container {
    height: 100vh;
    width: 100%;
    overflow: hidden; 
    position: fixed; /* Pinned to viewport */
    top: 0;
    left: 0;
}

.horizontal-track {
    display: flex;
    gap: 5vw;
    padding: 0 5vw;
    height: 100%;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    will-change: transform;
}

.gallery-item {
    flex: 0 0 auto;
    width: 60vw; /* Wide cinematic cards */
    height: 70vh;
    background-color: #ddd;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.1s linear; /* Parallax movement */
}

.gallery-text {
    position: absolute;
    bottom: -50px;
    left: 0;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--primary-color);
    opacity: 0;
    transition: all 0.5s ease;
}

.gallery-item:hover .gallery-text {
    bottom: 10px;
    opacity: 1;
}

.scroll-instruction {
    position: fixed;
    bottom: 30px;
    right: 30px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary-color);
    z-index: 100;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-10px);}
    60% {transform: translateY(-5px);}
}

/* =========================================
   8. FOOTER
   ========================================= */
footer {
    background-color: var(--primary-color);
    color: #fff;
    padding: 50px 5% 20px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.footer-brand h3 {
    color: #fff;
    margin-bottom: 5px;
}

.footer-links a {
    margin-left: 20px;
    color: #aaa;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: #fff;
}

.copyright {
    text-align: center;
    font-size: 0.8rem;
    color: #555;
    border-top: 1px solid #333;
    padding-top: 20px;
}