/* ===== CSS RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Matrix Green Palette */
    --matrix-green: #00ff41;
    --matrix-dark-green: #008f11;
    --matrix-glow: rgba(0, 255, 65, 0.5);

    /* Dark Background */
    --bg-primary: #0a0e27;
    --bg-secondary: #0f1419;
    --bg-card: #1a1f35;

    /* Accent Colors */
    --accent-cyan: #00d9ff;
    --accent-purple: #b800ff;
    --accent-red: #ff0055;

    /* Text */
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --text-glow: rgba(0, 255, 65, 0.8);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;

    /* Typography */
    --font-mono: 'Courier New', monospace;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

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

/* ===== CANVAS BACKGROUNDS ===== */
#matrix-canvas, #particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

#matrix-canvas {
    opacity: 0.15;
}

#particle-canvas {
    opacity: 0.4;
    z-index: 1;
}

/* ===== SKIP LINK ===== */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--matrix-green);
    color: var(--bg-primary);
    padding: 0.5rem 1rem;
    text-decoration: none;
    z-index: 10000;
    font-weight: bold;
}

.skip-link:focus {
    top: 0;
}

/* ===== NAVIGATION ===== */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 14, 39, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--matrix-green);
    box-shadow: 0 0 20px var(--matrix-glow);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: bold;
    font-family: var(--font-mono);
    color: var(--matrix-green);
    text-decoration: none;
    text-shadow: 0 0 10px var(--matrix-glow);
}

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

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--matrix-green);
    transition: width 0.3s ease;
    box-shadow: 0 0 5px var(--matrix-glow);
}

.nav-link:hover {
    color: var(--matrix-green);
}

.nav-link:hover::after,
.nav-link:focus::after {
    width: 100%;
}

/* ===== GLITCH EFFECT ===== */
.glitch, .glitch-title {
    position: relative;
    display: inline-block;
}

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

.glitch::before, .glitch-title::before {
    left: 2px;
    text-shadow: -2px 0 var(--accent-red);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after, .glitch-title::after {
    left: -2px;
    text-shadow: -2px 0 var(--accent-cyan);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(31px, 9999px, 94px, 0); }
    20% { clip: rect(70px, 9999px, 71px, 0); }
    40% { clip: rect(10px, 9999px, 20px, 0); }
    60% { clip: rect(85px, 9999px, 40px, 0); }
    80% { clip: rect(50px, 9999px, 90px, 0); }
    100% { clip: rect(60px, 9999px, 15px, 0); }
}

@keyframes glitch-anim2 {
    0% { clip: rect(65px, 9999px, 119px, 0); }
    20% { clip: rect(90px, 9999px, 60px, 0); }
    40% { clip: rect(15px, 9999px, 80px, 0); }
    60% { clip: rect(25px, 9999px, 95px, 0); }
    80% { clip: rect(45px, 9999px, 30px, 0); }
    100% { clip: rect(55px, 9999px, 70px, 0); }
}

/* ===== HERO SECTION ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8rem 2rem 4rem;
    position: relative;
    z-index: 2;
    gap: 4rem;
}

.hero-content {
    flex: 1;
    max-width: 800px;
    animation: fadeInUp 1s ease-out;
}

.terminal-window {
    background: rgba(15, 20, 25, 0.8);
    border: 1px solid var(--matrix-green);
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 0 30px var(--matrix-glow);
    backdrop-filter: blur(5px);
}

.terminal-header {
    background: rgba(26, 31, 53, 0.9);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--matrix-green);
}

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

.terminal-dot.red { background: var(--accent-red); box-shadow: 0 0 5px var(--accent-red); }
.terminal-dot.yellow { background: #ffaa00; box-shadow: 0 0 5px #ffaa00; }
.terminal-dot.green { background: var(--matrix-green); box-shadow: 0 0 5px var(--matrix-green); }

.terminal-title {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-left: auto;
}

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

.terminal-line {
    margin-bottom: 0.5rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.terminal-line.output {
    color: var(--text-primary);
    padding-left: 0;
}

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

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

.terminal-line.info {
    color: var(--accent-cyan);
}

.prompt {
    color: var(--matrix-green);
    margin-right: 0.5rem;
    user-select: none;
}

.terminal-input-line {
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
}

#terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    caret-color: var(--matrix-green);
}

#terminal-input::selection {
    background: var(--matrix-green);
    color: var(--bg-primary);
}

#terminal-output {
    margin-bottom: 1rem;
}

#terminal-output:empty {
    margin-bottom: 0;
}

/* Custom scrollbar for terminal */
.terminal-body::-webkit-scrollbar {
    width: 8px;
}

.terminal-body::-webkit-scrollbar-track {
    background: rgba(0, 255, 65, 0.05);
    border-radius: 4px;
}

.terminal-body::-webkit-scrollbar-thumb {
    background: var(--matrix-green);
    border-radius: 4px;
    box-shadow: 0 0 5px var(--matrix-glow);
}

.terminal-body::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
}

.cursor {
    color: var(--matrix-green);
    animation: blink 1s infinite;
}

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

.hero-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 900;
    font-family: var(--font-mono);
    color: var(--matrix-green);
    text-shadow: 0 0 20px var(--text-glow);
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
}

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

.bracket {
    color: var(--accent-cyan);
    font-weight: bold;
}

.separator {
    color: var(--accent-purple);
    margin: 0 0.5rem;
}

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

.hero-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

.scan-line {
    position: relative;
    padding-left: 1rem;
    border-left: 3px solid var(--matrix-green);
    animation: scanPulse 2s infinite;
}

@keyframes scanPulse {
    0%, 100% { border-color: var(--matrix-green); box-shadow: 0 0 10px var(--matrix-glow); }
    50% { border-color: var(--accent-cyan); box-shadow: 0 0 20px var(--accent-cyan); }
}

.cta-buttons {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.btn {
    position: relative;
    padding: 1rem 2rem;
    font-family: var(--font-mono);
    font-size: 1rem;
    text-decoration: none;
    border: 2px solid;
    background: transparent;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-primary {
    border-color: var(--matrix-green);
    color: var(--matrix-green);
}

.btn-primary:hover {
    background: var(--matrix-green);
    color: var(--bg-primary);
    box-shadow: 0 0 30px var(--matrix-glow);
    transform: translateY(-2px);
}

.btn-secondary {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.btn-secondary:hover {
    background: var(--accent-cyan);
    color: var(--bg-primary);
    box-shadow: 0 0 30px var(--accent-cyan);
    transform: translateY(-2px);
}

.btn-text {
    position: relative;
    z-index: 2;
}

.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 4rem;
    opacity: 0.6;
    animation: float 3s ease-in-out infinite;
}

.scroll-text {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    color: var(--matrix-green);
}

.scroll-arrow {
    width: 2px;
    height: 30px;
    background: linear-gradient(to bottom, var(--matrix-green), transparent);
    position: relative;
}

.scroll-arrow::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 8px solid var(--matrix-green);
}

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

/* ===== HOLOGRAM ===== */
.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.hologram-container {
    position: relative;
    width: 400px;
    height: 400px;
    animation: floatSlow 6s ease-in-out infinite;
}

.hologram-ring {
    position: absolute;
    border: 2px solid var(--matrix-green);
    border-radius: 50%;
    animation: rotate 10s linear infinite;
}

.ring-1 {
    top: 10%;
    left: 10%;
    width: 80%;
    height: 80%;
    opacity: 0.3;
    box-shadow: 0 0 20px var(--matrix-glow);
}

.ring-2 {
    top: 20%;
    left: 20%;
    width: 60%;
    height: 60%;
    opacity: 0.5;
    animation-duration: 8s;
    animation-direction: reverse;
    box-shadow: 0 0 30px var(--matrix-glow);
}

.ring-3 {
    top: 30%;
    left: 30%;
    width: 40%;
    height: 40%;
    opacity: 0.7;
    animation-duration: 6s;
    box-shadow: 0 0 40px var(--matrix-glow);
}

.hologram-core {
    position: absolute;
    top: 40%;
    left: 40%;
    width: 20%;
    height: 20%;
    background: radial-gradient(circle, var(--matrix-green) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 50px var(--matrix-glow);
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

@keyframes floatSlow {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

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

/* ===== SECTIONS ===== */
.section {
    padding: var(--spacing-xl) 2rem;
    position: relative;
    z-index: 2;
}

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

.section-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-family: var(--font-mono);
    color: var(--matrix-green);
    margin-bottom: var(--spacing-lg);
    position: relative;
    display: inline-block;
    text-shadow: 0 0 20px var(--text-glow);
}

.section-number {
    font-size: 1.5rem;
    color: var(--accent-cyan);
    margin-right: 1rem;
    opacity: 0.7;
}

/* ===== ABOUT SECTION ===== */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.about-card {
    position: relative;
    perspective: 1000px;
}

.card-inner {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--matrix-green);
    padding: 2.5rem;
    border-radius: 10px;
    transition: all 0.5s ease;
    overflow: hidden;
}

.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--matrix-glow) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.card-inner:hover .card-glow {
    opacity: 0.2;
}

.card-inner:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 255, 65, 0.3);
    border-color: var(--accent-cyan);
}

.icon-container {
    width: 60px;
    height: 60px;
    margin-bottom: 1.5rem;
}

.icon {
    width: 100%;
    height: 100%;
    color: var(--matrix-green);
    filter: drop-shadow(0 0 10px var(--matrix-glow));
}

.card-title {
    font-size: 1.5rem;
    font-family: var(--font-mono);
    color: var(--matrix-green);
    margin-bottom: 1rem;
}

.card-text {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ===== SKILLS SECTION ===== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
}

.skill-category {
    background: var(--bg-card);
    border: 1px solid var(--matrix-green);
    padding: 2.5rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.category-title {
    font-size: 1.8rem;
    font-family: var(--font-mono);
    color: var(--matrix-green);
    margin-bottom: 2rem;
    text-align: center;
}

.title-bracket {
    color: var(--accent-cyan);
}

.skill-bars {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.skill-item {
    animation: fadeInUp 0.6s ease-out backwards;
}

.skill-item:nth-child(1) { animation-delay: 0.1s; }
.skill-item:nth-child(2) { animation-delay: 0.2s; }
.skill-item:nth-child(3) { animation-delay: 0.3s; }

.skill-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.skill-name {
    font-family: var(--font-mono);
    color: var(--text-primary);
    font-size: 1rem;
}

.skill-level {
    font-family: var(--font-mono);
    color: var(--matrix-green);
    font-size: 0.9rem;
}

.skill-bar {
    height: 8px;
    background: rgba(0, 255, 65, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--matrix-dark-green), var(--matrix-green));
    width: 0;
    transition: width 1.5s ease-out;
    box-shadow: 0 0 10px var(--matrix-glow);
    position: relative;
}

.skill-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===== INTERESTS SECTION ===== */
.interests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.interest-card {
    background: var(--bg-card);
    border: 1px solid rgba(0, 255, 65, 0.3);
    padding: 2.5rem 2rem;
    border-radius: 10px;
    text-align: center;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.interest-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 65, 0.1), transparent);
    transition: left 0.6s ease;
}

.interest-card:hover::before {
    left: 100%;
}

.interest-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--matrix-green);
    box-shadow: 0 20px 40px rgba(0, 255, 65, 0.2);
}

.interest-icon {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
}

.hexagon {
    width: 80px;
    height: 80px;
    background: var(--bg-secondary);
    border: 2px solid var(--matrix-green);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease;
    box-shadow: 0 0 20px var(--matrix-glow);
}

.interest-card:hover .hexagon {
    transform: rotate(180deg);
    box-shadow: 0 0 40px var(--matrix-glow);
}

.hex-text {
    font-size: 1.5rem;
    color: var(--matrix-green);
    font-weight: bold;
    font-family: var(--font-mono);
}

.interest-title {
    font-size: 1.3rem;
    font-family: var(--font-mono);
    color: var(--matrix-green);
    margin-bottom: 1rem;
}

.interest-description {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* ===== CONTACT SECTION ===== */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.contact-terminal {
    background: rgba(15, 20, 25, 0.8);
    border: 1px solid var(--matrix-green);
    border-radius: 8px;
    box-shadow: 0 0 30px var(--matrix-glow);
    backdrop-filter: blur(5px);
}

.terminal-output {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.command {
    color: var(--accent-cyan);
}

.blink {
    animation: blink 1s infinite;
}

.contact-info {
    padding: 2rem;
}

.contact-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.contact-cta {
    font-size: 2rem;
    font-family: var(--font-mono);
    color: var(--matrix-green);
    margin-bottom: 2rem;
    text-shadow: 0 0 10px var(--text-glow);
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--matrix-green);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-family: var(--font-mono);
    transition: all 0.3s ease;
}

.social-link svg {
    width: 24px;
    height: 24px;
    color: var(--matrix-green);
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--matrix-green);
    color: var(--bg-primary);
    transform: translateX(10px);
    box-shadow: 0 0 20px var(--matrix-glow);
}

.social-link:hover svg {
    color: var(--bg-primary);
}

/* ===== FOOTER ===== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--matrix-green);
    padding: 2rem;
    position: relative;
    z-index: 2;
}

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

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-text {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

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

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-link:hover,
.footer-link:focus {
    color: var(--matrix-green);
    text-shadow: 0 0 10px var(--text-glow);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .hero {
        flex-direction: column;
        text-align: center;
    }

    .hero-content {
        max-width: 100%;
    }

    .cta-buttons {
        justify-content: center;
    }

    .hologram-container {
        width: 300px;
        height: 300px;
    }

    .contact-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --spacing-lg: 3rem;
        --spacing-xl: 4rem;
    }

    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero {
        padding: 6rem 1rem 3rem;
    }

    .section {
        padding: var(--spacing-lg) 1rem;
    }

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

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

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

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

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

:focus-visible {
    outline: 2px solid var(--matrix-green);
    outline-offset: 4px;
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    :root {
        --text-primary: #ffffff;
        --text-secondary: #cccccc;
    }
}
