/* ===== CSS Variables & Base Styles ===== */
:root {
    /* Light Theme */
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --accent: #0066ff;
    --accent-hover: #0052cc;
    --border: #e5e5e5;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
    
    /* Bento Colors */
    --cluedo-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --weather-bg: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --recipe-bg: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --tarot-bg: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
    --game-bg: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    --about-bg: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

[data-theme="dark"] {
    /* Dark Theme */
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --border: #2a2a2a;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.5);
    
    /* Bento Colors - Darker versions */
    --cluedo-bg: linear-gradient(135deg, #4c1d95 0%, #581c87 100%);
    --weather-bg: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    --recipe-bg: linear-gradient(135deg, #ec4899 0%, #f59e0b 100%);
    --tarot-bg: linear-gradient(135deg, #0891b2 0%, #1e1b4b 100%);
    --game-bg: linear-gradient(135deg, #2dd4bf 0%, #db2777 100%);
    --about-bg: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
}

/* ===== Navigation ===== */
.navbar {
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-links a:hover::after {
    width: 100%;
}

.theme-toggle {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    padding: 0.5rem 0.75rem;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    border-color: var(--accent);
}

.theme-toggle i {
    font-size: 0.9rem;
    transition: opacity 0.3s ease;
}

[data-theme="light"] .theme-toggle .fa-sun {
    opacity: 0.3;

}

[data-theme="dark"] .theme-toggle .fa-moon {
    opacity: 0.3;
    color: #fbbf24;
}

[data-theme="dark"] .theme-toggle .fa-sun {
    opacity: 0.2;
    color: #c3c3c3;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ===== Hero Section ===== */
.hero {
    max-width: 1400px;
    margin: 0 auto;
    padding: 6rem 2rem 4rem;
    text-align: center;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-weight: 300;
}

.hero-tags {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-tags span {
    background: var(--bg-secondary);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-tags i {
    color: var(--accent);
}

/* ===== Bento Grid ===== */
.bento-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 3rem;
    text-align: center;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    grid-auto-flow: dense;
}

/* Bento Item Base */
.bento-item {
    background: var(--bg-secondary);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease, border-color 0.3s ease;
    position: relative;
    border: 1px solid var(--border);
}

.bento-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

/* Featured Items - Large */
.bento-item.featured {
    grid-column: span 2;
    grid-row: span 2;
    min-height: 450px;
}

/* Medium Items */
.bento-item.medium {
    grid-column: span 2;
    min-height: 300px;
}

/* Small Items */
.bento-item.small {
    min-height: 250px;
}

/* Bento Content */
.bento-content {
    padding: 2rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

/* Featured Project Backgrounds */
.bento-item.cluedo .bento-content {
    background: var(--cluedo-bg);
}

.bento-item.weather .bento-content {
    background: var(--weather-bg);
}

.bento-item.recipe .bento-content {
    background: var(--recipe-bg);
}

.bento-item.tarot .bento-content {
    background: var(--tarot-bg);
}

.bento-item.tictactoe .bento-content,
.bento-item.dice .bento-content,
.bento-item.tennis .bento-content,
.bento-item.madlib .bento-content,
.bento-item.magic8 .bento-content {
    background: var(--game-bg);
}

.bento-item.about-card .bento-content {
    background: var(--about-bg);
}

.bento-item.more-projects .bento-content {
    background: var(--bg-secondary);
    border: 2px dashed var(--border);
}

/* Badge */
.bento-badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Project Info */
.project-info {
    color: white;
}

.project-info h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.project-info h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.project-info p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    opacity: 0.95;
}

.project-info.compact {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 0.75rem;
}

.project-info.compact.center {
    color: var(--text-primary);
}

.project-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

/* Tech Stack */
.tech-stack {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.tech-stack span {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 0.4rem 0.9rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Project Links */
.project-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-primary,
.btn-secondary,
.btn-small {
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: white;
    color: #1a1a1a;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-small {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
}

.btn-small:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.view-all-btn {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-all-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* About Card */
.about-content {
    text-align: center;
    color: white;
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    overflow: hidden;
    border: 4px solid rgba(255, 255, 255, 0.3);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-content h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.about-content p {
    opacity: 0.95;
    margin-bottom: 2rem;
    line-height: 1.7;
}

.about-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat strong {
    font-size: 2rem;
    font-weight: 700;
}

.stat span {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* ===== Contact Section ===== */
.contact-section {
    background: var(--bg-secondary);
    padding: 6rem 2rem;
    text-align: center;
    border-top: 1px solid var(--border);
}

.contact-container h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.contact-container p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.contact-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.contact-btn {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 1rem 2rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    font-size: 1rem;
    cursor: pointer;
}

.contact-btn:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent);
}

.contact-btn i {
    font-size: 1.2rem;
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--bg-secondary);
    margin: 5% auto;
    padding: 3rem;
    border-radius: 24px;
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.close-modal {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 2rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-modal:hover {
    color: var(--text-primary);
    background: var(--bg-primary);
}

.modal-content h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
}

.projects-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.project-category-list h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

.project-category-list ul {
    list-style: none;
}

.project-category-list li {
    margin-bottom: 0.75rem;
}

.project-category-list a {
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.project-category-list a::before {
    content: '→';
    color: var(--accent);
    font-weight: bold;
}

.project-category-list a:hover {
    background: var(--bg-primary);
    padding-left: 1rem;
}

/* ===== Footer ===== */
footer {
    background: var(--bg-secondary);
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    .bento-item.featured {
        grid-column: span 1;
        grid-row: span 1;
        min-height: 350px;
    }
    
    .bento-item.medium {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .hero {
        padding: 4rem 1.5rem 3rem;
    }
    
    .bento-section {
        padding: 3rem 1.5rem;
    }
    
    .bento-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .bento-item.featured,
    .bento-item.medium,
    .bento-item.small {
        grid-column: span 1;
        min-height: 300px;
    }
    
    .modal-content {
        margin: 10% 1rem;
        padding: 2rem 1.5rem;
        max-height: 85vh;
    }
    
    .projects-list {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

[data-aos] {
    opacity: 1;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-aos].aos-animate {
    opacity: 1;
}
