/* 
 * Design Agency Portfolio - Main Design System
 */

@import url('https://fonts.googleapis.com/css2?family=Libre+Bodoni:ital,wght@0,400..700;1,400..700&family=Inter:wght@300;400;500;600&family=Outfit:wght@300;400;600;900&display=swap');

:root {
    --bg-color: #0c0c0c;
    --text-color: #f2f2f2;
    --accent-color: #d1d1d1;
    --dim-text: #888888;
    --grid-gap: 2rem;
    --transition-smooth: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    --border-color: rgba(255, 255, 255, 0.1);
    --accent-red: #DC143C;
    --cursor-size: 14px; 
}

.custom-cursor {
    position: fixed;
    width: var(--cursor-size);
    height: var(--cursor-size);
    background: white;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease, background 0.3s ease;
}

.custom-cursor.cursor-grow {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid white;
}



html {
    scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none; /* Hide default cursor to use custom one */
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    opacity: 0;
    transition: background-color 0.8s ease, color 0.8s ease, opacity 1s ease;
}

h1, h2, h3, .serif {
    font-family: 'Libre Bodoni', serif;
    font-weight: 400;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-smooth);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Layout */
.container {
    max-width: 1400px; /* Adjusted for medium outer margins */
    margin: 0 auto;
    padding: 0 32px; /* Adjusted padding to 32px */
}

/* Hero Section */
.hero-full {
    width: 100vw;
    height: 92vh; /* Adjusted from 85vh so cards peek out less */
    position: relative;
    z-index: 5; /* Lower than portfolio to go behind */
}

body.light-theme .hero-full {
    /* Transparent to let body background show */
}



.hero-intro {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #ffffff; /* Default to dark theme text */
    z-index: 10;
    pointer-events: none;
    transition: color 0.8s ease;
}

body.light-theme .hero-intro {
    color: #000000;
}


.hero-intro-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: 0.05em;
    line-height: 1.1;
}

.hero-intro-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8); /* Default to dark theme text */
    transition: color 0.8s ease;
}

body.light-theme .hero-intro-desc {
    color: rgba(0, 0, 0, 0.8);
}

/* Portfolio Container */
.portfolio-container {
    position: relative;
    z-index: 10; /* Higher than hero-full */
    color: var(--text-color);
    margin-top: 0;
    padding-top: 0;
    transition: color 0.8s ease;
}

.portfolio-container .project-title,
.portfolio-container .project-category {
    color: var(--text-color);
    transition: color 0.8s ease;
}

body.light-theme .portfolio-container {
    /* Transparent to let body background show */
}

body.light-theme .portfolio-container .project-title {
    color: #000000;
}

body.light-theme .portfolio-container .project-category {
    color: #666666;
}

.portfolio-container .project-image {
    background-color: #1a1a1a;
    box-shadow: none; /* Shadow removed as requested */
    border-radius: 24px; /* Rounded corners added */
}

.hero-content {
    position: relative;
    z-index: 10;
    pointer-events: none;
}

section {
    padding: 100px 0;
}

.work {
    padding-top: 0;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 25px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ffffff;
    mix-blend-mode: difference;
    transition: var(--transition-smooth);
    background: transparent;
}

header.scrolled {
    padding: 15px 40px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(12, 12, 12, 0.5);
    mix-blend-mode: normal; 
}

/* Light Theme & Header Color Swapping */
body.light-theme {
    background-color: #ffffff;
    color: #000000;
}

body.header-dark-mode header,
body.header-dark-mode .custom-cursor {
    mix-blend-mode: normal;
    color: #ffffff;
}

body.header-dark-mode .custom-cursor {
    background: #ffffff;
}

body.header-dark-mode header.scrolled {
    background: rgba(12, 12, 12, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 20px; /* Adjusted to fit header height nicely */
    width: auto;
    display: block;
}

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

nav a {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.6;
}

nav a:hover, nav a.active {
    opacity: 1;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    cursor: pointer;
    z-index: 1001;
    color: inherit;
}
.hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: currentColor;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background-color: var(--bg-color);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: right 0.5s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 1000;
    }
    body.light-theme nav {
        background-color: #ffffff;
    }
    body.header-dark-mode nav {
        background-color: #ffffff;
    }
    nav.open {
        right: 0;
    }
    body.menu-open header {
        mix-blend-mode: normal !important;
        background-color: transparent !important;
        backdrop-filter: none !important;
    }
    body.menu-open nav {
        background-color: #000000 !important;
    }
    body.menu-open .hamburger span {
        background-color: #ffffff !important;
    }
    body.menu-open nav a {
        color: #ffffff !important;
    }
    body.menu-open .logo img {
        filter: brightness(0) invert(1) !important;
    }
    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 40px;
    }
    nav a {
        font-size: 1.5rem;
    }
    .hamburger.open span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger.open span:nth-child(2) {
        opacity: 0;
    }
    .hamburger.open span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}

/* Grid System */
.project-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Back to 3 columns */
    column-gap: 40px;
    row-gap: 160px; /* Keeping 2x vertical spacing */
    margin-top: 20px;
}

.project-item {
    position: relative;
    overflow: visible; /* Changed from hidden for 3D effect */
    perspective: 1000px;
}

.project-item a {
    display: block;
}

.project-image {
    width: 100%;
    aspect-ratio: 3 / 4; /* Reverted to 3:4 ratio */
    overflow: hidden;
    background-color: #1a1a1a;
    margin-bottom: 20px;
    border-radius: 24px;
    box-shadow: none;
    position: relative;
}

.project-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 24px;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 3;
    pointer-events: none;
}

.project-item:hover .project-image::before {
    opacity: 1;
}

.project-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle 600px at var(--mouse-x, 50%) var(--mouse-y, 50%), 
        rgba(255, 255, 255, 0.6), 
        transparent 50%
    );
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 2;
    mix-blend-mode: overlay;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-item:hover .project-image::after {
    opacity: 1; /* Trigger light glare overlay */
}

.project-item:hover .project-image img {
    /* Removed scale(1.05) to keep the image flat during the 3D tilt */
}

.view-project-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(20px);
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 500;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 4;
    pointer-events: none;
}

.project-item:hover .view-project-text {
    opacity: 1;
    transform: translate(-50%, -50%) translateY(0);
}



.project-info {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.project-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.25;
    transition: color 0.3s ease;
}

.project-item:hover .project-title {
    color: #ffffff; /* Brighter white on hover */
}

body.light-theme .project-item:hover .project-title {
    color: #c5a880; /* Gold accent on light theme hover instead of invisible white */
}

.project-category {
    font-size: 0.8rem;
    color: var(--dim-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
}

.project-item:hover .project-category {
    color: rgba(255, 255, 255, 0.6);
}

body.light-theme .project-item:hover .project-category {
    color: #888888;
}

/* Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered loading for detail page images */
.reveal-up {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 1.2s ease, transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-up.active {
    opacity: 1;
    transform: translateY(0);
}

/* Footer */
footer {
    padding: 100px 40px 40px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    font-size: 0.8rem;
    color: var(--dim-text);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
}

.contact-section {
    padding-top: 220px;
    padding-bottom: 120px;
    padding-left: 8%;
    padding-right: 8%;
}

/* Responsive */
@media (max-width: 1024px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 60px;
    }
    .project-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 991px) {
    .contact-section {
        padding-top: 160px;
        padding-bottom: 80px;
        padding-left: 8%;
        padding-right: 8%;
    }
}

/* Mobile Specific */
@media (max-width: 640px) {
    .project-grid {
        grid-template-columns: 1fr;
    }
    header {
        padding: 20px;
    }
    .container {
        padding: 0 20px;
    }
}


/* Smoke In Effect text styling */
.smoke-text-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 8rem; /* Made it larger than 3rem so it fits the hero section */
    font-weight: 300;
    letter-spacing: 0.05em;
    font-family: 'Inter', sans-serif;
    color: #ffffff;
    z-index: 5; /* Above canvas, below header */
    text-align: center;
    width: 100%;
}

.char {
    display: inline-block;
    white-space: pre;
}

@keyframes smokeIn { 
    0% { 
        transform: translateY(-20px) scale(1.5); 
        filter: blur(20px); 
        opacity: 0; 
    } 
    100% { 
        transform: translateY(0) scale(1); 
        filter: blur(0); 
        opacity: 1; 
    } 
}

@keyframes smokeOut {
    0% { 
        transform: translateY(0) scale(1); 
        filter: blur(0); 
        opacity: 1; 
    } 
    100% { 
        transform: translateY(-20px) scale(1.5); 
        filter: blur(20px); 
        opacity: 0; 
    }
}

/* Rolling Text Effect styling */
.char-wrap {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
    line-height: 1.1;
}

.char-inner {
    display: flex;
    flex-direction: column;
    transform: translateY(0%);
    transition: transform 0.75s cubic-bezier(0.455, 0.03, 0.515, 0.955);
}

.char-inner.is-in {
    transform: translateY(-33.3333%);
}

.char-inner.is-out {
    transform: translateY(-66.6666%);
}

.char-item {
    display: inline-block;
}
