/* ==========================================================================
   SISTEMA DE DISEÑO 2026 — ROBERTO PRADO (ESTÉTICA CARBON & ORANGE + 3D)
   Plus Jakarta Sans · Mobile-First · 3D & Glassmorphism
   ========================================================================== */

:root {
    --orange: #ff7a00;
    --orange-hover: #ff5500;
    --orange-grad: linear-gradient(135deg, #ff7a00 0%, #ff4d00 100%);
    --black: #f8f8fa;
    --surface-alt: #f1f1f5;
    --dark-grey: #ffffff;
    --medium-grey: #e4e4e7;
    --text-main: #0a0a0a;
    --text-grey: #52525b;
    --bg-card: rgba(255, 255, 255, 0.94);
    --border-glass: #e4e4e7;
    --border-highlight: #ff7a00;
    --shadow-card: 0 16px 38px -15px rgba(10, 10, 10, 0.08);
    --shadow-card-hover: 0 22px 48px -12px rgba(255, 122, 0, 0.22);
}

html.dark {
    --orange: #ff7a00;
    --orange-hover: #ff5500;
    --orange-grad: linear-gradient(135deg, #ff7a00 0%, #ff4d00 100%);
    --black: #0a0a0a;
    --surface-alt: #0d0d0d;
    --dark-grey: #161616;
    --medium-grey: #222222;
    --text-main: #ffffff;
    --text-grey: #a1a1aa;
    --bg-card: #161616;
    --border-glass: #222222;
    --border-highlight: #ff7a00;
    --shadow-card: 0 20px 45px -15px rgba(0, 0, 0, 0.75);
    --shadow-card-hover: 0 24px 55px -12px rgba(255, 122, 0, 0.25);
}

* {
    box-sizing: border-box;
}

html,
body {
    overflow-x: hidden;
    max-width: 100vw;
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--black);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

[hidden] {
    display: none !important;
}

section[id] {
    scroll-margin-top: 88px;
}

.hover-effect:hover {
    cursor: pointer;
}

/* --- NAVEGACIÓN --- */
.glass-nav {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--medium-grey);
}

html.dark .glass-nav {
    background: rgba(10, 10, 10, 0.94);
    border-bottom: 1px solid var(--medium-grey);
}

.brand-logo {
    font-weight: 800;
    font-size: 1.45rem;
    letter-spacing: -0.8px;
    color: var(--text-main);
}

.brand-logo span {
    color: var(--orange);
}

/* --- TÍTULOS DE SECCIÓN Y DIVISORES --- */
.title-area {
    text-align: center;
    margin-bottom: 46px;
}

.title-area h2,
.title-area h3 {
    font-size: clamp(1.65rem, 3.5vw, 2.35rem);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.title-underline {
    width: 54px;
    height: 4px;
    background: var(--orange-grad);
    margin: 14px auto 18px;
    border-radius: 10px;
}

.section-divider {
    position: relative;
}

.section-divider::before {
    content: "";
    position: absolute;
    top: 0;
    left: 6%;
    right: 6%;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--medium-grey) 15%,
        rgba(255, 122, 0, 0.55) 50%,
        var(--medium-grey) 85%,
        transparent
    );
    pointer-events: none;
}

/* --- BOTONES PILL (.btn-orange & .btn-outline-orange) --- */
.btn-orange {
    background: var(--orange-grad);
    color: #ffffff !important;
    padding: 14px 30px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: none;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 10px 25px -6px rgba(255, 122, 0, 0.4);
}

.btn-orange:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 32px -6px rgba(255, 122, 0, 0.55);
}

.btn-outline-dark {
    background: transparent;
    border: 1px solid var(--medium-grey);
    color: var(--text-main);
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

html.dark .btn-outline-dark {
    border-color: rgba(255, 255, 255, 0.28);
}

.btn-outline-dark:hover {
    border-color: var(--orange) !important;
    color: var(--orange) !important;
    background: rgba(255, 122, 0, 0.08);
    transform: translateY(-3px);
}

/* --- SUPERFICIES Y TARJETAS (35px RADIUS + CARBON & ORANGE) --- */
.glass-panel {
    background: var(--dark-grey);
    border: 1px solid var(--medium-grey);
    box-shadow: var(--shadow-card);
}

.rp-panel {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 85% 0%, rgba(255, 122, 0, 0.14), transparent 45%),
        var(--dark-grey);
    border: 1px solid var(--medium-grey);
    border-radius: 32px;
    box-shadow: var(--shadow-card);
}

.rp-panel::before {
    content: "";
    position: absolute;
    top: -130px;
    right: -90px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 122, 0, 0.15), transparent 70%);
    pointer-events: none;
}

.badge-orange {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--orange);
    background: rgba(255, 122, 0, 0.12);
    border: 1px solid rgba(255, 122, 0, 0.32);
    padding: 6px 14px;
    border-radius: 50px;
}

/* --- ICONOS ORBITALES DE IA (.ai-icon) --- */
.ai-orbit-icon {
    --glow: var(--orange);
    position: relative;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #111114;
    color: var(--glow);
}

.ai-orbit-icon::before {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0 55%, var(--glow) 70%, transparent 85% 100%);
    animation: ai-orbit 5s linear infinite;
    opacity: 0.85;
}

.ai-orbit-icon::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #111114;
}

.ai-orbit-icon i,
.ai-orbit-icon svg {
    position: relative;
    z-index: 1;
}

@keyframes ai-orbit {
    to {
        transform: rotate(360deg);
    }
}

/* --- LIENZO 3D HERO Y FONDOS ATMOSFÉRICOS --- */
.hero-3d-stage {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background:
        radial-gradient(circle at 75% 25%, rgba(255, 122, 0, 0.12), transparent 50%),
        radial-gradient(circle at 15% 80%, rgba(255, 77, 0, 0.08), transparent 45%);
}

.hero-canvas-wrap {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    touch-action: pan-y;
    overflow: hidden;
}

.hero-canvas-wrap canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none;
    touch-action: pan-y;
}

.ambient-grid {
    background-size: 40px 40px;
    background-image:
        linear-gradient(to right, rgba(255, 122, 0, 0.06) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 122, 0, 0.06) 1px, transparent 1px);
    mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, #000 55%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, #000 55%, transparent 100%);
}

/* --- TARJETAS 3D INTERACTIVAS (PERSPECTIVE + ORANGE GLARE) --- */
.tilt-card {
    position: relative;
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.35s ease;
    touch-action: manipulation;
}

.tilt-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        420px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(255, 122, 0, 0.15),
        rgba(255, 77, 0, 0.05) 45%,
        transparent 75%
    );
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
    z-index: 1;
}

.tilt-card:hover {
    box-shadow: var(--shadow-card-hover);
    border-color: var(--orange) !important;
}

.tilt-card:hover::before {
    opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
    .tilt-depth-lg {
        transform: translateZ(20px);
    }
    .tilt-depth-sm {
        transform: translateZ(12px);
    }
}

/* Marco 3D para Avatar / Foto de Perfil */
.avatar-3d-frame {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.avatar-orbit-ring {
    position: absolute;
    inset: -8px;
    border-radius: inherit;
    background: conic-gradient(from 0deg, #ff7a00, #ff4d00, #ffb703, #ff7a00);
    opacity: 0.45;
    filter: blur(12px);
    animation: orbit-spin 10s linear infinite;
    z-index: -1;
}

@keyframes orbit-spin {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.04);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

/* --- TIMELINE PROFESIONAL --- */
.timeline-line::before {
    content: "";
    position: absolute;
    left: 11px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(to bottom, #ff7a00, #ff4d00 45%, var(--medium-grey));
}

/* --- GRADIENTES DE TEXTO --- */
.text-gradient-tech {
    background: linear-gradient(135deg, #ff7a00 0%, #ff4d00 60%, #ffb703 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- NAVEGACIÓN ACTIVA --- */
.nav-link-active {
    color: var(--orange) !important;
    font-weight: 800 !important;
    position: relative;
}

.nav-link-active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 2px;
    border-radius: 9999px;
    background: var(--orange-grad);
}

/* --- FORMULARIO --- */
.rp-input {
    width: 100%;
    background: var(--black);
    border: 1px solid var(--medium-grey);
    border-radius: 14px;
    padding: 13px 16px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rp-input::placeholder {
    color: #71717a;
}

.rp-input:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.16);
}

/* --- BOTONES FLOTANTES CON RADAR (INTACTOS CON ACENTO NARANJA) --- */
.floating-actions {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 40;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.floating-radar-btn {
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 22px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
    text-decoration: none;
    transition: transform 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.floating-radar-btn:hover {
    transform: scale(1.1);
}

.floating-radar-btn i {
    position: relative;
    z-index: 1;
}

.floating-radar-btn::before,
.floating-radar-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--radar-color, rgba(37, 211, 102, 0.9));
    animation: radar-pulse 2.4s ease-out infinite;
    pointer-events: none;
}

.floating-radar-btn::after {
    animation-delay: 1.2s;
}

.floating-quote {
    background: var(--orange-grad);
    --radar-color: rgba(255, 122, 0, 0.9);
}

.floating-quote:hover {
    background: #ff5500;
}

.floating-whatsapp {
    background-color: #25d366;
    --radar-color: rgba(37, 211, 102, 0.9);
    font-size: 28px;
}

.floating-whatsapp:hover {
    background-color: #20ba5a;
}

@keyframes radar-pulse {
    0% {
        transform: scale(1);
        opacity: 0.78;
    }
    100% {
        transform: scale(1.9);
        opacity: 0;
    }
}

.floating-label {
    position: absolute;
    right: calc(100% + 14px);
    top: 50%;
    padding: 9px 15px;
    background: #0a0a0a;
    border: 1px solid #222222;
    border-radius: 9999px;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-50%) translateX(10px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    pointer-events: none;
    z-index: 2;
}

.floating-label::after {
    content: "";
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: #0a0a0a;
}

.floating-radar-btn:hover .floating-label,
.floating-radar-btn:focus-visible .floating-label {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* --- ACCESIBILIDAD Y DEGRADACIÓN EN MÓVIL --- */
@media (max-width: 640px) {
    .floating-actions {
        bottom: 20px;
        right: 20px;
        gap: 14px;
    }

    .floating-radar-btn {
        width: 52px;
        height: 52px;
        font-size: 20px;
    }

    .floating-whatsapp {
        font-size: 25px;
    }

    .rp-panel {
        border-radius: 24px;
    }
}

@media (hover: none) {
    .floating-label {
        display: none;
    }
    .tilt-card::before {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
