/* --- RESET & VARIABLES --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

:root {
    --bg-color: #0d0d0e;
    --card-bg: rgba(18, 18, 20, 0.75);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-hover: rgba(255, 255, 255, 0.12);
    --primary-red: #a82828;
    --primary-red-glow: rgba(168, 40, 40, 0.4);
    --accent-red: #ff3b3b;
    --text-main: #f1f1f3;
    --text-muted: #8e8e93;
    --sidebar-bg: rgba(15, 15, 18, 0.85);
    --code-font: 'JetBrains Mono', monospace;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* --- BACKGROUND MATRIX EFFECT --- */
.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    background: 
        radial-gradient(circle at 10% 50%, rgba(168, 40, 40, 0.15) 0%, transparent 45%),
        radial-gradient(circle at 90% 50%, rgba(168, 40, 40, 0.15) 0%, transparent 45%);
}

.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* --- VISITOR COUNTER --- */
.visitor-counter-container {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 100;
}

.visitor-counter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--sidebar-bg);
    border: 1px solid var(--card-border);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    font-family: var(--code-font);
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.visitor-counter i {
    color: var(--primary-red);
}

/* --- NAVIGATION SIDEBAR --- */
.sidebar {
    position: fixed;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--sidebar-bg);
    border: 1px solid var(--card-border);
    border-radius: 40px;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    backdrop-filter: blur(12px);
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.nav-item {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.nav-item i {
    font-size: 1.1rem;
}

.nav-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    background: var(--primary-red);
    color: #ffffff;
    box-shadow: 0 0 15px var(--primary-red-glow);
}

.nav-item .tooltip {
    position: absolute;
    left: 60px;
    background: #1c1c1f;
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateX(-10px);
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.nav-item:hover .tooltip {
    opacity: 1;
    transform: translateX(0);
}

.nav-divider {
    width: 20px;
    height: 1px;
    background: var(--card-border);
    margin: 4px 0;
}

/* --- MAIN CONTENT CONTAINER --- */
main {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 800px;
    padding: 40px 20px;
    margin-left: 80px;
}

.section {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- HEADER & TITLES --- */
.section-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 28px;
}

/* --- CARDS --- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 28px;
    backdrop-filter: blur(10px);
    margin-bottom: 24px;
    transition: border-color 0.3s ease;
}

.card:hover {
    border-color: var(--card-hover);
}

/* --- HOME SECTION --- */
.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.profile-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.1;
}

.profile-handle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: 4px;
    font-family: var(--code-font);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(46, 213, 115, 0.1);
    border: 1px solid rgba(46, 213, 115, 0.2);
    color: #2ed573;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #2ed573;
    border-radius: 50%;
    box-shadow: 0 0 8px #2ed573;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

.bio-text {
    color: #c4c4c8;
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 24px;
}

.quick-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    padding: 10px 18px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* --- SKILLS SECTION --- */
.skills-group {
    margin-bottom: 24px;
}

.skills-group-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 14px;
    font-family: var(--code-font);
}

.badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.skill-badge i {
    font-size: 1rem;
    color: #ff5252;
}

.info-box {
    background: rgba(168, 40, 40, 0.08);
    border: 1px solid rgba(168, 40, 40, 0.25);
    border-radius: 12px;
    padding: 16px 20px;
    margin-top: 12px;
}

.info-box h4 {
    color: #ff6b6b;
    font-size: 0.95rem;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-box p {
    color: #d1d1d6;
    font-size: 0.88rem;
    line-height: 1.5;
}

/* --- PROJECTS SECTION --- */
.project-link {
    text-decoration: none;
    color: inherit;
    display: block;
    margin-bottom: 24px;
}

.project-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
                box-shadow 0.3s ease, 
                border-color 0.3s ease;
}

.project-link:hover .project-card,
.clickable-project-card:hover {
    transform: translateY(-6px);
    border-color: rgba(168, 40, 40, 0.5);
    box-shadow: 0 12px 24px rgba(168, 40, 40, 0.15), 0 0 15px rgba(168, 40, 40, 0.2);
}

.clickable-project-card {
    cursor: pointer;
    margin-bottom: 24px;
}

.project-preview {
    width: 100%;
    height: 200px;
    background: #18181b;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    font-family: var(--code-font);
    font-size: 0.9rem;
    overflow: hidden;
    position: relative;
}

.project-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.project-preview i {
    font-size: 2.5rem;
    margin-bottom: 8px;
    opacity: 0.5;
}

.project-details h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.project-details p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 16px;
}

.project-footer {
    margin-top: 4px;
    display: flex;
    justify-content: flex-start;
}

.project-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--code-font);
}

/* --- VIDEO MODAL --- */
.video-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.video-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.video-frame {
    position: relative;
    width: 90%;
    max-width: 850px;
    background: #111;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    transform: scale(0.6);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.video-modal.active .video-frame {
    transform: scale(1);
}

.video-frame video {
    width: 100%;
    display: block;
    border-radius: 14px;
    outline: none;
}

.close-btn {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-red, #ff3b3b);
    color: white;
    border: none;
    font-size: 22px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease, background 0.2s ease;
    z-index: 10;
}

.close-btn:hover {
    transform: scale(1.15) rotate(90deg);
    background: #d62828;
}

/* --- CONTACTS SECTION --- */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.contact-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 20px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.2s ease;
}

.contact-card:hover {
    border-color: var(--card-hover);
    transform: translateY(-2px);
}

.contact-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: var(--code-font);
}

.contact-card-value {
    font-size: 1.05rem;
    font-weight: 600;
}

.contact-card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.time-widget {
    margin-top: 24px;
    text-align: center;
    font-family: var(--code-font);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.time-box {
    display: inline-block;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 6px;
    color: var(--text-main);
    font-weight: 600;
}

/* Badge Hider */
iframe[id^="netlify-alumni-badge"], 
a[href*="netlify.com/wt-ref"] {
    display: none !important;
}

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 768px) {
    body {
        align-items: flex-start;
    }

    .sidebar {
        top: auto;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        flex-direction: row;
        border-radius: 30px;
        padding: 10px 16px;
    }

    .visitor-counter-container {
        top: 20px;
        right: 20px;
    }

    .nav-item .tooltip {
        display: none;
    }

    .nav-divider {
        width: 1px;
        height: 20px;
        margin: 0 4px;
    }

    main {
        margin-left: 0;
        padding: 20px 16px 100px 16px;
    }

    .profile-header {
        flex-direction: column;
        gap: 12px;
    }
}