/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    /* Colors - Light (Default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f9f9f9;
    --text-primary: #111111;
    --text-secondary: #555555;
    --text-tertiary: #999999;
    --border-color: #eaeaea;
    --accent: #222222;
    --nav-bg: rgba(255, 255, 255, 0.95);

    /* Fonts */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing */
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 8rem;
    --container-max: 1000px;
}

/* Colors - Dark Mode Override */
[data-theme="dark"] {
    --bg-primary: #111111;
    --bg-secondary: #1a1a1a;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --text-tertiary: #666666;
    --border-color: #333333;
    --accent: #ffffff;
    --nav-bg: rgba(17, 17, 17, 0.95);
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

ul {
    list-style: none;
}

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

/* =========================================
   2. TYPOGRAPHY
   ========================================= */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 400;
    line-height: 1.2;
}

.display-title {
    font-size: 5.5rem;
    letter-spacing: -0.03em;
    margin-bottom: 2rem;
}

.section-title {
    font-size: 2rem;
    margin-bottom: var(--space-lg);
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 1.25rem;
    letter-spacing: -0.01em;
}

.meta-text {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* =========================================
   3. LAYOUT UTILITIES
   ========================================= */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: var(--space-xl) 0;
}

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

/* Animation Utils */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}


/* =========================================
   4. NAVIGATION
   ========================================= */
.nav-wrapper {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid transparent;
    transition: 0.3s;
}

.nav-wrapper.scrolled {
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.brand {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    letter-spacing: -0.01em;
}

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

.nav-links a {
    font-size: 0.9rem;
    color: var(--text-secondary);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0%;
    height: 1px;
    background: var(--text-primary);
    transition: width 0.3s;
}

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

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

/* Dark Mode Toggle */
.theme-toggle {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
    font-size: 1.5rem;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover {
    border-color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}


/* =========================================
   5. LANDING PAGE - HERO (Cinematic Reveal)
   ========================================= */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* Centered horizontally */
    text-align: center;
    /* Center text */
    max-width: 900px;
}

.reveal-mask {
    overflow: hidden;
    display: block;
    position: relative;
    margin-bottom: 0.5rem;
}

.reveal-text {
    transform: translateY(120%) skewY(10deg);
    opacity: 0;
    transform-origin: center top;
    animation: textRevealSkew 1.8s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    display: block;
    margin: 0;
    will-change: transform, opacity;
}

.hero p.reveal-text {
    font-size: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

@keyframes textRevealSkew {
    0% {
        transform: translateY(120%) skewY(10deg);
        opacity: 0;
    }

    100% {
        transform: translateY(0) skewY(0);
        opacity: 1;
    }
}


/* =========================================
   6. EXPERIENCE (Expandable Timeline)
   ========================================= */
.timeline {
    display: block;
    /* Revert grid */
    border-left: 2px solid var(--border-color);
    padding-left: 2rem;
    margin-left: 1rem;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    background: transparent;
    border: none;
    padding: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: calc(2rem * -1 - 7px);
    /* Align dot center on 2px border */
    top: 5px;
    width: 12px;
    height: 12px;
    background: var(--bg-primary);
    border: 2px solid var(--text-tertiary);
    border-radius: 50%;
    transition: 0.3s;
    z-index: 1;
}

.timeline-item:hover::before {
    border-color: var(--text-primary);
    background: var(--text-primary);
}

.timeline-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timeline-toggle {
    transition: transform 0.3s;
    font-size: 1.2rem;
    color: var(--text-tertiary);
}

.timeline-item.active .timeline-toggle {
    transform: rotate(180deg);
    color: var(--text-primary);
}

.timeline-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out, opacity 0.5s ease;
    opacity: 0;
    padding-top: 0;
}

.timeline-item.active .timeline-body {
    max-height: 500px;
    /* Arbitrary large limit */
    opacity: 1;
    padding-top: 1rem;
}

.timeline-role {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.timeline-org {
    color: var(--text-tertiary);
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    justify-content: space-between;
}

.timeline-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
    line-height: 1.6;
}


/* =========================================
   7. FANCY HORIZONTAL SCROLL (Certifications)
   ========================================= */
.horizontal-scroll-container {
    display: flex;
    overflow-x: auto;
    gap: 1.5rem;
    padding: 1rem 0.5rem 2rem 0.5rem;
    scroll-snap-type: x mandatory;
    scroll-behavior: auto;
    /* Changed from smooth for continuous JS scroll */
    -webkit-overflow-scrolling: touch;

    /* Hide Scrollbar */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

/* Hide Scrollbar for Chrome/Safari/Opera */
.horizontal-scroll-container::-webkit-scrollbar {
    display: none;
}

.horizontal-card {
    min-width: 320px;
    max-width: 320px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    scroll-snap-align: center;
    transition: 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    position: relative;
    overflow: hidden;
    /* Link styling reset */
    text-decoration: none;
    color: inherit;
    cursor: default;
    /* Default cursor for non-links */
}

/* Specific style for clickable cards */
a.horizontal-card {
    cursor: pointer;
}

a.horizontal-card:hover {
    border-color: var(--accent);
}

/* Make sure inner text elements inherit correctly or stay fixed */
.horizontal-card .card-title {
    color: var(--text-primary);
}

.horizontal-card .meta-text {
    color: var(--accent);
}

.horizontal-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
    border-color: transparent;
}

.cert-logo {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    margin-bottom: 1rem;
    object-fit: contain;
    background: #fff;
    padding: 4px;
    border: 1px solid var(--border-color);
}

/* Custom Scrollbar for horizontal section */
.horizontal-scroll-container::-webkit-scrollbar {
    height: 6px;
}

.horizontal-scroll-container::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.horizontal-scroll-container::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
    border-radius: 3px;
}


/* =========================================
   7. LISTS & TAGS (Awards/Skills)
   ========================================= */
.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.tag {
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: 0.3s;
}

.tag:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}


/* =========================================
   8. PROJECT CARDS
   ========================================= */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--space-lg);
}

.project-card {
    display: block;
}

.card-image {
    background: #f0f0f0;
    height: 250px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

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

.project-card:hover .card-image img {
    transform: scale(1.05);
}

.card-meta {
    margin-bottom: 0.5rem;
}


/* =========================================
   9. PHOTOGRAPHY GRID
   ========================================= */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.photo-item {
    cursor: pointer;
    overflow: hidden;
}

.photo-item img {
    width: 100%;
    height: auto;
    transition: opacity 0.3s;
}

.photo-item:hover img {
    opacity: 0.8;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

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

.lightbox img {
    max-height: 80vh;
    max-width: 90vw;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-primary);
}


/* =========================================
   10. MOBILE / RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    .display-title {
        font-size: 2.5rem;
    }

    .hero {
        min-height: 60vh;
    }

    .nav-links {
        display: none;
    }

    /* Simplified for this demo, would add burger menu */
    .timeline {
        margin-left: 0;
        padding-left: 1.5rem;
    }
}


/* =========================================
   11. CONTACT CARD (New)
   ========================================= */
.contact-card-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    background: var(--bg-primary);
    border-radius: 20px;
    padding: 3rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

@media (max-width: 768px) {
    .contact-card-wrapper {
        grid-template-columns: 1fr;
        padding: 2rem;
        gap: 2rem;
    }
}

.contact-item {
    margin-bottom: 2rem;
}

.contact-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.contact-link {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: 0.3s;
}

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

.social-link {
    font-size: 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: 0.3s;
}

.social-link:hover {
    color: var(--accent);
}

/* Form Styling */
.contact-form .form-group {
    margin-bottom: 1.5rem;
}

.contact-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: var(--text-primary);
    transition: 0.3s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-secondary);
}

.submit-btn {
    background: var(--accent);
    color: var(--bg-primary);
    /* Invert for contrast */
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
    width: 100%;
}

.submit-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}