/* ===== CSS Variables ===== */
:root {
    /* Colors - warm tones to complement the sunset image */
    --primary-dark: #0f172a;
    --primary-mid: #1e293b;
    --accent-gold: #d4a853;
    --accent-gold-hover: #c49a4a;
    --accent-teal: #2dd4bf;
    --accent-teal-hover: #14b8a6;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-light: #64748b;
    --text-white: #ffffff;
    --bg-dark: #0f172a;
    --bg-light: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.98);
    --border-light: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.16);

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.75rem;
    --font-size-5xl: 3.5rem;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
    --spacing-4xl: 6rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

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

/* Background Image */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../assets/images/background.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

/* Dark Overlay for Text Readability */
.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(15, 23, 42, 0.5) 0%,
        rgba(15, 23, 42, 0.4) 40%,
        rgba(15, 23, 42, 0.7) 100%
    );
    z-index: 1;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    padding: var(--spacing-xl);
    z-index: 2;
    animation: fadeInUp 1s ease-out;
}

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

/* Profile Image */
.profile-image-container {
    margin-bottom: var(--spacing-xl);
}

.profile-image {
    width: 160px;
    height: 160px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all var(--transition-base);
    margin: 0 auto;
}

.profile-image:hover {
    transform: scale(1.03);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Hero Text */
.hero-name {
    font-size: var(--font-size-5xl);
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.03em;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.hero-title {
    font-size: var(--font-size-xl);
    font-weight: 400;
    color: var(--accent-gold);
    margin-bottom: var(--spacing-lg);
    letter-spacing: 0.02em;
}

.hero-bio {
    font-size: var(--font-size-lg);
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: var(--spacing-2xl);
    line-height: 1.8;
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
}

/* CTA Buttons */
.cta-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: all var(--transition-base);
}

.btn-icon {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: var(--accent-gold);
    color: var(--primary-dark);
}

.btn-primary:hover {
    background: var(--accent-gold-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(212, 168, 83, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: var(--spacing-2xl);
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    cursor: pointer;
    animation: float 3s ease-in-out infinite;
}

.scroll-indicator svg {
    width: 28px;
    height: 28px;
    color: rgba(255, 255, 255, 0.5);
    transition: color var(--transition-fast);
}

.scroll-indicator:hover svg {
    color: var(--accent-gold);
}

@keyframes float {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-8px);
    }
}

/* ===== Projects Section ===== */
.projects {
    padding: var(--spacing-4xl) var(--spacing-xl);
    background: var(--bg-light);
    position: relative;
}

.projects-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
}

.tab-btn {
    padding: 0.75rem 2rem;
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: 2px solid transparent;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-base);
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--primary-dark);
    background: var(--bg-card);
    border-color: var(--primary-dark);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.section-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    text-align: center;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: var(--spacing-3xl);
}

/* Publications & RCLCO Projects Grid */
.publications-grid,
.rclco-projects-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: var(--spacing-lg);
}

@media (min-width: 768px) {
    .publications-grid,
    .rclco-projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Publication Card */
.publication-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    border: 1px solid rgba(0, 0, 0, 0.04);
    opacity: 0;
    transform: translateY(24px);
}

.publication-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.publication-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

.publication-image-container {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.publication-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.publication-image.contain {
    object-fit: contain;
}

.publication-image-container.contain-bg {
    background: #f0f0f0;
}

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

.publication-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-white);
    text-align: center;
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, var(--primary-mid) 0%, var(--primary-dark) 100%);
}

.publication-content {
    padding: var(--spacing-lg);
}

.publication-date {
    font-size: var(--font-size-sm);
    color: var(--text-light);
    margin-bottom: var(--spacing-sm);
}

.publication-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.01em;
    line-height: 1.4;
}

.publication-description {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: var(--spacing-lg);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.publication-links {
    display: flex;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.publication-link {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--primary-dark);
    font-weight: 500;
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
}

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

.publication-link svg {
    width: 16px;
    height: 16px;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: var(--spacing-lg);
}

@media (min-width: 640px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-xl);
    }
}

/* Project Card */
.project-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    opacity: 0;
    transform: translateY(24px);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.project-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

.project-card.clickable {
    cursor: pointer;
}

/* Project Image */
.project-image-container {
    position: relative;
    height: 160px;
    overflow: hidden;
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.project-image-container.has-image {
    background: #f6f4f0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.project-image-container.has-image .project-image {
    width: auto;
    height: auto;
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
}

.project-image-container.has-image.fill-image .project-image {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

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

/* Project Image Placeholder */
.project-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-white);
    text-align: center;
    padding: var(--spacing-lg);
}

.project-image-placeholder.live {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.project-image-placeholder.showcase {
    background: linear-gradient(135deg, var(--primary-mid) 0%, var(--primary-dark) 100%);
}

/* Project Header */
.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.project-header .project-title {
    margin-bottom: 0;
}

/* Project Badge */
.project-badge {
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    flex-shrink: 0;
}

.project-badge.live {
    background: #059669;
    color: var(--text-white);
}

.project-badge.showcase {
    background: var(--primary-dark);
    color: var(--text-white);
}

/* Project Content */
.project-content {
    padding: var(--spacing-lg);
}

.project-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.project-description {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-thesis {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    line-height: 1.5;
}

.project-about {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Tech Stack */
.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-lg);
}

.tech-tag {
    padding: 0.3rem 0.6rem;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    color: var(--text-light);
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* Project Actions */
.project-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.project-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 0.65rem var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.project-btn.live {
    background: #059669;
    color: var(--text-white);
}

.project-btn.live:hover {
    background: #047857;
}

.project-btn.showcase {
    background: var(--primary-dark);
    color: var(--text-white);
}

.project-btn.showcase:hover {
    background: var(--primary-mid);
}

.project-btn svg {
    width: 14px;
    height: 14px;
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay[hidden] {
    display: none;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-2xl);
    max-width: 540px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.95) translateY(20px);
    transition: transform var(--transition-base);
    box-shadow: var(--shadow-xl);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-image-container {
    height: 200px;
    background: #f6f4f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.modal-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.modal-image.fill {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.modal-image-placeholder {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-white);
    text-align: center;
    padding: var(--spacing-lg);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-mid) 0%, var(--primary-dark) 100%);
}

.modal-close {
    position: absolute;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--bg-light);
    transition: all var(--transition-fast);
    z-index: 1;
}

.modal-close:hover {
    background: var(--border-light);
    transform: rotate(90deg);
}

.modal-close svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

.modal-content {
    padding: var(--spacing-2xl);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.modal-header .modal-title {
    margin-bottom: 0;
}

.modal-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    flex-shrink: 0;
}

.modal-badge.showcase {
    background: var(--primary-dark);
    color: var(--text-white);
}

.modal-badge.live {
    background: #059669;
    color: var(--text-white);
}

.modal-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.modal-description {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--spacing-lg);
}

.modal-tech {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-xl);
}

.modal-tech .tech-label {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    margin-right: var(--spacing-sm);
}

.modal-details h4 {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.modal-features {
    list-style: none;
    padding: 0;
}

.modal-features li {
    position: relative;
    padding-left: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.modal-features li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 6px;
    height: 6px;
    background: var(--accent-gold);
    border-radius: var(--radius-full);
}

/* ===== Footer ===== */
.footer {
    background: var(--bg-dark);
    padding: var(--spacing-3xl) var(--spacing-xl);
    text-align: center;
}

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

.footer-links {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.footer-links a {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    transition: all var(--transition-fast);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-links a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-gold);
    transform: translateY(-2px);
}

.footer-links svg {
    width: 20px;
    height: 20px;
}

.footer-text {
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: var(--spacing-sm);
}

.footer-copyright {
    font-size: var(--font-size-xs);
    color: rgba(255, 255, 255, 0.3);
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 640px) {
    .hero-content {
        padding: var(--spacing-lg);
    }

    .hero-name {
        font-size: var(--font-size-3xl);
    }

    .hero-title {
        font-size: var(--font-size-base);
    }

    .hero-bio {
        font-size: var(--font-size-base);
    }

    .profile-image {
        width: 130px;
        height: 130px;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 220px;
        justify-content: center;
    }

    .section-title {
        font-size: var(--font-size-2xl);
    }

    .projects {
        padding: var(--spacing-3xl) var(--spacing-md);
    }

    .modal-content {
        padding: var(--spacing-lg);
    }
}

/* ===== Focus States for Accessibility ===== */
.btn:focus-visible,
.project-btn:focus-visible,
.modal-close:focus-visible,
.footer-links a:focus-visible {
    outline: 2px solid var(--accent-gold);
    outline-offset: 2px;
}

.project-card:focus-within {
    box-shadow: 0 0 0 2px var(--accent-gold);
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}
