:root {
    --bg-color: #F8FAFC; /* Soft slate/off-white */
    --bg-alt: #E2E8F0; /* Stronger contrast for alternate sections */
    --bg-dark: #0F172A; /* Deep navy */
    --text-primary: #0F172A; /* Slate 900 */
    --text-secondary: #334155; /* Slate 700 - darker for readability */
    --text-light: #F8FAFC;
    --text-light-muted: #94A3B8;
    --accent: #1E3A8A; /* Classic Legal Navy */
    --accent-hover: #1D4ED8;
    --wa-color: #25D366; /* WhatsApp green */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --section-padding-desk: 140px;
    --section-padding-mob: 80px;
    --automation-pattern-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400' viewBox='0 0 400 400'%3E%3Cpath d='M 100 200 C 150 200, 150 100, 200 100 C 250 100, 250 300, 300 300 C 350 300, 350 200, 400 200' fill='none' stroke='rgba(30,58,138,0.04)' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M 0 200 C 50 200, 50 100, 100 100' fill='none' stroke='rgba(30,58,138,0.04)' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M 300 300 C 350 300, 350 400, 400 400' fill='none' stroke='rgba(30,58,138,0.04)' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='100' cy='200' r='10' fill='rgba(30,58,138,0.02)' stroke='rgba(30,58,138,0.05)' stroke-width='3'/%3E%3Ccircle cx='200' cy='100' r='14' fill='rgba(30,58,138,0.02)' stroke='rgba(30,58,138,0.05)' stroke-width='3'/%3E%3Ccircle cx='300' cy='300' r='8' fill='rgba(30,58,138,0.02)' stroke='rgba(30,58,138,0.05)' stroke-width='3'/%3E%3C/svg%3E");
    --automation-pattern-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400' viewBox='0 0 400 400'%3E%3Cpath d='M 100 200 C 150 200, 150 100, 200 100 C 250 100, 250 300, 300 300 C 350 300, 350 200, 400 200' fill='none' stroke='rgba(255,255,255,0.04)' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M 0 200 C 50 200, 50 100, 100 100' fill='none' stroke='rgba(255,255,255,0.04)' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M 300 300 C 350 300, 350 400, 400 400' fill='none' stroke='rgba(255,255,255,0.04)' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='100' cy='200' r='10' fill='rgba(255,255,255,0.01)' stroke='rgba(255,255,255,0.05)' stroke-width='3'/%3E%3Ccircle cx='200' cy='100' r='14' fill='rgba(255,255,255,0.01)' stroke='rgba(255,255,255,0.05)' stroke-width='3'/%3E%3Ccircle cx='300' cy='300' r='8' fill='rgba(255,255,255,0.01)' stroke='rgba(255,255,255,0.05)' stroke-width='3'/%3E%3C/svg%3E");
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    background-image: var(--automation-pattern-dark);
    color: var(--text-primary);
    font-size: 20px; /* Increased font size */
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    position: relative;
}

/* Background Patterns */
.pattern-grid {
    background-image: var(--automation-pattern-light), linear-gradient(rgba(15, 23, 42, 0.06) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(15, 23, 42, 0.06) 1px, transparent 1px);
    background-size: 400px 400px, 40px 40px, 40px 40px;
}

.pattern-grid-top {
    background-image: var(--automation-pattern-dark), linear-gradient(rgba(15, 23, 42, 0.06) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(15, 23, 42, 0.06) 1px, transparent 1px);
    background-size: 400px 400px, 40px 40px, 40px 40px;
    background-position: top center;
    background-repeat: repeat, no-repeat, no-repeat;
}

.pattern-dots {
    background-image: var(--automation-pattern-dark), radial-gradient(rgba(15, 23, 42, 0.1) 1.5px, transparent 1.5px);
    background-size: 400px 400px, 24px 24px;
}

/* Section dividers for better separation */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(15, 23, 42, 0.1), transparent);
    width: 100%;
}

/* Language toggle logic */
html[data-lang="en"] [lang="es"] { display: none !important; }
html[data-lang="es"] [lang="en"] { display: none !important; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.bg-alt {
    background-color: var(--bg-alt);
    position: relative;
    border-top: 1px solid rgba(0,0,0,0.05);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.bg-dark {
    background-color: var(--bg-dark);
    color: var(--text-light);
    position: relative;
}

.bg-dark h1, .bg-dark h2, .bg-dark h3 {
    color: var(--text-light);
}

.bg-dark p, .bg-dark .section-label, .bg-dark .small-text, .bg-dark li {
    color: var(--text-light-muted);
}

.bg-dark .bullet-grid li {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(248, 250, 252, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    padding: 16px 0;
    transition: all 0.3s ease;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: -0.02em;
    color: var(--accent);
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-text {
    background: linear-gradient(90deg, #1E3A8A 0%, #1E3A8A 40%, #60A5FA 50%, #1E3A8A 60%, #1E3A8A 100%);
    background-size: 200% auto;
    color: transparent;
    -webkit-text-fill-color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: shine 4s linear infinite;
}

@keyframes shine {
    to { background-position: 200% center; }
}

.header-nav {
    display: flex;
    gap: 24px;
    align-items: center;
    margin-right: 24px;
}

.nav-link {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 1.05rem;
    transition: color 0.2s ease;
}

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

.lang-toggle {
    background: transparent;
    border: 1px solid rgba(15, 23, 42, 0.3);
    color: var(--accent);
    padding: 8px 16px;
    border-radius: 6px;
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-toggle:hover {
    background: rgba(15, 23, 42, 0.05);
}

/* Header Mobile Menu Hack */
.header-menu {
    display: flex;
    align-items: center;
}

.menu-checkbox {
    display: none;
}

.menu-toggle {
    display: none;
    cursor: pointer;
    padding: 8px;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.menu-toggle svg line {
    transition: transform 0.2s ease, opacity 0.2s ease;
    transform-origin: center;
}

@media (max-width: 768px) {
    body {
        font-size: 16px;
    }
    
    h1 {
        font-size: clamp(2rem, 8vw, 3.2rem);
    }
    
    h2 {
        font-size: clamp(1.6rem, 6vw, 2.5rem);
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .header-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: rgba(248, 250, 252, 0.98);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        flex-direction: column;
        padding: 24px;
        gap: 16px;
        border-bottom: 1px solid rgba(15, 23, 42, 0.08);
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
        z-index: 999;
    }
    
    .header-nav {
        flex-direction: column;
        width: 100%;
        margin-right: 0;
        gap: 16px;
    }
    
    .header-nav .nav-link {
        display: block;
        width: 100%;
        text-align: center;
        padding: 10px 0;
        font-size: 1.15rem;
    }
    
    .header-menu .lang-toggle {
        width: 100%;
        text-align: center;
        padding: 12px 0;
    }
    
    .menu-checkbox:checked ~ .header-menu {
        display: flex !important;
    }

    .menu-checkbox:checked ~ .menu-toggle .line-top {
        transform: translateY(6px) rotate(45deg);
    }
    .menu-checkbox:checked ~ .menu-toggle .line-mid {
        opacity: 0;
    }
    .menu-checkbox:checked ~ .menu-toggle .line-bot {
        transform: translateY(-6px) rotate(-45deg);
    }
    
    .footer-right {
        align-items: flex-start;
    }
}

section {
    padding: var(--section-padding-desk) 0;
    position: relative;
}

@media (max-width: 768px) {
    section {
        padding: var(--section-padding-mob) 0;
    }
}

h1, h2, h3 {
    font-weight: 800; /* Bolder headings */
    line-height: 1.1;
    letter-spacing: -0.04em;
    margin-bottom: 24px;
    color: var(--text-primary);
}

h1 {
    font-size: clamp(3rem, 6vw, 4.5rem);
    max-width: 800px;
}

h2 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    max-width: 700px;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.section-label {
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

p:last-child {
    margin-bottom: 0;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.8;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--accent);
    color: #FFFFFF;
    padding: 18px 36px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.15rem;
    transition: all 0.2s ease;
    border: 2px solid var(--accent);
    text-decoration: none;
}

.button:hover {
    background-color: var(--accent-hover);
    color: #FFFFFF;
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.2);
}

.button:active {
    transform: translateY(0);
}

.button-secondary {
    background-color: #FFFFFF;
    color: var(--accent);
    border: 2px solid rgba(15, 23, 42, 0.25);
}

.button-secondary:hover {
    background-color: #F8FAFC;
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

/* Hero Section Refinements */
.hero {
    position: relative;
    padding-top: 40px;
    padding-bottom: 60px;
    overflow: visible;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    z-index: -1;
    opacity: 0.6;
}

.hero-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, transparent 30%, var(--bg-color) 80%);
}

.hero-grid-layout {
    display: grid;
    grid-template-columns: 0.95fr 1.35fr;
    gap: 48px;
    align-items: center;
}

.hero-content {
    transform: translateY(-0.5cm);
}

.hero-visual {
    transform: translate(1.0cm, -3.0cm) scale(1.15);
    transform-origin: left center;
}

.hero-visual svg {
    overflow: visible;
}

@media (max-width: 1024px) {
    .hero-grid-layout {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .hero-content {
        transform: none;
    }
    .hero-visual {
        max-width: 780px;
        margin: 40px auto 0;
        transform: none;
        transform-origin: center center;
    }
    .hero-cta {
        justify-content: center;
    }
}

.positioning {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 32px;
    display: inline-block;
    padding: 10px 20px;
    background: #FFFFFF;
    border-radius: 100px;
    border: 1px solid rgba(15, 23, 42, 0.15);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.subhead {
    font-size: clamp(1.35rem, 2.5vw, 1.5rem);
    max-width: 650px;
    margin-bottom: 24px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.hero-cta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.text-center {
    text-align: center;
}

.text-center h2, .text-center .subhead {
    margin-left: auto;
    margin-right: auto;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

@media (max-width: 900px) {
    .grid-3 {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

.card {
    background: #FFFFFF;
    padding: 40px;
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    box-shadow: 0 12px 32px rgba(0,0,0,0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    position: relative;
    z-index: 2;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    border-color: rgba(15, 23, 42, 0.2);
}

.card-icon {
    margin-bottom: 32px;
    color: var(--accent);
    display: inline-flex;
    padding: 16px;
    background: rgba(15, 23, 42, 0.05);
    border-radius: 12px;
}

/* How It Works - Visual Process Flow */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

@media (max-width: 900px) {
    .steps-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }
    .step-line {
        display: none;
    }
}

.step-card {
    position: relative;
}

.step-header {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.step-number {
    font-family: var(--font-family);
    font-weight: 800;
    font-size: 1.25rem;
    color: #FFFFFF;
    background-color: var(--accent);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.2);
    position: relative;
    z-index: 2;
}

.step-line {
    flex-grow: 1;
    margin-left: 24px;
    height: 2px;
    overflow: hidden;
}

.step-card p {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.5;
}

.bullet-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px 48px;
    list-style: none;
    position: relative;
    z-index: 2;
}

.bullet-grid li {
    position: relative;
    padding-left: 32px;
    color: var(--text-secondary);
    font-size: 1.15rem;
    background: #FFFFFF;
    padding: 24px 24px 24px 48px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.bullet-grid li::before {
    content: "→";
    position: absolute;
    left: 20px;
    top: 24px;
    color: var(--accent);
    font-weight: bold;
    font-size: 1.25rem;
}

@media (max-width: 768px) {
    .bullet-grid {
        grid-template-columns: 1fr;
    }
}

.who-its-for p, .about p {
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    max-width: 900px;
    color: var(--text-primary);
    font-weight: 500;
    position: relative;
    z-index: 2;
    line-height: 1.5;
}

footer {
    padding: 64px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background-color: var(--bg-dark);
    color: var(--text-light);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.footer-left p {
    margin-bottom: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-light);
}

.footer-left .small-text {
    font-size: 0.95rem;
    color: var(--text-light-muted);
    margin-bottom: 0;
    font-weight: 500;
}

.footer-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.footer-links {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.footer-links .quiet-link {
    font-size: 0.95rem;
    color: var(--text-light-muted);
    font-weight: 500;
    text-decoration: none;
}

.footer-links .quiet-link:hover {
    color: var(--text-light);
}

.footer-links .divider {
    color: rgba(255, 255, 255, 0.15);
    font-size: 0.95rem;
}

.quiet-link {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.quiet-link:hover {
    color: var(--accent);
}

footer .quiet-link {
    color: var(--text-light-muted);
}

footer .quiet-link:hover {
    color: var(--text-light);
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 32px;
    }
}

/* Floating WhatsApp Button */
.floating-wa {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background-color: var(--wa-color);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.floating-wa:hover {
    transform: translateY(-6px) scale(1.05);
    box-shadow: 0 16px 32px rgba(37, 211, 102, 0.5);
    opacity: 1;
}

@media (max-width: 768px) {
    .floating-wa {
        bottom: 24px;
        right: 24px;
        width: 56px;
        height: 56px;
    }
    .floating-wa svg {
        width: 28px;
        height: 28px;
    }
    .hero-cta {
        flex-direction: column;
    }
    .hero-cta .button {
        width: 100%;
    }
}

/* Animations */
@keyframes spin-slow {
    100% { transform: rotate(360deg); }
}

.spin-slow {
    transform-origin: center;
    animation: spin-slow 16s linear infinite;
}

@keyframes pulse-fast {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.pulse-fast {
    animation: pulse-fast 2s ease-in-out infinite;
}

@keyframes flow-dash {
    to { stroke-dashoffset: -20; }
}

.path-flow {
    stroke-dasharray: 6 6;
    animation: flow-dash 1s linear infinite;
}

.vertical-animation-container {
    position: absolute;
    top: 0;
    left: 40px; /* Moved further from the edge */
    width: 120px; /* Wider to accommodate angles and icons */
    height: 100%;
    z-index: 1; /* Below the content to avoid overlap */
    pointer-events: none;
    opacity: 0.8;
}

.vertical-animation-container-right {
    left: auto !important;
    right: 40px;
    transform: scaleX(-1);
}

@media (max-width: 1200px) {
    .vertical-animation-container {
        display: none !important;
    }
}

.vertical-flow {
    animation: flow-vertical 4s linear infinite;
}

.vertical-flow-fast {
    animation: flow-vertical 2.5s linear infinite;
}

@keyframes flow-vertical {
    to { stroke-dashoffset: -40; }
}

.integrations {
    padding: 140px 0;
    position: relative;
}

@media (max-width: 768px) {
    .integrations {
        padding: 80px 0;
    }
}

.hero-visual-desktop {
    display: contents;
}

.hero-visual-mobile {
    display: none !important;
}

@keyframes logo-glow-anim {
    0%, 100% {
        stroke: #1E3A8A;
        filter: drop-shadow(0 0 2px rgba(30, 58, 138, 0.4));
    }
    10% {
        stroke: #1E3A8A;
        filter: drop-shadow(0 0 2px rgba(30, 58, 138, 0.4));
    }
    15% {
        stroke: #60A5FA;
        filter: drop-shadow(0 0 8px rgba(96, 165, 250, 0.9));
    }
    20% {
        stroke: #1E3A8A;
        filter: drop-shadow(0 0 2px rgba(30, 58, 138, 0.4));
    }
}

@media (max-width: 768px) {
    .hero-visual-desktop {
        display: none !important;
    }
    .hero-visual-mobile {
        display: block !important;
        max-width: 360px;
        margin: 20px auto 0;
        width: 100%;
    }
    .logo svg {
        stroke: #1E3A8A !important;
        animation: logo-glow-anim 4s ease-in-out infinite !important;
    }
}

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