/* CSS Reset & Variables */
:root {
    /* Nueva Paleta de Colores Ctrl-X (Tema Claro) */
    --bg-matte: #fcfcfc;
    /* Blanco Mate Fondo */
    --bg-secondary: #f4f6f9;
    /* Gris muy suave para secciones alternas */

    --text-main: #221c24;
    /* Dark Purple para texto principal */
    --text-muted: #555555;
    /* Muted Purple para subtítulos */

    /* Colores de Acento (Palette User) */
    --accent-1: #4E4D90;
    --accent-2: #753488;
    --accent-3: #B83996;
    --accent-4: #D14040;
    --accent-5: #AF0000;
    --accent-6: #44a5ac;

    --white: #ffffff;

    --font-suse: 'SUSE', sans-serif;
    --font-ctrlx: 'CtrlX', sans-serif;
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);

    /* Missing Variables Fix */
    --vibrant-pink: #BC1763;
    --hot-pink: #B83996;
    --deep-dark: #211833;

    --card-bg: #ffffff;
    --card-border: 1px solid rgba(78, 77, 144, 0.1);
    --card-shadow: 0 10px 40px -10px rgba(33, 24, 51, 0.1);
    --glass-nav: rgba(255, 255, 255, 0.85);

    /* Mobile Menu Vars (User Added) */
    --bg-sitio: #fcfcfc;
    /* This is updated by JS script.js */
    --nav-white: #ffffff;
    --verde-principal: #44a5ac;
    --rojo-principal: #D14040;
    --naranaj-principal: #cc412a;
    --azul-principal: #324c68;
    --rosa-principal: #b01455;
    --gris-principal: #555555;
    --negro-principal: #221c24;
    --icono-color: #222327;
    --transparente: transparent;
}

@font-face {
    font-family: 'CtrlX';
    src: url('../fonts/ctrlx.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

.font-ctrlx {
    font-family: var(--font-ctrlx) !important;
}

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

body {
    font-family: var(--font-suse);
    background-color: var(--bg-matte);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Service Cards Visibility Fix */
.service-card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--text-main) !important;
    /* Force visibility */
}

.service-card p {
    color: var(--text-muted) !important;
    font-size: 1rem;
}

/* GridStack / Blog Preview Styles */
.grid-stack-item-content {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform 0.3s ease;
}

.grid-stack-item-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.grid-stack-item-content h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.grid-stack-item-content p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.highlight-content {
    background: linear-gradient(135deg, var(--accent-3), var(--accent-4));
}

.highlight-content h3,
.highlight-content p {
    color: white !important;
}

/* Demo Card Fallback */
.demo-card {
    background: #eee;
    /* Fallback if image fails */
    min-height: 300px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 1rem;
    color: var(--text-main);
}

h1 span.highlight {
    background: linear-gradient(45deg, var(--accent-3), var(--accent-4));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Custom Font Application */
.logo a,
.footer-brand .brand-tagline,
.hero-content h1 {
    font-family: var(--font-ctrlx) !important;
}

/* Specific Adjustment: Hero Title only applies to "Ctrl-X" if it's the whole h1 text or wrapped. 
   In home.php it is: <h1>Ctrl-X <br><span class="highlight"> <Corta con lo cotidiano> </span></h1>
   So both "Ctrl-X" and the tagline in span get the font. Perfect. 
*/

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* Navigation */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: var(--glass-nav);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    height: 80px;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(to right, #fff, var(--muted-purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo img {
    height: 40px;
    /* Adjust based on logo aspect ratio */
    width: auto;
    display: block;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-item {
    font-weight: 600;
    position: relative;
    padding: 0.5rem 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.nav-item:hover {
    color: var(--accent-4);
}

.nav-item::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg, var(--accent-3), var(--accent-4));
    transition: 0.3s ease;
}

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

.btn-login {
    background: linear-gradient(135deg, var(--accent-4), var(--accent-5));
    color: white !important;
    padding: 0.6rem 1.8rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(188, 23, 99, 0.2);
    font-weight: 600;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(188, 23, 99, 0.4);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 2.5rem;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-2), var(--accent-3));
    color: white;
    box-shadow: 0 4px 15px rgba(117, 52, 136, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(117, 52, 136, 0.5);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--accent-1);
    color: var(--accent-1);
}

.btn-outline:hover {
    background: var(--accent-1);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1.2rem;
    font-size: 0.85rem;
    border-radius: 6px;
}

/* Hero Section */
.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Center horizontally by default */
    position: relative;
    overflow: hidden;
    padding: 0 10%;
    margin-top: -80px;
    /* Compensate layout for sticky header if needed, or adjust */
    padding-top: 80px;
}

.hero-bg-anim {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../img/hero-bg.png') no-repeat center center/cover;
    /* Can remove dark overlay or adjust for light theme */
    opacity: 0.1;
    /* Very subtle on light bg */
    mix-blend-mode: multiply;
    /* Better for light backgrounds */
    z-index: -1;
    /* Optional: Animate scale subtly */
    animation: scaleBg 20s infinite alternate;
}

@keyframes pulseBg {
    from {
        transform: scale(1);
        opacity: 0.5;
    }

    to {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

@keyframes scaleBg {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.1);
    }
}

.hero-content {
    z-index: 2;
    max-width: 800px;
    text-align: center;
}

.hero-content h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.hero-content p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 400;
}

.cta-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

/* Common Section Styles */
.section {
    padding: 6rem 10%;
    position: relative;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 4rem;
    text-align: center;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-main);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent-3);
    margin: 1rem auto 0;
    border-radius: 2px;
}

/* Service Cards */
.grid-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
}

.service-card {
    background: var(--card-bg);
    border: var(--card-border);
    padding: 3rem 2rem;
    border-radius: 24px;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px -10px rgba(33, 24, 51, 0.15);
    border-color: var(--accent-6);
}

.service-card .icon {
    font-size: 2.5rem;
    color: var(--accent-6);
    margin-bottom: 1.5rem;
    display: inline-block;
    padding: 1.2rem;
    background: rgba(184, 57, 150, 0.05);
    border-radius: 50%;
}

.service-card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.service-card p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Demo Cards */
.demo-card {
    background: var(--card-bg);
    border: var(--card-border);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: var(--transition);
}

.demo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2);
}

.demo-card .card-content {
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.2));
}

.demo-card h3 {
    color: var(--white);
    /* Valid only if over image, check context */
}

.demo-card .price {
    color: var(--vibrant-pink);
}

/* Footer */
.main-footer {
    background: #150f21;
    /* Darker shade of deep-dark */
    color: var(--text-muted);
    padding: 5rem 10% 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-logo h3 {
    color: white;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.footer-links h4,
.footer-social h4 {
    color: white;
    margin-bottom: 1.5rem;
}

.footer-links ul li {
    margin-bottom: 0.8rem;
}

.footer-links a:hover {
    color: var(--vibrant-pink);
    padding-left: 5px;
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10%;
    transition: 0.3s;
}

.social-icon:hover {
    background: var(--hot-pink);
    color: white;
    transform: rotate(15deg);
}

/* Loader */
#loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--deep-dark);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s;
}

#loader {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--vibrant-pink);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loader-hidden {
    opacity: 0;
    visibility: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    /* Mobile Menu incomplete in this snippet */
    .hero-content h1 {
        font-size: 2.8rem;
    }

    .hero {
        padding-top: 4rem;
        text-align: center;
    }

    .cta-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    /* Footer Mobile Optimization */
    .footer-container {
        flex-direction: column;
        text-align: center;
        gap: 2.5rem;
    }

    .footer-brand,
    .footer-nav,
    .footer-social {
        align-items: center;
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .footer-logo-img {
        margin: 0 auto 1rem;
        height: 60px;
        /* Slightly larger on mobile for visibility */
    }

    /* Organize Nav Links in a 2-column Grid */
    .footer-nav ul {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem 2rem;
        text-align: left;
    }

    .footer-nav h4 {
        margin-bottom: 1rem;
        border-bottom: 2px solid var(--accent-3);
        /* Visual separator */
        padding-bottom: 0.5rem;
        display: inline-block;
    }

    .footer-social {
        margin-top: 1rem;
        padding-top: 2rem;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        width: 100%;
    }
}

/* Custom Cursors (High Contrast: White Fill, Black Outline, Medium Shadow, Larger 48px) */
/* Custom Cursors (Global Application) */
html {
    cursor: auto;
    min-height: 100%;
}

body {
    cursor: url('../img/cursor-arrow.svg') 6 6, auto;
    min-height: 100vh;
}

/* Force everything to inherit the cursor unless specified otherwise */
* {
    cursor: inherit;
}

@keyframes wiggle {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(5deg);
    }

    75% {
        transform: rotate(-5deg);
    }
}

/* Interactive Elements (Hand Cursor) - Apply directly, not just on hover */
a,
button,
.btn,
label,
select,
input[type="submit"],
input[type="button"],
.service-card,
.demo-card,
.blog-item,
.gallery-item,
.filter-btn {
    cursor: url('../img/cursor-hand-thick.svg') 14 0, pointer;
}

/* Inputs should keep text cursor */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
textarea {
    cursor: text;
}

/* Wiggle Animation (Text Links Only) */
a:hover:not(.btn-primary):not(.btn-outline):not(.service-card):not(.demo-card) {
    animation: wiggle 0.5s ease-in-out;
    display: inline-block;
}

/* Ink Transition Layer (Shared) */
.cd-transition-layer {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10000;
    height: 100%;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    pointer-events: none;
    /* Allow clicks through when hidden */
}

.cd-transition-layer .bg-layer {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translateY(-50%) translateX(-50%);
    height: 100%;
    width: 100%;
    background: radial-gradient(circle, var(--accent-3) 0%, transparent 10%);
    background-size: 100% 100%;
    transition: transform 0.8s;
}

.cd-transition-layer.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.cd-transition-layer.opening .bg-layer {
    animation: ink-open 0.8s forwards;
}

.cd-transition-layer.closing .bg-layer {
    animation: ink-close 0.8s forwards;
}

@keyframes ink-open {
    0% {
        transform: translate(-50%, -50%) scale(0);
    }

    100% {
        transform: translate(-50%, -50%) scale(25);
    }
}

@keyframes ink-close {
    0% {
        transform: translate(-50%, -50%) scale(25);
    }

    100% {
        transform: translate(-50%, -50%) scale(0);
    }
}

/* --- Mobile Bottom Navigation (User Implemented) --- */
/* Mobile Navigation Wrapper - Global */

@media (max-width: 768px) {

    /* Hide Default Header Nav Elements on Mobile */
    .nav-links,
    .burger {
        display: none !important;
    }
}

/* Wrapper handles positioning and centering */
.mobile-nav-wrapper {
    display: none;
    /* Hidden by default on desktop */
    width: 100%;
    position: fixed;
    bottom: 20px;
    left: 0;
    z-index: 9999;
    pointer-events: none;
    /* Let clicks pass through outside */
}

@media (max-width: 768px) {
    .mobile-nav-wrapper {
        display: flex !important;
        justify-content: center;
    }

    .main-nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 5%;
        background: var(--glass-nav);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        position: sticky;
        top: 0;
        z-index: 1000;
        border-bottom: 1px solid rgba(0, 0, 0, 0.03);
        height: 55px;
    }

    .reader-toolbar-clean {
        position: sticky;
        top: 54px !important;
        z-index: 990;
        background: var(--reader-bg);
        border-bottom: 1px solid var(--reader-border);
        border-top: 1px solid var(--reader-border);
        padding: 0.8rem 0;
        margin-bottom: 2rem;
        transition: background 0.3s;
        box-shadow: 0 4px 10px -2px rgba(0, 0, 0, 0.05);
    }
}

/* The Navigation Bar */
.mobile-nav {
    width: 360px;
    height: 70px;
    background: var(--nav-white);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 15px;
    /* User radius */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
}

/* List Container */
.mobile-nav-list {
    display: flex;
    width: 360px;
    padding: 0;
    margin: 0;
    list-style: none;
}

/* List Items */
.mobile-list-item {
    position: relative;
    list-style: none;
    width: 60px;
    height: 70px;
    z-index: 10;
    /* Icons on top */
}

/* Links */
.mobile-list-item a {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    width: 100%;
    text-decoration: none;
}

/* Icons */
.mobile-list-item a .icon {
    position: relative;
    display: block;
    line-height: 75px;
    font-size: 1.5rem;
    transition: 0.5s;
    color: var(--icono-color);
    pointer-events: none;
    margin-top: 0;
    text-align: center;
}

.mobile-list-item.active a .icon {
    transform: translateY(-32px);
    color: #fff;
}

/* Text Label */
.mobile-list-item a .text {
    position: absolute;
    color: var(--icono-color);
    font-weight: 500;
    font-size: 0.75em;
    transition: 0.5s;
    opacity: 0;
    transform: translateY(20px);
}

.mobile-list-item.active a .text {
    opacity: 1;
    transform: translateY(10px);
}

/* --- INDICATOR (User Values) --- */
.indicator {
    position: absolute;
    top: -25px;
    /* Fixed px instead of % to keep consistent protrusion */
    width: 60px;
    height: 60px;
    background: var(--rojo-principal);
    border-radius: 50%;

    /* The script injects the color here */
    border: 6px solid var(--bg-sitio);

    transition: 0.5s;
    z-index: 1;
    /* Behind icons */
}

/* Left Ear */
.indicator::before {
    content: '';
    position: absolute;
    top: 50%;
    /* Adjust to middle of circle roughly */
    left: -22px;
    /* Adjusted for smaller circle */
    width: 20px;
    height: 20px;
    background: transparent;
    border-top-right-radius: 20px;
    /* White shadow to match bar is vital */
    box-shadow: 1px -10px 0 0 var(--transparente);
}

/* Right Ear */
.indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -22px;
    width: 20px;
    height: 20px;
    background: transparent;
    border-top-left-radius: 20px;
    box-shadow: -1px -10px 0 0 var(--transparente);
}

/* Movement Logic */
.mobile-nav-list li:nth-child(1).active~.indicator {
    transform: translateX(calc(60px * 0));
}

.mobile-nav-list li:nth-child(2).active~.indicator {
    transform: translateX(calc(60px * 1));
}

.mobile-nav-list li:nth-child(3).active~.indicator {
    transform: translateX(calc(60px * 2));
}

.mobile-nav-list li:nth-child(4).active~.indicator {
    transform: translateX(calc(60px * 3));
}

.mobile-nav-list li:nth-child(5).active~.indicator {
    transform: translateX(calc(60px * 4));
}

.mobile-nav-list li:nth-child(6).active~.indicator {
    transform: translateX(calc(60px * 5));
}