/* ==============================
   Variables & Theming
============================== */
:root[data-theme="dark"] {
    --bg-main: #0a0a0a;
    --bg-alt: #121212;
    --bg-glass: rgba(18, 18, 18, 0.7);
    --bg-element: #1a1a1a;
    --text-primary: #f5f5f5;
    --text-secondary: #a3a3a3;
    --accent: #d4af37; /* Elegant gold */
    --accent-hover: #f1cf5c;
    --border: #333333;
    --glow: rgba(212, 175, 55, 0.3);
}

:root[data-theme="light"] {
    --bg-main: #fcfcfc;
    --bg-alt: #f0f0f0;
    --bg-glass: rgba(255, 255, 255, 0.8);
    --bg-element: #ffffff;
    --text-primary: #121212;
    --text-secondary: #666666;
    --accent: #2e5c8a; /* Slate blue */
    --accent-hover: #457db3;
    --border: #e0e0e0;
    --glow: rgba(46, 92, 138, 0.3);
}

/* Base variables */
:root {
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-slow: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    --radius: 8px;
    --radius-lg: 16px;
    --nav-height: 80px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

h1, h2, h3, h4, h5, h6, .brand, .brand-small {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
}

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

ul {
    list-style: none;
}

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

.container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
}

.section-padding {
    padding: 100px 0;
}

.bg-alt {
    background-color: var(--bg-alt);
}

/* ==============================
   Typography & Utilities
============================== */
.section-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 20px;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin-bottom: 40px;
}

.section-desc.sm {
    font-size: 1rem;
}

.glow-text {
    color: var(--accent);
    text-shadow: 0 0 10px var(--glow);
}

/* Reveal Animation Class */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 30px;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background-color: var(--text-primary);
    color: var(--bg-main);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
:root[data-theme="dark"] .btn-primary:hover {
    box-shadow: 0 10px 20px rgba(255,255,255,0.05);
}

.icon-button {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: var(--transition);
}

.icon-button:hover {
    background-color: var(--bg-element);
    color: var(--accent);
}

/* ==============================
   Navigation
============================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    z-index: 1000;
    background: transparent;
    transition: var(--transition);
}

.navbar.scrolled {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
}

.brand {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0%;
    height: 1px;
    background-color: var(--accent);
    transition: var(--transition);
}

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

/* Theme Toggle Icons */
[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

/* ==============================
   Hero Parallax
============================== */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.hero-parallax-bg {
    position: absolute;
    top: -10%;
    left: 0;
    width: 100%;
    height: 120%; /* Extra height for scrolling */
    background-image: url('https://images.unsplash.com/photo-1492691527719-9d1e07e534b4?q=80&w=2071&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    z-index: 1;
    transform: translateY(0);
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(10,10,10,0.4) 0%, rgba(10,10,10,0.8) 100%);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    padding: 0 20px;
    color: #ffffff; /* Always light text on hero */
}

.hero-title {
    font-size: clamp(4rem, 8vw, 7rem);
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 20px;
    animation: fadeUp 1s ease-out forwards;
    opacity: 0;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: rgba(255,255,255,0.8);
    margin-bottom: 40px;
    animation: fadeUp 1s ease-out 0.3s forwards;
    opacity: 0;
}

.hero .btn {
    animation: fadeUp 1s ease-out 0.6s forwards;
    opacity: 0;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: #fff;
    opacity: 0.7;
    animation: fadeUp 1s ease-out 1s forwards;
    opacity: 0;
}

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

.mouse {
    width: 24px;
    height: 40px;
    border: 2px solid #fff;
    border-radius: 12px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 8px;
    background: #fff;
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollWheel 2s infinite cubic-bezier(0.15, 0.41, 0.69, 0.94);
}

/* ==============================
   Bio Section
============================== */
.bio-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.bio-image-wrapper {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
}

.bio-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    aspect-ratio: 4/5;
    transition: var(--transition-slow);
}

.bio-image-wrapper:hover .bio-image {
    transform: scale(1.05);
}

.glass-plate {
    position: absolute;
    bottom: 20px;
    right: -20px;
    width: 150px;
    height: 150px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    z-index: 2;
    transform: translateZ(20px); /* Suggests 3D */
    opacity: 0;
    transition: var(--transition-slow);
}

.bio-image-wrapper:hover .glass-plate {
    opacity: 1;
    right: 20px;
}

.stats {
    display: flex;
    gap: 40px;
    margin-top: 40px;
}

.stat-num {
    display: block;
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--accent);
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ==============================
   Featured Carousel
============================== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 50px;
    flex-wrap: wrap;
    gap: 20px;
}

.carousel-nav {
    display: flex;
    gap: 10px;
}

.carousel-nav .icon-button {
    background: var(--bg-element);
    border: 1px solid var(--border);
}

.carousel-container {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Firefox */
    padding-bottom: 20px;
    -webkit-overflow-scrolling: touch;
}

.carousel-container::-webkit-scrollbar {
    display: none; /* Chrome */
}

.carousel-item {
    flex: 0 0 calc(33.333% - 14px);
    min-width: 300px;
    scroll-snap-align: start;
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    group;
}

.carousel-item img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    transition: var(--transition-slow);
}

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

.carousel-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent 50%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px;
    opacity: 0;
    transition: var(--transition);
}


/* ==============================
   Portfolio Gallery
============================== */
.filter-group {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.filter-btn.active, .filter-btn:hover {
    background: var(--text-primary);
    color: var(--bg-main);
    border-color: var(--text-primary);
}

.gallery-grid {
    column-count: 3;
    column-gap: 20px;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 20px;
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: zoom-in;
    transform: scale(1);
    transition: var(--transition-slow);
}

.gallery-item.hidden {
    display: none;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius);
    transition: var(--transition-slow);
}

.gallery-item:hover img {
    transform: scale(1.03);
    filter: brightness(0.8);
}

.gallery-item-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    color: #fff;
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
    z-index: 2;
}

.gallery-item:hover .gallery-item-info {
    opacity: 1;
    transform: translateY(-10px);
}

.gallery-item-info h4 {
    font-size: 1.2rem;
}

.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent 50%);
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
}

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

/* ==============================
   Contact
============================== */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    background: var(--bg-element);
    border-radius: var(--radius-lg);
    padding: 60px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
}

.social-links {
    display: flex;
    gap: 20px;
    margin-top: 30px;
    margin-bottom: 30px;
}

.social-links a {
    font-weight: 600;
    color: var(--text-secondary);
}

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

.email-link {
    font-size: 1.5rem;
    font-weight: 300;
    position: relative;
    display: inline-block;
}

.email-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--text-primary);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group input, .input-group textarea {
    width: 100%;
    background: var(--bg-main);
    border: 1px solid var(--border);
    padding: 16px 20px;
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.input-group input:focus, .input-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}



/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0,0,0,0.2);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ==============================
   Footer
============================== */
.footer {
    padding: 40px 0;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.back-top {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-element);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.back-top:hover {
    background: var(--text-primary);
    color: var(--bg-main);
}

/* ==============================
   Lightbox
============================== */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: all;
}

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

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
}

.lightbox-caption {
    margin-top: 20px;
    text-align: center;
    color: #fff;
    width: 100%;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 3rem;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    z-index: 2001;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    transition: var(--transition);
}

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

.lightbox-nav.prev { left: 40px; }
.lightbox-nav.next { right: 40px; }

/* ==============================
   Animations
============================== */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scrollWheel {
    0% { transform: translate(-50%, 0); opacity: 1; }
    100% { transform: translate(-50%, 15px); opacity: 0; }
}

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

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ==============================
   Responsive
============================== */
@media (max-width: 1024px) {
    .gallery-grid { column-count: 2; }
    .bio-grid { grid-template-columns: 1fr; gap: 40px; }
    .contact-layout { grid-template-columns: 1fr; padding: 40px; }
    .section-padding { padding: 80px 0; }
}

@media (max-width: 768px) {
    .nav-links { display: none; /* simple mobile nav */ }
    .gallery-grid { column-count: 1; }
    .carousel-item { flex: 0 0 calc(80% - 10px); }
    .lightbox-nav { display: none; /* Disable arrows on mobile */ }
}
