/* Modern CSS Reset & Setup */
:root {
    --bg-main: #060911;
    --bg-card: rgba(15, 23, 42, 0.6);
    --bg-card-hover: rgba(30, 41, 59, 0.8);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(139, 92, 246, 0.4);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --color-primary: #8b5cf6;
    --color-secondary: #3b82f6;
    --color-accent: #06b6d4;
    
    --gradient-brand: linear-gradient(135deg, var(--color-primary), var(--color-secondary), var(--color-accent));
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --header-height: 80px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Grids & Glows */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    opacity: 0.8;
}

.bg-glow {
    position: fixed;
    top: -20%;
    left: 20%;
    width: 60vw;
    height: 60vw;
    z-index: -1;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, rgba(59, 130, 246, 0.03) 50%, transparent 100%);
    filter: blur(120px);
    pointer-events: none;
    animation: pulse-glow 15s infinite alternate ease-in-out;
}

@keyframes pulse-glow {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.1) translate(-5%, 5%); }
}

/* Helper Components */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header & Navigation */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(6, 9, 17, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    transition: var(--transition-smooth);
}

.header.scrolled {
    height: 70px;
    background: rgba(6, 9, 17, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: var(--transition-smooth);
}

.logo-dot {
    width: 8px;
    height: 8px;
    background: var(--gradient-brand);
    border-radius: 50%;
    margin-right: 8px;
    display: inline-block;
}

.logo-ext {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

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

.nav-link:hover {
    color: var(--text-primary);
}

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

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

.btn-header {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1.25rem;
    border-radius: 30px;
}

.btn-header:hover {
    background: var(--text-primary);
    color: var(--bg-main) !important;
    border-color: var(--text-primary);
}

.btn-header::after {
    display: none;
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 110;
}

.mobile-toggle .bar {
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    transition: var(--transition-smooth);
    border-radius: 2px;
}

/* Hero Section */
.hero-section {
    position: relative;
    padding-top: calc(var(--header-height) + 4rem);
    padding-bottom: 6rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hero-container {
    text-align: center;
    z-index: 5;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 2rem;
    letter-spacing: 0.5px;
}

.hero-tag::before {
    content: '';
    width: 6px;
    height: 6px;
    background-color: #34d399;
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 10px #34d399;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -2px;
    max-width: 900px;
    margin: 0 auto 1.5rem;
}

.gradient-text {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 650px;
    margin: 0 auto 2.5rem;
    font-weight: 400;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2.25rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    text-decoration: none;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.btn-primary {
    background: var(--gradient-brand);
    color: white;
    border: none;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.25);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.4);
}

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

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

.btn-cerebro {
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.35);
    color: var(--color-primary);
    font-weight: 600;
}

.btn-cerebro:hover {
    background: rgba(139, 92, 246, 0.18);
    border-color: rgba(139, 92, 246, 0.7);
    box-shadow: 0 6px 24px rgba(139, 92, 246, 0.25);
    transform: translateY(-3px);
}

.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
}

.mouse {
    width: 26px;
    height: 44px;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

.wheel {
    width: 4px;
    height: 8px;
    background-color: var(--text-secondary);
    border-radius: 2px;
    animation: scroll-wheel 1.6s infinite ease-in-out;
}

@keyframes scroll-wheel {
    0% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(8px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* Animations */
.animate-fade-in {
    opacity: 0;
    animation: fadeIn 1s forwards ease-out 0.2s;
}

.animate-slide-up {
    opacity: 0;
    transform: translateY(30px);
    animation: slideUp 1s forwards cubic-bezier(0.16, 1, 0.3, 1) 0.4s;
}

.animate-slide-up-delayed {
    opacity: 0;
    transform: translateY(30px);
    animation: slideUp 1s forwards cubic-bezier(0.16, 1, 0.3, 1) 0.6s;
}

.animate-slide-up-delayed-more {
    opacity: 0;
    transform: translateY(30px);
    animation: slideUp 1s forwards cubic-bezier(0.16, 1, 0.3, 1) 0.8s;
}

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

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Projects Section */
.projects-section {
    padding: 8rem 0;
    position: relative;
    border-top: 1px solid var(--border-color);
}

.section-header {
    text-align: center;
    margin-bottom: 5rem;
}

.section-tag {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    margin-bottom: 0.75rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 1rem;
}

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

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: var(--transition-smooth);
}

.project-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-color-hover);
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.project-glow {
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: var(--glow-color);
    filter: blur(40px);
    pointer-events: none;
    transition: var(--transition-smooth);
}

.project-card:hover .project-glow {
    transform: scale(1.5);
    filter: blur(30px);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.project-image {
    width: 100%;
    height: 180px;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-category {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-status {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.status-active {
    background: rgba(52, 211, 153, 0.1);
    color: #34d399;
}

.status-redirected {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
}

.project-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-alias {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 400;
}

.project-card-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    flex-grow: 1;
}

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

.project-tags span {
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    color: var(--text-secondary);
}

.project-link {
    display: inline-flex;
    align-items: center;
    font-size: 0.95rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    gap: 0.5rem;
    transition: var(--transition-smooth);
}

.project-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 10;
}

.project-card:hover .project-link {
    color: var(--color-primary);
}

.link-icon {
    width: 16px;
    height: 16px;
    transition: var(--transition-smooth);
}

.project-card:hover .link-icon {
    transform: translate(2px, -2px);
}

/* About Me Section */
.about-section {
    padding: 8rem 0;
    border-top: 1px solid var(--border-color);
    position: relative;
}

.about-container {
    max-width: 900px;
}

.about-text {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 3.5rem;
}

.skill-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.skill-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 0.625rem;
    border-radius: 12px;
}

.skill-icon svg {
    width: 20px;
    height: 20px;
    color: var(--color-primary);
    display: block;
}

.skill-item h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.skill-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Contact Section */
.contact-section {
    padding: 8rem 0 10rem;
    border-top: 1px solid var(--border-color);
}

.contact-card {
    position: relative;
    background: radial-gradient(ellipse at top right, rgba(139, 92, 246, 0.15) 0%, rgba(6, 9, 17, 0.6) 80%);
    border: 1px solid var(--border-color);
    border-radius: 32px;
    padding: 4.5rem;
    text-align: center;
    overflow: hidden;
}

.contact-glow {
    position: absolute;
    bottom: -150px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.15) 0%, transparent 70%);
    filter: blur(50px);
    pointer-events: none;
}

.contact-content {
    position: relative;
    z-index: 2;
}

.contact-title {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    margin-bottom: 1.5rem;
}

.contact-desc {
    color: var(--text-secondary);
    max-width: 550px;
    margin: 0 auto 3rem;
    font-size: 1.15rem;
    line-height: 1.7;
}

.contact-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.btn-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

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

.social-links a {
    color: var(--text-secondary);
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 50%;
}

.social-links a:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-3px);
}

.social-links svg {
    width: 20px;
    height: 20px;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border-color);
    padding: 2.5rem 0;
    background: #04060b;
}

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

.footer-left p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-right .status-dot {
    width: 8px;
    height: 8px;
    background-color: #34d399;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px #34d399;
    animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

.footer-right .status-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .hero-title {
        font-size: 3.25rem;
    }
    .contact-title {
        font-size: 2.5rem;
    }
    .contact-card {
        padding: 3rem 2rem;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 0 1.5rem;
    }
    
    .mobile-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: #060911;
        border-left: 1px solid var(--border-color);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 3rem;
        transition: var(--transition-smooth);
        z-index: 105;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .mobile-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .mobile-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    .hero-title {
        font-size: 2.5rem;
        letter-spacing: -1px;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
    }
    
    .hero-actions .btn {
        width: 100%;
    }
    
    .projects-section, .about-section, .contact-section {
        padding: 5rem 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .footer-container {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
}

/* ==========================================================================
   Domain Integration Styles (.es / .com)
   ========================================================================== */

/* Logo Extension Transitions */
.logo-ext {
    display: inline-block;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.logo-ext.transition-out {
    opacity: 0;
    transform: translateY(-6px);
}
.logo-ext.transition-in {
    opacity: 0;
    transform: translateY(6px);
}

/* Domain Connection Pill */
.domain-connection-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    background: rgba(255, 255, 255, 0.95);
    color: #060911;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 0.4rem 1.1rem;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.05);
    width: fit-content;
    z-index: 5;
    position: relative;
    pointer-events: none; /* Let events fall through to the card link */
}

.domain-pill-arrow {
    color: var(--color-primary);
    font-size: 0.8rem;
    display: inline-block;
    animation: slide-arrow 1.5s infinite alternate ease-in-out;
}

@keyframes slide-arrow {
    0% { transform: translateX(0); }
    100% { transform: translateX(3px); }
}

.domain-pill-text {
    letter-spacing: -0.2px;
}

.domain-pill-es {
    opacity: 0.65;
}

.domain-pill-com {
    font-weight: 800;
}

/* Redirection Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    max-width: 380px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.2) inset;
    padding: 1.25rem;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateY(0);
}

.toast-notification.hidden {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
}

.toast-content {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    position: relative;
}

.toast-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    flex-shrink: 0;
}

.toast-icon {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-body {
    flex-grow: 1;
    padding-right: 1.5rem;
}

.toast-body h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.toast-body p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.toast-close {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    background: transparent;
    border: none;
    font-size: 1.25rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-smooth);
    padding: 4px;
}

.toast-close:hover {
    color: var(--text-primary);
}

@media (max-width: 480px) {
    .toast-notification {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
}

