/* ===== CSS Variables ===== */
:root {
    --color-bg: #0a0a0f;
    --color-bg-elevated: #12121a;
    --color-bg-card: #1a1a25;
    --color-navy: #1e3a5f;
    --color-navy-light: #2d5a8a;
    --color-navy-glow: #3d7ab8;
    --color-accent: #4a90c2;
    --color-text: #f5f5f7;
    --color-text-muted: #8a8a9a;
    --color-text-subtle: #5a5a6a;
    --color-border: #2a2a3a;
    
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Inter', -apple-system, sans-serif;
    
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 300;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.7;
    overflow-x: hidden;
}

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

a {
    color: inherit;
    text-decoration: none;
}

/* ===== Navigation ===== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 4rem;
    background: linear-gradient(to bottom, var(--color-bg), transparent);
    transition: var(--transition-smooth);
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.nav-links {
    display: flex;
    gap: 3rem;
}

.nav-links a {
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    transition: var(--transition-fast);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-accent);
    transition: var(--transition-smooth);
}

.nav-links a:hover {
    color: var(--color-text);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    width: 24px;
    height: 1px;
    background: var(--color-text);
    transition: var(--transition-fast);
}

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 8rem 2rem 4rem;
    position: relative;
    background: 
        radial-gradient(ellipse at 20% 80%, rgba(30, 58, 95, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(45, 90, 138, 0.1) 0%, transparent 50%),
        var(--color-bg);
}

.hero-content {
    max-width: 900px;
}

.hero-subtitle {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 2rem;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 10vw, 7rem);
    font-weight: 300;
    line-height: 1.1;
    margin-bottom: 2rem;
}

.hero-title span {
    display: block;
}

.hero-title-accent {
    font-style: italic;
    background: linear-gradient(135deg, var(--color-accent), var(--color-navy-glow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--color-text-muted);
    max-width: 500px;
    margin: 0 auto 3rem;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 2px;
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: var(--transition-smooth);
}

.hero-cta:hover {
    background: var(--color-navy);
    border-color: var(--color-navy-light);
    transform: translateY(-2px);
}

.hero-cta svg {
    transition: var(--transition-fast);
}

.hero-cta:hover svg {
    transform: translate(4px, -4px);
}

.hero-scroll {
    position: absolute;
    bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.hero-scroll span {
    font-size: 0.625rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-text-subtle);
}

.hero-scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, var(--color-accent), transparent);
    animation: scroll-pulse 2s ease-in-out infinite;
}

@keyframes scroll-pulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.8); }
    50% { opacity: 1; transform: scaleY(1); }
}

/* ===== Section Styling ===== */
.section-header {
    margin-bottom: 4rem;
    max-width: 600px;
}

.section-number {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    color: var(--color-accent);
    display: block;
    margin-bottom: 1rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 300;
    margin-bottom: 1rem;
}

.section-description {
    color: var(--color-text-muted);
    font-size: 1rem;
}

/* ===== Work / Gallery Section ===== */
.work {
    padding: 8rem 4rem;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    cursor: pointer;
}

.gallery-item--wide {
    grid-column: span 2;
}

.gallery-item--tall {
    grid-row: span 2;
}

.gallery-image {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 300px;
    overflow: hidden;
}

.gallery-item--wide .gallery-image {
    min-height: 350px;
}

.gallery-item--tall .gallery-image {
    min-height: 100%;
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
    filter: brightness(0.9) saturate(0.9);
}

.gallery-item:hover .gallery-image img {
    transform: scale(1.05);
    filter: brightness(1) saturate(1);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(10, 10, 15, 0.9) 0%,
        rgba(10, 10, 15, 0.3) 50%,
        transparent 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    opacity: 0;
    transition: var(--transition-smooth);
}

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

.gallery-category {
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
}

.gallery-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 400;
}

/* ===== About Section ===== */
.about {
    padding: 8rem 4rem;
    background: var(--color-bg-elevated);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 6rem;
    align-items: center;
}

.about-image {
    position: relative;
}

.about-image::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: 20px;
    bottom: 20px;
    border: 1px solid var(--color-navy);
    border-radius: 4px;
    z-index: -1;
}

.about-image img {
    border-radius: 4px;
    filter: grayscale(20%);
    transition: var(--transition-smooth);
}

.about-image:hover img {
    filter: grayscale(0%);
}

.about-text {
    max-width: 600px;
}

.about-heading {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 400;
    line-height: 1.4;
    margin-bottom: 2rem;
}

.about-text p {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

.about-stats {
    display: flex;
    gap: 3rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--color-accent);
}

.stat-label {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-subtle);
}

/* ===== Services Section ===== */
.services {
    padding: 8rem 4rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.service-card {
    padding: 2.5rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    transition: var(--transition-smooth);
}

.service-card:hover {
    border-color: var(--color-navy);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(30, 58, 95, 0.15);
}

.service-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-navy);
    border-radius: 50%;
    margin-bottom: 1.5rem;
    color: var(--color-accent);
}

.service-card h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 1rem;
}

.service-card p {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* ===== Contact Section ===== */
.contact {
    padding: 10rem 4rem;
    background: 
        radial-gradient(ellipse at 50% 100%, rgba(30, 58, 95, 0.2) 0%, transparent 60%),
        var(--color-bg-elevated);
    text-align: center;
}

.contact-content {
    max-width: 600px;
    margin: 0 auto;
}

.contact .section-header {
    margin: 0 auto 3rem;
}

.contact-email {
    display: inline-block;
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 300;
    font-style: italic;
    margin-bottom: 3rem;
    position: relative;
    transition: var(--transition-fast);
}

.contact-email::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--color-accent);
    transform: scaleX(0);
    transition: var(--transition-smooth);
}

.contact-email:hover {
    color: var(--color-accent);
}

.contact-email:hover::after {
    transform: scaleX(1);
}

.contact-social {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.social-link {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    color: var(--color-text-muted);
    transition: var(--transition-smooth);
}

.social-link:hover {
    color: var(--color-text);
    border-color: var(--color-accent);
    background: var(--color-navy);
}

/* ===== Footer ===== */
.footer {
    padding: 2rem 4rem;
    border-top: 1px solid var(--color-border);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--color-text-subtle);
    letter-spacing: 0.05em;
}

/* ===== Responsive Design ===== */
@media (max-width: 1200px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 968px) {
    .nav {
        padding: 1.5rem 2rem;
    }
    
    .nav-links {
        display: none;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .work,
    .about,
    .services,
    .contact {
        padding: 6rem 2rem;
    }
    
    .gallery {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-item--wide,
    .gallery-item--tall {
        grid-column: span 1;
        grid-row: span 1;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        gap: 4rem;
    }
    
    .about-image {
        max-width: 400px;
    }
    
    .about-stats {
        gap: 2rem;
    }
}

@media (max-width: 640px) {
    .hero {
        padding: 6rem 1.5rem 4rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .gallery {
        grid-template-columns: 1fr;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .about-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

/* ===== Animations ===== */
@media (prefers-reduced-motion: no-preference) {
    .gallery-item,
    .service-card,
    .about-image {
        opacity: 0;
        transform: translateY(30px);
        animation: fadeInUp 0.8s ease forwards;
    }
    
    .gallery-item:nth-child(1) { animation-delay: 0.1s; }
    .gallery-item:nth-child(2) { animation-delay: 0.2s; }
    .gallery-item:nth-child(3) { animation-delay: 0.3s; }
    .gallery-item:nth-child(4) { animation-delay: 0.4s; }
    .gallery-item:nth-child(5) { animation-delay: 0.5s; }
    .gallery-item:nth-child(6) { animation-delay: 0.6s; }
    .gallery-item:nth-child(7) { animation-delay: 0.7s; }
    
    .service-card:nth-child(1) { animation-delay: 0.1s; }
    .service-card:nth-child(2) { animation-delay: 0.2s; }
    .service-card:nth-child(3) { animation-delay: 0.3s; }
    .service-card:nth-child(4) { animation-delay: 0.4s; }
}

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

/* ===== Selection ===== */
::selection {
    background: var(--color-navy);
    color: var(--color-text);
}

/* ===== Gallery Categories ===== */
.gallery-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 3rem;
}

.category-btn {
    padding: 0.5rem 1.25rem;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 2px;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.category-btn:hover,
.category-btn.active {
    color: var(--color-text);
    border-color: var(--color-accent);
    background: var(--color-navy);
}

.gallery-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--color-text-muted);
}

.gallery-loading::after {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    margin: 1.5rem auto 0;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Lightbox ===== */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 2rem;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition-fast);
}

.lightbox-close:hover {
    color: var(--color-accent);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: 1.5rem;
    padding: 1rem;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition-fast);
}

.lightbox-prev { left: 2rem; }
.lightbox-next { right: 2rem; }

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--color-navy);
    border-color: var(--color-accent);
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.lightbox-caption {
    text-align: center;
    padding: 1.5rem;
}

.lightbox-caption h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.lightbox-caption p {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* ===== Dynamic Gallery Items ===== */
.gallery-item {
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    background: var(--color-bg-card);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.gallery-item .gallery-image {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--color-bg-elevated);
}

.gallery-item .gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease, opacity 0.4s ease;
    opacity: 0;
}

.gallery-item .gallery-image img.loaded {
    opacity: 1;
}

.gallery-item:hover .gallery-image img {
    transform: scale(1.05);
}

/* Image Loading Skeleton */
.gallery-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        var(--color-bg-elevated) 0%,
        var(--color-bg-card) 50%,
        var(--color-bg-elevated) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    z-index: 1;
}

.gallery-image.loaded::before {
    display: none;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (max-width: 768px) {
    .gallery {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .gallery-item .gallery-image {
        aspect-ratio: 16/10;
    }
}

@media (max-width: 640px) {
    .lightbox-prev,
    .lightbox-next {
        padding: 0.75rem;
        font-size: 1.25rem;
    }
    
    .lightbox-prev { left: 1rem; }
    .lightbox-next { right: 1rem; }
}
