.section-soft {
    background: rgba(255, 255, 255, 0.02);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 3rem;
}

.section-heading-center {
    text-align: center;
    margin-bottom: 3rem;
}

.section-intro {
    color: var(--text-muted);
    margin-bottom: 3rem;
    max-width: 720px;
}

.section-intro--compact {
    margin-bottom: 0;
}

.section-intro--center {
    max-width: 600px;
    margin: 0 auto;
}

.section-copy {
    color: var(--text-muted);
    margin-top: 1rem;
}

.hero-content--ready {
    opacity: 0;
    transform: translateY(26px);
    transition:
        opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

body.page-ready .hero-content--ready {
    opacity: 1;
    transform: none;
}

.hero::after {
    content: '';
    position: absolute;
    left: -8%;
    bottom: -12%;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.12) 0%, transparent 72%);
    filter: blur(40px);
    z-index: 0;
    animation: heroFloat 14s ease-in-out infinite;
}

.nav-panel {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-toggle {
    display: none;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.35rem;
    cursor: pointer;
    z-index: 1002;
}

.mobile-menu-toggle span {
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

body.nav-open {
    overflow: hidden;
}

body.nav-open .mobile-menu-toggle span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

body.nav-open .mobile-menu-toggle span:nth-child(2) {
    opacity: 0;
}

body.nav-open .mobile-menu-toggle span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.64);
    backdrop-filter: blur(6px);
    z-index: 998;
}

.nav-links a {
    position: relative;
    padding: 0.35rem 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -0.35rem;
    width: 0;
    height: 2px;
    background: var(--accent);
    opacity: 0;
    transition: width 0.3s ease, opacity 0.3s ease;
}

.pricing-unit {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 400;
}

.contact-details-list {
    margin-top: 3rem;
}

.contact-detail {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.contact-detail i {
    color: var(--accent);
    font-size: 1.1rem;
}

.contact-alert {
    border: 1px solid transparent;
    border-radius: 16px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

.contact-alert--success {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.35);
    color: #bbf7d0;
}

.contact-alert--error {
    background: rgba(248, 113, 113, 0.12);
    border-color: rgba(248, 113, 113, 0.35);
    color: #fecaca;
}

.form-actions {
    display: grid;
    gap: 0.85rem;
}

.form-entry-message {
    padding: 0.9rem 1rem;
    border-radius: 14px;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #dbeafe;
    font-size: 0.92rem;
    line-height: 1.5;
}

.form-note {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

.site-footer {
    padding: 4rem 0;
    border-top: 1px solid var(--glass-border);
    text-align: center;
    color: var(--text-muted);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.btn-cta:focus-visible,
.nav-links a:focus-visible,
.nav-links a.active,
.logo:focus-visible,
.project-link:focus-visible,
.form-group input:focus-visible,
.form-group textarea:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.9);
    outline-offset: 3px;
}

.nav-links a.active {
    color: #ffffff;
    text-decoration: none;
}

.nav-links a.active::after {
    width: 100%;
    opacity: 1;
}

.btn-cta[disabled] {
    cursor: wait;
    opacity: 0.8;
}

.reveal {
    will-change: transform, opacity;
}

.project-card:hover,
.pricing-card:hover,
.exp-card:hover {
    transform: translateY(-8px);
}

.btn-cta:hover {
    transform: translateY(-4px);
}

.skill-tag {
    transition:
        transform 0.35s ease,
        background-color 0.35s ease,
        border-color 0.35s ease,
        box-shadow 0.35s ease;
}

.skill-tag:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 30px rgba(59, 130, 246, 0.18);
}

.project-link i {
    transition: transform 0.35s ease;
}

.project-link:hover i {
    transform: translateX(5px);
}

.pricing-card.popular {
    transform: translateY(-10px);
    box-shadow: 0 18px 42px rgba(59, 130, 246, 0.16);
}

.pricing-card.popular:hover {
    transform: translateY(-14px);
}

.project-card,
.pricing-card,
.exp-card,
.skill-tag,
.project-link,
.header-location,
.nav-links a {
    transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes heroFloat {
    0%,
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    50% {
        transform: translate3d(14px, -10px, 0) scale(1.03);
    }
}

@media (max-width: 1100px) {
    .nav-panel {
        gap: 1rem;
    }

    .nav-links {
        gap: 1.25rem;
    }

    .header-location {
        min-width: 124px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation: none !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
        scroll-behavior: auto !important;
    }

    .reveal,
    .reveal.visible {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 900px) {
    .mobile-menu-toggle {
        display: inline-flex;
        order: 3;
    }

    .nav-container {
        gap: 1rem;
    }

    .nav-panel {
        position: fixed;
        top: 1rem;
        right: 1rem;
        bottom: 1rem;
        width: min(88vw, 360px);
        padding: 5.5rem 1.25rem 1.25rem;
        border: 1px solid var(--glass-border);
        border-radius: 28px;
        background:
            linear-gradient(180deg, rgba(30, 41, 59, 0.96), rgba(2, 6, 23, 0.98));
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
        z-index: 1001;
        display: grid;
        align-content: start;
        gap: 1.5rem;
        transform: translateX(calc(100% + 1.5rem));
        opacity: 0;
        pointer-events: none;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    body.nav-open .nav-panel {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-links {
        display: grid;
        gap: 0.55rem;
        margin: 0;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 0.95rem 1rem;
        border: 1px solid rgba(255, 255, 255, 0.06);
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.03);
        font-size: 1rem;
        color: var(--text-main);
    }

    .nav-links a::after {
        bottom: 0.6rem;
        left: 1rem;
    }

    .header-meta {
        display: block;
    }

    .header-meta .btn-cta {
        width: 100%;
    }

    .hero {
        min-height: 100svh;
        height: auto;
        padding: 8rem 0 5rem;
    }

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

    .hero h1 {
        font-size: clamp(2.8rem, 9vw, 4rem);
    }

    .hero p {
        max-width: 100%;
        font-size: 1.05rem;
    }

    .section {
        padding: 6rem 0;
    }

    .experience-grid,
    .project-grid,
    .pricing-grid {
        grid-template-columns: 1fr;
    }

    .project-grid,
    .pricing-grid {
        gap: 1.5rem;
    }

    .project-img-wrapper {
        height: 220px;
    }

    .pricing-card.popular,
    .pricing-card.popular:hover {
        transform: none;
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2rem;
    }
}

@media (hover: none), (pointer: coarse) {
    .project-card:hover,
    .pricing-card:hover,
    .exp-card:hover,
    .btn-cta:hover,
    .project-link:hover i,
    .skill-tag:hover {
        transform: none;
    }

    .project-card:hover,
    .pricing-card:hover,
    .exp-card:hover {
        box-shadow: none;
        border-color: var(--glass-border);
    }

    .hero::after {
        animation: none;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.25rem;
    }

    .header {
        padding: 1rem 0;
    }

    .header.scrolled {
        padding: 0.85rem 0;
    }

    .section-header {
        display: block;
    }

    .section-intro,
    .section-intro--center {
        margin-bottom: 2rem;
    }

    .hero {
        padding: 7.5rem 0 4rem;
        align-items: flex-end;
        background-position: 72% center;
    }

    .hero::before {
        width: 360px;
        height: 360px;
        top: auto;
        bottom: -10%;
        right: -20%;
        filter: blur(60px);
    }

    .hero-tag {
        font-size: 0.78rem;
        padding: 0.45rem 0.85rem;
    }

    .hero h1 {
        font-size: clamp(2.2rem, 10vw, 3.1rem);
        margin-bottom: 1rem;
    }

    .hero p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .hero-btns {
        display: grid;
        gap: 0.85rem;
    }

    .hero-btns .btn-cta {
        width: 100%;
    }

    .section-title {
        font-size: clamp(1.9rem, 7vw, 2.5rem);
    }

    .skills-container {
        gap: 0.75rem;
    }

    .skill-tag {
        width: 100%;
        text-align: center;
    }

    .exp-card,
    .project-info,
    .pricing-card,
    .contact-wrapper {
        border-radius: 20px;
    }

    .exp-card,
    .pricing-card {
        padding: 2rem 1.35rem;
    }

    .project-info {
        padding: 1.5rem;
    }

    .project-img-wrapper {
        height: 200px;
    }

    .pricing-price {
        font-size: 2.4rem;
    }

    .pricing-features {
        margin: 1.5rem 0;
    }

    .contact-detail {
        align-items: flex-start;
    }

    .form-group input,
    .form-group textarea {
        padding: 0.95rem;
    }

    .site-footer {
        padding: 3rem 0;
    }
}

@media (max-width: 560px) {
    .logo {
        font-size: 1.2rem;
    }

    .mobile-menu-toggle {
        width: 46px;
        height: 46px;
        border-radius: 14px;
    }

    .nav-panel {
        top: 0.75rem;
        right: 0.75rem;
        bottom: 0.75rem;
        width: calc(100vw - 1.5rem);
        padding: 5rem 1rem 1rem;
    }

    .hero {
        min-height: auto;
    }

    .hero h1 {
        font-size: clamp(2rem, 11vw, 2.6rem);
    }

    .project-card,
    .pricing-card,
    .exp-card {
        min-width: 0;
    }

    .project-tag {
        width: 100%;
        text-align: center;
    }

    .contact-wrapper {
        padding: 1.35rem;
    }

    .form-entry-message {
        font-size: 0.88rem;
        padding: 0.85rem 0.9rem;
    }
}

/* ---- ANIMACIONES REESCRITAS Y OPTIMIZADAS ---- */

/* 1. Gradiente del Hero */
.gradient-text {
    background: linear-gradient(270deg, #fff, var(--accent), #10b981, #fff);
    background-size: 200% 200%;
    animation: gradientShift 6s ease infinite;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 2. Animación Garantizada del Título (Hero) con Keyframes */
.hero-content--ready {
    opacity: 0;
    animation: heroFloatUp 1.8s ease-out forwards;
}
@keyframes heroFloatUp {
    0% {
        opacity: 0;
        transform: translateY(40px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 3. Scroll Reveal (Curva de velocidad más constante para que no salte rápido) */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition-property: opacity, transform;
    /* 1.5s con 'ease-out' regular para evitar el salto rápido inicial de la curva cubic */
    transition-duration: 1.5s, 1.5s;
    transition-timing-function: ease-out, ease-out;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
    transition-delay: var(--reveal-delay, 0s), var(--reveal-delay, 0s);
}

/* 4. Hovers Limpios */
.project-card, .pricing-card, .exp-card {
    transition: transform 0.4s ease-out, box-shadow 0.4s ease-out, border-color 0.4s ease !important;
}

.exp-card:hover, .project-card:hover, .pricing-card:hover {
    transform: translateY(-8px) scale(1.02) !important;
    box-shadow: 0 16px 32px rgba(59, 130, 246, 0.15) !important;
    border-color: rgba(59, 130, 246, 0.4) !important;
}

.skill-tag {
    transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease !important;
}

.skill-tag:hover {
    background: transparent !important;
    color: var(--accent) !important;
    transform: translateY(-4px) !important;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.2) !important;
    border-color: var(--accent) !important;
}

/* Deshabilitar scroll en CSS para dejar que JS lo maneje */
html {
    scroll-behavior: auto !important;
}

/* ANIMACIÓN DEL TÍTULO PRINCIPAL CORREGIDA */
.hero-content {
    animation: heroFloatUpFinal 1.8s ease-out forwards !important;
}

@keyframes heroFloatUpFinal {
    0% {
        opacity: 0;
        transform: translateY(40px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}
