/* 
   Modern Portfolio Design System - Cyber-Dark Tech Aesthetic
   Refined to match user-provided images
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@400;600;700;800;900&display=swap');

:root {
    --bg-deep: #000000;
    --bg-card: #151515;
    /* Slightly lighter than pure black */
    --bg-section: #050505;
    --accent: #00ffb3;
    /* Neon Turquoise / Green */
    --accent-hover: #00cc8f;
    --text-primary: #ffffff;
    --text-secondary: #999999;
    --text-muted: #666666;
    --border-subtle: rgba(255, 255, 255, 0.05);
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    background-color: var(--bg-deep);
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    background-color: var(--bg-deep);
}

h1,
h2,
h3,
h4 {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 100px 0;
}

/* Animations Trigger */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

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

/* --- HEADER / NAVIGATION --- */
header {
    position: sticky;
    top: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

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

.logo {
    font-size: 1.8rem;
    font-weight: 900;
    color: white;
    font-family: 'Outfit', sans-serif;
}

.logo span {
    color: var(--accent);
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    transition: var(--transition);
}

.nav-toggle-bar {
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 999px;
    transition: var(--transition);
}

header.nav-open .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

header.nav-open .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}

header.nav-open .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

nav ul li a {
    text-decoration: none;
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    transition: var(--transition);
    text-transform: uppercase;
}

nav ul li a:hover {
    color: var(--accent);
}

nav ul li a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

/* --- INSTAGRAM SECTION --- */
#instagram-lab {
    background: var(--bg-deep);
    padding: 100px 0;
    border-top: 1px solid var(--border-subtle);
}

.insta-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
}

.insta-slider-container {
    position: relative;
    padding: 0 4rem;
}

.insta-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
    backdrop-filter: blur(5px);
}

.slider-arrow:hover {
    background: var(--accent);
    color: var(--bg-deep);
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(0, 255, 179, 0.4);
}

.slider-arrow.prev {
    left: 0;
}

.slider-arrow.next {
    right: 0;
}


.insta-filters {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}


.insta-item {
    position: relative;
    aspect-ratio: 1/1;
    border-radius: 24px;
    overflow: hidden;
    display: block;
}

/* Indicador de video (siempre visible pero sutil) */
.insta-item.video::before {
    content: '\f144';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    color: white;
    font-size: 1.2rem;
    z-index: 5;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.2);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    backdrop-filter: blur(4px);
}

.insta-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
    position: relative;
    z-index: 2;
}

.insta-img-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: #1a1a1a; /* Dark gray for "loading" or "empty" */
    overflow: hidden;
}

/* Placeholder when image is missing or broken */
.insta-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(45deg, #111, #222);
    z-index: 1;
}

.insta-placeholder i {
    font-size: 2rem;
    color: var(--border-subtle);
    opacity: 0.3;
}

/* Specific styling for broken state */
.insta-img-container.broken-img .insta-placeholder {
    opacity: 1;
}

.insta-img-container.broken-img .insta-placeholder::after {
    content: 'Enlace expirado';
    position: absolute;
    bottom: 2rem;
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.insta-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0;
    transition: var(--transition);
}

.insta-overlay i {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.insta-caption {
    font-size: 0.85rem;
    color: white;
    text-align: center;
    padding: 0 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    font-weight: 500;
}

.insta-hashtags {
    margin-top: 0.8rem;
    font-size: 0.7rem;
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
}


.insta-item:hover .insta-overlay {
    opacity: 1;
}

.insta-item:hover img {
    transform: scale(1.1);
}

@media (max-width: 992px) {
    .insta-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .insta-grid {
        grid-template-columns: 1fr;
    }
}

/* --- HERO SECTION --- */
#hero {
    position: relative;
    height: calc(100vh - 80px);
    min-height: 700px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: var(--bg-deep);
}

.video-background-cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.video-background-cover iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.1);
    width: 100vw;
    height: 56.25vw;
    min-width: 177.77vh;
    min-height: 100vh;
    filter: opacity(3.3) grayscale(0.1);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, var(--bg-deep) 100%);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    align-items: center;
    gap: 4rem;
    width: 100%;
}

.hero-text h1 {
    font-size: clamp(4rem, 10vw, 7rem);
    font-weight: 900;
    line-height: 0.85;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.hero-text .subtitle {
    font-size: 1.5rem;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 2rem;
    display: block;
}

.hero-text p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin-bottom: 3rem;
    font-weight: 300;
}

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

@keyframes floatAvatar {
    0% {
        transform: translateY(0px) rotateY(-5deg) rotateX(5deg);
    }

    50% {
        transform: translateY(-20px) rotateY(10deg) rotateX(-5deg);
    }

    100% {
        transform: translateY(0px) rotateY(-5deg) rotateX(5deg);
    }
}

.avatar-animation-wrapper {
    animation: floatAvatar 6s ease-in-out infinite;
    transform-style: preserve-3d;
}

.avatar-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 24px;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.8);
    transform-style: preserve-3d;
}

.avatar-card img {
    width: 320px;
    height: 400px;
    object-fit: cover;
    border-radius: 20px;
    transform: translateZ(50px);
}

.hero-links {
    display: flex;
    gap: 1.5rem;
}

.btn {
    padding: 1.2rem 2.5rem;
    border-radius: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.8rem;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
}

.btn-accent {
    background: var(--accent);
    color: var(--bg-deep);
}

.btn-accent:hover {
    background: var(--accent-hover);
    transform: translateY(-3px);
}

.btn-outline {
    background: transparent;
    color: white;
    border: 1px solid var(--border-subtle);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-3px);
}

.btn-load-more {
    background: #252525;
    color: white;
    border: none;
    border-radius: 30px;
    padding: 1rem 2rem;
    font-weight: 500;
    font-size: 1rem;
    text-transform: none;
    letter-spacing: 0;
    transition: var(--transition);
}

.btn-load-more:hover {
    background: var(--accent);
    color: var(--text-primary);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 255, 179, 0.1);
}

/* --- SECTION TITLES --- */
.section-title {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title h2 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
}

.section-title p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.1rem;
}

/* --- PORTFOLIO --- */
.portfolio-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn,
.insta-filter-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.filter-btn:hover,
.insta-filter-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

.filter-btn.active,
.insta-filter-btn.active {
    background: var(--accent);
    color: var(--bg-deep);
    border-color: var(--accent);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.portfolio-item {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    background: var(--bg-card);
    transition: var(--transition);
}

.portfolio-img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/11;
    overflow: hidden;
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
    display: flex;
    align-items: flex-end;
    padding: 2rem;
    opacity: 0;
    transition: var(--transition);
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-item:hover img {
    transform: scale(1.1);
}

.overlay-content {
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-item:hover .overlay-content {
    transform: translateY(0);
}

.category-tag {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: var(--accent);
    color: var(--bg-deep);
    font-size: 0.7rem;
    font-weight: 800;
    border-radius: 4px;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.overlay-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: white;
}

.view-btn {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* --- SKILLS --- */
#skills {
    position: relative;
    overflow: hidden;
    background: var(--bg-section);
}

#skills::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('https://mir-s3-cdn-cf.behance.net/project_modules/fs/7d7598114615571.603ea33a416c0.png') center/cover no-repeat;
    opacity: 0.1;
    filter: grayscale(1);
    pointer-events: none;
}

/* --- SKILLS --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.skill-card {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 24px;
    border: 1px solid var(--border-subtle);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.skill-card:hover {
    background: rgba(255, 255, 255, 0.02);
    border-color: var(--accent);
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.skill-icon-box {
    width: 60px;
    height: 60px;
    background: rgba(0, 255, 179, 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    transition: var(--transition);
}

.skill-card:hover .skill-icon-box {
    background: var(--accent);
    transform: rotateY(180deg);
}

.skill-icon-box i {
    color: var(--accent);
    font-size: 1.5rem;
    transition: var(--transition);
}

.skill-card:hover .skill-icon-box i {
    color: var(--bg-deep);
}

.skill-card h4 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: white;
}

.skill-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}


/* --- CONTACT --- */
.contact-container {
    max-width: 800px;
    margin: 0 auto;
}

.contact-form {
    background: var(--bg-card);
    padding: 3rem;
    border-radius: 24px;
    border: 1px solid var(--border-subtle);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    letter-spacing: 1px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    background: var(--bg-deep);
    border: 1px solid var(--border-subtle);
    padding: 1.2rem;
    border-radius: 12px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

/* FOOTER */
footer {
    padding: 4rem 0;
    border-top: 1px solid var(--border-subtle);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.social-links a {
    color: var(--text-muted);
    font-size: 1.5rem;
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--accent);
}

.btn:focus-visible,
.filter-btn:focus-visible,
.insta-filter-btn:focus-visible,
.slider-arrow:focus-visible,
.back-to-top:focus-visible,
.social-links a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* Scroll progress bar */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--accent);
    z-index: 10001;
    width: 0;
}

/* Custom cursor */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
}

.cursor-dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid var(--accent);
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 50px;
    height: 50px;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s;
    opacity: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top:hover {
    background: var(--accent);
    color: var(--bg-deep);
}

@media (max-width: 768px) {

    .cursor-dot,
    .cursor-outline {
        display: none;
    }
}


/* Responsive */
@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-visual {
        display: none;
    }

    .hero-links {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    nav {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background: rgba(0, 0, 0, 0.98);
        border-bottom: 1px solid var(--border-subtle);
        transform: translateY(-10px);
        opacity: 0;
        pointer-events: none;
        transition: var(--transition);
    }

    nav ul {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 2rem 1.5rem;
    }

    nav ul li a {
        font-size: 0.9rem;
    }

    header.nav-open nav {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .hero-text h1 {
        font-size: 3.5rem;
    }

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

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}