/* === BASE RESET & VARIABLES === */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --text-primary: #e0e0e8;
    --text-secondary: #8888a0;
    --accent-primary: #00ff88;
    --accent-secondary: #00d4ff;
    --accent-glow: rgba(0, 255, 136, 0.3);
    --error-red: #ff4444;
    --warning-yellow: #ffbb00;
    --font-mono: 'Space Mono', monospace;
    --font-sans: 'Inter', -apple-system, sans-serif;
}

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

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) var(--bg-secondary);
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 4px;
}

/* === MATRIX CANVAS === */
#matrix {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.08;
}

/* === NAVIGATION === */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    animation: slideDown 0.8s ease-out;
}

.nav-logo {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-shadow: 0 0 20px var(--accent-glow);
}

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

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--accent-glow);
}

.nav-links a:hover {
    color: var(--accent-primary);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-socials {
    display: flex;
    gap: 1rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-socials a {
    color: var(--text-secondary);
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.nav-socials a:hover {
    color: var(--accent-primary);
    text-shadow: 0 0 10px var(--accent-glow);
    transform: translateY(-2px);
}

.nav-socials a::after {
    display: none;
}

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

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

.hero-content h1 {
    font-family: var(--font-mono);
    font-size: clamp(4rem, 15vw, 12rem);
    font-weight: 700;
    color: var(--accent-primary);
    text-shadow: 
        0 0 20px var(--accent-glow),
        0 0 40px var(--accent-glow),
        0 0 80px var(--accent-glow);
    margin-bottom: 1rem;
    position: relative;
}

.hero-subtitle {
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 2px;
    min-height: 2rem;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 2rem;
    animation: fadeInUp 1s ease-out 0.3s backwards;
}

.tag {
    padding: 0.4rem 1rem;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--accent-primary);
    font-family: var(--font-mono);
    text-transform: lowercase;
    transition: all 0.3s ease;
}

.tag:hover {
    background: rgba(0, 255, 136, 0.2);
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px var(--accent-glow);
    transform: translateY(-2px);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: float 2s ease-in-out infinite, fadeInUp 1s ease-out 1s backwards;
}

.mouse {
    width: 24px;
    height: 40px;
    border: 2px solid var(--text-secondary);
    border-radius: 12px;
    position: relative;
}

.mouse::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 2px;
    animation: scroll 2s ease-in-out infinite;
}

.scroll-indicator span {
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* === GLITCH EFFECT === */
.glitch {
    position: relative;
    animation: glitchText 3s infinite;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.glitch::before {
    animation: glitchBefore 2s infinite;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
    color: var(--accent-secondary);
}

.glitch::after {
    animation: glitchAfter 2s infinite;
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
    color: var(--error-red);
}

/* === SECTIONS === */
section {
    padding: 8rem 2rem;
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-family: var(--font-mono);
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--accent-primary);
    margin-bottom: 3rem;
    text-align: center;
    text-shadow: 0 0 20px var(--accent-glow);
}

/* === ABOUT === */
.about {
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: start;
}

.about-text {
    animation: fadeInLeft 1s ease-out 0.3s backwards;
}

.about-intro {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.about-list {
    list-style: none;
    margin-bottom: 2rem;
}

.about-list li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
}

.about-list li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--accent-primary);
    font-family: var(--font-mono);
}

.highlight {
    color: var(--accent-primary);
    font-weight: 600;
}

.error-text {
    color: var(--error-red);
    font-family: var(--font-mono);
    animation: pulse 2s infinite;
}

.about-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.about-stats.animate {
    animation: fadeInRight 1s ease-out 0.5s backwards;
}

.stat {
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 30px var(--accent-glow);
    transform: translateY(-5px);
}

.stat-number {
    display: block;
    font-family: var(--font-mono);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-shadow: 0 0 10px var(--accent-glow);
    min-height: 3.5rem;
    transition: color 0.3s ease;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-height: 1.5rem;
}

@media (max-width: 480px) {
    .stat-number {
        font-size: 1.8rem;
        min-height: 2.5rem;
    }
    
    .stat-label {
        font-size: 0.65rem;
    }
    
    .stat {
        padding: 1rem;
    }
}

/* === THOUGHTS (BLOG) === */
.thoughts {
    background: var(--bg-secondary);
}

.thoughts-grid {
    display: grid;
    gap: 2rem;
}

.thought-card {
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.4s ease;
    opacity: 0;
    transform: translateY(30px);
    cursor: pointer;
}

.thought-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.thought-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.3),
        0 0 30px var(--accent-glow);
    transform: translateY(-5px) scale(1.01);
}

.thought-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.thought-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.thought-tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    background: rgba(0, 255, 136, 0.1);
    border-radius: 10px;
    color: var(--accent-primary);
    font-family: var(--font-mono);
}

.thought-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.thought-card:hover h3 {
    color: var(--accent-primary);
}

.thought-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.read-more {
    color: var(--accent-primary);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.read-more:hover {
    text-shadow: 0 0 10px var(--accent-glow);
    letter-spacing: 1px;
}

/* === PROJECTS === */
.projects {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    transform: translateY(40px) scale(0.95);
}

.project-card.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.project-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 40px var(--accent-glow);
    transform: translateY(-10px) scale(1.02);
}

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

.project-icon {
    font-size: 2rem;
    animation: bounce 2s ease-in-out infinite;
}

.project-status {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.project-status.broken {
    background: rgba(255, 68, 68, 0.2);
    color: var(--error-red);
    border: 1px solid rgba(255, 68, 68, 0.3);
}

.project-status.working {
    background: rgba(0, 255, 136, 0.2);
    color: var(--accent-primary);
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.project-card h3 {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.project-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.project-tech span {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 6px;
    color: var(--accent-secondary);
}

.project-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

/* === TERMINAL === */
.terminal-section {
    background: var(--bg-primary);
}

.terminal-window {
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.5),
        0 0 40px var(--accent-glow);
    max-width: 800px;
    margin: 0 auto;
    animation: terminalPulse 15s ease-in-out infinite;
}

@keyframes terminalPulse {
    0%, 100% { 
        box-shadow: 
            0 25px 80px rgba(0, 0, 0, 0.5),
            0 0 40px var(--accent-glow);
    }
    50% { 
        box-shadow: 
            0 25px 80px rgba(0, 0, 0, 0.5),
            0 0 40px var(--accent-glow),
            0 0 80px rgba(0, 100, 255, 0.15);
    }
}

.terminal-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.terminal-dots {
    display: flex;
    gap: 0.5rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }

.terminal-title {
    flex: 1;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.terminal-close {
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.terminal-close:hover {
    color: var(--error-red);
}

.terminal-body {
    padding: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.8;
    min-height: 300px;
    max-height: 400px;
    overflow-y: auto;
}

.terminal-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.prompt {
    color: var(--accent-primary);
}

.command {
    color: var(--text-primary);
}

.cursor {
    animation: blink 1s step-end infinite;
    color: var(--accent-primary);
}

.terminal-output {
    color: var(--text-secondary);
    padding: 0.5rem 0;
    white-space: pre-wrap;
}

.terminal-output .error {
    color: var(--error-red);
}

.terminal-output .success {
    color: var(--accent-primary);
}

.terminal-output .warning {
    color: var(--warning-yellow);
}

/* === FOOTER === */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 4rem 2rem 2rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-logo {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.footer-left p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.footer-tagline {
    font-style: italic;
    color: var(--text-secondary);
    max-width: 400px;
    font-size: 0.85rem;
    opacity: 0.8;
}

.footer-socials {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.footer-socials a {
    color: var(--text-secondary);
    font-size: 1.3rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: var(--bg-tertiary);
}

.footer-socials a:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-3px);
}

.footer-right {
    text-align: right;
}

.footer-right p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.footer-right a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-family: var(--font-mono);
}

.footer-right a:hover {
    color: var(--accent-secondary);
    text-shadow: 0 0 10px var(--accent-glow);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.hit-counter {
    font-family: var(--font-mono);
    background: var(--bg-primary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.counter {
    color: var(--accent-primary);
    font-weight: 700;
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--accent-glow);
}

/* === ANIMATIONS === */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes glitchText {
    0%, 100% { text-shadow: 0 0 20px var(--accent-glow); }
    2% { text-shadow: -2px 0 var(--error-red), 2px 0 var(--accent-secondary); }
    4% { text-shadow: 0 0 20px var(--accent-glow); }
    50% { text-shadow: 0 0 20px var(--accent-glow); }
    52% { text-shadow: 2px 0 var(--accent-secondary), -2px 0 var(--error-red); }
    54% { text-shadow: 0 0 20px var(--accent-glow); }
}

@keyframes glitchBefore {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-2px); }
    40% { transform: translateX(2px); }
    60% { transform: translateX(-1px); }
    80% { transform: translateX(1px); }
}

@keyframes glitchAfter {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(2px); }
    40% { transform: translateX(-2px); }
    60% { transform: translateX(1px); }
    80% { transform: translateX(-1px); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes type {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes glitch {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

/* === SOMBER GLOW EFFECT === */
@keyframes somberGlow {
    0%, 100% { 
        box-shadow: 
            0 10px 40px rgba(0, 0, 0, 0.3),
            0 0 30px var(--accent-glow);
    }
    50% { 
        box-shadow: 
            0 10px 40px rgba(0, 0, 0, 0.3),
            0 0 30px var(--accent-glow),
            0 0 60px rgba(0, 100, 255, 0.1);
    }
}

.thought-card:nth-child(2) {
    animation: somberGlow 8s ease-in-out infinite;
}

.thought-card:nth-child(6) {
    animation: somberGlow 10s ease-in-out infinite;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .nav {
        padding: 1rem 1.5rem;
    }
    
    .nav-links {
        display: none;
    }
    
    .nav-socials {
        display: flex;
        position: absolute;
        right: 1.5rem;
        top: 50%;
        transform: translateY(-50%);
        margin-left: 0;
        padding-left: 0;
        border-left: none;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .about-stats {
        grid-template-columns: 1fr 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-right {
        text-align: center;
    }
    
    .footer-socials {
        justify-content: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .terminal-body {
        font-size: 0.8rem;
    }
}
