:root {
    --bg-main: #E8F2D3;
    --hero-bg: #C8B6FF;
    --border-profile: #7B855E;
    --text-dark: #1A1A1A;
    --text-muted: #555555;
    --card-bg: #FFFFFF;
    --transition-smooth: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        background-color 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
    font-family: 'Plus Jakarta Sans', sans-serif;
    margin: 0;
    overflow-x: hidden;
}

.container {
    padding: 100px 5%;
    max-width: 1200px;
    margin: 0 auto;
}

/* --- Menú de Navegación Flotante (Glassmorphism) --- */
.glass-nav {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1100px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50px;
    padding: 12px 30px;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-back-link {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.nav-back-link:hover {
    transform: translateX(-3px);
}

.nav-brand {
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 25px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-smooth);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--border-profile);
    transition: var(--transition-smooth);
}

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

.nav-btn-nav {
    text-decoration: none;
    background: var(--text-dark);
    color: white;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.nav-btn-nav:hover {
    background: var(--border-profile);
    transform: translateY(-2px);
}

/* --- Hero Section Refinado --- */
.hero-section {
    min-height: 100vh;
    padding-top: 120px;
    background: var(--hero-bg);
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
}

#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: all;
}

.blur-blob {
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.4);
    filter: blur(80px);
    border-radius: 50%;
    z-index: 1;
}

.blob-1 {
    top: 10%;
    left: -5%;
}

.blob-2 {
    bottom: 10%;
    right: -5%;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
    gap: 50px;
    position: relative;
    z-index: 2;
    width: 100%;
}

.hero-info {
    max-width: 600px;
}

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.6);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(76, 175, 80, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

.hero-title {
    font-size: 3.5rem;
    line-height: 1.1;
    margin: 0 0 15px 0;
    font-weight: 800;
    letter-spacing: -1px;
}

.text-gradient {
    background: linear-gradient(45deg, var(--text-dark), var(--border-profile));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.4rem;
    color: var(--border-profile);
    font-weight: 600;
    margin: 0 0 20px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 35px;
}

.hero-cta-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: var(--text-dark);
    color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover {
    background: var(--border-profile);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-dark);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
}

.hero-visual {
    display: flex;
    justify-content: center;
    perspective: 1000px;
}

.profile-card-wrapper {
    position: relative;
    width: 100%;
    max-width: 320px;
}

.profile-card-bg {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 100%;
    height: 100%;
    background: var(--border-profile);
    border-radius: 24px;
    z-index: 1;
}

.profile-card {
    position: relative;
    background: var(--card-bg);
    padding: 25px;
    border-radius: 24px;
    z-index: 2;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    transition: transform 0.1s ease-out;
}

.profile-image-frame {
    width: 100%;
    height: 280px;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-size: 1.4rem;
    margin: 0 0 5px 0;
}

.profile-role {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
    font-weight: 500;
}

/* --- Títulos e Identidad de Secciones --- */
.section-header {
    margin-bottom: 50px;
}

.section-header.text-center {
    text-align: center;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.section-tag {
    display: inline-block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--border-profile);
    font-weight: 700;
    margin-bottom: 8px;
}

h2 {
    font-size: 2.5rem;
    margin: 0;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.5;
    margin-top: 10px;
}

/* --- Sección Sobre Mí --- */
.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-lead {
    font-size: 1.3rem;
    line-height: 1.5;
    font-weight: 500;
    margin-bottom: 20px;
}

.about-body {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 35px;
}

.about-stats {
    display: flex;
    gap: 30px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-num {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--border-profile);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* --- Bento Grid Showcase --- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 280px;
    gap: 25px;
    margin-top: 40px;
}

.bento-card {
    background: var(--card-bg);
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    transition: var(--transition-smooth);
    transform-style: preserve-3d;
}

.bento-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle 180px at var(--x, 0px) var(--y, 0px), rgba(200, 182, 255, 0.18), transparent 80%);
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bento-card:hover::before {
    opacity: 1;
}

.bento-card:hover {
    box-shadow: 0 20px 45px rgba(200, 182, 255, 0.15);
}

.bento-w2 {
    grid-column: span 2;
}

.bento-h2 {
    grid-row: span 2;
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    height: 140px;
    flex-shrink: 0;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.03);
}

.bento-h2 .card-image-wrapper {
    height: 320px;
    flex: none;
    flex-shrink: 0;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.bento-card:hover .card-image-wrapper img {
    transform: scale(1.06) translateZ(10px);
}

.card-overlay-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.4) 100%);
    pointer-events: none;
}

.card-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transform: translateZ(15px);
}

.bento-h2 .card-content {
    padding: 30px;
}

.card-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.badge {
    background: var(--bg-main);
    color: var(--text-dark);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.card-title {
    font-size: 1.3rem;
    margin: 0 0 8px 0;
    font-weight: 700;
}

.card-description {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

/* Tarjeta Bento Dark */
.bento-dark {
    background: #1A1A24;
    color: white;
    position: relative;
    border: 1px solid rgba(200, 182, 255, 0.05);
}

.bento-dark-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    background-image: radial-gradient(white 1px, transparent 0);
    background-size: 24px 24px;
}

.card-content-full {
    padding: 35px;
    height: 100%;
    display: flex;
    align-items: center;
}

.bento-dashboard-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 30px;
    width: 100%;
    align-items: center;
}

.dashboard-title {
    font-size: 1.4rem;
    margin: 0 0 10px 0;
    color: var(--hero-bg);
}

.dashboard-stats-grid {
    display: flex;
    gap: 20px;
    justify-content: flex-end;
}

.dash-stat {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px 20px;
    border-radius: 16px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.dash-val {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--hero-bg);
}

.dash-lbl {
    font-size: 0.75rem;
    color: #888;
}

/* --- Sección de Videos Multimedia (Grid de 16:9 Proporcional) --- */
.video-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-top: 40px;
}

.video-card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(200, 182, 255, 0.08);
}

.video-player-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    /* Forzado de proporción horizontal limpia */
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.video-player-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.player-controls-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
    padding: 20px 15px 15px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 5;
}

.play-pause-btn,
.volume-btn {
    color: white;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: var(--transition-smooth);
}

.play-pause-btn:hover,
.volume-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.progress-bar-simulated {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--hero-bg);
    width: 0%;
    transition: width 0.1s linear;
}

.video-info {
    padding-top: 15px;
}

.video-info h3 {
    font-size: 1.2rem;
    margin: 0 0 6px 0;
}

.video-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

/* --- Habilidades Técnicas Premium --- */
.skills-showcase-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-top: 40px;
}

.skill-card-premium {
    background: var(--card-bg);
    padding: 30px 25px;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.02);
    transition: var(--transition-smooth);
}

.skill-card-premium:hover {
    transform: translateY(-5px);
    border-color: var(--border-profile);
    box-shadow: 0 15px 35px rgba(123, 133, 94, 0.1);
}

.skill-card-icon {
    width: 45px;
    height: 45px;
    background: var(--bg-main);
    color: var(--text-dark);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.skill-card-premium h3 {
    font-size: 1.2rem;
    margin: 0 0 10px 0;
}

.skill-card-premium p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0 0 20px 0;
    min-height: 68px;
}

.skill-level-bar {
    width: 100%;
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
}

.skill-level-fill {
    height: 100%;
    background: var(--border-profile);
    border-radius: 3px;
}

/* --- Banner de Contacto --- */
.footer-section {
    padding-bottom: 40px;
}

.contact-card-premium {
    background: #1A1A24;
    color: white;
    border-radius: 32px;
    padding: 60px 50px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(200, 182, 255, 0.05);
}

.contact-card-bg-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(200, 182, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.contact-card-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
    margin: 0 auto;
}

.cta-tag {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--hero-bg);
    font-weight: 700;
}

.contact-card-premium h2 {
    font-size: 2.3rem;
    margin: 10px 0 15px 0;
}

.contact-card-premium p {
    color: #aaa;
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 35px;
}

.contact-quick-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.quick-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: #eee;
    background: rgba(255, 255, 255, 0.04);
    padding: 10px 20px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: var(--transition-smooth);
}

.quick-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--hero-bg);
    transform: translateY(-2px);
}

.footer-credits {
    text-align: center;
    margin-top: 60px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 25px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- Scroll Reveal con Transición Suave --- */
.scroll-reveal-item {
    opacity: 0;
    transform: translateY(40px) scale(0.97);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-reveal-item.revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ==========================================================================
   MEDIA QUERIES (Responsividad Pulida)
   ========================================================================== */

@media (max-width: 992px) {
    .container {
        padding: 80px 6%;
    }

    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }

    .hero-info {
        margin: 0 auto;
    }

    .hero-cta-group {
        justify-content: center;
    }

    .hero-visual {
        order: -1;
    }

    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .skills-showcase-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    /* Un solo video por fila en pantallas medianas/chicas */
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.8rem;
    }

    .nav-links {
        display: none;
    }

    .bento-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }

    .bento-w2 {
        grid-column: span 1;
    }

    .bento-h2 {
        grid-row: span 1;
    }

    .bento-h2 .card-image-wrapper {
        height: 140px;
    }

    .card-content-full {
        padding: 20px;
    }

    .bento-dashboard-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 20px;
    }

    .dashboard-stats-grid {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.3rem;
    }

    .container {
        padding: 60px 4%;
    }

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

    .contact-card-premium {
        padding: 40px 20px;
    }

    .contact-quick-links {
        flex-direction: column;
        align-items: center;
    }

    .quick-item {
        width: 100%;
        justify-content: center;
    }
}