/**
 * NerSquad Portfolio - Main Stylesheet
 * 
 * Este archivo centraliza todos los estilos del portfolio
 * para facilitar mantenimiento y performance.
 */

/* ==========================================================================
   1. CSS RESET & BASE
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

::selection {
    background: #F04E12;
    color: #0A0A0A;
    -webkit-text-fill-color: #0A0A0A;
}

/* ==========================================================================
   2. CUSTOM PROPERTIES (CSS Variables)
   ========================================================================== */

:root {
    /* Colors */
    --color-primary: #FFFFFF;
    --color-background-light: #F0F0F0;
    --color-background-dark: #0A0A0A;

    /* Spacing */
    --sidebar-width: 18.75rem;
    --spacing-base: 0.5rem;

    /* Border Radius */
    --radius-default: 1.5rem;
    --radius-sm: 0.5rem;
    --radius-lg: 2rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms;
    --transition-base: 300ms;
    --transition-slow: 500ms;

    /* Z-index */
    --z-sidebar: 10;
    --z-whatsapp: 50;
}

/* ==========================================================================
   3. MATERIAL ICONS
   ========================================================================== */

.material-icons-outlined {
    font-size: 20px;
}

/* ==========================================================================
   4. VIEW TOGGLE SYSTEM (Grid/List)
   ========================================================================== */

/* Base styles for toggles */
.view-toggle {
    color: #9CA3AF;
    transition: color 0.2s ease;
}

/* Active toggle - Dark Mode */
.dark .view-toggle.active {
    color: #FFFFFF;
    font-weight: 500;
}

/* Active toggle - Light Mode */

/* Inactive toggles - Dark Mode */
.dark .view-toggle:not(.active) {
    color: rgba(255, 255, 255, 0.4);
}

/* Inactive toggles - Light Mode */

/* Hover effect */
.view-toggle:hover {
    opacity: 0.8;
}

.list-view {
    display: none;
}

body.view-list .list-view {
    display: block;
}

body.view-list .grid-view {
    display: none;
}

/* ==========================================================================
   5. ANIMATIONS
   ========================================================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Fade In Classes */
.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.fade-in-delay-1 {
    animation: fadeIn 0.6s ease-out 0.2s forwards;
    opacity: 0;
}

.fade-in-delay-2 {
    animation: fadeIn 0.6s ease-out 0.4s forwards;
    opacity: 0;
}

.fade-in-delay-3 {
    animation: fadeIn 0.6s ease-out 0.6s forwards;
    opacity: 0;
}

/* Scale In */
.scale-in {
    animation: scaleIn 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================================================
   6. WHATSAPP BUTTON
   ========================================================================== */

.whatsapp-button {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 3.5rem;
    height: 3.5rem;
    background-color: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transition: all var(--transition-base) ease;
    z-index: var(--z-whatsapp);
}

.whatsapp-button:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: scale(1.1);
}

.whatsapp-badge {
    position: absolute;
    top: -0.5rem;
    left: -0.5rem;
    background-color: #EF4444;
    color: white;
    font-size: 0.75rem;
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.whatsapp-button:hover .whatsapp-badge {
    opacity: 1;
}

/* ==========================================================================
   7. PROJECT CARDS
   ========================================================================== */

.project-card {
    transition: all var(--transition-slow) cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: var(--radius-sm);
}

.project-card:hover {
    transform: translateY(-4px);
}

.dark .project-card:hover .project-img-wrapper {
    border-color: rgba(240, 78, 18, 0.5);
}

.project-img-wrapper {
    transition: all var(--transition-slow) cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid transparent;
}

.project-card:hover .project-image {
    transform: scale(1.05);
}

.project-image {
    transition: transform var(--transition-slow) cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================================================
   7.5. SIDEBAR & FILTERS
   ========================================================================== */

aside nav a {
    display: inline-block;
    transition: all var(--transition-base) ease;
    position: relative;
}

aside nav a:hover {
    color: #F04E12;
    transform: translateX(5px);
}

aside nav a.active {
    color: #F04E12;
    font-weight: 700;
}

aside nav a.active::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #F04E12;
}

.filter-btn {
    padding: 0.375rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: #a8a29e;
    transition: all var(--transition-base) ease;
    background: rgba(255, 255, 255, 0.02);
}

.dark .filter-btn {
    border-color: rgba(255, 255, 255, 0.05);
}

.filter-btn:hover {
    border-color: rgba(240, 78, 18, 0.5);
    color: #F04E12;
    background: rgba(240, 78, 18, 0.05);
}

.filter-btn.active {
    border-color: #F04E12;
    color: #F04E12;
    background: rgba(240, 78, 18, 0.1);
}

.badge-cliente {
    background: rgba(255, 247, 237, 0.9); /* orange-50 */
    color: #ea580c; /* orange-600 */
    border: 1px solid rgba(234, 88, 12, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.dark .badge-cliente {
    background: rgba(67, 20, 7, 0.85); /* dark orange tint */
    color: #fdba74; /* orange-300 */
    border: 1px solid rgba(253, 186, 116, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   7.6. CYBER UTILITIES (About Us)
   ========================================================================== */

.cyber-value-card {
    transition: all var(--transition-base) ease;
}

.dark .cyber-value-card:hover {
    border-color: rgba(240, 78, 18, 0.3);
}

.dark .cyber-value-card:hover .cyber-icon-container {
    background: rgba(240, 78, 18, 0.1);
}

.dark .cyber-value-card:hover .cyber-icon-container span {
    color: #F04E12 !important;
}

/* ==========================================================================
   8. CYBER CARDS
   ========================================================================== */

.cyber-card {
    transition: all var(--transition-base) ease;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.dark .cyber-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.dark .cyber-card:hover {
    border-color: rgba(240, 78, 18, 0.3);
    transform: translateY(-4px);
}

.dark .cyber-card:hover .cyber-icon-container {
    background: rgba(240, 78, 18, 0.1);
}

.dark .cyber-card:hover .cyber-icon-container span {
    color: #F04E12 !important;
}

/* ==========================================================================
   8.5. CYBER INPUTS & NUMBERS
   ========================================================================== */

.cyber-input {
    transition: all var(--transition-base) ease;
    background: #ffffff;
    border: 2px solid rgba(0, 0, 0, 0.05);
    color: #1c1917; /* stone-900 */
}

.cyber-input:focus {
    border-color: rgba(240, 78, 18, 0.5);
    outline: none;
}

.cyber-input option {
    background-color: #ffffff;
    color: #1c1917;
}

.dark .cyber-input {
    background: rgba(255, 255, 255, 0.02);
    border: 2px solid rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.dark .cyber-input:focus {
    border-color: rgba(240, 78, 18, 0.5);
    background: rgba(240, 78, 18, 0.02);
}

.dark .cyber-input option {
    background-color: #1c1917; /* stone-900 */
    color: #ffffff;
}

.cyber-number {
    transition: all var(--transition-base) ease;
    border: 2px solid #e5e5e5; /* stone-200 */
    background: transparent;
    color: #d6d3d1; /* stone-300 */
}

.dark .cyber-number {
    border-color: #292524; /* stone-800 */
    color: #44403c; /* stone-700 */
}

.group:hover .cyber-number {
    border-color: #F04E12;
    color: #F04E12;
    transform: scale(1.1);
}

/* ==========================================================================
   9. BREADCRUMBS
   ========================================================================== */

.breadcrumb-separator {
    margin: 0 0.5rem;
    color: #78716c;
    /* stone-500 */
}

/* ==========================================================================
   9. TAG PILLS
   ========================================================================== */

.tag-pill {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    border-radius: 9999px;
    transition: all var(--transition-fast) ease;
}

.tag-pill:hover {
    transform: translateY(-2px);
}

/* ==========================================================================
   11. RESPONSIVE UTILITIES
   ========================================================================== */

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-base) ease;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
    }
}

/* ==========================================================================
   11. UTILITY CLASSES
   ========================================================================== */

/* ==========================================================================
   12. LOADING STATES
   ========================================================================== */

.skeleton {
    background: linear-gradient(90deg,
            #f0f0f0 25%,
            #e0e0e0 50%,
            #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

.dark .skeleton {
    background: linear-gradient(90deg,
            #1a1a1a 25%,
            #2a2a2a 50%,
            #1a1a1a 75%);
    background-size: 200% 100%;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ==========================================================================
   13. FOCUS STATES (Accessibility)
   ========================================================================== */

*:focus-visible {
    outline: 2px solid #F04E12;
    outline-offset: 4px;
}

/* ==========================================================================
   14. CUSTOM SCROLLBAR
   ========================================================================== */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #e5e5e5;
}

::-webkit-scrollbar-thumb {
    background: #a8a29e;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #78716c;
}

.dark ::-webkit-scrollbar-track {
    background: #111111;
}

.dark ::-webkit-scrollbar-thumb {
    background: #333333;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #F04E12;
}

/* ==========================================================================
   16. PRINT STYLES
   ========================================================================== */

@media print {

    .whatsapp-button,
    button,
    nav {
        display: none !important;
    }
}

/* ==========================================================================
   17. NAVBAR ENHANCEMENTS & MOBILE RESPONSIVE
   ========================================================================== */

/* Logo Glow Effect - Dark Mode */
.dark aside .logo-navbar span {
    text-shadow:
        0 0 10px rgba(255, 255, 255, 0.3),
        0 0 20px rgba(255, 255, 255, 0.2),
        0 0 30px rgba(255, 255, 255, 0.1);
    transition: text-shadow 0.3s ease;
}

.dark aside .logo-navbar:hover span {
    text-shadow:
        0 0 15px rgba(255, 255, 255, 0.5),
        0 0 30px rgba(255, 255, 255, 0.3),
        0 0 45px rgba(255, 255, 255, 0.2);
}

/* Logo Glow Effect - Light Mode */

/* Active Navigation Item with Glow - Dark Mode */
.dark nav a.active {
    color: #FFFFFF !important;
    opacity: 1 !important;
    text-shadow:
        0 0 10px rgba(255, 255, 255, 0.5),
        0 0 20px rgba(255, 255, 255, 0.3);
    font-weight: 600;
}

/* Active Navigation Item with Glow - Light Mode */

nav a:not(.active) {
    opacity: 0.6;
}

/* Nav Hover - Dark Mode */
.dark nav a:hover {
    opacity: 1;
    text-shadow:
        0 0 8px rgba(255, 255, 255, 0.4),
        0 0 15px rgba(255, 255, 255, 0.2);
}

/* Nav Hover - Light Mode */

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1000;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.mobile-menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #FFFFFF;
    margin: 4px auto;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
    transform-origin: center center;
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
    transform-origin: center center;
}

/* Mobile Responsive Styles */
@media (max-width: 1024px) {

    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    /* Hide sidebar by default on mobile */
    aside {
        position: fixed !important;
        left: -100% !important;
        width: 280px !important;
        height: 100vh !important;
        background: #0A0A0A !important;
        border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
        transition: left 0.3s ease !important;
        z-index: 999 !important;
        padding: 2rem !important;
    }

    aside.mobile-open {
        left: 0 !important;
    }

    /* Overlay for mobile menu */
    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.7);
        z-index: 998;
        backdrop-filter: blur(4px);
    }

    .mobile-overlay.active {
        display: block;
    }

    /* Adjust main content */
    main {
        margin-left: 0 !important;
        padding: 5rem 1.5rem 2rem !important;
    }

    /* Adjust grid for tablets */
    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {

    /* Single column on mobile */
    .grid-cols-1,
    .grid-cols-2,
    .grid-cols-3,
    .md\:grid-cols-2,
    .lg\:grid-cols-3 {
        grid-template-columns: 1fr !important;
    }

    /* Adjust spacing */
    .gap-8 {
        gap: 1.5rem !important;
    }

    /* Adjust WhatsApp button position */
    .whatsapp-button,
    a[href^="https://wa.me"] {
        bottom: 1.5rem !important;
        right: 1.5rem !important;
        width: 3.5rem !important;
        height: 3.5rem !important;
    }

    /* Smaller logo text on mobile */
    aside a[href="#"] span,
    aside a[href*="proyectos.html"] span {
        font-size: 2.5rem !important;
    }

    /* Adjust navigation font size */
    nav ul {
        font-size: 1.5rem !important;
    }

    /* Stack view toggles */
    .view-toggle {
        font-size: 0.65rem !important;
    }
}

@media (max-width: 480px) {

    /* Extra small devices */
    main {
        padding: 4rem 1rem 1.5rem !important;
    }

    aside {
        width: 250px;
        padding: 1.5rem;
    }

    /* Smaller logo on very small screens */
    aside a[href="#"] span,
    aside a[href*="proyectos.html"] span {
        font-size: 2rem !important;
    }

    nav ul {
        font-size: 1.25rem !important;
    }
}

/* Fix for desktop - ensure sidebar is visible */
@media (min-width: 1025px) {
    aside {
        left: 0 !important;
    }

    .mobile-menu-toggle,
    .mobile-overlay {
        display: none !important;
    }
}

/* ==========================================================================
   18. SERVICES PAGE RESPONSIVE & FOOTER FIXES
   ========================================================================== */

/* Services Grid Responsive */
@media (max-width: 768px) {

    /* Stack service cards vertically on mobile */
    .service-card {
        padding: 2rem;
    }

    .service-card h2 {
        font-size: 1.5rem;
    }

    /* Center footer content on mobile */
    footer .grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    footer .grid>div,
    footer h4,
    footer ul {
        text-align: center;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    footer .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

/* Center footer on all sizes */
footer .grid {
    justify-items: center;
}

footer .grid>div {
    width: 100%;
    max-width: 250px;
}

/* ==========================================================================
   19. EXTRA SMALL MOBILE FIXES (400px and below)
   ========================================================================== */

@media (max-width: 480px) {

    /* Hero section fixes */
    section {
        padding: 2rem 1rem !important;
    }

    /* Center and size hero titles properly */
    section h1 {
        font-size: 2.5rem !important;
        line-height: 1.1 !important;
        text-align: center !important;
        padding: 0 0.5rem !important;
        word-wrap: break-word !important;
    }

    section p {
        font-size: 1rem !important;
        line-height: 1.6 !important;
        text-align: center !important;
        padding: 0 0.5rem !important;
    }

    /* Service cards extra padding reduction */
    .service-card {
        padding: 1.5rem !important;
        margin: 0 0.5rem !important;
    }

    .service-card h2 {
        font-size: 1.25rem !important;
        line-height: 1.3 !important;
    }

    .service-card p {
        font-size: 0.875rem !important;
    }

    /* Main content padding */
    main {
        padding: 4rem 0.5rem 1.5rem !important;
    }

    /* Process section */
    .max-w-6xl,
    .max-w-5xl,
    .max-w-4xl {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* ==========================================================================
   20. IMAGE CAROUSEL / GALLERY
   ========================================================================== */

/* Carousel Container */
.carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 1rem;
    background: #e5e5e5;
}

.dark .carousel {
    background: #262626;
}

/* Carousel Track - holds all slides */
.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

/* Individual Slide */
.carousel-slide {
    min-width: 100%;
    position: relative;
    aspect-ratio: 16 / 9;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Navigation Arrows */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.carousel-btn:hover {
    background: #ffffff;
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn-prev {
    left: 16px;
}

.carousel-btn-next {
    right: 16px;
}

.carousel-btn .material-icons-outlined {
    font-size: 24px;
    color: #0a0a0a;
}

/* Dark mode arrows */
.dark .carousel-btn {
    background: rgba(0, 0, 0, 0.7);
}

.dark .carousel-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

.dark .carousel-btn .material-icons-outlined {
    color: #ffffff;
}

/* Mobile: hide arrows to prevent overlap, rely on swipe and dots */
@media (max-width: 768px) {
    .carousel-btn {
        display: none;
    }
}

/* Indicator Dots */
.carousel-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

.carousel-dot.active {
    background: #ffffff;
    transform: scale(1.2);
}

/* Dark mode dots */
.dark .carousel-dot {
    background: rgba(255, 255, 255, 0.3);
}

.dark .carousel-dot:hover {
    background: rgba(255, 255, 255, 0.6);
}

.dark .carousel-dot.active {
    background: #ffffff;
}

/* Image Counter */
.carousel-counter {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    z-index: 10;
}

/* ==========================================================================
   21. WHATSAPP BUTTON MINIMALIST
   ========================================================================== */

/* Botón minimalista - blanco/negro por defecto, verde en hover */
.whatsapp-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    transition: all 0.3s ease;
    /* Default: Minimalista */
    background: #0A0A0A;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.whatsapp-btn svg {
    color: #ffffff;
    transition: all 0.3s ease;
}

.whatsapp-btn:hover {
    background: #25D366;
    transform: scale(1.1);
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
}

/* Light mode */

/* ==========================================================================
   22. SCROLL ANIMATIONS (Fade In)
   ========================================================================== */

/* Elementos que aparecen al hacer scroll */
.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Delay variations for staggered animations */
.fade-in-delay-1 {
    transition-delay: 0.1s;
}

.fade-in-delay-2 {
    transition-delay: 0.2s;
}

.fade-in-delay-3 {
    transition-delay: 0.3s;
}

/* ==========================================================================
   23. GALLERY SECTION IMPROVEMENTS
   ========================================================================== */

/* Espaciado mejorado para la galería en páginas de proyecto */
.gallery-section {
    margin-top: 2rem;
}

.gallery-section h2 {
    margin-bottom: 2.5rem;
}

/* ==========================================================================
   24. VIEW DEMO/PROJECT BUTTON (Minimalist)
   ========================================================================== */

/* Botón minimalista para ver demo o proyecto real */
.view-demo-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    border-radius: 9999px;
    transition: all 0.3s ease;
    text-decoration: none;
    /* Minimalista - Dark mode default */
    background: #0A0A0A;
    color: #ffffff;
    border: 1px solid #0A0A0A;
}

.view-demo-btn:hover {
    background: transparent;
    color: #0A0A0A;
    border-color: #0A0A0A;
}

.view-demo-btn .material-icons-outlined {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.view-demo-btn:hover .material-icons-outlined {
    transform: translateX(3px);
}

/* Light mode */

/* Dark mode */
.dark .view-demo-btn {
    background: #ffffff;
    color: #0A0A0A;
    border-color: #ffffff;
}

.dark .view-demo-btn:hover {
    background: transparent;
    color: #ffffff;
    border-color: #ffffff;
}

/* ==========================================================================
   25. ANIMATED HERO - Rotating Words Animation
   ========================================================================== */

/* Container for the animated hero */
.animated-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.animated-hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    max-width: 56rem;
    text-align: center;
}

/* Badge/Pill button at top */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 9999px;
    background: #e5e5e5;
    color: #44403c;
    transition: all 0.3s ease;
    text-decoration: none;
    animation: fadeInDown 0.6s ease-out forwards;
}

.dark .hero-badge {
    background: #262626;
    color: #a8a29e;
}

.hero-badge:hover {
    background: #d6d3d1;
    transform: translateY(-2px);
}

.dark .hero-badge:hover {
    background: #3d3d3d;
}

.hero-badge svg,
.hero-badge .material-icons-outlined {
    width: 16px;
    height: 16px;
    font-size: 16px;
    transition: transform 0.3s ease;
}

.hero-badge:hover svg,
.hero-badge:hover .material-icons-outlined {
    transform: translateX(3px);
}

/* Main title container */
.hero-title-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 700;
    letter-spacing: -0.05em;
    line-height: 1.1;
    color: #44403c;
}

.dark .hero-title {
    color: #d6d3d1;
}

/* Rotating words container */
.hero-rotating-container {
    position: relative;
    display: inline-block;
    vertical-align: bottom;
    overflow: visible;
    height: 1.1em;
    min-width: 12ch;
}

/* When used inline in original hero layout */
h1 .hero-rotating-container {
    vertical-align: baseline;
}

.hero-rotating-word {
    position: absolute;
    left: 0;
    top: 0;
    font-weight: 700;
    letter-spacing: -0.05em;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: #F04E12;
    white-space: nowrap;
    line-height: 1.3;
}

.hero-rotating-word.active {
    opacity: 1;
    transform: translateY(0);
}

.hero-rotating-word.exit-up {
    opacity: 0;
    transform: translateY(-150%);
}

.hero-rotating-word.exit-down {
    opacity: 0;
    transform: translateY(150%);
}

/* Las variantes de gradiente (cyan/emerald/amber/rose) se eliminaron:
   el sistema usa un solo acento plano (#F04E12), definido en .hero-rotating-word. */

/* Hero description */
.hero-description {
    font-size: clamp(1rem, 2vw, 1.25rem);
    line-height: 1.75;
    color: #78716c;
    max-width: 42rem;
    animation: fadeInUp 0.6s ease-out 0.3s forwards;
    opacity: 0;
}

.dark .hero-description {
    color: #a8a29e;
}

/* Hero buttons container */
.hero-buttons {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    animation: fadeInUp 0.6s ease-out 0.5s forwards;
    opacity: 0;
}

/* Primary hero button */
.hero-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 9999px;
    background: #0A0A0A;
    color: #ffffff;
    border: 2px solid #0A0A0A;
    transition: all 0.3s ease;
    text-decoration: none;
    cursor: pointer;
}

.hero-btn-primary:hover {
    background: transparent;
    color: #0A0A0A;
}

.dark .hero-btn-primary {
    background: #ffffff;
    color: #0A0A0A;
    border-color: #ffffff;
}

.dark .hero-btn-primary:hover {
    background: transparent;
    color: #ffffff;
}

/* Outline hero button */
.hero-btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 9999px;
    background: transparent;
    color: #0A0A0A;
    border: 2px solid #d6d3d1;
    transition: all 0.3s ease;
    text-decoration: none;
    cursor: pointer;
}

.hero-btn-outline:hover {
    border-color: #0A0A0A;
    background: #0A0A0A;
    color: #ffffff;
}

.dark .hero-btn-outline {
    color: #ffffff;
    border-color: #44403c;
}

.dark .hero-btn-outline:hover {
    border-color: #ffffff;
    background: #ffffff;
    color: #0A0A0A;
}

.hero-btn-primary svg,
.hero-btn-primary .material-icons-outlined,
.hero-btn-outline svg,
.hero-btn-outline .material-icons-outlined {
    width: 16px;
    height: 16px;
    font-size: 16px;
    transition: transform 0.3s ease;
}

.hero-btn-primary:hover svg,
.hero-btn-primary:hover .material-icons-outlined,
.hero-btn-outline:hover svg,
.hero-btn-outline:hover .material-icons-outlined {
    transform: translateX(3px);
}

/* Keyframe animations for hero */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .animated-hero {
        padding: 1.5rem;
    }

    .animated-hero-content {
        gap: 1.5rem;
    }

    .hero-rotating-container {
        height: 1.3em;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .hero-btn-primary,
    .hero-btn-outline {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.25rem;
    }

    .hero-rotating-container {
        font-size: 2.25rem;
    }
}

/* ==========================================================================
   26. IMPROVED RESPONSIVE - CENTERING & SERVICES FIX
   ========================================================================== */

/* Force proper box-sizing */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Prevent horizontal overflow on mobile */
html,
body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* ===== TABLET (max 1024px) ===== */
@media screen and (max-width: 1024px) {

    /* Main content layout */
    body main.ml-\[18\.75rem\] {
        width: 100%;
        max-width: 100vw;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* Sections within main */
    body main section {
        width: 100%;
        max-width: 100%;
    }

    /* Container constraints */
    body main .max-w-6xl,
    body main .max-w-5xl,
    body main .max-w-4xl,
    body main .max-w-3xl {
        width: 100%;
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Views */
    body .grid-view,
    body .list-view {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }

    /* Service cards - 2x2 grid on tablet */
    body .service-card {
        width: 100%;
        max-width: 100%;
        margin: 0;
    }

    /* Projects grid - 2 columns on tablet */
    body .grid.grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3 {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        width: 100%;
    }
}

/* ===== MOBILE (max 768px) ===== */
@media screen and (max-width: 768px) {

    /* Single column grids */
    body .grid.grid-cols-1.md\:grid-cols-2,
    body .grid.grid-cols-1.md\:grid-cols-4 {
        grid-template-columns: 1fr;
    }

    /* Service card adjustments */
    body .service-card {
        padding: 1.5rem;
    }

    body .service-card h2 {
        font-size: 1.5rem;
    }

    body .service-card p {
        font-size: 0.9rem;
    }

    /* Footer centered */
    body footer .grid.grid-cols-1.md\:grid-cols-4 {
        grid-template-columns: 1fr;
        text-align: center;
    }

    body footer .grid>div {
        text-align: center;
    }

    /* CTA section */
    body section h2.text-5xl {
        font-size: 2rem;
    }

    body section p.text-xl {
        font-size: 1rem;
    }

    /* Projects grid - 1 column on mobile */
    body .grid.grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3 {
        grid-template-columns: 1fr;
    }

    /* ===== HERO CENTERING FIX ===== */
    body main section.min-h-screen {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    body main section.min-h-screen .max-w-5xl {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    /* Hero title container - force center */
    body main section.min-h-screen h1 {
        text-align: center;
        width: 100%;
    }

    /* Hero rotating container - centered */
    body main section h1 .hero-rotating-container {
        display: flex;
        justify-content: center;
        width: 100%;
        min-width: unset;
    }

    /* Hero paragraph - centered */
    body main section.min-h-screen p {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }

    /* Hero label text - centered */
    body main section.min-h-screen .text-xs {
        text-align: center;
        width: 100%;
    }

    /* Container needs to center its children */
    body main section h1 .hero-rotating-container {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        min-width: unset;
        text-align: center;
    }

    /* Rotating words - center with transform */
    body main section h1 .hero-rotating-word {
        left: 50%;
        transform: translateX(-50%) translateY(100%);
    }

    body main section h1 .hero-rotating-word.active {
        transform: translateX(-50%) translateY(0);
    }

    body main section h1 .hero-rotating-word.exit-up {
        transform: translateX(-50%) translateY(-150%);
    }

    body main section h1 .hero-rotating-word.exit-down {
        transform: translateX(-50%) translateY(150%);
    }
}

/* ===== SMALL MOBILE (max 480px) ===== */
@media screen and (max-width: 480px) {
    body main {
        padding: 4rem 0.75rem 1.5rem;
    }

    body .service-card {
        padding: 1.25rem;
    }

    body .service-card h2 {
        font-size: 1.25rem;
    }

    body .service-card ul {
        font-size: 0.8rem;
    }

    /* Hero section sizing */
    body main section.min-h-screen {
        padding: 1rem;
    }

    body main section.min-h-screen h1 {
        font-size: 2rem;
        line-height: 1.2;
    }

    /* Process step circles */
    body .w-16.h-16 {
        width: 3rem;
        height: 3rem;
        font-size: 1.25rem;
    }

    /* CTA button */
    body a.inline-flex.items-center {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

/* ==========================================================================
   27. PROJECTS FILTER BUTTONS & DYNAMIC ELEMENTS
   ========================================================================== */

/* Filter Buttons */
.filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1px solid rgba(120, 113, 108, 0.3);
    border-radius: 9999px;
    background: transparent;
    color: #78716c;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    border-color: rgba(120, 113, 108, 0.6);
    color: #44403c;
}

.dark .filter-btn:hover {
    border-color: rgba(168, 162, 158, 0.6);
    color: #d6d3d1;
}

.filter-btn.active {
    background: #1c1917;
    border-color: #1c1917;
    color: #ffffff;
}

.dark .filter-btn.active {
    background: #ffffff;
    border-color: #ffffff;
    color: #1c1917;
}

/* Tag Pills (for project pages) */
.tag-pill {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.025em;
    border: 1px solid rgba(120, 113, 108, 0.3);
    border-radius: 9999px;
    color: #57534e;
}

.dark .tag-pill {
    border-color: rgba(168, 162, 158, 0.3);
    color: #a8a29e;
}

/* Category Pills */
.category-pill {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.025em;
    background: rgba(120, 113, 108, 0.1);
    border-radius: 9999px;
    color: #57534e;
}

.dark .category-pill {
    background: rgba(168, 162, 158, 0.1);
    color: #a8a29e;
}

/* Gallery Item */
.gallery-item {
    overflow: hidden;
    border-radius: 0.75rem;
}

.gallery-item img {
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.02);
}

/* Mobile Responsive Filters */
@media screen and (max-width: 768px) {
    .filter-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.65rem;
    }
    
    #projects-filters {
        padding-bottom: 1rem;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    #projects-filters::-webkit-scrollbar {
        display: none;
    }
}
/* Typography Rules */
.font-display {
    font-family: 'Space Grotesk', sans-serif;
}
body, h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', sans-serif;
}

/* Hide scrollbar for horizontal scrollable areas */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}
.hide-scrollbar {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Ensure filter buttons don't shrink or wrap on mobile scroll */
@media (max-width: 768px) {
    .filter-btn {
        flex-shrink: 0;
        white-space: nowrap;
    }
}

/* ==========================================================================
   CLIENT STRIP (marquee de clientes)
   Única excepción a la regla de "sin animación ambiental" (DESIGN.md §7),
   aprobada por el usuario. Bucle continuo; se pausa al hover y respeta
   prefers-reduced-motion (cae a una fila estática envuelta).
   ========================================================================== */
.client-strip-viewport {
    overflow: hidden;
}

.client-strip-track {
    display: flex;
    align-items: center;
    width: max-content;
    animation: client-strip-scroll 28s linear infinite;
}

.client-strip-item {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding-left: 1.75rem;
}

.client-strip-sep {
    flex-shrink: 0;
    padding-left: 1.75rem;
    color: #d6d3d1; /* stone-300 */
}

.dark .client-strip-sep {
    color: #44403c; /* stone-700 */
}

.client-strip-viewport:hover .client-strip-track {
    animation-play-state: paused;
}

@keyframes client-strip-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .client-strip-track {
        animation: none;
        flex-wrap: wrap;
        justify-content: center;
        row-gap: 0.5rem;
    }
}
