:root {
    --web-bg: #F9F9F9;
    --web-primary: #C9A050; /* Sand Gold */
    --web-dark: #1A1A1A; /* Deep Charcoal */
    --web-text: #4A4A4A;
    --web-card: #FFFFFF;
}

body.web-mode {
    background-color: var(--web-bg);
    color: var(--web-dark);
    position: relative;
    transition: 0.5s;
}

body.web-mode::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(circle at 10% 10%, rgba(201, 160, 80, 0.05) 0%, transparent 40%),
                radial-gradient(circle at 90% 90%, rgba(26, 26, 26, 0.03) 0%, transparent 40%);
    z-index: -1;
}

.web-navbar {
    padding: 30px 0;
    transition: var(--transition);
}

/* Webb Mode Nav Overrides */
.hud-nav a { color: var(--web-dark); opacity: 0.7; }
.hud-nav a:hover { color: var(--web-primary); opacity: 1; }
.hud-nav .status-tag { color: var(--web-dark); border-color: rgba(0,0,0,0.1); background: rgba(0,0,0,0.03); }

.web-btn-primary {
    background: var(--web-primary);
    color: white;
    padding: 18px 35px;
    border-radius: 12px;
    font-weight: 700;
    display: inline-block;
    transition: var(--transition);
}

.web-btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(211, 110, 70, 0.3);
}

.web-btn-secondary {
    background: #EAE3D2;
    color: var(--web-dark);
    padding: 18px 35px;
    border-radius: 12px;
    font-weight: 700;
    display: inline-block;
    margin-left: 15px;
    transition: var(--transition);
}

.web-btn-secondary:hover {
    background: #dfd4b8;
}

.web-hero h1 {
    font-size: 5rem;
    line-height: 1;
    font-weight: 900;
    margin-bottom: 20px;
    letter-spacing: -3px;
    color: var(--web-dark);
}

/* Modern Section Headers */
.web-section-header {
    text-align: center;
    margin-bottom: 80px;
}

.web-section-header span {
    color: var(--web-primary);
    font-weight: 800;
    letter-spacing: 3px;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.web-section-header h2 {
    font-size: 3.5rem;
    font-weight: 900;
    letter-spacing: -2px;
    margin-top: 10px;
}

/* Refined Cards */
.web-card {
    background: var(--web-card);
    border-radius: 24px;
    padding: 50px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02), 0 10px 15px rgba(0,0,0,0.03);
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.web-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 30px 60px rgba(211, 110, 70, 0.15);
    border-color: var(--web-primary);
}

.web-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 4px; height: 100%;
    background: var(--web-primary);
    transform: scaleY(0);
    transition: 0.5s;
}

.web-card:hover::before {
    transform: scaleY(1);
}

/* Image Grids */
.web-project-img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    border-radius: 20px;
    transition: 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

.web-card:hover .web-project-img {
    transform: scale(1.05);
}

.tag {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 50px;
    background: rgba(211, 110, 70, 0.1);
    color: var(--web-primary);
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 15px;
}

/* Split layout (image 1) */
.split-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.dark-feature-card {
    background: var(--web-dark);
    color: white;
    padding: 60px;
    border-radius: 30px;
}

.dark-feature-card h2 {
    font-size: 2.8rem;
    margin-bottom: 25px;
}

.mini-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 40px;
}

.mini-card {
    background: rgba(255,255,255,0.05);
    padding: 20px;
    border-radius: 15px;
}

.mini-card h4 { font-size: 1.1rem; margin-bottom: 5px; }
.mini-card p { font-size: 0.85rem; opacity: 0.7; }

/* Contact Block */
.web-contact-block {
    background: #FFFFFF;
    border-radius: 30px;
    padding: 60px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 40px;
}

.web-footer {
    padding: 40px 0;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.5;
}

/* ============================================================
   WEB MODE — RESPONSIVE MOBILE
   Cubre todos los grids y tipografías definidos con inline styles
   en web.php que no responden al resize normal.
   ============================================================ */

/* --- Tablet (≤ 1024px) --- */
@media (max-width: 1024px) {
    .web-hero .container {
        grid-template-columns: 1fr !important;
        gap: 50px !important;
    }
    .web-hero h1 {
        font-size: 5rem !important;
        letter-spacing: -2px !important;
    }
}

/* --- Mobile landscape / tablet pequeño (≤ 900px) --- */
@media (max-width: 900px) {
    /* Padding top para que el contenido no quede detrás del mobile nav */
    .web-hero {
        padding-top: 90px !important;
        padding-bottom: 60px !important;
        min-height: auto !important;
    }

    /* Hero — grid 2 col → 1 col */
    .web-hero .container {
        grid-template-columns: 1fr !important;
        gap: 40px !important;
    }

    .web-hero h1 {
        font-size: 4rem !important;
        letter-spacing: -2px !important;
        line-height: 0.95 !important;
        margin-bottom: 25px !important;
    }

    /* Ocultar device mockup en tablet */
    .hero-devices-wrapper { display: none !important; }

    /* Section paddings — demasiado altas para móvil */
    section[id] {
        padding-top: 80px !important;
        padding-bottom: 80px !important;
    }

    /* "¿Qué hacemos?" — grid 2 col → 1 col */
    #hacemos .container > div[data-aos] {
        grid-template-columns: 1fr !important;
        gap: 40px !important;
    }
    #hacemos h2 {
        font-size: 3rem !important;
        letter-spacing: -1.5px !important;
        line-height: 1 !important;
        margin-bottom: 25px !important;
    }
    #hacemos p { font-size: 1.1rem !important; }

    /* "Proyectos" */
    #proyectos h2 {
        font-size: 3rem !important;
        letter-spacing: -1.5px !important;
    }

    /* "Especialidad/Pilares" — 3 col → 1 col */
    #especialidad h2 {
        font-size: 3rem !important;
        letter-spacing: -1.5px !important;
    }
    #especialidad .container > div:nth-child(2) {
        grid-template-columns: 1fr !important;
        gap: 40px !important;
    }

    /* "Proceso de trabajo" — 4 col → 2 col */
    #valor h2 {
        font-size: 2.5rem !important;
        letter-spacing: -1.5px !important;
        margin-bottom: 50px !important;
    }
    #valor .container > div:first-of-type {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }

    /* "Contacto" */
    #contacto h2 {
        font-size: 3rem !important;
        letter-spacing: -2px !important;
        margin: 20px 0 !important;
    }
    #contacto .container > div:first-child > h2,
    #contacto .container > div:first-child > [style*="font-size: 5.5rem"] {
        font-size: 3rem !important;
    }

    /* "Responsive" showcase section */
    #responsive h2 {
        font-size: 3rem !important;
        letter-spacing: -1.5px !important;
    }

    /* Footer — grid 3 col → 1 col */
    footer .container > div:first-child {
        grid-template-columns: 1fr !important;
        gap: 40px !important;
    }
    footer .container > div:last-child {
        flex-direction: column !important;
        gap: 8px !important;
        text-align: center !important;
    }
}

/* --- Mobile portrait (≤ 768px) --- */
@media (max-width: 768px) {
    .web-hero {
        padding-top: 75px !important;
        padding-bottom: 50px !important;
    }
    .web-hero h1 {
        font-size: 3rem !important;
        letter-spacing: -1.5px !important;
    }

    /* Botones hero — flex column */
    .web-hero [style*="display: flex; gap: 15px"] {
        flex-direction: column !important;
        gap: 12px !important;
    }
    .web-hero .cyber-cta,
    .web-hero a[style*="padding: 20px 50px"] {
        text-align: center !important;
        padding: 16px 30px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Proceso → 2 cols en móvil pequeño */
    #valor .container > div:first-of-type {
        grid-template-columns: 1fr 1fr !important;
    }
    #valor .container > div:first-of-type > div {
        padding: 30px 20px !important;
    }

    /* Case studies → 1 col */
    .case-studies-grid { grid-template-columns: 1fr !important; }

    /* Showcase devices */
    .devices-showcase-row { gap: 25px !important; }
    .mon-screen { width: 200px !important; height: 132px !important; }

    /* Stats strip */
    .case-stats-strip {
        flex-direction: column !important;
        gap: 20px !important;
        padding: 30px !important;
    }
    .case-stat-divider { width: 50px !important; height: 1px !important; }

    /* "Especialidad" heading margin */
    #especialidad .container > div:first-child {
        margin-bottom: 50px !important;
    }
}

/* --- Móvil muy pequeño (≤ 480px) --- */
@media (max-width: 480px) {
    .web-hero h1 {
        font-size: 2.5rem !important;
        letter-spacing: -1px !important;
    }

    #hacemos h2,
    #especialidad h2,
    #proyectos h2,
    #contacto h2,
    #valor h2 {
        font-size: 2.3rem !important;
        letter-spacing: -1px !important;
    }

    /* Proceso → 1 col en pantallas muy chicas */
    #valor .container > div:first-of-type {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    /* Ocultar el primer device (monitor) en showcase */
    .devices-showcase-row > .showcase-device:first-child { display: none !important; }

    /* Features pills — scroll horizontal en lugar de wrap */
    section[id="responsive"] [style*="flex-wrap: wrap"] {
        gap: 10px !important;
    }
    .feature-pill { font-size: 0.75rem !important; padding: 10px 15px !important; }

    /* Contact section heading */
    #contacto [style*="font-size: 5.5rem"] {
        font-size: 2.3rem !important;
        letter-spacing: -1px !important;
    }
    #contacto [style*="font-size: 1.35rem"] {
        font-size: 1rem !important;
    }

    /* Footer padding */
    footer { padding: 60px 0 30px !important; }
    footer h3 { font-size: 1.5rem !important; }
}
