:root {
    --primary: #ff4d00;
    /* Electric Industrial Orange */
    --font-head: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);

    /* Default (Light) Theme */
    --bg-rgb: 255, 255, 255;
    --bg: rgb(var(--bg-rgb));
    --text-rgb: 0, 0, 0;
    --text: rgb(var(--text-rgb));
    --text-soft: #666666;
    --border: #000000;
    --card-bg: #000000;
    --card-text: #ffffff;
    --card-border: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] {
    --bg-rgb: 10, 10, 10;
    --bg: rgb(var(--bg-rgb));
    --text-rgb: 255, 255, 255;
    --text: rgb(var(--text-rgb));
    --text-soft: #a0a0a0;
    --border: #ffffff;
    --card-bg: #1a1a1a;
    --card-text: #ffffff;
    --card-border: rgba(255, 255, 255, 0.1);
}

body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-head);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- THE INDUSTRIAL CANVAS --- */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* --- NAVIGATION --- */
/* --- NAVIGATION --- */
.main-header {
    padding: 30px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 100;
}

.logo {
    font-weight: 900;
    font-size: 1.5rem;
    letter-spacing: -1px;
    line-height: 1.5;
}

.logo span {
    padding: 2px 8px;
    background: var(--text);
    color: var(--bg);
    display: inline-block;
}

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

nav a,
.theme-toggle {
    text-decoration: none;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    transition: var(--transition);
    background: none;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
}

nav a:hover,
.theme-toggle:hover {
    background: var(--primary);
    color: #fff;
}

/* --- HERO SECTION (CORRECTED ANGLE 03) --- */
.hero {
    min-height: calc(100vh - 60px);
    /* Angle 02 logic to hide Services */
    padding: 100px 5% 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* More prominent Blueprint Grid */
.hero::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 45%;
    /* Fills the right side */
    height: 100%;
    background-image:
        linear-gradient(rgba(var(--text-rgb), 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--text-rgb), 0.07) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -1;
    mask-image: radial-gradient(circle at center, black, transparent 80%);
    pointer-events: none;
}

.section-tag {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    display: block;
}

.hero h1 {
    font-size: clamp(2.5rem, 7vw, 5.5rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    margin-bottom: 3.5rem;
}



.hero h1 span {
    display: block;
    font-weight: 300;
    /* Light weight to contrast with the bold start */
    opacity: 0.8;
}

.hero-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: flex-end;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.hero-desc {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-soft);
    max-width: 480px;
}

.hero-stats {
    display: flex;
    justify-content: flex-end;
    gap: 4rem;
}

.stat-item h4 {
    font-family: var(--font-mono);
    font-size: 3rem;
    font-weight: 800;
}

.stat-item p {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-soft);
}

/* --- SERVICES (BLUEPRINT SCHEMATIC) --- */
.section-services {
    background: var(--bg);
    padding: 80px 5%;
    border-top: 1px solid rgba(var(--text-rgb), 0.1);
}

.section-services h2 {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 15px;
    line-height: 1;
    color: var(--text);
}

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

.s-item {
    padding: 40px;
    border: 1px solid rgba(var(--text-rgb), 0.1);
    position: relative;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    /* Indicar que es cliqueable */
}

.s-item:hover {
    background: rgba(var(--primary-rgb), 0.03);
    border-color: var(--primary);
}

.s-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 25px;
    z-index: 1;
}

.s-icon {
    color: var(--primary);
    flex-shrink: 0;
    transition: var(--transition);
}

.s-icon i,
.s-icon svg {
    width: 50px !important;
    height: 50px !important;
    stroke-width: 1px !important;
}

.s-title-group {
    display: flex;
    flex-direction: column;
}

.s-title-group span {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    opacity: 0.4;
    display: block;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.s-item h3 {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text);
    text-transform: uppercase;
}

.s-item p {
    color: var(--text-soft);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
    max-width: 280px;
    z-index: 1;
}

.s-link {
    margin-top: auto;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 800;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
    display: inline-block;
    width: fit-content;
}

.s-link:hover {
    border-bottom-color: var(--primary);
    transform: translateX(5px);
}

/* --- PROCESS SECTION --- */
.section-process {
    background: rgba(var(--text-rgb), 0.03);
    padding: 80px 5%;
    border-top: 1px solid rgba(var(--text-rgb), 0.1);
    position: relative;
}

.process-section {
    margin-top: 0;
}

.process-section h2 {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 12px;
    line-height: 1;
    color: var(--text);
}

.section-subtitle,
.process-subtitle {
    color: var(--text-soft);
    font-size: 1.1rem;
    margin-bottom: 50px;
    font-family: var(--font-mono);
    max-width: 600px;
}

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

.process-item {
    padding: 40px;
    border: 1px solid rgba(var(--text-rgb), 0.1);
    position: relative;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.process-item:hover {
    background: rgba(var(--primary-rgb), 0.03);
    border-color: var(--primary);
}

.process-number {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    opacity: 0.4;
    display: block;
    margin-bottom: 5px;
    text-transform: uppercase;
    font-weight: 700;
}

.process-item h3 {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text);
    text-transform: uppercase;
}

.process-item p {
    color: var(--text-soft);
    font-size: 0.85rem;
    line-height: 1.6;
    max-width: 280px;
}

.cta-footer {
    margin-top: 40px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.cta-footer a {
    font-size: 3.2rem;
    text-decoration: none;
    color: var(--primary);
    font-weight: 900;
    line-height: 1;
    transition: var(--transition);
}

.cta-footer a:hover {
    color: var(--text);
    transform: translateX(10px);
}

.cta-footer p {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    max-width: 350px;
    color: var(--text-soft);
    line-height: 1.5;
    opacity: 0.7;
}

/* --- MARQUEE --- */
.marquee {
    background: var(--primary);
    color: #fff;
    padding: 15px 0;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 1.5rem;
    overflow: hidden;
    white-space: nowrap;
    border-top: 2px solid #000;
    border-bottom: 2px solid #000;
    height: 60px;
    display: flex;
    align-items: center;
}

.marquee-alt {
    background: var(--text) !important;
    color: var(--bg) !important;
    border-color: var(--primary);
}

.marquee-alt .marquee-content {
    animation-direction: reverse;
}

.marquee-content {
    display: inline-block;
    animation: scroll 20s linear infinite;
}

@keyframes scroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

/* --- WHATSAPP BUTTON --- */
.wa-float {
    position: fixed;
    bottom: 40px;
    right: 40px;
    background: #25d366;
    color: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    text-decoration: none;
    transition: var(--transition);
}

.wa-float:hover {
    transform: scale(1.1) rotate(10deg);
}

/* --- RESPONSIVE FIXES (COMPREHENSIVE) --- */
@media (max-width: 1100px) {
    .hero h1 {
        font-size: clamp(2.8rem, 8vw, 6rem);
    }
}

@media (max-width: 900px) {
    .main-header {
        position: relative;
        /* Fixed to relative to prevent overlap in mobile */
        padding: 40px 5% 20px;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 25px;
    }

    nav {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    nav a,
    .theme-toggle {
        font-size: 0.85rem;
        padding: 5px 0;
        margin: 0;
        width: 100%;
        text-align: left;
    }

    .hero {
        padding-top: 140px;
        padding-bottom: 30px;
        min-height: auto;
    }

    .hero-tag {
        margin-top: 10px;
        font-size: 0.75rem;
        margin-bottom: 1rem;
    }

    .hero h1 {
        font-size: 2.5rem;
        font-weight: 900;
        line-height: 1.1;
        margin-top: 0;
        margin-bottom: 25px;
        letter-spacing: -1.5px;
    }

    .hero-footer {
        grid-template-columns: 1fr;
        gap: 25px;
        padding-top: 20px;
        border-top: 1px solid var(--border);
    }

    .hero-desc {
        font-size: 1rem;
        line-height: 1.6;
    }

    .hero-stats {
        justify-content: space-between;
        gap: 15px;
        flex-wrap: wrap;
        border-top: 1px solid var(--border);
        padding-top: 20px;
    }

    .stat-item h4 {
        font-size: 2rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .s-item {
        padding: 30px 20px;
    }

    .s-item h3 {
        font-size: 1.1rem;
    }

    .s-item p {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .section-services h2 {
        font-size: 2rem;
        margin-bottom: 30px;
    }

    .section-services {
        padding: 40px 5%;
    }

    .process-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .section-process {
        padding: 40px 5%;
    }

    .process-section {
        margin-top: 0;
        padding-top: 0;
    }

    .process-section h2 {
        font-size: 2rem;
        margin-bottom: 12px;
    }

    .process-subtitle {
        font-size: 0.95rem;
        margin-bottom: 40px;
    }

    .process-item {
        padding: 25px 20px;
    }

    .process-number {
        font-size: 2.5rem;
        margin-bottom: 15px;
    }

    .process-item h3 {
        font-size: 1.1rem;
    }

    .process-item p {
        font-size: 0.9rem;
    }

    .cta-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 30px;
        margin-top: 30px;
    }

    .cta-footer a {
        font-size: 1.8rem;
        line-height: 1.2;
    }

    .marquee {
        font-size: 1.2rem;
    }

    footer {
        flex-direction: column;
        gap: 15px;
        text-align: left;
        padding: 30px 5% !important;
        font-size: 0.9rem;
    }

    footer div:last-child {
        font-size: 0.75rem;
    }
}

/* --- MODAL SYSTEM --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease forwards;
}

.modal-content {
    background: var(--bg);
    border: 1px solid rgba(var(--text-rgb), 0.1);
    max-width: 600px;
    width: 100%;
    position: relative;
    padding: 60px;
    transform: translateY(20px);
    opacity: 0;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.1);
}

.modal-overlay.active .modal-content {
    animation: modalSlide 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.modal-close {
    position: absolute;
    top: 25px;
    right: 25px;
    background: none;
    border: none;
    font-size: 2.5rem;
    cursor: pointer;
    color: var(--text);
    opacity: 0.5;
    transition: var(--transition);
}

.modal-close:hover {
    opacity: 1;
    transform: rotate(90deg);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-bottom: 40px;
}

.modal-icon svg {
    width: 60px;
    height: 60px;
    color: var(--primary);
}

.modal-number {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--primary);
    display: block;
    margin-bottom: 8px;
}

.modal-title {
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1;
}

.modal-description {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-soft);
    margin-bottom: 40px;
}

.modal-cta .btn-primary {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 15px 35px;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: 1px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.modal-cta .btn-primary:hover {
    background: #000;
    transform: translateY(-2px);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalSlide {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* --- CALCULATOR SECTION --- */
.section-calculator {
    padding: 100px 5%;
    background: var(--bg);
    color: var(--text);
    border-top: 1px solid rgba(var(--text-rgb), 0.1);
}

.calc-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.calc-inputs {
    display: flex;
    flex-direction: column;
    gap: 35px;
}

.input-group label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    margin-bottom: 15px;
    color: var(--primary);
    text-transform: uppercase;
}

.input-range {
    width: 100%;
    height: 4px;
    background: rgba(var(--text-rgb), 0.1);
    appearance: none;
    outline: none;
}

.input-range::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary);
    cursor: pointer;
    border-radius: 0;
}

.range-val {
    display: block;
    font-size: 2rem;
    font-weight: 900;
    margin-top: 10px;
}

.calc-results {
    background: rgba(var(--primary-rgb), 0.05);
    border: 1px solid var(--primary);
    padding: 60px;
    position: relative;
    overflow: hidden;
}

.calc-results::before {
    content: 'ESTIMACIÓN IA';
    position: absolute;
    top: 20px;
    right: 20px;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text);
    opacity: 0.5;
}

.result-item {
    margin-bottom: 30px;
}

.result-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    opacity: 0.6;
    display: block;
    margin-bottom: 5px;
}

.result-value {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary);
}

.result-value small {
    font-size: 1rem;
    opacity: 0.7;
}

/* --- POC SECTION --- */
.section-poc {
    padding: 100px 5%;
    text-align: center;
    background: var(--bg);
}

.poc-box {
    border: 1px solid rgba(var(--text-rgb), 0.1);
    padding: 80px 40px;
    max-width: 900px;
    margin: 0 auto;
    background: rgba(var(--text-rgb), 0.02);
}

.poc-box h2 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.poc-box p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    color: var(--text-soft);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.btn-poc {
    display: inline-block;
    background: var(--text);
    color: var(--bg);
    padding: 20px 50px;
    font-weight: 900;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid var(--text);
}

.btn-poc:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-5px);
}

@media (max-width: 768px) {
    .calc-container {
        grid-template-columns: 1fr;
        gap: 50px;
    }

    .calc-results {
        padding: 40px 30px;
    }

    .poc-box h2 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 40px 25px;
    }

    .modal-title {
        font-size: 1.8rem;
    }

    .modal-description {
        font-size: 1rem;
    }


    /* Compact Navigation for Mobile */
    .main-header {
        padding: 15px 5%;
        flex-direction: column;
        gap: 15px;
        position: absolute;
    }

    nav {
        gap: 5px;
        flex-wrap: wrap;
        justify-content: center;
    }

    nav a,
    .theme-toggle {
        font-size: 0.65rem;
        padding: 4px 8px;
    }

    .hero {
        min-height: 100dvh;
        padding: 120px 5% 40px;
        /* Further reduced padding */
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        /* Better distribution */
    }

    .hero::after {
        width: 100%;
        mask-image: radial-gradient(circle at top, black, transparent 70%);
        background-size: 20px 20px;
        opacity: 0.4;
    }

    .hero h1 {
        font-size: 2rem;
        /* Scaled down for mobile */
        letter-spacing: -1px;
        margin-bottom: 1rem;
        line-height: 1.1;
    }

    .hero-footer {
        display: flex;
        flex-direction: column;
        gap: 0.8rem;
        /* Tighter gap */
        border-top: 1px solid rgba(var(--text-rgb), 0.1);
        padding-top: 1rem;
        margin-top: 1rem;
    }

    .hero-desc {
        font-size: 0.85rem;
        line-height: 1.6;
        width: 100%;
        max-width: 100%;
    }

    .hero-stats {
        display: flex;
        justify-content: space-between;
        gap: 10px;
    }

    .stat-item h4 {
        font-size: 1.4rem;
    }

    .stat-item p {
        font-size: 0.65rem;
    }

    .section-services h2 {
        font-size: 1.8rem;
        margin-bottom: 25px;
    }

    .section-process {
        padding: 30px 5%;
    }

    .s-item {
        padding: 30px 20px;
        border: 1px solid rgba(var(--text-rgb), 0.15);
        /* Slightly darker border */
        background: rgba(var(--text-rgb), 0.01);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
        /* Added for mobile definition */
        margin-bottom: 15px;
        /* Spacing if grid gap isn't enough */
    }

    .s-item h3 {
        font-size: 1.1rem;
    }

    .s-item p {
        font-size: 0.85rem;
        max-width: 100%;
        /* Better for mobile */
    }

    .process-section h2 {
        font-size: 1.8rem;
    }

    .process-subtitle {
        font-size: 0.85rem;
        margin-bottom: 30px;
    }

    .process-item {
        padding: 25px 20px;
        border: 1px solid rgba(var(--text-rgb), 0.15);
        /* More visible frame */
        background: rgba(var(--text-rgb), 0.01);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
        /* Added for mobile definition */
        margin-bottom: 10px;
    }

    .process-number {
        font-size: 2rem;
        opacity: 0.6;
        /* More visible on mobile */
    }

    .process-item h3 {
        font-size: 1.1rem;
    }

    .process-item p {
        font-size: 0.85rem;
        max-width: 100%;
    }

    .cta-footer a {
        font-size: 1.5rem;
    }

    .marquee {
        font-size: 1rem;
        padding: 6px 0;
    }

    .wa-float {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }

    footer {
        padding: 25px 5% !important;
        font-size: 0.85rem;
    }

    footer div:last-child {
        font-size: 0.7rem;
    }
}