:root {
    /* Colors - Apple-esque Dark Mode */
    --bg-color: #000000;
    --bg-secondary: #111111;
    --text-primary: #f5f5f7;
    /* Apple off-white */
    --text-secondary: #86868b;
    --accent: #2997ff;
    /* Apple Blue */
    --hero-gradient: linear-gradient(180deg, #fff 0%, #aaa 100%);
    /* White gradient for dark mode */

    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 32px;
    --spacing-lg: 64px;
    --spacing-xl: 120px;

    /* Layout */
    --max-width: 1200px;
    --nav-height: 60px;
}

[data-theme="light"] {
    --bg-color: #ffffff;
    --bg-secondary: #f5f5f7;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --nav-bg: rgba(255, 255, 255, 0.8);
    --border-color: rgba(0, 0, 0, 0.1);
    --hero-gradient: linear-gradient(180deg, #111 0%, #666 100%);
    /* Dark gradient for light mode */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;

    /* Smooth Theme Transition */
    transition: background-color 0.5s cubic-bezier(0.2, 0.8, 0.2, 1),
        color 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Theme Icon Animation */
#theme-toggle {
    position: relative;
    width: 24px;
    height: 24px;
    overflow: hidden;
}

.sun-icon,
.moon-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-origin: center;
    transition: all 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Dark Mode State (Default or Forced) */
[data-theme="dark"] .sun-icon,
:root:not([data-theme="light"]) .sun-icon {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

[data-theme="dark"] .moon-icon,
:root:not([data-theme="light"]) .moon-icon {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-90deg) scale(0.5);
}

/* Light Mode State */
[data-theme="light"] .sun-icon {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(90deg) scale(0.5);
}

[data-theme="light"] .moon-icon {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 600;
    letter-spacing: -0.02em;
}

h1.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    line-height: 1.1;
    margin-bottom: var(--spacing-sm);
    background: var(--hero-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    margin-bottom: var(--spacing-md);
}

p {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--text-primary);
}

/* Navbar */
/* Navbar - Floating Glass Style (macOS Dock Effect) */
.navbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: var(--max-width);
    height: var(--nav-height);

    /* Refractive Glass Effect */
    background: rgba(15, 15, 15, 0.3);
    /* High transparency for pass-through */

    /* Strong vivid blur */
    /* Reduced Blur & Normal Saturation */
    backdrop-filter: blur(8px) brightness(1.1);
    -webkit-backdrop-filter: blur(8px) brightness(1.1);

    z-index: 1000;

    /* Subtle borders */
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;

    display: flex;
    justify-content: center;

    /* Depth Shadows: Drop + Inner Rim */
    box-shadow:
        0 10px 40px -10px rgba(0, 0, 0, 0.5),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

@media (max-width: 768px) {
    .navbar {
        position: absolute;
        /* Stop sticky on mobile */
        top: 20px;
        width: 90%;
    }
}

.nav-content {
    width: 100%;
    padding: 0 var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 600;
    font-size: 1.25rem;
    letter-spacing: -0.01em;
    color: #ffffff;
    /* Always white for dark glass navbar */
}

.nav-links {
    list-style: none;
    display: flex;
    gap: var(--spacing-md);
}

.nav-links a {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    /* Off-white for idle state */
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #ffffff;
    /* Bright white on hover */
}

#theme-toggle {
    color: #ffffff !important;
    /* Force white icon */
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 var(--spacing-md);
    position: relative;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 300;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0.5;
}

.scroll-indicator span {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.scroll-indicator .line {
    width: 1px;
    height: 40px;
    background-color: var(--text-secondary);
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Work Sections */
.work-section {
    padding: var(--spacing-lg) 0;
    min-height: auto;
    /* Allow content to dictate height */
}

.fluid-container {
    max-width: 1200px;
    /* Limit width to keep it centered */
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    /* Balanced padding */
}

.section-desc {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-top: -20px;
    margin-bottom: var(--spacing-md);
}

/* --- PHOTOGRAPHY SECTION --- */
.photo-section {
    padding: var(--spacing-lg) 0;
    position: relative;
    z-index: 2;
    min-height: 600px;
}

/* Hidden Utility */
.hidden {
    display: none !important;
}

/* VIEW 1: ALBUMS GRID */
.albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 24px 0;
    justify-content: center;
    /* Helper for some flex fallbacks */
}

.album-card {
    position: relative;
    aspect-ratio: 4/5;
    /* Portrait-ish cards */
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.album-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
}

.album-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.album-card:hover .album-cover {
    transform: scale(1.05);
}

.album-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    color: white;
}

.album-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.album-count {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* VIEW 2: GALLERY NAV */
.gallery-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.nav-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-primary);
}

/* Reusing Masonry Grid Styles */
.photo-grid {
    column-count: 3;
    column-gap: 24px;
    padding: 0;
    /* Remove padding as nav has it */
}

@media (max-width: 1024px) {
    .photo-grid {
        column-count: 2;
    }
}

@media (max-width: 600px) {
    .photo-grid {
        column-count: 2;
        /* 2 Columns for Mobile */
        column-gap: 12px;
    }

    .albums-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        /* Smaller cards */
        gap: 16px;
    }

    /* Mobile Video Fix */
    .media-element {
        height: auto !important;
        /* Allow height to adjust */
        aspect-ratio: 9/16;
        /* Default vertical */
        min-width: 70vw;
        /* Wider cards */
    }

    .media-element.video-horizontal {
        aspect-ratio: 16/9;
        width: 85vw !important;
    }
}

/* Standard Video Grid (Not Masonry) */
.standard-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
}

.video-container {
    position: relative;
    width: 300px;
    /* Standard width */
    max-width: 100%;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: #000;
    transition: transform 0.3s ease;
    /* Aspect ratio will be set inline or via class */
}

.video-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.video-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.video-container:hover img {
    opacity: 1;
}

.album-card {
    position: relative;
    aspect-ratio: 4/5;
    /* Portrait-ish cards */
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.album-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
}

.album-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.album-card:hover .album-cover {
    transform: scale(1.05);
}

.album-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    color: white;
}

.album-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.album-count {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* VIEW 2: GALLERY NAV */
.gallery-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.nav-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-primary);
}



.photo-item {
    break-inside: avoid;
    margin-bottom: 24px;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: zoom-in;
    transition: transform 0.3s ease;
    /* Skeleton Loading State */
    min-height: 300px;
    background-color: #1a1a1a;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

.photo-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    transition: transform 0.5s ease;
}

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

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

/* About */
.about {
    padding: var(--spacing-xl) 0;
    background-color: var(--bg-secondary);
}

.small-container {
    max-width: 800px;
    text-align: center;
}

.about p {
    font-size: 1.5rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Contact / Footer */
.contact {
    padding: var(--spacing-xl) 0;
    text-align: center;
}

.email-link {
    display: block;
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    margin: var(--spacing-md) 0;
    color: var(--text-primary);
}

.email-link:hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 8px;
}

.socials {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.section-header {
    margin-bottom: var(--spacing-lg);
    text-align: center;
    padding-right: var(--spacing-md);
    /* Balance flud-container padding for true center */
}

.copyright {
    font-size: 0.8rem;
    opacity: 0.4;
}

/* Album Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: none;
    /* Hidden by default */
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(10px);
}

.modal.open {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 3rem;
    color: var(--text-primary);
    background: none;
    border: none;
    cursor: pointer;
    z-index: 2001;
    transition: transform 0.2s ease;
}

.close-modal:hover {
    transform: scale(1.1);
}

.modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
}

.modal-media-container {
    position: relative;
    max-width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-media {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-caption {
    margin-top: var(--spacing-sm);
    text-align: center;
    color: var(--text-primary);
}

.modal-caption h3 {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 2rem;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 50%;
    backdrop-filter: blur(5px);
    transition: all 0.2s ease;
    z-index: 2002;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}

@media (max-width: 768px) {
    .nav-btn {
        padding: 10px 15px;
        font-size: 1.5rem;
    }

    .prev-btn {
        left: 10px;
    }

    .next-btn {
        right: 10px;
    }
}

/* Animation Classes Used by JS */
.reveal-text {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

/* --- CAROUSEL MODAL STYLES --- */

.modal-media-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    height: 80vh;
    /* Critical: Prevents collapse */
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    /* Enable 3D depth */
    overflow: hidden;
    margin: 0 auto;
    /* Center horizontally */
}

/* The Wrapper for items */
.carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Individual Video Item */
.carousel-item {
    position: absolute;
    top: 50%;
    /* Horizontal positioning handled by state classes now */
    left: 50%;
    transform: translate(-50%, -50%);

    /* Dynamic Sizing based on content */
    width: auto;
    height: 80%;
    /* Match container height roughly */
    max-width: 80vw;

    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    /* Smoother */
    z-index: 1;
    opacity: 0;

    /* Remove box styling from wrapper so it hugs video */
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

.carousel-item video {
    width: auto;
    height: 100%;
    /* Force height to fill wrapper */
    object-fit: contain;
    /* Ensure aspect ratio preserved */
    display: block;

    /* Visuals on Video Element */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    /* DEBUG: Magenta background removed */
    background: transparent;
    /* Letterbox fill if needed, but width:auto minimizes this */
    border: none;
    /* For iframe */
}

/* Specific fix for iframe aspect ratio */
/* Specific fix for iframe aspect ratio */
iframe.carousel-item {
    width: 100% !important;
    height: 100% !important;
    min-width: 300px !important;
    /* Force visibility */
    min-height: 500px !important;
    /* Force visibility */
    /* DEBUG: High Contrast */
    border: 5px solid red !important;
    background: #fff !important;
}

/* --- STATES --- */

/* Active (Center) */
.carousel-item.active {
    opacity: 1;
    z-index: 10;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    filter: blur(0) brightness(1);
}

/* Previous (Left) */
.carousel-item.prev {
    opacity: 0.5;
    z-index: 5;
    left: 15%;
    /* Move further left */
    /* Rotate and scale, but keep centered on point */
    transform: translate(-50%, -50%) scale(0.7) rotateY(25deg);
    filter: blur(3px) brightness(0.6);
    pointer-events: none;
}

/* Next (Right) */
.carousel-item.next {
    opacity: 0.5;
    z-index: 5;
    left: 85%;
    /* Move further right */
    transform: translate(-50%, -50%) scale(0.7) rotateY(-25deg);
    filter: blur(3px) brightness(0.6);
    pointer-events: none;
}

/* Hide others */
.carousel-item.hidden {
    opacity: 0;
    z-index: 0;
    transform: translate(-50%, -50%) scale(0.5);
    pointer-events: none;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .carousel-item {
        max-width: 90vw;
        height: 60%;
        /* Smaller height on mobile */
    }

    .carousel-item.prev {
        left: 10%;
        /* Tighter squeeze */
        transform: translate(-50%, -50%) scale(0.7);
    }

    .carousel-item.next {
        left: 90%;
        transform: translate(-50%, -50%) scale(0.7);
    }
}