/* 
  ÁLVAREZ GARCÍA - UI SYSTEM v5.5
  "Hybrid Apple x SalesHub" 
*/

:root {
    /* Brand Palette - Coolors Fix */
    --primary: #166088;
    /* Petroleum Blue */
    --secondary: #4A6FA5;
    /* Muted Blue */
    --accent: #C2F970;
    /* Lime Green */
    --accent-soft: #C0D6DF;
    /* Soft Blue/Grey */
    --accent-dark: #588157;
    /* Dark Forest Green */

    /* Backgrounds */
    --bg-site: #F9FAFB;
    --bg-white: #FFFFFF;
    --bg-alt: #F3F4F6;
    --bg-dark: #001219;
    /* Deeper Dark for cards */

    /* Text */
    --text-main: #111827;
    --text-muted: #6B7280;
    --text-light: #FFFFFF;

    /* Typography - Apple Precision */
    --font-main: 'Poppins', sans-serif;
    --h1-size: clamp(3rem, 10vw, 5.5rem);
    --h2-size: clamp(2.5rem, 6vw, 4rem);
    --lead-size: 1.2rem;

    /* UI Tokens - Soft & Deep */
    --radius-xl: 48px;
    --radius-lg: 32px;
    --radius-sm: 16px;
    --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.04);
    --shadow-deep: 0 30px 60px rgba(22, 96, 136, 0.1);
    --glow-lime: 0 0 20px rgba(194, 249, 112, 0.3);
    --transition-apple: 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Base --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-site);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* --- Typography --- */
h1,
h2,
h3 {
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.15;
}

h1 {
    font-size: var(--h1-size);
}

h2 {
    font-size: var(--h2-size);
}

/* Animated Selection Style (Apple/Excel Hybrid) */
.text-selection {
    position: relative;
    display: inline-block;
    z-index: 1;
    padding: 0 0.4rem;
    line-height: 1.1;
}

.text-selection::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5%;
    width: 0;
    height: 105%;
    background: var(--accent);
    z-index: -1;
    transition: width 1.2s cubic-bezier(0.65, 0, 0.35, 1);
    border-radius: 2px;
}

.text-selection.active::after {
    width: 100%;
}

.lead {
    font-size: var(--lead-size);
    color: var(--text-muted);
    max-width: 850px;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.eyebrow {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--primary);
    text-transform: uppercase;
    display: block;
    margin-bottom: 1.5rem;
}

.sub-cta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 1.5rem;
    display: block;
    font-weight: 500;
}

/* --- Nav --- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(249, 250, 251, 0.8);
    backdrop-filter: blur(20px);
    z-index: 2000;
    padding: 1.2rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 3rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.nav-links a:hover {
    opacity: 0.6;
}

@media (max-width: 968px) {
    .nav-links {
        display: none !important;
    }

    .logo img {
        height: 24px;
    }
}

/* Sticky CTA */
.sticky-cta {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #000;
    color: #fff;
    padding: 0.8rem 2rem;
    border-radius: 999px;
    font-weight: 600;
    z-index: 1001;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    text-decoration: none;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sticky-cta.visible {
    transform: translateX(-50%) translateY(0);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 1.2rem 2.8rem;
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition-apple);
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 1.2rem 3rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
    border: none;
}

.btn-black {
    background: linear-gradient(135deg, var(--accent), #D4FF80);
    color: #111827; /* Dark text for better contrast on lime */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-black:hover {
    transform: translateY(-4px);
    background: #000;
    color: #fff;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    border-color: #000;
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent), #D4FF80);
    color: #000;
    box-shadow: var(--glow-lime);
}

.btn-accent:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(194, 249, 112, 0.5);
}

.btn-white {
    background: #fff;
    color: var(--primary);
    border: 1px solid rgba(22, 96, 136, 0.1);
}

.btn-white:hover {
    background: #f9fafb;
    transform: translateY(-4px);
    box-shadow: var(--shadow-deep);
}

/* --- Scroll Expansion Section (Apple Style) --- */
.scroll-expand-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    color: #fff;
    padding: 10rem 0;
    transition: transform 1s ease-out;
}

.expand-container {
    transform: scale(0.9);
    transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
    width: 100%;
}

.expand-container.active {
    transform: scale(1);
}

/* --- Services Zig-Zag --- */
.service-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
    align-items: center;
    margin-bottom: 8rem;
}

.service-row:nth-child(even) {
    direction: rtl;
}

.service-row:nth-child(even) .service-content {
    direction: ltr;
}

.service-img {
    width: 100%;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-deep);
}

.service-img img {
    width: 100%;
    display: block;
    transition: transform 1s var(--transition-apple);
}

.service-row:hover .service-img img {
    transform: scale(1.05);
}

/* --- Contrast Section (Problems) --- */
.problem-section {
    position: relative;
    background: #fff;
    overflow: hidden;
}

.bg-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.1;
    background-image: radial-gradient(var(--primary) 1px, transparent 1px);
    background-size: 50px 50px;
}

.contrast-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 3rem;
    margin-bottom: 2rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    border: 1px solid rgba(22, 96, 136, 0.1);
    box-shadow: var(--shadow-soft);
    transition: var(--transition-fast);
}

.contrast-card:hover {
    transform: translateX(10px);
    border-color: var(--accent);
    box-shadow: var(--shadow-deep);
}

/* --- Hero v6 Mesh Gradient --- */
.hero-v5 {
    position: relative;
    background: #fff;
    overflow: hidden;
}

.hero-v5::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 70% 80%, rgba(194, 249, 112, 0.18), transparent 40%),
        radial-gradient(circle at 20% 30%, rgba(22, 96, 136, 0.12), transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(74, 111, 165, 0.12), transparent 40%);
    animation: meshRotate 20s linear infinite;
    z-index: 0;
}

@keyframes meshRotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* --- Floating Glass Icons --- */
.glass-icon {
    position: absolute;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.4);
    animation: float 6s ease-in-out infinite;
    z-index: 5;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

@media (max-width: 968px) {
    .glass-icon {
        display: none;
    }
}

/* --- Footer Refined --- */
footer {
    background: #fff;
    padding: 6rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

@media (max-width: 968px) {
    .service-row {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .service-row:nth-child(even) {
        direction: ltr;
    }

    .contrast-card {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .arrow-sep {
        transform: rotate(90deg);
        padding: 1rem 0;
    }
}

/* --- Author Signature Component --- */
.author-signature {
    padding: 8rem 0;
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.signature-box {
    display: flex;
    align-items: center;
    gap: 4rem;
    max-width: 900px;
    margin: 0 auto;
}

.signature-photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow-deep);
    border: 4px solid var(--accent);
}

.signature-copy h4 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
    font-weight: 800;
}

.signature-copy p {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .signature-box {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .signature-photo {
        width: 120px;
        height: 120px;
    }
}