/* ==========================================================
   Estética Premium & Minimalista - RixersDev
   ========================================================== */

:root {
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-display: 'Syne', var(--font-sans);
    --font-mono: 'Fira Code', monospace;

    /* Paleta Cromática Champaña & Carbón */
    --bg-primary: #0a0a0b;          /* Negro carbón mate */
    --bg-secondary: #0f0f11;        /* Negro satinado */
    --color-gold-base: #c5a880;     /* Oro champaña base */
    --color-gold-light: #f3e5ab;    /* Oro champaña claro */
    --text-white: #f5f5f7;          /* Crema suave */
    --text-muted: #8e8e93;          /* Gris topo */
    --border-color: rgba(255, 255, 255, 0.04);
    --border-glow: rgba(197, 168, 128, 0.15);

    --transition-smooth: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset y Fundamentos */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg-primary);
    color: var(--text-white);
    font-family: var(--font-sans);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Ocultar cursor nativo en dispositivos con hover para usar el cursor premium */
@media (hover: hover) {
    body {
        cursor: none;
    }
    a, button, input, textarea, select, .elegant-card {
        cursor: none;
    }
}

/* Scrollbar Personalizado */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.05);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-gold-base);
}

/* Canvas de partículas estilo Active Theory */
.particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: -3;
}

/* Cuadrícula de Ingeniería Interactiva */
.engineering-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: -4;
    background-image: 
        linear-gradient(rgba(197, 168, 128, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(197, 168, 128, 0.02) 1px, transparent 1px);
    background-size: 80px 80px;
    background-position: center;
    opacity: 0.8;
}

.engineering-grid::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(197, 168, 128, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(197, 168, 128, 0.1) 1px, transparent 1px);
    background-size: 80px 80px;
    background-position: center;
    mask-image: radial-gradient(circle 220px at var(--mouse-x, 50%) var(--mouse-y, 50%), black 0%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle 220px at var(--mouse-x, 50%) var(--mouse-y, 50%), black 0%, transparent 100%);
}

/* ==========================================================
   Elementos Interactivos del Cursor (GSAP)
   ========================================================== */

/* Foco de luz ambiental que persigue al cursor (inercia) */
.ambient-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: -2;
    background: radial-gradient(circle, 
        rgba(197, 168, 128, 0.05) 0%, 
        rgba(197, 168, 128, 0.01) 40%, 
        transparent 70%);
    filter: blur(20px);
    transform: translate(-50%, -50%);
    will-change: transform;
}

/* Dot de precisión del cursor */
.custom-cursor-dot {
    position: fixed;
    width: 8px;
    height: 8px;
    background-color: var(--color-gold-base);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference; /* Efecto cromático sobre texto */
    will-change: transform;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Animaciones de cambio de tamaño del cursor en hover */
.custom-cursor-dot.hovered {
    width: 24px;
    height: 24px;
    background-color: transparent;
    border: 1px solid var(--color-gold-base);
    mix-blend-mode: normal;
}

/* ==========================================================
   Estructuras de Layout
   ========================================================== */

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Header */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6rem;
    opacity: 0; /* Animado con GSAP */
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-white);
}

.logo-image {
    height: 46px; /* Altura estilizada y armoniosa en desktop */
    width: auto;
    display: block;
}

.logo-name {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.logo-accent {
    color: var(--color-gold-base);
    font-weight: 400;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.status-indicator {
    width: 6px;
    height: 6px;
    background-color: var(--color-gold-base);
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 8px var(--color-gold-base);
}

.status-indicator::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid var(--color-gold-base);
    opacity: 0;
    animation: statusPulse 2s infinite ease-out;
}

@keyframes statusPulse {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* Main */
.site-main {
    display: block;
}

/* ==========================================================
   Secciones
   ========================================================== */

/* Hero Section */
.hero-section {
    text-align: left;
    max-width: 850px;
    margin-bottom: 8rem;
}

.hero-badge-container {
    margin-bottom: 2rem;
    opacity: 0; /* Animado con GSAP */
}

.hero-badge {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-gold-base);
    border-bottom: 1px solid rgba(197, 168, 128, 0.3);
    padding-bottom: 0.25rem;
    letter-spacing: 0.15em;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6.5vw, 4.5rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 2.5rem;
}

.text-gradient {
    background: linear-gradient(135deg, var(--text-white) 40%, var(--color-gold-base) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 680px;
    font-weight: 300;
}

/* Máscaras de texto para GSAP Reveal */
.reveal-wrapper {
    overflow: hidden;
    position: relative;
}

.reveal-item {
    display: block;
    transform: translateY(105%);
    opacity: 0;
}

/* Timer Section (Reloj minimalista) */
.timer-section {
    opacity: 0; /* Animado con GSAP */
    margin-bottom: 8rem;
}

.elegant-timer {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.timer-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.timer-number {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 500;
    line-height: 1;
    color: var(--text-white);
    letter-spacing: -0.02em;
}

.timer-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.15em;
    margin-top: 0.5rem;
}

.timer-divider {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 300;
    color: rgba(197, 168, 128, 0.3);
    line-height: 1;
    padding-bottom: 1.5rem;
}

/* Services Section */
.services-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh; /* Llena la pantalla al bloquearse (pin) */
    gap: 4rem;
}

.section-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

.section-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-gold-base);
    letter-spacing: 0.1em;
}

.section-headline {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    margin-top: 0.5rem;
    letter-spacing: -0.01em;
}

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

.elegant-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 2px solid rgba(197, 168, 128, 0.2);
    border-radius: 4px;
    padding: 3rem 2.25rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 280px;
    will-change: transform, opacity;
}

/* Efecto de Foco Magnético Interno (Spotlight Card) */
.elegant-card::after {
    content: '';
    position: absolute;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(197, 168, 128, 0.08) 0%, transparent 70%);
    top: var(--card-y, 0px);
    left: var(--card-x, 0px);
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.elegant-card:hover::after {
    opacity: 1;
}

/* Forzar que el texto y contenido de la tarjeta quede por encima del spotlight */
.elegant-card > * {
    position: relative;
    z-index: 2;
}

/* Estilos de Caracteres para Split Text */
.char-item {
    display: inline-block;
    will-change: transform, opacity;
}

.elegant-card:hover {
    border-left-color: var(--color-gold-base);
    background: rgba(255, 255, 255, 0.015);
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.5), inset 0 0 12px rgba(197, 168, 128, 0.02);
    transform: translateY(-6px);
}

.card-num {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--color-gold-base);
    opacity: 0.6;
    margin-bottom: 1.5rem;
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.card-description {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    font-weight: 300;
}

.card-footer-line {
    height: 1px;
    width: 0;
    background: linear-gradient(90deg, var(--color-gold-base), transparent);
    position: absolute;
    bottom: 0;
    left: 0;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.elegant-card:hover .card-footer-line {
    width: 100%;
}

/* Newsletter Section */
.newsletter-section {
    margin-bottom: 8rem;
}

.newsletter-wrapper {
    background: radial-gradient(circle at 100% 100%, rgba(197, 168, 128, 0.03) 0%, transparent 60%), var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 3rem;
}

.newsletter-info {
    max-width: 450px;
}

.newsletter-info h3 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.newsletter-info p {
    color: var(--text-muted);
    font-weight: 300;
    font-size: 0.95rem;
}

.elegant-form {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    max-width: 500px;
}

.form-input-container {
    flex-grow: 1;
}

.elegant-form input[type="email"] {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.85rem 0;
    color: var(--text-white);
    font-family: var(--font-sans);
    font-size: 1.05rem;
    font-weight: 300;
    border-radius: 0;
    transition: border-bottom-color 0.4s ease;
}

.elegant-form input[type="email"]:focus {
    outline: none;
    border-bottom-color: var(--color-gold-base);
}

.magnetic-button {
    background: transparent;
    border: 1px solid rgba(197, 168, 128, 0.4);
    color: var(--color-gold-base);
    padding: 0.85rem 2rem;
    border-radius: 9999px;
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    transition: background 0.3s, border-color 0.3s, color 0.3s;
    will-change: transform;
}

.magnetic-button:hover {
    background: var(--color-gold-base);
    border-color: var(--color-gold-base);
    color: var(--bg-primary);
}

.btn-arrow {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.magnetic-button:hover .btn-arrow {
    transform: translateX(3px);
}

.elegant-feedback {
    width: 100%;
    margin-top: 1rem;
    font-size: 0.85rem;
    min-height: 20px;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

.elegant-feedback.show {
    opacity: 1;
    transform: translateY(0);
}

.elegant-feedback.success {
    color: #a7f3d0;
}

.elegant-feedback.error {
    color: #fca5a5;
}

/* sr-only (Screen Reader Accessibility) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Footer */
.site-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
    flex-wrap: wrap;
    gap: 1.5rem;
    opacity: 0; /* Animado con GSAP */
}

.footer-right {
    display: flex;
    gap: 2rem;
}

.magnetic-social {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
    will-change: transform;
}

.magnetic-social:hover {
    color: var(--color-gold-base);
}

/* ==========================================================
   Media Queries Responsivas
   ========================================================= */

@media (max-width: 992px) {
    .newsletter-wrapper {
        flex-direction: column;
        align-items: flex-start;
        padding: 3rem 2rem;
    }
    .elegant-form {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 2rem 1.25rem;
    }
    
    .site-header {
        margin-bottom: 4rem;
        gap: 1.5rem;
    }
    
    .logo-image {
        height: 30px; /* Reducido levemente para ajuste óptimo */
    }
    
    .site-main {
        display: block;
    }
    
    .hero-section, .timer-section {
        margin-bottom: 5.5rem;
    }

    .services-section {
        margin-bottom: 5.5rem;
        gap: 2rem;
    }
    
    .newsletter-section {
        margin-bottom: 4rem;
    }
    
    .newsletter-info h3 {
        font-size: 1.45rem; /* Reduce el tamaño para evitar cortes feos */
        word-break: normal;
    }

    .services-layout {
        position: relative;
        height: 380px; /* Altura fija para contener las tarjetas apiladas */
        display: block; /* Desactivar grid */
        overflow: hidden; /* Evita que las tarjetas se asomen por debajo */
        border-radius: 4px;
    }

    .elegant-card {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        padding: 2.25rem 1.5rem;
        will-change: transform, opacity;
    }

    #card-frontend { z-index: 1; }
    #card-backend { z-index: 2; }
    #card-cloud { z-index: 3; }
    
    .elegant-timer {
        gap: 1rem;
    }
    
    .timer-divider {
        padding-bottom: 0.75rem;
    }

    .elegant-form {
        flex-direction: column;
        align-items: stretch;
        gap: 1.25rem;
    }

    .magnetic-button {
        justify-content: center;
        width: 100%;
    }
    
    .site-footer {
        flex-direction: column-reverse;
        align-items: center;
        text-align: center;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .header-status {
        padding: 0.6rem;
        border-radius: 50%;
    }

    .header-status .status-text {
        display: none;
    }
}

/* ==========================================================
   Lenis Smooth Scroll & Indicador de Scroll Animado
   ========================================================== */
html.lenis, html.lenis body {
    height: auto;
}

.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis-smooth [data-lenis-prevent] {
    overflow: clip;
}

/* Indicador de Scroll Animado */
.scroll-indicator-wrapper {
    margin-top: 3.5rem;
    overflow: hidden;
    position: relative;
    will-change: transform, opacity;
}

.scroll-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.scroll-indicator:hover {
    opacity: 0.95;
}

.mouse-icon {
    width: 18px;
    height: 30px;
    border: 1.5px solid var(--color-gold-base);
    border-radius: 9999px;
    position: relative;
    display: block;
}

.mouse-wheel {
    width: 3px;
    height: 6px;
    background-color: var(--color-gold-base);
    border-radius: 9999px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollWheelPulse 1.8s infinite ease-in-out;
    display: block;
}

.scroll-text {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

@keyframes scrollWheelPulse {
    0% {
        top: 6px;
        opacity: 0;
    }
    30% {
        opacity: 1;
    }
    100% {
        top: 18px;
        opacity: 0;
    }
}
