/* Modern Styles - EspinoSales (Premium Dark & Automation Theme) */
/* Refactored per design-taste-frontend skill: DESIGN_VARIANCE=8, MOTION_INTENSITY=6, VISUAL_DENSITY=4 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
    /* Color Palette — Off-blacks, no pure #000 */
    --bg-dark: #090910;
    --bg-secondary: #0f0f1a;
    --bg-card: #12121e;
    --bg-card-hover: #16162a;

    /* Accent: desaturated indigo — not neon, not AI purple */
    --primary-color: #5a5fcf;
    --primary-dim: rgba(90, 95, 207, 0.12);
    --primary-border: rgba(90, 95, 207, 0.25);

    /* Secondary: deep rose, restrained */
    --secondary-color: #c4507a;

    /* Text */
    --text-main: #edeef2;
    --text-muted: #7b7f94;
    --text-subtle: #4a4d62;

    /* Glass — liquid refraction */
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-inner: rgba(255, 255, 255, 0.04);
    --glass-bg: rgba(15, 15, 26, 0.72);

    /* Gradients — no oversaturated, no rainbow */
    --gradient-accent: linear-gradient(135deg, #5a5fcf 0%, #9b5ea8 100%);
    --gradient-subtle: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-secondary) 100%);

    /* Layout */
    --container-max-width: 1200px;
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;

    /* Motion */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --transition-fast: 0.2s var(--ease-out-expo);
    --transition-base: 0.35s var(--ease-out-expo);
    --transition-slow: 0.6s var(--ease-out-expo);
}

/* ─── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ─── Base ───────────────────────────────────────────────────── */
body {
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Grain texture overlay — fixed pseudo-element, never on scroll containers */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-size: 180px 180px;
}

/* ─── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4 {
    color: var(--text-main);
    font-family: 'Outfit', system-ui, sans-serif;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}

h1 {
    font-size: clamp(2.75rem, 5.5vw, 4.5rem);
    font-weight: 800;
}

h2 {
    font-size: clamp(2rem, 3.5vw, 3rem);
    letter-spacing: -0.025em;
}

h3 {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

p {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    max-width: 65ch;
}

a {
    text-decoration: none;
    transition: color var(--transition-fast);
}

/* ─── Container ──────────────────────────────────────────────── */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ─── Glassmorphism — Liquid Refraction ──────────────────────── */
/* Uses inner border + inner shadow for physical edge simulation */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow:
        0 4px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.07),  /* top edge refraction */
        inset 0 0 0 0.5px rgba(255, 255, 255, 0.03); /* inner micro-border */
}

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    font-family: 'Outfit', system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.975rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
    will-change: transform;
}

.btn:active {
    transform: scale(0.97) translateY(1px);
}

.btn-primary {
    background: var(--gradient-accent);
    color: #fff;
    border: none;
    /* Tinted shadow — not neon glow */
    box-shadow: 0 4px 20px rgba(90, 95, 207, 0.25), inset 0 1px 0 rgba(255,255,255,0.12);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(90, 95, 207, 0.35), inset 0 1px 0 rgba(255,255,255,0.15);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

/* ─── Hero — Left-Aligned Split Layout (DESIGN_VARIANCE=8) ───── */
/* Prohibido: centrado simétrico. Obligatorio: asimétrico o split */
.hero {
    position: relative;
    padding: 7rem 0 5rem;
    overflow: hidden;
    min-height: 100dvh; /* NEVER h-screen — use dvh for mobile safety */
    display: flex;
    align-items: center;
    background:
        radial-gradient(ellipse 70% 50% at 25% 40%, rgba(90, 95, 207, 0.1), transparent 65%),
        radial-gradient(ellipse 40% 40% at 75% 60%, rgba(196, 80, 122, 0.06), transparent 60%);
}

/* Split hero layout — content left, visual right */
.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    width: 100%;
    z-index: 10;
    position: relative;
}

.hero-text {
    text-align: left;
}

.hero-visual {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

/* Animated nodes / abstract visual for right side */
.hero-orbit {
    position: relative;
    width: 340px;
    height: 340px;
    flex-shrink: 0;
}

.hero-orbit-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(90, 95, 207, 0.18);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.hero-orbit-ring:nth-child(1) { width: 100%; height: 100%; animation: spin-slow 18s linear infinite; }
.hero-orbit-ring:nth-child(2) { width: 68%; height: 68%; border-color: rgba(196, 80, 122, 0.15); animation: spin-slow 12s linear infinite reverse; }
.hero-orbit-ring:nth-child(3) { width: 36%; height: 36%; border-color: rgba(90, 95, 207, 0.25); animation: spin-slow 7s linear infinite; }

.hero-orbit-dot {
    position: absolute;
    border-radius: 50%;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.hero-orbit-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    background: var(--primary-dim);
    border: 1px solid var(--primary-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 0 32px rgba(90, 95, 207, 0.15);
    animation: pulse-center 3s ease-in-out infinite;
}

.hero-node {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
    box-shadow: 0 0 12px rgba(90, 95, 207, 0.5);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1rem;
    background: var(--primary-dim);
    border: 1px solid var(--primary-border);
    border-radius: 9999px;
    color: #a0a5e8;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1.75rem;
    letter-spacing: 0.01em;
}

.hero-badge span {
    width: 7px;
    height: 7px;
    background-color: #10B981;
    border-radius: 50%;
    display: block;
    /* Subtle pulse, not neon glow */
    animation: pulse-dot 2.5s ease-in-out infinite;
}

/* ─── Pain Points — Asymmetric Zig-Zag Layout ────────────────── */
/* NO 3-equal-columns — use stacked feature rows */
.pain-points-section {
    padding: 6rem 0;
}

.pain-points-header {
    max-width: 520px;
    margin-bottom: 4rem;
}

.pain-points-header p {
    max-width: 100%;
}

.zigzag-grid {
    display: grid;
    gap: 1.5rem;
}

.zigzag-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2rem;
    align-items: start;
    padding: 2rem 2.25rem;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 4px 24px rgba(0, 0, 0, 0.3);
    transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
    will-change: transform;
    /* Staggered load-in */
    opacity: 0;
    animation: fade-up 0.6s var(--ease-out-expo) forwards;
}

.zigzag-item:nth-child(1) { animation-delay: 0.1s; }
.zigzag-item:nth-child(2) { animation-delay: 0.22s; }
.zigzag-item:nth-child(3) { animation-delay: 0.34s; }

.zigzag-item:hover {
    transform: translateX(6px);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 8px 32px rgba(0, 0, 0, 0.4);
}

.zigzag-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.3rem;
}

.zigzag-item h3 {
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
}

.zigzag-item p {
    margin-bottom: 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Keep existing service-icon for backward compatibility */
.service-icon {
    font-size: 2rem;
    margin-bottom: 1.25rem;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
}

/* ─── Services Grid (Why Us section) ─────────────────────────── */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.service-card {
    padding: 2.25rem;
    transition: transform var(--transition-base), border-color var(--transition-base);
    will-change: transform;
}

.service-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-border);
}

/* ─── Case Study / Stats ─────────────────────────────────────── */
.stat-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.25rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

/* ─── Section Headings — Horizontal Rule Accent ──────────────── */
.section-label {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary-color);
    margin-bottom: 1.25rem;
}

.section-label::before {
    content: '';
    display: block;
    width: 24px;
    height: 1px;
    background: var(--primary-color);
    opacity: 0.6;
}

/* ─── Footer ─────────────────────────────────────────────────── */
footer {
    border-top: 1px solid var(--glass-border);
    padding: 3.5rem 0;
    margin-top: 4rem;
    text-align: center;
    color: var(--text-muted);
}

footer a {
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

footer a:hover {
    color: var(--text-main);
}

/* ─── Animations ─────────────────────────────────────────────── */
/* Hardware-accelerated only: transform + opacity — never top/left/width */

@keyframes glow {
    0%, 100% { box-shadow: 0 4px 14px rgba(37, 211, 102, 0.2); }
    50%       { box-shadow: 0 4px 24px rgba(37, 211, 102, 0.4); }
}

.animate-glow {
    animation: glow 3s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.6; transform: scale(0.85); }
}

@keyframes pulse-center {
    0%, 100% { box-shadow: 0 0 32px rgba(90, 95, 207, 0.15); }
    50%       { box-shadow: 0 0 48px rgba(90, 95, 207, 0.28); }
}

@keyframes spin-slow {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes float-gentle {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-8px); }
}

/* ─── Dropdown Menu ──────────────────────────────────────────── */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: rgba(12, 12, 22, 0.96);
    min-width: 200px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255,255,255,0.07);
    z-index: 101;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-md);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    overflow: hidden;
}

.dropdown:hover .dropdown-content {
    display: block;
    animation: fade-up 0.2s var(--ease-out-expo) both;
}

.dropdown-content a {
    color: var(--text-muted);
    padding: 11px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background var(--transition-fast), color var(--transition-fast);
}

.dropdown-content a:hover {
    background-color: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
}

.dropdown-content a:last-child {
    border-bottom: none;
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    h1 { font-size: 2.4rem; }

    .hero {
        padding-top: 5.5rem;
        padding-bottom: 3rem;
    }

    /* Hero collapses to single column on mobile */
    .hero-content {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }

    .hero-text {
        text-align: center;
    }

    .hero-visual {
        justify-content: center;
    }

    .hero-orbit {
        width: 240px;
        height: 240px;
    }

    /* Zigzag collapses cleanly */
    .zigzag-item {
        grid-template-columns: auto 1fr;
        gap: 1.25rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }
}