/* ===========================
   CSS Variables & Reset
   =========================== */
:root {
    --bg-primary: #0a0e27;
    --bg-secondary: #151932;
    --bg-card: #1a1f3a;
    --bg-card-hover: #1f2442;

    --text-primary: #e8eaf6;
    --text-secondary: #9fa8da;
    --text-muted: #5c6bc0;

    --accent-primary: #00e676;
    --accent-secondary: #00bfa5;
    --accent-tertiary: #7c4dff;
    --accent-warn: #ff4081;

    --font-mono: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(0, 230, 118, 0.3);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: linear-gradient(135deg, var(--bg-primary) 0%, #0d1129 50%, var(--bg-primary) 100%);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 230, 118, 0.03) 2px, rgba(0, 230, 118, 0.03) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(124, 77, 255, 0.03) 2px, rgba(124, 77, 255, 0.03) 4px);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

/* ===========================
   Hero Section
   =========================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 2rem 0;
}

.hero-content {
    text-align: center;
    animation: fadeInUp 0.8s ease-out;
}

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

/* Glitch Effect */
.glitch-wrapper {
    position: relative;
    display: inline-block;
}

.hero-title {
    font-family: var(--font-mono);
    font-size: clamp(3rem, 10vw, 6rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 50%, var(--accent-tertiary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    position: relative;
    letter-spacing: -0.02em;
    filter: drop-shadow(0 0 10px rgba(0, 230, 118, 0.5));
}


.hero-subtitle {
    font-family: var(--font-mono);
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.hero-description {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    line-height: 1.8;
}

.accent {
    color: var(--accent-primary);
    font-family: var(--font-mono);
    font-size: 0.9em;
    font-weight: 600;
}

/* Social Links */
.social-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 2rem;
}

.social-link {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.social-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 230, 118, 0.2);
    transition: var(--transition);
    transform: translate(-50%, -50%);
}

.social-link:hover::before {
    width: 146%;
    height: 146%;
}

.social-link:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.scroll-indicator span {
    display: block;
    width: 24px;
    height: 40px;
    border: 2px solid var(--accent-primary);
    border-radius: 12px;
    position: relative;
}

.scroll-indicator span::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    width: 4px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 2px;
    transform: translateX(-50%);
    animation: scroll 1.5s infinite;
}

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

@keyframes scroll {
    0% { top: 8px; opacity: 1; }
    100% { top: 24px; opacity: 0; }
}

/* ===========================
   Projects Section
   =========================== */
.projects {
    padding: 6rem 0;
    position: relative;
}

.section-title {
    font-family: var(--font-mono);
    font-size: clamp(2rem, 5vw, 3rem);
    text-align: center;
    margin-bottom: 4rem;
    color: var(--text-primary);
}

.title-bracket {
    color: var(--accent-primary);
    font-weight: 700;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-tertiary));
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition);
}

.project-card:hover::before {
    transform: scaleX(1);
}

.project-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.project-card.featured {
    grid-column: span 1;
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(124, 77, 255, 0.1) 100%);
}

.project-card.repo-card {
    position: relative;
}

.project-card.repo-card::after {
    content: '';
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 128px;
    height: 128px;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='%239fa8da' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 2C6.477 2 2 6.477 2 12c0 4.42 2.865 8.17 6.839 9.49.5.092.682-.217.682-.482 0-.237-.008-.866-.013-1.7-2.782.603-3.369-1.34-3.369-1.34-.454-1.156-1.11-1.463-1.11-1.463-.908-.62.069-.608.069-.608 1.003.07 1.531 1.03 1.531 1.03.892 1.529 2.341 1.087 2.91.831.092-.646.35-1.086.636-1.336-2.22-.253-4.555-1.11-4.555-4.943 0-1.091.39-1.984 1.029-2.683-.103-.253-.446-1.27.098-2.647 0 0 .84-.269 2.75 1.025A9.578 9.578 0 0112 6.836c.85.004 1.705.114 2.504.336 1.909-1.294 2.747-1.025 2.747-1.025.546 1.377.203 2.394.1 2.647.64.699 1.028 1.592 1.028 2.683 0 3.842-2.339 4.687-4.566 4.935.359.309.678.919.678 1.852 0 1.336-.012 2.415-.012 2.743 0 .267.18.578.688.48C19.138 20.167 22 16.418 22 12c0-5.523-4.477-10-10-10z'/%3E%3C/svg%3E");
    opacity: 0.1;
}

.project-card.legacy-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(191, 165, 110, 0.33) 100%);
    border-color: rgba(0, 191, 165, 0.3);
}

.project-card.legacy-card::before {
    background: linear-gradient(90deg, var(--accent-secondary), var(--accent-primary));
}

.project-card.legacy-card:hover {
    border-color: var(--accent-secondary);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.project-title {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 600;
    flex: 1;
}

.project-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    background: rgba(0, 230, 118, 0.15);
    color: var(--accent-primary);
    border-radius: 6px;
    border: 1px solid rgba(0, 230, 118, 0.3);
    white-space: nowrap;
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
    flex-grow: 1;
}

.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.project-link {
    font-family: var(--font-mono);
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    position: relative;
}

.project-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    transition: var(--transition);
}

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

.project-tech {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===========================
   Folders Section
   =========================== */
.folders-section {
    margin-top: 4rem;
    padding-top: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.folders-title {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    text-align: center;
}

.folders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.folder-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    transition: var(--transition);
    text-align: center;
}

.folder-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-secondary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.folder-icon {
    font-size: 2rem;
    filter: grayscale(0.3);
    transition: var(--transition);
}

.folder-card:hover .folder-icon {
    filter: grayscale(0);
    transform: scale(1.1);
}

.folder-name {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.folder-card:hover .folder-name {
    color: var(--accent-secondary);
}

/* ===========================
   Footer
   =========================== */
.footer {
    padding: 3rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 4rem;
}

.footer-text {
    font-family: var(--font-mono);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.code-symbol {
    color: var(--accent-primary);
    font-weight: 700;
}

.separator {
    margin: 0 0.75rem;
    color: var(--accent-tertiary);
}

.timezone {
    color: var(--accent-secondary);
}

.footer-subtext {
    font-family: var(--font-mono);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    opacity: 0.7;
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .project-card.featured {
        grid-column: span 1;
    }

    .folders-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .hero {
        min-height: 90vh;
    }

    .scroll-indicator {
        display: none;
    }
}

@media (max-width: 480px) {
    .project-footer {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .folders-grid {
        grid-template-columns: 1fr;
    }
}

/* ===========================
   Card entry animation
   =========================== */
@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-enter {
    animation: cardFadeIn 0.6s ease var(--anim-delay, 0s) both;
}

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

/* Selection */
::selection {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 6px;
    border: 3px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}
