/* ===== Global Reset & Utils ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-dim);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

::selection {
    background: var(--accent);
    color: var(--bg-primary);
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 20px;
    background: var(--accent);
    color: var(--bg-primary);
    padding: 1rem 2rem;
    z-index: 10000;
    text-decoration: none;
    font-weight: bold;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* ===== CSS Variables ===== */
:root {
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Space Grotesk', sans-serif;
    --font-mono: 'Space Grotesk', 'Consolas', monospace;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius: 16px;
    --radius-sm: 10px;
}

/* Dark Mode - Hacker Theme */
[data-theme="dark"] {
    --bg-primary: #0a0f0a;
    --bg-secondary: #0d120d;
    --bg-card: #111a11;
    --bg-card-hover: #152015;
    --text-primary: #00ff00;
    --text-secondary: #33cc33;
    --accent: #00ff41;
    --accent-dim: rgba(0, 255, 65, 0.1);
    --accent-glow: rgba(0, 255, 65, 0.3);
    --border: rgba(0, 255, 65, 0.15);
    --danger: #ff3333;
    --warning: #ffcc00;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.6);

    /* Terminal Theme Variables - Dark */
    --term-bg: rgba(10, 15, 10, 0.95);
    --term-text: var(--accent);
    --term-header: #1a1a1a;
    --term-title: var(--text-secondary);
    --term-border: var(--border);
    --term-prompt: var(--text-secondary);
}

/* Hacker Light Mode - Vintage Hardware Aesthetic */
[data-theme="light"] {
    --bg-primary: #f0f4f0;
    --bg-secondary: #e2e8e2;
    --bg-card: #f8faf8;
    --bg-card-hover: #ffffff;
    --text-primary: #0a1f0a;
    --text-secondary: #3d523d;
    --accent: #00a352;
    --accent-dim: rgba(0, 163, 82, 0.1);
    --accent-glow: rgba(0, 163, 82, 0.2);
    --border: rgba(0, 60, 30, 0.25);
    --danger: #b32424;
    --warning: #b38f00;
    --shadow: 4px 4px 0px rgba(0, 40, 20, 0.1);
    /* Blocky shadow */

    /* Terminal Theme Variables - Hacker Light */
    --term-bg: #e8ede8;
    --term-text: #0a1f0a;
    --term-header: #d0d6d0;
    --term-title: #2d452d;
    --term-border: #004d26;
    --term-prompt: #008040;
}

[data-theme="light"] body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(rgba(0, 60, 30, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
    z-index: -1;
}

/* CRT Scanlines Effect */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%,
            rgba(0, 0, 0, 0.1) 50%), linear-gradient(90deg,
            rgba(255, 0, 0, 0.02),
            rgba(0, 255, 0, 0.01),
            rgba(0, 0, 255, 0.02));
    background-size: 100% 3px, 3px 100%;
    pointer-events: none;
    z-index: 9999;
}

[data-theme="light"] .scanlines {
    opacity: 0.15;
    background: linear-gradient(rgba(0, 60, 30, 0) 50%,
            rgba(0, 60, 30, 0.05) 50%);
    background-size: 100% 4px;
}

/* ===== Loading Screen & Terminal ===== */
.loader {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: all 0.8s cubic-bezier(0.8, 0, 0.2, 1);
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(1.1);
}

.terminal-container {
    width: 100%;
    max-width: 800px;
    height: 500px;
    background: var(--term-bg);
    border: 1px solid var(--term-border);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), 0 0 20px var(--accent-dim);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    z-index: 2;
    transition: background var(--transition), border var(--transition);
}

.terminal-header {
    background: var(--term-header);
    padding: 10px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--term-border);
    transition: background var(--transition);
}

.terminal-controls {
    display: flex;
    gap: 8px;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.close {
    background: #ff5f56;
}

.minimize {
    background: #ffbd2e;
}

.maximize {
    background: #27c93f;
}

.terminal-title {
    flex: 1;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--term-title);
    margin-right: 60px;
    /* Offset for controls */
}

.terminal-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--term-text);
}

.terminal-line {
    margin-bottom: 6px;
    display: block;
}

.terminal-line.success {
    color: var(--accent);
}

.terminal-line.info {
    color: #3399ff;
}

.terminal-line.warning {
    color: var(--warning);
}

.terminal-line.error {
    color: var(--danger);
}

.terminal-input-line {
    padding: 10px 20px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.terminal-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.terminal-visual-display {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    white-space: pre-wrap;
    word-break: break-all;
    width: 100%;
    color: var(--term-text);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 1rem;
}

.terminal-prompt {
    color: var(--term-prompt);
    font-weight: bold;
}

#terminalInput {
    background: transparent;
    border: none;
    outline: none;
    color: transparent;
    /* Hide text, we use visual display */
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 1rem;
    flex: 1;
    width: 100%;
    caret-color: transparent;
    /* Hide real cursor */
}

/* The dynamic cursor inside the visual display */
.terminal-cursor {
    display: inline-block;
    width: 0.6em;
    height: 1.1em;
    background: var(--term-text);
    margin-left: 0;
    animation: terminal-blink 1s step-end infinite;
    vertical-align: middle;
}

@keyframes terminal-blink {

    from,
    to {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.terminal-skip {
    margin-top: 20px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition);
    z-index: 2;
}

.terminal-skip:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-dim);
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@media (max-width: 600px) {
    .terminal-container {
        height: 400px;
    }

    .terminal-body {
        font-size: 0.85rem;
    }
}

/* ===== Custom Cursor Glow ===== */
.cursor-glow {
    position: fixed;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.4;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
}

@media (max-width: 768px) {
    .cursor-glow {
        display: none;
    }
}

/* ===== Back to Top Button ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition);
    z-index: 1000;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px var(--accent-glow);
}

.back-to-top svg {
    width: 24px;
    height: 24px;
}

/* ===== Reset ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    font-size: 1rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    line-height: 1.2;
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* ===== Utilities ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 120px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 80px;
}

.section-label {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 16px;
    font-family: var(--font-mono);
}

.section-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -1px;
}

.highlight {
    color: var(--accent);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

[data-theme="light"] .btn {
    border-radius: 4px;
    border: 2px solid var(--border);
}

.btn-primary {
    background: var(--accent);
    color: #000;
}

[data-theme="light"] .btn-primary {
    color: #fff;
    background: #008040;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px var(--accent-glow);
}

.btn-outline {
    border: 1px solid var(--accent);
    color: var(--accent);
}

[data-theme="light"] .btn-outline {
    border: 2px solid var(--accent);
    color: var(--accent);
    background: transparent;
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-sm {
    padding: 10px 18px;
    font-size: 0.85rem;
}

/* ===== Navigation ===== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 0;
    background: transparent;
    transition: all var(--transition);
}

.nav.scrolled {
    background: var(--bg-secondary);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link.active::after {
    width: 100%;
}

.nav-cta {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Theme Toggle Button */
.theme-toggle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    color: var(--accent);
    font-size: 1.2rem;
}

.theme-toggle:hover {
    background: var(--accent);
    color: var(--bg-primary);
    transform: scale(1.05);
    box-shadow: 0 0 20px var(--accent-glow);
}

.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
}

.mobile-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all var(--transition);
}

/* ===== Mobile Menu ===== */
.mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    z-index: 999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 32px;
}

.mobile-menu.active {
    display: flex;
}

.mobile-menu .nav-link {
    font-size: 1.5rem;
}

/* ===== Hero ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 80px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 20%, var(--accent-dim) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(100, 100, 255, 0.05) 0%, transparent 50%),
        url('https://images.unsplash.com/photo-1526374965328-7f61d4dc18c5?w=1920&q=80') center/cover no-repeat;
    opacity: 0.15;
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
}

.hero-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 24px;
}

.hero-label .dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 20px;
    min-height: 2.4em;
}

.typing-text {
    display: inline;
}

.typing-cursor {
    color: var(--accent);
    animation: blink 0.7s infinite;
    font-weight: 400;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 600px;
    line-height: 1.7;
}

.hero-cta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.hero-social {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
}

.social-link {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.social-link svg {
    width: 20px;
    height: 20px;
}

.social-link:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px var(--accent-glow);
}

.hero-stats {
    display: flex;
    gap: 48px;
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.stat-item h4 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-item p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ===== About ===== */
#about {
    background: var(--bg-secondary);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 60px;
    align-items: center;
}

.about-visual {
    position: relative;
    padding: 40px;
}

.about-image-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 24px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--accent);
    box-shadow: 0 0 30px var(--accent-glow), 0 0 60px var(--accent-dim);
}

[data-theme="light"] .about-image-wrapper {
    border-radius: 8px;
    border: 2px solid var(--border);
    box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.1);
}

.about-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(30%);
    transition: all var(--transition);
}

.about-image-wrapper:hover .about-image {
    filter: grayscale(0%);
    transform: scale(1.05);
}

.about-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-dim) 0%, transparent 50%);
    pointer-events: none;
}

.about-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
}

[data-theme="light"] .about-card {
    border-radius: 4px;
    border: 2px solid var(--border);
    background: #fff;
    box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.05);
}

.about-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.about-avatar {
    width: 64px;
    height: 64px;
    background: var(--accent-dim);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--accent);
    font-weight: 700;
}

[data-theme="light"] .about-avatar {
    border-radius: 4px;
    border: 2px solid var(--border);
    background: var(--bg-secondary);
}

.about-card-title {
    font-weight: 600;
}

.about-card-role {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.about-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.about-tag {
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

[data-theme="light"] .about-tag {
    border-radius: 4px;
    border: 2px solid var(--border);
    background: #fff;
    color: var(--text-primary);
}

.about-text h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.about-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 25px;
}

[data-theme="light"] .about-text {
    font-family: var(--font-mono);
    font-size: 1rem;
}

.about-highlights {
    display: grid;
    gap: 16px;
    margin-top: 32px;
}

.about-highlight {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.about-highlight-icon {
    width: 24px;
    height: 24px;
    background: var(--accent-dim);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 0.75rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.about-highlight p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.about-highlight strong {
    color: var(--text-primary);
}

/* ===== Skills ===== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

.skill-category {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

[data-theme="light"] .skill-category {
    border: 2px solid var(--border);
    border-radius: 4px;
    background: #fff;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.1);
}

.skill-category:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.skill-tag {
    display: inline-block;
    padding: 6px 14px;
    background: var(--accent-dim);
    border: 1px solid var(--border);
    border-radius: 4px;
    /* Blocky default */
    font-size: 0.85rem;
    font-family: var(--font-mono);
    color: var(--accent);
    margin: 4px;
}

[data-theme="light"] .skill-tag {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    color: var(--text-primary);
}

.skill-category-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-dim);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 1.25rem;
}

.skill-category h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
}

.skill-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skill-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.skill-item::before {
    content: '›';
    color: var(--accent);
    font-weight: bold;
}

/* ===== Projects ===== */
#projects {
    background: var(--bg-secondary);
}

.projects-filter {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 48px;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    opacity: 0.6;
    letter-spacing: 1px;
    margin-right: 8px;
}

.filter-btn {
    padding: 8px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

[data-theme="light"] .filter-btn {
    border-radius: 4px;
    border: 2px solid var(--border);
}

.filter-btn.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.projects-filter {
    position: relative;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 32px;
    margin-bottom: 64px;
}

[data-theme="light"] .projects-filter {
    border-radius: 4px;
    border: 2px solid var(--border);
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.1);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.hidden {
    display: none !important;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    min-height: 520px;
}

[data-theme="light"] .project-card {
    border-radius: 4px;
    border: 2px solid var(--border);
}

.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px var(--accent-glow);
}

.project-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid var(--accent);
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 5;
}

.project-card:hover::after {
    opacity: 0.5;
}

.project-image-container {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.project-card:hover .project-image {
    transform: scale(1.1);
}

.project-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--bg-card) 0%, transparent 60%);
    opacity: 0.6;
}

.project-icon-overlay {
    position: absolute;
    bottom: 16px;
    left: 16px;
    width: 48px;
    height: 48px;
    background: rgba(26, 26, 26, 0.7);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 2;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.difficulty-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 5px 12px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    font-size: 0.6rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #fff;
    z-index: 3;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .difficulty-badge {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--border);
    color: #000;
    font-weight: 700;
}

.difficulty-badge[data-difficulty="advanced"] {
    color: #ff3333;
    border-color: rgba(255, 51, 51, 0.3);
    box-shadow: 0 0 15px rgba(255, 51, 51, 0.2);
}

.difficulty-badge[data-difficulty="intermediate"] {
    color: #ff9933;
    border-color: rgba(255, 153, 51, 0.3);
}

.difficulty-badge[data-difficulty="beginner"] {
    color: #00ff41;
    border-color: rgba(0, 255, 65, 0.3);
}

.project-card:hover .project-icon-overlay {
    transform: rotate(-10deg) scale(1.1);
    border-color: var(--accent);
}

.project-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-family: var(--font-heading);
    line-height: 1.3;
}

.project-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.project-meta {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
    flex: 1;
}

.meta-section h4 {
    font-size: 0.7rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--accent);
    margin-bottom: 6px;
    opacity: 0.8;
}

.meta-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.p-skill-tag,
.p-tool-tag {
    padding: 4px 12px;
    background: var(--accent-dim);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--accent);
    transition: all 0.3s ease;
}

[data-theme="light"] .p-skill-tag,
[data-theme="light"] .p-tool-tag {
    border: 2px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.p-skill-tag:hover,
.p-tool-tag:hover {
    background: var(--accent);
    color: #000;
}

.p-tool-tag {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.project-links {
    display: flex;
    gap: 12px;
    margin-top: auto;
}

.project-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 0.9rem;
    font-family: var(--font-mono);
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.project-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--accent);
    transition: all 0.4s ease;
    z-index: -1;
}

.project-btn:hover::before {
    left: 0;
}

.project-btn:hover {
    color: #000;
    border-color: var(--accent);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.project-btn.btn-view {
    background: var(--accent);
    color: #000;
    border: none;
}

.project-btn.btn-view::before {
    background: #fff;
}

.project-btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.5;
}

.project-btn span {
    font-size: 0.8rem;
}

.project-btn.btn-view:hover {
    box-shadow: 0 0 30px var(--accent-glow);
}

/* ===== Journey ===== */
.journey-timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.journey-timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

[data-theme="light"] .journey-timeline::before {
    width: 4px;
    background: var(--accent);
}

.journey-item {
    position: relative;
    padding-left: 40px;
    padding-bottom: 48px;
}

[data-theme="light"] .journey-item {
    padding-left: 50px;
}

.journey-item:last-child {
    padding-bottom: 0;
}

.journey-marker {
    position: absolute;
    left: -8px;
    top: 0;
    width: 18px;
    height: 18px;
    background: var(--accent);
    border: 4px solid var(--bg-primary);
    border-radius: 50%;
}

[data-theme="light"] .journey-marker {
    left: -12px;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    /* Blocky marker */
    border: 2px solid #000;
}

.journey-item.current .journey-marker {
    box-shadow: 0 0 0 4px var(--accent-dim);
}

.journey-phase {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    margin-bottom: 8px;
}

.journey-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.journey-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.journey-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.journey-tag {
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

[data-theme="light"] .journey-tag {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    color: var(--text-primary);
}

/* ===== Contact ===== */
#contact {
    background: var(--bg-secondary);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 60px;
}

.contact-info h3 {
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.contact-info>p {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.contact-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

[data-theme="light"] .contact-icon {
    border-radius: 4px;
    border: 2px solid var(--border);
    background: #000;
    color: var(--accent);
}

.contact-item-text span {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.contact-item-text a,
.contact-item-text p {
    font-weight: 500;
    margin-top: 2px;
}

.contact-form {
    background: var(--bg-card);
    padding: 40px;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

[data-theme="light"] .contact-form {
    border-radius: 4px;
    border: 2px solid var(--border);
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    transition: var(--transition);
}

[data-theme="light"] .form-group input,
[data-theme="light"] .form-group textarea {
    border-radius: 4px;
    border: 2px solid var(--border);
    background: #fff;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

[data-theme="light"] .form-group input,
[data-theme="light"] .form-group textarea {
    border-radius: 4px;
    border: 2px solid var(--border);
    background: #fff;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-dim);
}

.form-group input.error,
.form-group textarea.error {
    border-color: var(--danger);
}

.form-error {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 6px;
    display: none;
}

.form-group textarea {
    resize: vertical;
    min-height: 140px;
}

.contact-form .btn {
    width: 100%;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.loader-dots {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.loader-dots span {
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
    animation: dotPulse 1.4s infinite ease-in-out both;
}

.loader-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loader-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes dotPulse {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1.0);
    }
}

.btn.is-loading .btn-text {
    display: none;
}

.btn.is-loading .loader-dots {
    display: flex;
}

/* ===== Footer ===== */
.footer {
    background: var(--bg-primary);
    padding: 40px 0;
    border-top: 1px solid var(--border);
}

[data-theme="light"] .footer {
    border-top: 4px solid var(--border);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-logo {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--accent);
}

.footer-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ===== Animations ===== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Matrix Background ===== */
#matrixCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    opacity: 0.15;
    pointer-events: none;
}

[data-theme="light"] #matrixCanvas {
    opacity: 0.05;
}

/* ===== Scroll Progress ===== */
.scroll-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    z-index: 1001;
    background: transparent;
}

.scroll-progress-bar {
    height: 100%;
    background: var(--accent);
    width: 0%;
    box-shadow: 0 0 10px var(--accent-glow);
    transition: width 0.1s ease;
}

/* ===== Certifications Section ===== */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.cert-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 32px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

.cert-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 10px 30px var(--accent-dim);
}

.cert-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 0 10px var(--accent-glow));
}

.cert-info h3 {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.cert-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ===== Testimonials Section ===== */
#testimonials {
    background: var(--bg-secondary);
}

.testimonial-slider-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    padding: 0 60px;
}

.testimonial-slider {
    overflow: hidden;
    position: relative;
    min-height: 200px;
}

.testimonial-item {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.testimonial-item.active {
    opacity: 1;
    visibility: visible;
    position: relative;
}

.testimonial-text {
    font-size: 1.25rem;
    font-style: italic;
    color: var(--text-primary);
    margin-bottom: 24px;
    line-height: 1.8;
}

.testimonial-author {
    font-weight: 600;
    color: var(--accent);
    font-family: var(--font-mono);
}

.slider-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
}

.slider-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.slider-btn:hover {
    background: var(--accent);
    color: var(--bg-primary);
    box-shadow: 0 0 20px var(--accent-glow);
}

/* ===== Blog Section ===== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

.blog-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    transition: var(--transition);
}

.blog-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.blog-date {
    font-size: 0.8rem;
    color: var(--accent);
    font-family: var(--font-mono);
    margin-bottom: 12px;
}

.blog-card h3 {
    font-size: 1.5rem;
    margin-bottom: 16px;
    line-height: 1.3;
}

.blog-card p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.blog-link {
    font-weight: 600;
    color: var(--accent);
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    transition: var(--transition);
}

.blog-link:hover {
    gap: 8px;
}

/* ===== Project Details Modal ===== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    padding: 20px;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    border: 1px solid var(--border);
    border-radius: 20px;
    position: relative;
    overflow-y: auto;
    transform: scale(0.9);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    color: var(--text-secondary);
    z-index: 10;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--accent);
}

.modal-body {
    padding: 60px;
}

.modal-header {
    margin-bottom: 40px;
}

.modal-title {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.modal-meta {
    display: flex;
    gap: 24px;
    margin-bottom: 32px;
}

.modal-image {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 40px;
    aspect-ratio: 16/9;
    object-fit: cover;
}

/* Project Card Micro-interactions */
.project-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.project-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 20px var(--accent-dim);
}

/* Accessibility - Better Contrast */
[data-theme="dark"] {
    --text-primary: #ecfdf5;
    /* Off-white green tint for better legibility */
    --accent: #22c55e;
    /* More readable green */
}

/* ===== Responsive ===== */
@media (max-width: 992px) {

    .about-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .skills-grid {
        grid-template-columns: 1fr 1fr;
    }

    .hero-stats {
        gap: 32px;
    }
}

@media (max-width: 768px) {

    .nav-links,
    .nav-cta .btn {
        display: none;
    }

    .mobile-toggle {
        display: flex;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .hero-stats {
        flex-wrap: wrap;
        gap: 24px;
    }

    .footer-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}