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

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

body {
    font-family: 'Roboto Mono', monospace;
    background: #060a06;
    color: #e8f5e9;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: .025;
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 9999;
}

.grid-bg {
    background-size: 48px 48px;
    background-image: linear-gradient(to right, rgba(16, 185, 129, .03) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(16, 185, 129, .03) 1px, transparent 1px);
    mask-image: linear-gradient(to bottom, transparent 2%, black 30%, black 70%, transparent 98%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 2%, black 30%, black 70%, transparent 98%);
}

.no-js .fade-up {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
}

@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
        filter: blur(6px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

.fade-up {
    opacity: 0;
    transform: translateY(30px);
    filter: blur(6px);
}

.fade-up.show {
    animation: fadeUp .9s cubic-bezier(.25, 1, .5, 1) both;
}

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

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: .6;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

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

.marquee {
    animation: marquee 35s linear infinite;
}

.marquee:hover {
    animation-play-state: paused;
}

.text-gradient-hero {
    background: linear-gradient(180deg, #d1fae5 0%, #6ee7b7 40%, #166534 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glow-line {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, .5), transparent);
}

.project-card {
    transition: all .6s cubic-bezier(.25, 1, .5, 1);
    border: 1px solid rgba(16, 185, 129, .08);
}

.project-card:hover {
    transform: translateY(-6px);
    border-color: rgba(16, 185, 129, .3);
    box-shadow: 0 20px 60px -15px rgba(16, 185, 129, .12);
}

.project-card:hover .card-logo {
    opacity: 1;
    transform: scale(1.05);
}

.card-logo {
    opacity: .5;
    transition: all .8s cubic-bezier(.25, 1, .5, 1);
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .3));
}

.project-card:hover .card-arrow {
    transform: translate(3px, -3px);
    color: #4ade80;
}

.card-arrow {
    transition: all .3s;
}

.nav-link {
    color: rgba(167, 243, 208, .4);
    transition: color .25s;
    position: relative;
}

.nav-link:hover {
    color: #a7f3d0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: #10b981;
    transition: width .3s;
}

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

.tag {
    background: rgba(16, 185, 129, .06);
    border: 1px solid rgba(16, 185, 129, .1);
    color: #6ee7b7;
    transition: all .3s;
}

.tag:hover {
    background: rgba(16, 185, 129, .12);
    border-color: rgba(16, 185, 129, .25);
}

.skill-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #059669, #34d399);
    width: 0;
    transition: width 1.2s cubic-bezier(.25, 1, .5, 1);
}

.skill-fill.animate {
    width: var(--w);
}

.btn-glow {
    position: relative;
    overflow: hidden;
    transition: all .3s;
    background: #059669;
    color: #fff;
    cursor: pointer;
}

.btn-glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .4), transparent);
    transform: skewX(-20deg);
    transition: left .75s ease-in-out;
}

.btn-glow:hover::before {
    left: 150%;
}

.btn-glow:hover {
    box-shadow: 0 0 35px rgba(16, 185, 129, .25);
}

.btn-outline {
    border: 1px solid rgba(16, 185, 129, .15);
    color: #a7f3d0;
    transition: all .3s;
    cursor: pointer;
}

.btn-outline:hover {
    border-color: rgba(16, 185, 129, .4);
    background: rgba(16, 185, 129, .08);
    box-shadow: 0 0 20px rgba(16, 185, 129, .1);
}

.btn-cuerdos {
    border: 1px solid rgba(16, 185, 129, .25);
    color: #6ee7b7;
    background: rgba(16, 185, 129, .06);
    transition: all .3s;
    cursor: pointer;
}

.btn-cuerdos:hover {
    border-color: rgba(16, 185, 129, .5);
    background: rgba(16, 185, 129, .12);
    box-shadow: 0 0 25px rgba(16, 185, 129, .15);
}

.status-dot {
    position: relative;
}

.status-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #34d399;
    animation: pulse-ring 2s ease-out infinite;
}

.collab-badge {
    background: rgba(16, 185, 129, .06);
    border: 1px solid rgba(16, 185, 129, .12);
}

.cuerdos-badge {
    background: rgba(16, 185, 129, .1);
    border: 1px solid rgba(16, 185, 129, .15);
}

.contact-link {
    transition: all .3s;
    cursor: pointer;
}

.contact-link:hover {
    transform: translateX(4px);
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(16, 185, 129, .12);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(16, 185, 129, .25);
}

.nav-bar {
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    background: rgba(6, 10, 6, .7);
    border-bottom: 1px solid rgba(16, 185, 129, .08);
}

#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height .4s cubic-bezier(.25, 1, .5, 1), opacity .3s;
    opacity: 0;
}

#mobile-menu.open {
    max-height: 420px;
    opacity: 1;
}

.icon-menu-close {
    display: none;
}

.icon-menu-open {
    display: inline;
}

.menu-active .icon-menu-close {
    display: inline;
}

.menu-active .icon-menu-open {
    display: none;
}

@media (hover: none) and (pointer: coarse) {
    .project-card:hover {
        transform: none;
        border-color: rgba(16, 185, 129, .08);
        box-shadow: none;
    }
    .project-card:hover .card-logo {
        opacity: .5;
        transform: none;
    }
    .project-card:hover .card-arrow {
        transform: none;
        color: inherit;
    }
    .contact-link:hover {
        transform: none;
    }
    .btn-glow:hover {
        box-shadow: none;
    }
    .btn-glow:hover::before {
        left: -100%;
    }
    .btn-outline:hover {
        border-color: rgba(16, 185, 129, .15);
        background: transparent;
        box-shadow: none;
    }
    .btn-cuerdos:hover {
        border-color: rgba(16, 185, 129, .25);
        background: rgba(16, 185, 129, .06);
        box-shadow: none;
    }
    .nav-link:hover {
        color: rgba(167, 243, 208, .4);
    }
    .nav-link:hover::after {
        width: 0;
    }
    .tag:hover {
        background: rgba(16, 185, 129, .06);
        border-color: rgba(16, 185, 129, .1);
    }
    .project-card:active {
        transform: scale(.985);
        transition-duration: .1s;
    }
    .btn-glow:active,
    .btn-outline:active,
    .btn-cuerdos:active {
        transform: scale(.97);
        transition-duration: .1s;
    }
    .contact-link:active {
        transform: scale(.98);
        transition-duration: .1s;
    }
}

@supports (padding: max(0px)) {
    nav {
        padding-top: env(safe-area-inset-top);
    }
    footer {
        padding-bottom: max(24px, env(safe-area-inset-bottom));
    }
}

@media (max-width: 768px) {
    input, select, textarea {
        font-size: 16px;
    }
    .project-card, .btn-glow, .btn-outline, .contact-link {
        will-change: transform;
    }
    .tag:active {
        transform: scale(.95);
    }
}

@media (max-width: 640px) {
    .grid-bg {
        background-size: 32px 32px;
    }
    @keyframes fadeUp {
        0% {
            opacity: 0;
            transform: translateY(20px);
            filter: blur(4px);
        }
        100% {
            opacity: 1;
            transform: translateY(0);
            filter: blur(0);
        }
    }
    .fade-up.show {
        animation: fadeUp .7s cubic-bezier(.25, 1, .5, 1) both;
    }
    @keyframes float {
        0%, 100% {
            transform: translateY(0);
        }
        50% {
            transform: translateY(-6px);
        }
    }
    .marquee {
        animation: marquee 25s linear infinite;
    }
    p, .text-xs {
        line-height: 1.6;
    }
    ::-webkit-scrollbar {
        width: 4px;
    }
    .avatar-frame {
        width: 220px !important;
        height: 290px !important;
    }
}

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

@media (max-width: 640px) {
    section[id] {
        scroll-margin-top: 56px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    html {
        scroll-behavior: auto;
    }
    .marquee {
        animation: none;
    }
    .fade-up {
        opacity: 1;
        transform: none;
        filter: none;
    }
}