/* Modern Reset & Variables */
:root {
    --primary-color: #00c6ff;
    --secondary-color: #0072ff;
    --accent-color: #ff4b1f;
    --text-main: #2c3e50;
    --text-light: #546e7a;
    --text-light-light: #6bb2d6bf;
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.12);
    --radius: 16px;
    --font-main: 'Noto Sans SC', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Page Transitions */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

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

body {
    font-family: var(--font-main);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    padding: 15px 0;
}

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

.handbook-link {
    margin-left: 5px;
    font-size: 0.9rem;
    color: var(--text-light-light);
    text-decoration: none;
    font-weight: 500;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-nav {
    display: flex;
    gap: 20px;
}

.site-nav a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-nav a:hover, .site-nav a.active {
    color: var(--secondary-color);
    background: rgba(0, 114, 255, 0.08);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 40px 20px;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 60px 0;
    margin-bottom: 40px;
}

.hero-text h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--text-main);
}

.highlight {
    background: linear-gradient(120deg, var(--secondary-color), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-weight: 500;
}

.description {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto;
}

/* Projects Section */
.section-title {
    font-size: 2rem;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-main);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 30px;
}

.project-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 30px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    container-type: inline-size;
    container-name: card;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(0, 114, 255, 0.2);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-header h3 {
    font-size: 1.4rem;
    margin: 0;
}

.badge {
    background: rgba(0, 198, 255, 0.1);
    color: var(--secondary-color);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.card-body {
    flex: 1;
    margin-bottom: 25px;
}

.card-body p {
    color: var(--text-light);
    font-size: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(0, 114, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 114, 255, 0.4);
}

/* Placeholder Card */
.placeholder-card {
    border: 2px dashed rgba(0,0,0,0.1);
    background: transparent;
    box-shadow: none;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--text-light);
}

.placeholder-card i {
    font-size: 2rem;
    margin-bottom: 15px;
    color: rgba(0,0,0,0.2);
}

.placeholder-card:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.placeholder-card:hover i {
    color: var(--secondary-color);
}

/* Footer */
.site-footer {
    background: white;
    padding: 30px 0;
    text-align: center;
    color: var(--text-light);
    margin-top: 60px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-text h1 {
        font-size: 2.5rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .site-nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* Container Queries for Project Card */
@container card (max-width: 420px) {
    .btn-repo .btn-text {
        display: none;
    }
    .btn-repo {
        padding: 10px 12px;
    }
}

@container card (max-width: 320px) {
    .btn-store .btn-text {
        display: none;
    }
    .btn-store {
        padding: 10px 12px;
    }
}

@container card (max-width: 250px) {
    .btn-download .btn-text {
        display: none;
    }
    .btn-download {
        padding: 10px 12px;
    }
}

/* Fallback Media Query for Mobile */
@media (max-width: 420px) {
    .btn-repo .btn-text {
        display: none;
    }
    .btn-repo {
        padding: 10px 12px;
    }
}

@media (max-width: 320px) {
    .btn-store .btn-text {
        display: none;
    }
    .btn-store {
        padding: 10px 12px;
    }
}

@media (max-width: 250px) {
    .btn-download .btn-text {
        display: none;
    }
    .btn-download {
        padding: 10px 12px;
    }
}
