:root {

    /* Color Palette - Light Mode */
    --color-primary: #264653;
    --color-accent: #E76F51;
    --color-support: #F4A261;
    --color-bg: #FDFCF8;
    --color-text: #2f2f2f;
    --color-white: #ffffff;

    /* Typography */
    --font-header: 'Outfit',
        sans-serif;
    --font-body: 'Outfit',
        sans-serif;

    /* Spacing */
    --space-unit: 1rem;
    --container-max-width: 1200px;

    /* Transitions */
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Mode Variables */
body.dark-mode {
    --color-primary: #4A9EAF;
    --color-accent: #FF8C6B;
    --color-support: #FFB380;
    --color-bg: #1a1a1a;
    --color-text: #e0e0e0;
    --color-white: #2a2a2a;
}

html {
    scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-header);
    color: var(--color-primary);
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-smooth);
}

button {
    font-family: inherit;
    /* Fix for button font consistency */
}

ul {
    list-style: none;
}

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--color-accent);
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: var(--transition-smooth);
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

/* Reusable Components */
.btn {
    display: inline-block;
    padding: 1.2rem 2.4rem;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-white);
    box-shadow: 0 10px 20px rgba(231, 111, 81, 0.2);
}

.btn-primary:hover {
    background-color: #d15d41;
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(231, 111, 81, 0.3);
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.btn-secondary:hover {
    background-color: var(--color-primary);
    color: var(--color-bg);
    transform: translateY(-3px);
}

/* Sections */
section {
    padding: 10rem 0;
}

/* Header/Nav */
header {
    height: 90px;
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(253, 252, 248, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    transition: var(--transition-smooth);
}

body.dark-mode header {
    background-color: rgba(26, 26, 26, 0.8);
}

header.scrolled {
    height: 70px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

header .nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo img {
    height: 45px;
    width: auto;
    mix-blend-mode: multiply;
}

body.dark-mode .logo img {
    mix-blend-mode: screen;
    filter: brightness(1.2);
}

.nav-links {
    display: flex;
    gap: 3rem;
    align-items: center;
}

.nav-links a {
    font-weight: 600;
    font-size: 1rem;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-accent);
    transition: var(--transition-smooth);
}

.nav-links a:hover::after {
    width: 100%;
}

/* Mobile Menu Toggle - Modern Dot Design */
/* Mobile Menu Toggle - Burger Lines */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 1101;
    background: transparent;
    border: none;
    padding: 0;
    flex-shrink: 0;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: var(--color-primary);
    border-radius: 4px;
    transition: var(--transition-smooth);
    transform-origin: left;
    position: static;
    /* Clear absolute from previous */
}

/* Old dot styles removed */

/* Burger to X Animation */
.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg);
}

/* Hero Section */
.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    padding-top: 90px;
    padding-bottom: 3rem;
    background: radial-gradient(circle at top right, rgba(244, 162, 97, 0.1), transparent),
        radial-gradient(circle at bottom left, rgba(38, 70, 83, 0.05), transparent);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 4rem;
    align-items: center;
}

.hero-content h1 {
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.15;
    margin-bottom: 1.5rem;
}

.hero-content p {
    font-size: clamp(1rem, 2vw, 1.3rem);
    margin-bottom: 2.5rem;
    color: #444;
    max-width: 550px;
    line-height: 1.6;
}

body.dark-mode .hero-content p {
    color: #ccc;
}

.cta-group {
    display: flex;
    gap: 1.5rem;
}

.hero-image {
    position: relative;
}

.hero-image>div {
    transition: var(--transition-smooth);
}

.hero-image:hover>div {
    transform: translateY(-5px);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.15);
}

body.dark-mode .hero-image>div {
    background: var(--color-card) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.hero-image img {
    width: 100%;
    border-radius: 30px;
    box-shadow: 30px 30px 0 var(--color-support);
    transition: var(--transition-smooth);
}

.hero-image:hover img {
    transform: scale(1.02);
}

/* Animations */
[data-reveal] {
    opacity: 1;
    /* Visible by default (Safety fallback) */
    transform: translateY(0);
    transition: 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Only hide if JS is working and ready */
html.js-ready [data-reveal] {
    opacity: 0;
    transform: translateY(30px);
}

[data-reveal].revealed,
html.js-ready [data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

.animate-up {
    animation: fadeInUp 0.8s ease forwards;
}

/* Solution Grid */
.solution-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.card {
    background: var(--color-white);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: var(--transition-smooth);
    border-bottom: 4px solid transparent;
}

body.dark-mode .card {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.card:hover {
    transform: translateY(-10px);
    border-bottom: 4px solid var(--color-accent);
}

.card h3 {
    margin: 1.5rem 0 1rem;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
}

.card p {
    font-size: clamp(0.95rem, 1.5vw, 1.05rem);
    line-height: 1.6;
}

.card i {
    font-size: 2.5rem;
    color: var(--color-accent);
}

/* Contractors & Clients Styles */
.split-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 0;
}

.split-content {
    padding: 6rem 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* Center content horizontally */
    text-align: center;
    /* Center text */
}

.bg-sand {
    background-color: var(--color-support);
    color: var(--color-primary);
}

body.dark-mode .bg-sand {
    color: #1a1a1a;
}

body.dark-mode .bg-sand h2 {
    color: #1a1a1a;
}

.bg-cream {
    background-color: var(--color-bg);
}

.feature-list {
    margin: 2rem auto;
    max-width: 400px;
    text-align: left;
    width: 100%;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Media Queries */
@media (max-width: 1024px) {
    .container {
        padding: 0 3rem;
    }

    .hero-content h1 {
        font-size: 4rem;
    }
}

@media (max-width: 768px) {

    /* Prevent horizontal overflow */
    html,
    body {
        overflow-x: hidden;
        max-width: 100vw;
        position: relative;
    }

    .container {
        padding: 0 1.25rem;
        max-width: 100%;
    }

    section {
        padding: clamp(3rem, 8vw, 5rem) 0;
        overflow: hidden;
    }

    /* Mobile header - logo left, menu right */
    header {
        height: 70px;
    }

    header .nav-container {
        padding: 0 1.25rem;
    }

    .logo {
        flex: 0 0 auto;
        z-index: 1101;
        position: relative;
    }

    .logo img {
        height: 32px;
    }

    .menu-toggle {
        display: flex;
        flex: 0 0 auto;
        margin-left: auto;
        z-index: 1101;
        position: relative;
        margin-right: 0.5rem;
        /* Add spacing from edge */
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 85%;
        height: 100vh;
        background-color: var(--color-bg);
        flex-direction: column;
        justify-content: center;
        padding: 4rem 2rem;
        box-shadow: -20px 0 60px rgba(0, 0, 0, 0.2);
        transition: 0.5s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 1050;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
        margin-bottom: 1.5rem;
    }

    .nav-links li a {
        font-size: 1.1rem;
        font-weight: 600;
    }

    /* Hero Section - Responsive with clamp() */
    .hero {
        text-align: center;
        min-height: auto;
        padding-top: 110px;
        /* Increased from 90px */
        padding-bottom: 2rem;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-content h1 {
        font-size: clamp(1.75rem, 5.5vw, 2.5rem);
        line-height: 1.2;
        margin-bottom: 1rem;
    }

    .hero-content p {
        margin-left: auto;
        margin-right: auto;
        font-size: clamp(0.95rem, 2.5vw, 1.1rem);
        line-height: 1.5;
        margin-bottom: 2rem;
    }

    .hero-content>span {
        /* Changed selector to direct child */
        font-size: clamp(0.7rem, 2vw, 0.85rem) !important;
        letter-spacing: 2px !important;
        display: block;
        margin-bottom: 0.5rem;
    }

    .cta-group {
        justify-content: center;
        flex-direction: column;
        gap: 0.85rem;
        align-items: center;
    }

    .btn {
        padding: 0.85rem 1.75rem;
        font-size: clamp(0.9rem, 2.2vw, 1rem);
        width: 100%;
        max-width: 300px;
        text-align: center;
    }

    /* Hero image - Full width, properly contained */
    .hero-image {
        width: 100vw;
        max-width: 100vw;
        padding: 0;
        margin-left: calc(-50vw + 50%);
        position: relative;
        margin-top: 2rem;
        /* Added margin to push cards down */
    }

    .hero-image>div {
        box-shadow: none !important;
        margin: 0;
        width: 100% !important;
        border-radius: 0 !important;
    }

    .hero-image>div>div {
        font-size: clamp(2rem, 6vw, 3rem) !important;
    }

    .hero-image>div>div>div {
        font-size: clamp(1.1rem, 3vw, 1.5rem) !important;
    }



    .split-content {
        align-items: flex-start;
        /* Left align on mobile too per request */
        text-align: left;
        padding: 4rem 2rem;
    }

    .split-content .btn {
        width: 100%;
        /* Full width button */
        max-width: 100%;
        margin-top: 1rem;
        align-self: center;
        /* Center the button itself */
    }

    /* Problem Section */
    section#problema h2 {
        font-size: clamp(1.75rem, 5vw, 2.5rem) !important;
        line-height: 1.2;
        margin-bottom: 1.5rem !important;
    }

    section#problema p {
        font-size: clamp(1rem, 2.5vw, 1.2rem) !important;
        line-height: 1.5;
    }

    /* Solution Section */
    section#solucion h2 {
        font-size: clamp(1.75rem, 5vw, 2.25rem) !important;
    }

    section#solucion>.container>div>p {
        font-size: clamp(0.95rem, 2vw, 1.05rem) !important;
    }

    /* Cards - Properly sized */
    .solution-grid {
        gap: 1.25rem;
        margin-top: 2rem;
        grid-template-columns: 1fr;
    }

    .card {
        padding: 1.75rem 1.5rem;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    }

    .card>div {
        font-size: clamp(2rem, 5vw, 2.5rem) !important;
    }

    .card h3 {
        font-size: clamp(1.1rem, 3vw, 1.3rem) !important;
        margin: 1rem 0 0.75rem;
    }

    .card p {
        font-size: clamp(0.9rem, 2vw, 1rem) !important;
        line-height: 1.5;
    }

    /* Services Section */
    section>.container>div[style*="grid"] {
        gap: 1rem !important;
    }

    section>.container>div>div[style*="padding"] {
        padding: 1.5rem 1rem !important;
    }

    section>.container>div>div h4 {
        font-size: clamp(0.95rem, 2.5vw, 1.1rem) !important;
    }

    section>.container>div>div p {
        font-size: clamp(0.8rem, 2vw, 0.9rem) !important;
    }

    section>.container>div>div>div {
        font-size: clamp(1.75rem, 5vw, 2.25rem) !important;
    }

    /* Dual Flow - Profesionales & Clientes */
    .split-section {
        grid-template-columns: 1fr;
    }

    .split-content {
        padding: clamp(3rem, 8vw, 4.5rem) 1.5rem !important;
    }

    .split-content h2 {
        font-size: clamp(2rem, 6vw, 3rem) !important;
        line-height: 1.1;
        margin-bottom: 1rem;
    }

    .split-content p {
        font-size: clamp(0.95rem, 2.5vw, 1.1rem) !important;
        line-height: 1.5;
        margin-bottom: 1.5rem;
    }

    .feature-item {
        font-size: clamp(0.9rem, 2vw, 1rem);
        gap: 0.75rem;
    }

    .split-content .btn {
        padding: 0.85rem 1.75rem !important;
        font-size: clamp(0.9rem, 2.2vw, 1rem) !important;
        max-width: 280px;
    }

    /* Final CTA Section */
    section#unirse {
        padding: clamp(4rem, 10vw, 7rem) 0 !important;
    }

    section#unirse h2 {
        font-size: clamp(2rem, 6vw, 3rem) !important;
        line-height: 1.2;
        margin-bottom: 1.5rem !important;
    }

    section#unirse p {
        font-size: clamp(1rem, 2.5vw, 1.15rem) !important;
        margin-bottom: 2.5rem !important;
        padding: 0 0.5rem;
    }

    section#unirse .btn {
        padding: 1rem 2rem !important;
        font-size: clamp(0.95rem, 2.5vw, 1.1rem) !important;
        max-width: 320px;
        width: 100%;
    }

    /* Dark Mode Toggle */
    .dark-mode-toggle {
        bottom: 1rem;
        right: 1rem;
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

/* Modal Styles */
.modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal-content {
    background-color: var(--color-white);
    margin: auto;
    padding: 2.5rem;
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal {
    color: #aaa;
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition-smooth);
}

.close-modal:hover,
.close-modal:focus {
    color: var(--color-primary);
    text-decoration: none;
}

.modal-header {
    text-align: center;
    margin-bottom: 2rem;
}

.modal-header h2 {
    color: var(--color-primary);
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--color-primary);
    font-size: 0.95rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition-smooth);
    background-color: #f9f9f9;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-accent);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(231, 111, 81, 0.1);
}

.btn-block {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    margin-top: 1rem;
}

/* Dark Mode Modal Overrides */
body.dark-mode .modal-content {
    background-color: #1a1a1a;
    color: #f1faee;
}

body.dark-mode .modal-header h2 {
    color: #f1faee;
}

body.dark-mode .form-group label {
    color: #a8dadc;
}

body.dark-mode .form-group input,
body.dark-mode .form-group select {
    background-color: #333;
    border-color: #444;
    color: white;
}

body.dark-mode .form-group input:focus,
body.dark-mode .form-group select:focus {
    border-color: var(--color-accent);
    background-color: #444;
}

body.dark-mode .close-modal {
    color: #fff;
}

/* Footer Section */
footer {
    background-color: var(--color-primary);
    color: var(--color-white);
    padding: 3rem 0;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.footer-logo img {
    height: 40px;
}

.footer-info {
    font-size: 0.9rem;
    opacity: 0.8;
}

.copyright {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
}

body.dark-mode footer {
    background-color: #111;
}
