:root {
    --accent: #a855f7;
    --accent-dim: #9333ea;
    --bg-dark: #0a0f1a;
    --bg-card: #111827;
    --bg-card-hover: #1a2332;
    --text-muted: #94a3b8;
}

html {
    scroll-behavior: smooth;
}

section[id] {
    scroll-margin-top: 80px;
}

body {
    background-color: var(--bg-dark);
    color: #e2e8f0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-image: radial-gradient(rgba(168, 85, 247, 0.06) 1px, transparent 1px);
    background-size: 24px 24px;
}

.navbar {
    background-color: rgba(10, 15, 26, 0.85) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(168, 85, 247, 0.1);
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--accent) !important;
}

.nav-link {
    color: var(--text-muted) !important;
    transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent) !important;
}

.hero {
    min-height: 70vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-name {
    font-size: clamp(2.8rem, 6vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1.1;
}

.hero-name .accent {
    color: var(--accent);
}

.btn-accent {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #0a0f1a;
    font-weight: 600;
    padding: 0.6rem 1.6rem;
    transition: all 0.2s;
}

.btn-accent:hover {
    background-color: var(--accent-dim);
    border-color: var(--accent-dim);
    color: #0a0f1a;
    transform: translateY(-1px);
}

.btn-outline-accent {
    border-color: rgba(168, 85, 247, 0.3);
    color: var(--accent);
    font-weight: 600;
    padding: 0.6rem 1.6rem;
    transition: all 0.2s;
}

.btn-outline-accent:hover {
    background-color: rgba(168, 85, 247, 0.1);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
}

.section-title {
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 0.25rem;
}

.section-line {
    width: 48px;
    height: 3px;
    background-color: var(--accent);
    border-radius: 2px;
    margin-bottom: 2.5rem;
}

.project-card {
    background-color: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 1.75rem;
    height: 100%;
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.15s ease;
    position: relative;
    transform-style: preserve-3d;
    perspective: 800px;
}

.project-card:hover {
    background-color: var(--bg-card-hover);
    border-color: rgba(168, 85, 247, 0.2);
}

.project-card .card-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    background-color: rgba(168, 85, 247, 0.1);
    color: var(--accent);
}

.project-card h5 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.project-card p {
    color: var(--text-muted);
    font-size: 0.925rem;
    line-height: 1.6;
}

.badge-tech {
    background-color: rgba(168, 85, 247, 0.1);
    color: var(--accent);
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.3em 0.65em;
    border-radius: 6px;
    border: 1px solid rgba(168, 85, 247, 0.15);
}

.badge-stars {
    background-color: rgba(234, 179, 8, 0.1);
    color: #eab308;
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.3em 0.65em;
    border-radius: 6px;
    border: 1px solid rgba(234, 179, 8, 0.15);
}

.card-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: gap 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.card-link:hover {
    color: var(--accent-dim);
    gap: 0.55rem;
}

.placeholder-card {
    border-style: dashed;
    border-color: rgba(168, 85, 247, 0.2);
    opacity: 0.7;
}

.placeholder-card:hover {
    opacity: 1;
}

footer {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}



.image-strip {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.image-strip::-webkit-scrollbar {
    height: 4px;
}

.image-strip::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}

.image-strip-item {
    flex: 0 0 auto;
    width: 280px;
    height: 180px;
    border-radius: 10px;
    overflow: hidden;
    opacity: 0.45;
    filter: grayscale(60%);
    transition: all 0.4s ease;
    cursor: pointer;
}

.image-strip-item:hover {
    opacity: 1;
    filter: grayscale(0%);
}

.image-strip-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.text-accent {
    color: var(--accent);
}

.text-body {
    color: var(--text-muted);
    line-height: 1.8;
}

.text-small {
    font-size: 0.85rem;
}

.text-label {
    color: var(--accent);
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.text-sublabel {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
    letter-spacing: 0.5px;
}

.text-footer {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.link-accent {
    color: var(--accent);
    text-decoration: none;
}

.terminal-input-wrapper {
    padding: 0 1rem 0.75rem;
}

.lightbox {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 10003;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    backdrop-filter: blur(4px);
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 8px;
    object-fit: contain;
}

.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #c084fc);
    z-index: 10001;
    width: 0%;
    transition: width 0.1s linear;
}

.typing-text {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 720px;
}

.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1.1em;
    background-color: var(--accent);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink 0.8s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.terminal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 10004;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.terminal-overlay.active {
    display: flex;
}

.terminal {
    width: 90%;
    max-width: 640px;
    background-color: #0d1117;
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 10px;
    overflow: hidden;
    font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
    font-size: 0.85rem;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.terminal-header {
    background-color: #161b22;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.terminal-dot.red { background-color: #ff5f56; }
.terminal-dot.yellow { background-color: #ffbd2e; }
.terminal-dot.green { background-color: #27c93f; }

.terminal-title {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.terminal-body {
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.terminal-body::-webkit-scrollbar {
    width: 4px;
}

.terminal-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}

.terminal-line {
    color: #c9d1d9;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

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

.terminal-line .output {
    color: var(--text-muted);
}

.terminal-line .highlight {
    color: #c084fc;
}

.terminal-line .success {
    color: #22c55e;
}

.terminal-input-line {
    display: flex;
    align-items: center;
    color: #c9d1d9;
}

.terminal-input-line .prompt {
    color: var(--accent);
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.terminal-input {
    background: none;
    border: none;
    color: #c9d1d9;
    font-family: inherit;
    font-size: inherit;
    outline: none;
    width: 100%;
}

.terminal-hint {
    color: var(--text-muted);
    font-size: 0.7rem;
    text-align: center;
    margin-top: 0.5rem;
    opacity: 0.6;
}

.hint-glow {
    color: var(--text-muted);
    font-size: 0.7rem;
    opacity: 0.4;
    cursor: default;
    transition: all 0.4s ease;
}

.hint-glow:hover {
    opacity: 1;
    color: var(--accent);
    text-shadow: 0 0 8px rgba(168, 85, 247, 0.4);
}

.particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background-color: rgba(168, 85, 247, 0.3);
    border-radius: 50%;
    animation: float linear infinite;
}

@keyframes float {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-10vh) scale(1);
        opacity: 0;
    }
}

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background-color: var(--accent);
    color: #0a0f1a;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.3);
}

.back-to-top.show {
    opacity: 1;
    pointer-events: auto;
}

.back-to-top:hover {
    background-color: var(--accent-dim);
    transform: translateY(-2px);
}

.tool-category {
    border-top: 3px solid transparent;
}

.tool-category.cat-recovery .card-icon {
    background-color: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.tool-category.cat-recovery {
    border-top-color: #22c55e;
}

.tool-category.cat-firmware .card-icon {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.tool-category.cat-firmware {
    border-top-color: #3b82f6;
}

.tool-category.cat-deploy .card-icon {
    background-color: rgba(249, 115, 22, 0.1);
    color: #f97316;
}

.tool-category.cat-deploy {
    border-top-color: #f97316;
}

.tool-category.cat-dev .card-icon {
    background-color: rgba(6, 182, 212, 0.1);
    color: #06b6d4;
}

.tool-category.cat-dev {
    border-top-color: #06b6d4;
}

.tool-category.cat-gamedev .card-icon {
    background-color: rgba(236, 72, 153, 0.1);
    color: #ec4899;
}

.tool-category.cat-gamedev {
    border-top-color: #ec4899;
}

.tool-category.cat-hardware .card-icon {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.tool-category.cat-hardware {
    border-top-color: #ef4444;
}

@media (max-width: 768px) {
    .hero {
        min-height: auto;
        padding-top: 5rem;
        padding-bottom: 2rem;
    }
}

.quote-rotator {
    display: inline-block;
    position: relative;
}

.quote-rotator .text-sublabel {
    transition: opacity 0.5s ease;
}

.quote-rotator.fade-out .text-sublabel {
    opacity: 0;
}

.hero-name {
    position: relative;
}

[data-level="1"] .hero-name {
    animation: hero-jitter 0.8s infinite;
    text-shadow: 3px 0 rgba(255, 0, 0, 0.4), -3px 0 rgba(0, 255, 255, 0.4);
}

[data-level="2"] .hero-name {
    animation: hero-jitter 0.6s infinite;
    text-shadow: 5px 0 rgba(255, 0, 0, 0.5), -5px 0 rgba(0, 255, 255, 0.5);
    filter: blur(0.3px);
}

[data-level="3"] .hero-name {
    animation: hero-jitter 0.45s infinite, hero-flicker 0.3s infinite;
    text-shadow: 8px 0 rgba(255, 0, 0, 0.6), -8px 0 rgba(0, 255, 255, 0.6);
    filter: blur(0.6px);
}

[data-level="4"] .hero-name {
    animation: hero-jitter 0.35s infinite, hero-flicker 0.2s infinite, hero-skew 0.5s infinite;
    text-shadow: 12px 0 rgba(255, 0, 0, 0.7), -12px 0 rgba(0, 255, 255, 0.7);
    filter: blur(1px);
}

[data-level="5"] .hero-name {
    animation: hero-jitter 0.25s infinite, hero-flicker 0.15s infinite, hero-skew 0.3s infinite, hero-glitch 0.4s infinite;
    text-shadow: 18px 0 rgba(255, 0, 0, 0.8), -18px 0 rgba(0, 255, 255, 0.8);
    filter: blur(1.5px);
}

[data-level="1"] .typing-text,
[data-level="2"] .typing-text,
[data-level="3"] .typing-text {
    text-shadow: 2px 0 rgba(255, 0, 0, 0.2), -2px 0 rgba(0, 255, 255, 0.2);
}

[data-level="4"] .typing-text,
[data-level="5"] .typing-text {
    text-shadow: 5px 0 rgba(255, 0, 0, 0.4), -5px 0 rgba(0, 255, 255, 0.4);
    filter: blur(0.5px);
}

[data-level="5"] .hero::before {
    background: radial-gradient(circle, rgba(255, 0, 0, 0.15) 0%, transparent 70%);
    animation: bg-pulse 0.5s infinite;
}

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

@keyframes hero-flicker {
    0%, 100% { opacity: 1; }
    33% { opacity: 0.85; }
    66% { opacity: 0.95; }
}

@keyframes hero-skew {
    0%, 100% { transform: skewX(0deg); }
    25% { transform: skewX(-1deg); }
    75% { transform: skewX(1deg); }
}

@keyframes hero-glitch {
    0%, 100% { clip-path: inset(0 0 0 0); }
    20% { clip-path: inset(10% 0 60% 0); transform: translateX(4px); }
    40% { clip-path: inset(50% 0 20% 0); transform: translateX(-4px); }
    60% { clip-path: inset(30% 0 40% 0); transform: translateX(2px); }
    80% { clip-path: inset(70% 0 5% 0); transform: translateX(-2px); }
}

@keyframes bg-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.ripple {
    position: fixed;
    border-radius: 50%;
    border: 2px solid var(--accent);
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    animation: ripple-expand 0.6s ease-out forwards;
}

@keyframes ripple-expand {
    0% {
        width: 0;
        height: 0;
        opacity: 0.6;
    }
    100% {
        width: 120px;
        height: 120px;
        opacity: 0;
    }
}

.char {
    display: inline-block;
    transition: transform 0.15s ease;
    position: relative;
}

body.vhs {
    animation: vhs-wobble 0.15s infinite;
}

body.vhs::before {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.15) 2px,
        rgba(0, 0, 0, 0.15) 4px
    );
    z-index: 10002;
    pointer-events: none;
}

body.vhs::after {
    content: '';
    position: fixed;
    inset: 0;
    background: linear-gradient(
        transparent 0%,
        rgba(255, 255, 255, 0.03) 50%,
        transparent 100%
    );
    background-size: 100% 8px;
    z-index: 10002;
    pointer-events: none;
    animation: vhs-scan 4s linear infinite;
}

body.vhs .hero-name,
body.vhs .typing-text,
body.vhs .section-title {
    text-shadow: 2px 0 rgba(255, 0, 0, 0.3), -2px 0 rgba(0, 255, 255, 0.3);
}

body.vhs .navbar {
    border-bottom-color: rgba(255, 0, 0, 0.15);
}

@keyframes vhs-wobble {
    0% { transform: translateX(0); }
    25% { transform: translateX(-1px); }
    50% { transform: translateX(1px); }
    75% { transform: translateX(-0.5px); }
    100% { transform: translateX(0); }
}

@keyframes vhs-scan {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}
