/* Solo variables y bases. Todo lo demás se maneja con Tailwind. */

:root {
    --byd-dark: #141414;
    --byd-card: #1C1C1C;
    --byd-card-hover: #222222;
    --byd-icon-bg: #272727;
    --byd-neon-green: #00FFA0;
    --byd-sus-green: #00C896;
    --byd-sus-blue: #0066FF;
    --byd-neon-blue: #00A2FF;
}

html {
    background-color: var(--byd-dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   Borde que se llena al hacer hover (opcional, uso puntual)
   ============================================================ */
@property --border-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

.card-border {
    position: relative;
    isolation: isolate;
}

.card-border::before {
    content: '';
    position: absolute;
    inset: -1px;
    padding: 1px;
    border-radius: inherit;
    pointer-events: none;
    background: conic-gradient(
        from 0deg,
        var(--byd-neon-green) 0deg,
        var(--byd-neon-blue) var(--border-angle),
        transparent var(--border-angle)
    );
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    transition: --border-angle 1.2s ease-in-out;
    opacity: 0.9;
}

.card-border:hover::before {
    --border-angle: 360deg;
}

@media (prefers-reduced-motion: reduce) {
    .card-border::before {
        transition: none;
    }
}

/* ============================================================
   Tipografía display: mejoras de renderizado para tamaños masivos
   ============================================================ */
.font-display {
    font-feature-settings: 'ss01' on, 'ss02' on;
    text-rendering: optimizeLegibility;
}

/* ============================================================
   Scrollbar sutil
   ============================================================ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: #0f0f0f;
}
::-webkit-scrollbar-thumb {
    background: #2a2a2a;
    border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
    background: #3a3a3a;
}

/* ============================================================
   Selección de texto
   ============================================================ */
::selection {
    background: var(--byd-neon-green);
    color: #000;
}

/* ============================================================
   Efecto Pro de revelación de imagen (Vista Lista)
   ============================================================ */
.group:hover .reveal-image {
    clip-path: inset(0 0 0 0) !important;
}

/* ============================================================
   Efecto Skeleton / Blur para la lista de proyectos
   ============================================================ */
.animate-pulse-slow {
    animation: pulse-slow 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-slow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ============================================================
   Efectos para la sección de Paquetes
   ============================================================ */

/* 1. Efecto Spotlight (Sigue al ratón) */
.pricing-card {
    position: relative;
}

.pricing-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(255, 255, 255, 0.06),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
    z-index: 0;
    overflow: hidden; 
}

.pricing-card:hover::before {
    opacity: 1;
}

.pricing-card.bg-white::before {
    background: radial-gradient(
        600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(0, 0, 0, 0.03),
        transparent 40%
    );
}

.pricing-card > * {
    position: relative;
    z-index: 1;
}

/* 2. Brillo animado en el botón principal (Shimmer) */
.btn-shimmer {
    position: relative;
    overflow: hidden;
}

.btn-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transform: skewX(-25deg);
    transition: left 0.7s ease-in-out;
}

.btn-shimmer:hover::after {
    left: 150%;
}

/* ============================================================
   Input Focus Effect (Neón suave solo en la línea inferior)
   ============================================================ */
.input-neon-focus {
    transition: border-color 0.4s ease;
    /* Aseguramos que no haya estilos por defecto */
    box-shadow: none !important; 
    outline: none !important;
}

.input-neon-focus:focus {
    border-color: var(--byd-neon-green) !important;
    /* Usamos drop-shadow para que el brillo se aplique a la forma del borde (la línea), 
       no a la caja entera */
    filter: drop-shadow(0 4px 6px rgba(0, 255, 160, 0.2));
}

/* ============================================================
   Efecto Glitch Reutilizable (Sutil y bajo demanda)
   ============================================================ */
.glitch-hover {
    position: relative;
    display: inline-block;
    cursor: crosshair;
}

/* Cuando hacemos hover en el contenedor, se activan los pseudoelementos */
.glitch-hover:hover::before,
.glitch-hover:hover::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a0a; /* Mismo color de fondo para que tape el original */
    pointer-events: none;
}

/* Capa 1: Desplazamiento hacia la izquierda con tinte cian */
.glitch-hover:hover::before {
    left: 2px;
    text-shadow: -2px 0 #00FFFF;
    clip-path: inset(24% 0 61% 0);
    animation: glitch-anim-1 2.5s infinite linear alternate-reverse;
}

/* Capa 2: Desplazamiento hacia la derecha con tinte rojo (o neón) */
.glitch-hover:hover::after {
    left: -2px;
    text-shadow: 2px 0 #FF003C;
    clip-path: inset(54% 0 21% 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% { clip-path: inset(20% 0 60% 0); }
    20% { clip-path: inset(60% 0 10% 0); }
    40% { clip-path: inset(40% 0 50% 0); }
    60% { clip-path: inset(80% 0 5% 0); }
    80% { clip-path: inset(10% 0 70% 0); }
    100% { clip-path: inset(30% 0 40% 0); }
}

@keyframes glitch-anim-2 {
    0% { clip-path: inset(10% 0 70% 0); }
    20% { clip-path: inset(30% 0 50% 0); }
    40% { clip-path: inset(70% 0 20% 0); }
    60% { clip-path: inset(20% 0 60% 0); }
    80% { clip-path: inset(50% 0 30% 0); }
    100% { clip-path: inset(80% 0 5% 0); }
}

@media (prefers-reduced-motion: reduce) {
    .glitch-hover:hover::before,
    .glitch-hover:hover::after {
        animation: none;
        opacity: 0;
    }
}

/* ============================================================
   Cursor Personalizado (Cruceta Técnica)
   ============================================================ */
@media (min-width: 1024px) {
    body, a, button, [role="button"], input, textarea, .glitch-hover, .faq-trigger, .cursor-none {
        cursor: none !important;
    }
}

#custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 28px;
    height: 28px;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Cruz horizontal */
#custom-cursor::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #fff;
    transform: translateY(-50%);
    transition: background-color 0.3s ease;
}

/* Cruz vertical */
#custom-cursor::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 1px;
    height: 100%;
    background-color: #fff;
    transform: translateX(-50%);
    transition: background-color 0.3s ease;
}

/* Punto central (Invisible por defecto, verde al hover) */
#custom-cursor .dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background-color: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

/* Hover state */
#custom-cursor.hovering {
    transform: translate(-50%, -50%) scale(1.2);
}

#custom-cursor.hovering::before,
#custom-cursor.hovering::after {
    background-color: rgba(0, 255, 160, 0.4); /* Verde neón sutil */
}

#custom-cursor.hovering .dot {
    background-color: var(--byd-neon-green);
    width: 6px;
    height: 6px;
    box-shadow: 0 0 10px var(--byd-neon-green);
}


/* ============================================================
   Botón To-Top (Anillo de progreso circular)
   ============================================================ */
#to-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background-color: var(--byd-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999; /* Asegurar que esté por encima de todo */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

#to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#to-top-btn:hover {
    background-color: #1a1a1a;
    border-color: var(--byd-neon-green);
}

/* SVG del anillo de progreso */
#to-top-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

#to-top-progress circle {
    fill: none;
    stroke: var(--byd-neon-green);
    stroke-width: 1.5;
    stroke-dasharray: 138; /* Circunferencia aprox para radio 22 */
    stroke-dashoffset: 138;
    transition: stroke-dashoffset 0.1s linear;
}

/* Icono de flecha */
#to-top-btn svg.arrow-icon {
    width: 16px;
    height: 16px;
    color: #fff;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 2;
}

#to-top-btn:hover svg.arrow-icon {
    transform: translateY(-3px);
    color: var(--byd-neon-green);
}

/* ============================================================
   Efecto Hero Scanline + Glitch (Automático al cargar)
   ============================================================ */
.hero-glitch {
    position: relative;
    display: inline-block;
    /* Degradado con blanco, verde neón y azul */
    background: linear-gradient(
        90deg, 
        #ffffff 0%, 
        #ffffff 30%, 
        var(--byd-neon-green) 50%, 
        var(--byd-neon-blue) 70%, 
        #ffffff 100%
    );
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    /* Animación de barrido de color: 1 vez al cargar */
    animation: color-shine 3s linear 1 forwards;
    will-change: background-position;
}

/* Al hacer hover, reiniciamos el brillo */
.hero-glitch:hover {
    animation: color-shine 2s linear infinite;
}

@keyframes color-shine {
    to { background-position: -200% center; }
}

/* Capas del Glitch */
.hero-glitch::before,
.hero-glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--byd-dark); /* Tapa el texto original para que se vea el corte */
    color: #fff;
    -webkit-text-fill-color: initial; /* Quita la transparencia del gradiente en las capas */
    pointer-events: none;
    opacity: 0;
}

/* Capa 1: Franjas verdes/cian */
.hero-glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--byd-neon-green);
    /* La animación dura 3s en total. Los primeros 2s hace el glitch, luego se oculta */
    animation: glitch-scan-1 3s steps(2, end) 1 forwards;
    animation-delay: 0.5s;
}

/* Capa 2: Franjas azules */
.hero-glitch::after {
    left: -2px;
    text-shadow: 2px 0 var(--byd-neon-blue);
    animation: glitch-scan-2 3s steps(2, end) 1 forwards;
    animation-delay: 0.8s;
}

/* Keyframes del Glitch (Corte de arriba a abajo) */
@keyframes glitch-scan-1 {
    0% { clip-path: inset(10% 0 80% 0); opacity: 1; transform: translateX(-2px); }
    10% { clip-path: inset(40% 0 40% 0); opacity: 1; transform: translateX(2px); }
    20% { clip-path: inset(80% 0 5% 0); opacity: 1; transform: translateX(-2px); }
    30% { clip-path: inset(20% 0 60% 0); opacity: 1; transform: translateX(2px); }
    40% { clip-path: inset(60% 0 20% 0); opacity: 1; transform: translateX(-2px); }
    50% { clip-path: inset(5% 0 85% 0); opacity: 1; transform: translateX(2px); }
    60%, 100% { clip-path: inset(0 0 100% 0); opacity: 0; }
}

@keyframes glitch-scan-2 {
    0% { clip-path: inset(70% 0 10% 0); opacity: 1; transform: translateX(2px); }
    10% { clip-path: inset(30% 0 50% 0); opacity: 1; transform: translateX(-2px); }
    20% { clip-path: inset(5% 0 80% 0); opacity: 1; transform: translateX(2px); }
    30% { clip-path: inset(50% 0 30% 0); opacity: 1; transform: translateX(-2px); }
    40% { clip-path: inset(10% 0 70% 0); opacity: 1; transform: translateX(2px); }
    50% { clip-path: inset(85% 0 5% 0); opacity: 1; transform: translateX(-2px); }
    60%, 100% { clip-path: inset(0 0 100% 0); opacity: 0; }
}

/* Clase para retrasar la segunda palabra */
.hero-glitch-delay {
    animation-delay: 0.8s;
}
.hero-glitch-delay::before {
    animation-delay: 1.3s;
}
.hero-glitch-delay::after {
    animation-delay: 1.6s;
}

/* ============================================================
   Animaciones de Entrada (Hero)
   ============================================================ */
@keyframes fade-in-down {
    0% { opacity: 0; transform: translateY(-20px); }
    100% { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in-up {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in-left {
    0% { opacity: 0; transform: translateX(-20px); }
    100% { opacity: 1; transform: translateX(0); }
}
@keyframes fade-in-right {
    0% { opacity: 0; transform: translateX(20px); }
    100% { opacity: 1; transform: translateX(0); }
}

.anim-fade-down { animation: fade-in-down 1s ease-out forwards; }
.anim-fade-up { animation: fade-in-up 1s ease-out forwards; }
.anim-fade-left { animation: fade-in-left 1s ease-out forwards; }
.anim-fade-right { animation: fade-in-right 1s ease-out forwards; }

/* Clases de retraso (delays) */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }

/* ============================================================
   Isla Flotante de Acciones (Compacta con Iconos Medianos)
   ============================================================ */
#floating-island {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 52px; /* Mantenemos la isla compacta */
    background-color: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    padding: 0.75rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem; /* Un poquito más de espacio para que respiren los iconos */
    z-index: 50;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
}

#floating-island.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

#floating-island.hidden-at-bottom {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
}

/* Botones de compartir */
.island-btn {
    width: 32px; /* Un poco más ancho para acomodar el icono grande */
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    border-radius: 50%;
    transition: all 0.3s ease;
    cursor: pointer;
    background: transparent;
    border: none;
    position: relative;
    flex-shrink: 0;
}

.island-btn:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Aumentamos el tamaño de los iconos de compartir */
.island-btn svg {
    width: 16px; /* Antes 13px */
    height: 16px;
}

/* Tooltips */
.island-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 100%;
    margin-right: 12px;
    background: #222;
    color: #fff;
    font-size: 10px;
    padding: 5px 8px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.island-btn:hover::after {
    opacity: 1;
}

/* El Texto del Porcentaje */
.progress-text {
    font-size: 10px; 
    color: #fff;
    font-weight: 600;
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1;
    letter-spacing: 0.5px;
    margin: 2px 0;
}

/* La Flecha con el Aro */
.progress-ring-container {
    position: relative;
    width: 34px; /* Aumentado para que el aro se vea más grande */
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.progress-ring-container:hover {
    transform: scale(1.05);
}

.progress-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 34px; /* Ajustado al nuevo tamaño */
    height: 34px;
    transform: rotate(-90deg);
}

.progress-ring circle {
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
}

.progress-ring .ring-bg {
    stroke: rgba(255, 255, 255, 0.15);
}

.progress-ring .ring-fill {
    stroke: var(--byd-neon-green);
    stroke-dasharray: 94.2; /* 2 * pi * 15 (nuevo radio) */
    stroke-dashoffset: 94.2;
    transition: stroke-dashoffset 0.1s linear;
}

/* La flecha interna */
.arrow-icon {
    width: 14px; /* Antes 11px */
    height: 14px;
    color: #fff;
    position: relative;
    z-index: 2;
    transition: color 0.3s ease, transform 0.3s ease;
}

.progress-ring-container:hover .arrow-icon {
    color: var(--byd-neon-green);
    transform: translateY(-1px);
}

/* Animación al copiar */
@keyframes icon-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.icon-pop {
    animation: icon-pop 0.3s ease-out;
}

/* ============================================================
   Revelación automática de la Lista de Proyectos (Fluido y Premium)
   ============================================================ */

.group-list-observer {
    transition: all 0.5s ease;
}

/* Efecto hover general de la fila */
.group-list-observer:hover h3 {
    color: #fff;
}

/* Transiciones base para todos los elementos */
.group-list-observer .list-skeleton,
.group-list-observer .list-content,
.group-list-observer .list-skeleton-image,
.group-list-observer .list-image,
.group-list-observer .list-divider {
    transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

/* --- ESTADO INICIAL (Oculto) --- */
.group-list-observer .list-divider {
    background-color: rgba(255, 255, 255, 0.05); /* Línea casi invisible */
}

/* --- ESTADO VISIBLE (Revelado) --- */
.group-list-observer.is-visible .list-divider {
    background-color: rgba(255, 255, 255, 0.15); /* Línea se ilumina */
}

.group-list-observer.is-visible .list-skeleton {
    opacity: 0;
    filter: blur(4px);
}

.group-list-observer.is-visible .list-content {
    opacity: 1;
    transform: translateY(0);
}

.group-list-observer.is-visible .list-skeleton-image {
    opacity: 0;
    filter: blur(4px);
}

.group-list-observer.is-visible .list-image {
    opacity: 1;
    clip-path: inset(0 0 0 0) !important;
}

.group-list-observer.is-visible .list-image > div {
    transform: scale(1);
}