@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

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

:root {
    --bg: #000000;
    --fg: #ffffff;
    --gray: #808080;
    --gray-dark: #404040;
    --gray-light: #c0c0c0;
    --accent: #00ff00;
}

/* Prevent FOUC */
.designation,
.title-line,
.status-bar span:last-child,
.section-header h2 {
    opacity: 0;
}

body {
    background: var(--bg);
    color: var(--fg);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    line-height: 1.4;
    overflow-x: hidden;
    position: relative;
}

.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    pointer-events: none;
    z-index: 1;
}

.vertical-text {
    position: fixed;
    right: 20px;
    bottom: 150px;
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    color: var(--gray);
    font-weight: 400;
    z-index: 50;
    pointer-events: none;
    white-space: nowrap;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
}

.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    z-index: 200;
    background: rgba(0,0,0,0.95);
    border-bottom: 1px solid var(--gray-dark);
    backdrop-filter: blur(10px);
}

.nav-line {
    width: 60px;
    height: 1px;
    background: var(--fg);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.audio-player {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    max-width: 400px;
    min-width: 0;
}

.audio-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--gray);
    color: var(--fg);
    font-size: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', sans-serif;
}

.audio-btn:hover {
    border-color: var(--fg);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.audio-btn.playing {
    border-color: var(--fg);
}

.audio-progress {
    flex: 1;
    height: 2px;
    background: var(--gray-dark);
    cursor: pointer;
    position: relative;
    border-radius: 1px;
    overflow: hidden;
}

.audio-progress-bar {
    height: 100%;
    background: var(--fg);
    width: 0%;
    transition: width 0.1s linear;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.coordinates {
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: var(--gray);
    font-weight: 400;
    white-space: nowrap;
    flex-shrink: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 100px 40px 40px;
    position: relative;
    z-index: 1;
}

.hero {
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-bottom: 1px solid var(--gray-dark);
    margin-bottom: 40px;
    position: relative;
}

.designation {
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    color: var(--gray);
    margin-bottom: 20px;
    font-weight: 400;
}

.main-title {
    font-size: clamp(4rem, 12vw, 10rem);
    font-weight: 600;
    line-height: 0.85;
    letter-spacing: 0.05em;
    margin-bottom: 40px;
}

.title-line {
    display: block;
}

.cursor {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: var(--gray-light);
    font-weight: 400;
}

.status-indicator {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 10px var(--accent);
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.3;
        transform: scale(0.9);
    }
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1px;
    background: var(--gray-dark);
    border: 1px solid var(--gray-dark);
    margin-bottom: 80px;
}

.info-cell {
    background: var(--bg);
    padding: 25px;
    transition: all 0.3s ease;
}

.info-cell:hover {
    background: #0f0f0f;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.03);
}

.cell-label {
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: var(--gray);
    margin-bottom: 10px;
    font-weight: 400;
}

.cell-value {
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    font-weight: 400;
}

.projects-section {
    margin-bottom: 80px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 0.8rem;
    letter-spacing: 0.3em;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.header-line {
    flex: 1;
    height: 1px;
    background: var(--gray-dark);
}

.repos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    background: transparent;
}

.loading {
    grid-column: 1 / -1;
    padding: 50px;
    text-align: center;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: var(--gray);
    border: 1px solid var(--gray-dark);
    background: var(--bg);
}

.repo-card {
    background: var(--bg);
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: var(--fg);
    border: 1px solid var(--gray-dark);
    position: relative;
    overflow: hidden;
    margin-right: -1px;
    margin-bottom: -1px;
}

.repo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.repo-card:hover {
    background: #f5f5f5;
    color: #1a1a1a;
    border-color: #e0e0e0;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.15), inset 0 0 20px rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.repo-card:hover::before {
    opacity: 1;
}

.repo-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.repo-name {
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    word-break: break-word;
    hyphens: auto;
    overflow-wrap: break-word;
    transition: all 0.3s ease;
}

.repo-card:hover .repo-name {
    color: #1a1a1a;
}

.repo-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

.repo-language {
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    padding: 4px 8px;
    border: 1px solid var(--gray-dark);
    font-weight: 400;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.repo-card:hover .repo-language {
    border-color: currentColor;
    font-weight: 500;
}

.lang-shell, .lang-bash { color: #4EAA25; }
.lang-python { color: #4B8BBE; }
.lang-javascript { color: #E8D44D; }
.lang-typescript { color: #3178C6; }
.lang-c { color: #A8B9CC; }
.lang-cpp { color: #F34B7D; }
.lang-go { color: #00ADD8; }
.lang-rust { color: #F74C00; }
.lang-perl { color: #39457E; }
.lang-ruby { color: #CC342D; }
.lang-php { color: #777BB4; }
.lang-java { color: #F89820; }
.lang-swift { color: #FA7343; }
.lang-kotlin { color: #B125EA; }
.lang-makefile { color: #6D8600; }
.lang-dockerfile { color: #2496ED; }
.lang-html { color: #E34C26; }
.lang-css { color: #1572B6; }

.repo-card:hover .lang-shell,
.repo-card:hover .lang-bash { color: #4EAA25; background: rgba(78, 170, 37, 0.15); }
.repo-card:hover .lang-python { color: #4B8BBE; background: rgba(75, 139, 190, 0.15); }
.repo-card:hover .lang-javascript { color: #C5A429; background: rgba(232, 212, 77, 0.15); }
.repo-card:hover .lang-typescript { color: #3178C6; background: rgba(49, 120, 198, 0.15); }
.repo-card:hover .lang-c { color: #A8B9CC; background: rgba(168, 185, 204, 0.15); }
.repo-card:hover .lang-cpp { color: #F34B7D; background: rgba(243, 75, 125, 0.15); }
.repo-card:hover .lang-go { color: #00ADD8; background: rgba(0, 173, 216, 0.15); }
.repo-card:hover .lang-rust { color: #F74C00; background: rgba(247, 76, 0, 0.15); }
.repo-card:hover .lang-perl { color: #39457E; background: rgba(57, 69, 126, 0.15); }
.repo-card:hover .lang-ruby { color: #CC342D; background: rgba(204, 52, 45, 0.15); }
.repo-card:hover .lang-php { color: #777BB4; background: rgba(119, 123, 180, 0.15); }
.repo-card:hover .lang-java { color: #F89820; background: rgba(248, 152, 32, 0.15); }
.repo-card:hover .lang-swift { color: #FA7343; background: rgba(250, 115, 67, 0.15); }
.repo-card:hover .lang-kotlin { color: #B125EA; background: rgba(177, 37, 234, 0.15); }
.repo-card:hover .lang-makefile { color: #6D8600; background: rgba(109, 134, 0, 0.15); }
.repo-card:hover .lang-dockerfile { color: #2496ED; background: rgba(36, 150, 237, 0.15); }
.repo-card:hover .lang-html { color: #E34C26; background: rgba(227, 76, 38, 0.15); }
.repo-card:hover .lang-css { color: #1572B6; background: rgba(21, 114, 182, 0.15); }

.commit-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.commit-recent { 
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent);
}
.commit-moderate { background: var(--gray); }
.commit-old { background: var(--gray-dark); }

.repo-card:hover .commit-dot {
    transform: scale(1.3);
}

.repo-card:hover .commit-recent {
    background: #1a1a1a;
    box-shadow: 0 0 6px #1a1a1a;
}

.repo-card:hover .commit-moderate {
    background: #505050;
}

.repo-card:hover .commit-old {
    background: #808080;
}

.repo-description {
    font-size: 0.85rem;
    color: var(--gray-light);
    line-height: 1.5;
    flex-grow: 1;
    transition: all 0.3s ease;
}

.repo-card:hover .repo-description {
    color: #505050;
}

.repo-stats {
    display: flex;
    gap: 20px;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: var(--gray);
    font-weight: 400;
    transition: all 0.3s ease;
    margin-top: auto;
    padding-top: 5px;
}

.repo-stats .star-icon {
    color: #FFD700;
}

.repo-stats .fork-icon {
    color: #A8B9CC;
}

.repo-card:hover .repo-stats {
    color: #606060;
}

.repo-card:hover .repo-stats .star-icon {
    color: #FFD700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.repo-card:hover .repo-stats .fork-icon {
    color: #A8B9CC;
}

.contact-section {
    margin-bottom: 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1px;
    background: var(--gray-dark);
    border: 1px solid var(--gray-dark);
}

.contact-link {
    background: var(--bg);
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-decoration: none;
    color: var(--fg);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.contact-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.contact-link:hover {
    background: #0f0f0f;
    box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.05);
}

.contact-link:hover::before {
    opacity: 1;
}

.contact-link:hover .contact-value {
    color: #ffffff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.contact-label {
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: var(--gray);
    font-weight: 400;
}

.contact-value {
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    font-weight: 400;
    transition: all 0.3s ease;
}

.footer {
    border-top: 1px solid var(--gray-dark);
    padding: 30px 40px;
    margin-top: 80px;
}

.footer-line {
    width: 60px;
    height: 1px;
    background: var(--gray-dark);
    margin-bottom: 20px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: var(--gray);
    font-weight: 400;
}

.particle {
    position: fixed;
    width: 3px;
    height: 3px;
    background: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.1;
    z-index: 0;
    will-change: transform, opacity;
    transform: translateZ(0);
}

.repo-card,
.contact-link,
.info-cell {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.title-line,
.section-header h2,
.status-bar span {
    will-change: opacity;
    transform: translateZ(0);
}

.repo-card:not(:hover),
.contact-link:not(:hover),
.info-cell:not(:hover) {
    will-change: auto;
}

.info-grid,
.section-header,
.repos-grid,
.contact-section,
.footer {
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.info-grid.show,
.section-header.show,
.repos-grid.show,
.contact-section.show,
.footer.show {
    opacity: 1;
}

@media (max-width: 1024px) {
    .repos-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .vertical-text {
        right: 15px;
        bottom: 130px;
        font-size: 0.7rem;
    }
    
    .audio-player {
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 80px 20px 20px;
    }
    
    .top-nav {
        padding: 15px 20px;
        gap: 15px;
    }
    
    .nav-line {
        width: 40px;
    }
    
    .audio-player {
        flex: 1;
        max-width: none;
        min-width: 120px;
    }
    
    .coordinates {
        font-size: 0.65rem;
    }
    
    .vertical-text {
        display: none;
    }
    
    .info-grid,
    .repos-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .main-title {
        font-size: 3rem;
    }
    
    .hero {
        min-height: 40vh;
        margin-bottom: 40px;
    }
    
    .projects-section {
        margin-bottom: 60px;
    }
    
    .footer {
        padding: 20px;
        margin-top: 60px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

@media (min-width: 769px) and (max-width: 1400px) {
    .vertical-text {
        right: 15px;
        bottom: 140px;
    }
}

@media (min-height: 900px) {
    .vertical-text {
        bottom: 170px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .particle {
        display: none;
    }
}