/* ========================================
   Local Font Loading
======================================== */

/* Thunder - Títulos hero (condensada, impactante) */
@font-face {
    font-family: 'Thunder';
    src: url('../assets/fonts/Thunder-BlackHC.ttf') format('truetype'),
         url('../assets/fonts/Thunder-BlackHC.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}


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

:root {
    --bg-primary: #0a1628;
    --bg-secondary: #0f1f35;
    --bg-card: #162a46;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --accent-1: #10b981;
    --accent-2: #06b6d4;
    --accent-3: #0ea5e9;
    --gradient-1: linear-gradient(135deg, #10b981 0%, #06b6d4 50%, #0ea5e9 100%);
    --gradient-2: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    --gradient-3: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
    --gradient-4: linear-gradient(135deg, #06b6d4 0%, #10b981 100%);
}

html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    height: 100%;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-primary);
    background-position: center;
    background-size: cover;
    background-repeat: repeat;
    background-attachment: fixed;
    z-index: -1;
}

/* Animated background */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bg-animation::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 20% 80%, rgba(16, 185, 129, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(6, 182, 212, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(14, 165, 233, 0.1) 0%, transparent 40%);
    animation: bgMove 20s ease-in-out infinite;
}

@keyframes bgMove {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(5deg); }
    66% { transform: translate(-20px, 20px) rotate(-5deg); }
}

/* Floating particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 15s infinite;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 20s; }
.particle:nth-child(2) { left: 20%; animation-delay: 2s; animation-duration: 25s; }
.particle:nth-child(3) { left: 30%; animation-delay: 4s; animation-duration: 18s; }
.particle:nth-child(4) { left: 40%; animation-delay: 1s; animation-duration: 22s; }
.particle:nth-child(5) { left: 50%; animation-delay: 3s; animation-duration: 19s; }
.particle:nth-child(6) { left: 60%; animation-delay: 5s; animation-duration: 24s; }
.particle:nth-child(7) { left: 70%; animation-delay: 2s; animation-duration: 21s; }
.particle:nth-child(8) { left: 80%; animation-delay: 4s; animation-duration: 17s; }
.particle:nth-child(9) { left: 90%; animation-delay: 1s; animation-duration: 23s; }

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

/* Navigation */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 3rem;
    z-index: 100;
    opacity: 0;
    animation: fadeIn 1s ease-out 0.5s forwards;
}

.logo {
    display: inline-block;
    text-decoration: none;
}

.logo img {
    height: 40px;
    width: auto;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

@keyframes revealText {
    from {
        color: transparent;
        text-shadow: none;
    }
    to {
        color: white;
        text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    }
}

@keyframes blockReveal {
    0% {
        width: 0%;
        left: 0;
    }
    25% {
        width: 100%;
        left: 0;
    }
    50% {
        width: 100%;
        left: 0;
    }
    100% {
        width: 0;
        left: 100%;
    }
}

@keyframes dotPop {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    position: relative;
}

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

.hero h1 {
    font-family: 'Thunder', sans-serif;
    color: var(--gradient-1);
    font-size: clamp(5rem, 20vw, 16rem);
    text-shadow: none;
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    padding-block: 0.05em;
    position: relative;
    display: inline-block;
}

.hero h1 .gradient-text {
    color: white;
    display: block;
    position: relative;
    color: transparent;
    animation: revealText 0.8s ease-out 4s forwards;
}

.hero h1 .gradient-text::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ad0000;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    animation: blockReveal 4s cubic-bezier(0.74, 0.06, 0.4, 0.92) forwards;
    z-index: 1;
}

.hero h1 .gradient-text::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 25px;
    background: #ad0000;

    border-radius: 50%;
    top: 0.635em;
    right: -0.1em;
    opacity: 0;
    animation: dotPop 0.8s cubic-bezier(0.74, 0.06, 0.4, 0.92) forwards;
    animation-delay: 4s;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-top: 2rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.7s forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll Hint Arrow */
.scroll-hint {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    animation: fadeIn 1s ease-out 1.2s forwards;
}

.scroll-hint svg {
    width: 32px;
    height: 32px;
    color: var(--text-secondary);
    animation: bounceArrow 2s ease-in-out infinite;
}

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

/* About Section */
.about-section {
    padding: 8rem 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.about-content-wrapper {
    text-align: center;
}

.about-title {
    font-family: 'Geist', sans-serif;
    color:#ffffff;
    text-shadow: 0 0 50px rgba(0, 0, 0, 1);
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 2rem;

}

.about-text {
    color: var(--text-secondary);
    font-size: 1.15rem;
    line-height: 1.8;
    max-width: 700px;
    margin: 0 auto 3rem;
}

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.skill-tag {
    padding: 0.6rem 1.2rem;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.skill-tag:hover {
    border-color: var(--accent-1);
    color: var(--text-primary);
    transform: translateY(-2px);
}

/* ========================================
Projects Section — Pinned Flashcards
======================================== */
.projects-section {
    position: relative;
}

.projects-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.projects-title {
    font-family: 'Geist', sans-serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom:1rem;
    color: rgb(255, 255, 255);
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Pin wrapper — tall enough for scroll distance */
.projects-pin-wrapper {
    position: relative;
    /* Height set by JS: 100vh * numberOfCards */
}

/* Viewport — pinned to screen */
.projects-viewport {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Cards stack — all cards on top of each other */
.cards-stack {
    position: relative;
    width: 100%;
    max-width: 900px;
    padding: 0 2rem;
}

/* Project Card */
.project-card {
    position: absolute;
    top: 50%;
    left: 50%;
    width: calc(100% - 4rem);
    max-width: 900px;
    border-radius: 28px;
    padding: 3.5rem;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    border: 1px solid rgb(255, 255, 255);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
    will-change: transform, opacity;
    /* Start hidden — JS controls positioning */
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
    pointer-events: none;
}

.project-card.is-active {
    pointer-events: auto;
}

.project-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

/* Accent colors per card */
.project-card[data-accent="blue"]  { background: linear-gradient(180deg, #162a46 0%, #0f1f35 100%); }
.project-card[data-accent="green"] { background: linear-gradient(180deg, #132a2e 0%, #0f1f35 100%); }
.project-card[data-accent="cyan"]  { background: linear-gradient(180deg, #152535 0%, #0f1f35 100%); }

/* Top accent line */
.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card.is-active::before {
    transform: scaleX(1);
}

.project-card[data-accent="blue"]::before  { background: var(--gradient-3); }
.project-card[data-accent="green"]::before { background: var(--gradient-4); }
.project-card[data-accent="cyan"]::before  { background: var(--gradient-4); }

/* Big number */
.project-number {
    font-family: 'Thunder', sans-serif;
    font-size: clamp(6rem, 12vw, 10rem);
    font-weight: 700;
    position: absolute;
    top: 1rem;
    right: 2rem;
    color: #ffffff;
    opacity: 0.09;
    line-height: 1;
    pointer-events: none;
}

/* Card content */
.project-card-content {
    position: relative;
    z-index: 1;
}

.project-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    margin-bottom: 1.75rem;
}

.project-card[data-accent="blue"] .project-icon  { background: linear-gradient(135deg, rgba(14, 165, 233, 0.15) 0%, rgba(2, 132, 199, 0.15) 100%); }
.project-card[data-accent="green"] .project-icon { background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(20, 184, 166, 0.15) 100%); }
.project-card[data-accent="cyan"] .project-icon  { background: linear-gradient(135deg, rgba(6, 182, 212, 0.15) 0%, rgba(16, 185, 129, 0.15) 100%); }

.project-card h3 {
    font-family: 'Geist', sans-serif;
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
    margin-bottom: 0.4rem;
    color: white;
}

.project-url {
    font-size: 0.95rem;
    color: var(--accent-1);
    margin-bottom: 1.25rem;
    display: block;
    opacity: 0.8;
}

.project-description {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.75;
    margin-bottom: 1.75rem;
    max-width: 600px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 2rem;
}

.project-tag {
    padding: 0.45rem 0.95rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: border-color 0.3s ease, color 0.3s ease;
}

.project-card:hover .project-tag {
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.project-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.8rem;
    background: var(--gradient-1);
    border-radius: 50px;
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.25);
}

.project-card:hover .project-cta {
    box-shadow: 0 8px 35px rgba(16, 185, 129, 0.45);
    transform: translateX(3px);
}

.project-cta svg {
    width: 18px;
    height: 18px;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover .project-cta svg {
    transform: translateX(5px);
}

/* Progress bars — vertical, right side */
.project-progress {
    position: absolute;
    right: 3rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    z-index: 10;
}

.progress-bar {
    width: 3px;
    height: 32px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: background 0.3s ease;
}

.progress-bar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    border-radius: 3px;
    background: var(--accent-1);
    transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.progress-bar.active::after {
    height: 100%;
}

.progress-bar.visited::after {
    height: 100%;
    background: rgba(243, 243, 243, 0.4);
}

.progress-bar:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* Counter */
.project-counter {
    position: absolute;
    right: 3rem;
    bottom: 2.5rem;
    font-family: 'Thunder', sans-serif;
    font-size: 1.1rem;
    color: rgb(68, 68, 68);
    letter-spacing: 0.1em;
    z-index: 10;
}

.project-counter .current-num {
    color: var(--accent-1);
    font-size: 1.4rem;
}

/* Contact Section */
.contact-section {
    padding: 8rem 2rem;
    text-align: center;
}

.contact-box {
    background: var(--bg-card);
    border-radius: 32px;
    padding: 5rem 3rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.contact-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--gradient-1);
}

.contact-title {
    color: rgb(255, 255, 255);
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
    font-family: 'Geist', sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
}

.contact-text {
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    font-size: 1.1rem;
}

.btn {
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    display: inline-block;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 35px rgba(16, 185, 129, 0.6);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2.5rem;
}

.social-link {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--accent-1);
    border-color: var(--accent-1);
    color: white;
    transform: translateY(-3px);
}

.social-link svg {
    width: 22px;
    height: 22px;
}

/* Scroll animations */
.reveal {
    opacity: 0;
    transform: translateY(60px);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Mobile responsive */
@media (max-width: 768px) {
    nav {
        padding: 1rem 1.5rem;
    }

    .logo img {
        height: 40px;
    }

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

    .hero h1 .gradient-text::after {
        width: 12px;
        height: 12px;
        right: -0.25em;
        top: 0.55em;
    }

    .project-card {
        padding: 2.5rem 1.75rem;
        border-radius: 22px;
        width: calc(100% - 2.5rem);
    }

    .project-number {
        font-size: 5rem;
        right: 1rem;
    }

    .project-icon {
        width: 56px;
        height: 56px;
        font-size: 1.8rem;
        margin-bottom: 1.25rem;
    }

    .project-progress {
        right: 1rem;
    }

    .project-counter {
        right: 1rem;
        bottom: 2rem;
        font-size: 0.95rem;
    }

    .project-counter .current-num {
        font-size: 1.15rem;
    }

    .contact-box {
        padding: 3rem 1.5rem;
    }

    .about-section,
    .contact-section {
        padding: 5rem 1.5rem;
    }

}

/* Page transition overlay */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease;
}

/* Overlay for going back to index (light bg blurred) */
.page-transition.to-index {
    background: url('../assets/green_background(16.9).png') center / cover no-repeat;
    filter: blur(30px);
    transform: scale(1.1);
}

.page-transition.active {
    opacity: 1;
}

/* Parallax effect for hero text */
.parallax-text {
    transition: transform 0.1s ease-out;
}
