
/* ==========================================
   MD CREATIVE - PORTAFOLIO PROFESIONAL
   DISEÑO RESPONSIVE TIPO APP
========================================== */

/* 1. VARIABLES GENERALES */

:root {
    --bg: #080d18;
    --bg-secondary: #101a2c;
    --card: #162338;
    --card-hover: #1b2b43;

    --primary: #38bdf8;
    --primary-hover: #7dd3fc;

    --text: #f8fafc;
    --muted: #94a3b8;
    --border: #293b54;

    --radius: 16px;
    --header-height: 78px;
    --shadow: 0 15px 45px rgba(0, 0, 0, .25);
}

/* 2. CONFIGURACION GENERAL */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
    overflow-x: clip;
}

body {
    width: 100%;
    min-height: 100vh;

    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.7;

    background: var(--bg);
    color: var(--text);

    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

a {
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

button {
    font: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

button,
a,
input,
select,
textarea {
    touch-action: manipulation;
}

input,
select,
textarea {
    font-size: 16px;
}

img,
video,
svg {
    max-width: 100%;
}

img,
video {
    height: auto;
}

.container {
    width: min(1200px, calc(100% - 40px));
    margin-inline: auto;
}

.hero-grid > *,
.cards > *,
.project-grid > * {
    min-width: 0;
}

h1, h2, h3, p {
    overflow-wrap: break-word;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
}

/* ==========================================
   3. HEADER Y NAVEGACION
========================================== */

.header {
    position: sticky;
    top: 0;
    z-index: 100;

    width: 100%;

    background: rgba(8, 13, 24, .94);
    border-bottom: 1px solid var(--border);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.navbar {
    min-height: var(--header-height);

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
}

.logo {
    display: inline-flex;
    align-items: center;

    font-size: 25px;
    font-weight: 800;
    letter-spacing: -.7px;
    white-space: nowrap;
}

.logo span {
    color: var(--primary);
    margin-right: 6px;
}

/* ENLACES ESCRITORIO */

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-links a {
    position: relative;

    padding: 8px 0;

    font-size: 14px;
    font-weight: 500;
    color: var(--muted);

    transition: color .25s ease;
}

.nav-links a::after {
    content: "";

    position: absolute;
    left: 0;
    bottom: 2px;

    width: 0;
    height: 2px;

    background: var(--primary);
    border-radius: 5px;

    transition: width .25s ease;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a:hover::after {
    width: 100%;
}

/* ==========================================
   4. BOTON DE ACCESO ADMINISTRATIVO
========================================== */

.nav-links a.admin-access {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 42px;
    padding: 9px 15px;

    border: 1px solid var(--primary);
    border-radius: 12px;

    background: rgba(56, 189, 248, .12);
    color: var(--primary);

    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;

    transition:
        background .25s ease,
        color .25s ease;
}

.nav-links a.admin-access::after {
    display: none;
}

.nav-links a.admin-access:hover,
.nav-links a.admin-access:focus-visible {
    background: var(--primary);
    color: #07111f;
}

/* OCULTAR COMPONENTES MOVILES */

.menu-toggle,
.mobile-panel,
.menu-backdrop,
.app-tabbar {
    display: none;
}

/* ==========================================
   5. SECCION PRINCIPAL HERO
========================================== */

.hero {
    position: relative;

    padding: 115px 0;

    background:
        radial-gradient(
            circle at 80% 30%,
            rgba(22, 80, 140, .35),
            transparent 45%
        ),
        var(--bg);
}

.hero-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1.35fr)
        minmax(0, 1fr);

    align-items: center;
    gap: 65px;
}

.eyebrow {
    display: inline-block;

    margin-bottom: 15px;

    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;

    color: var(--primary);
}

.hero h1 {
    margin-bottom: 25px;

    font-size: clamp(34px, 5vw, 58px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -1.2px;
}

.hero h1 span {
    display: block;
    color: var(--primary);
    overflow-wrap: anywhere;
}

.hero p {
    max-width: 680px;
    color: var(--muted);
    font-size: 16px;
}

/* BOTONES GENERALES */

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;

    margin-top: 35px;
}

.btn-primary,
.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 48px;
    padding: 12px 28px;

    border-radius: 12px;

    font-size: 14px;
    font-weight: 700;

    transition:
        background .25s ease,
        color .25s ease,
        transform .25s ease;
}

.btn-primary {
    background: var(--primary);
    color: #07111f;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-outline {
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: #07111f;
    transform: translateY(-2px);
}

/* ==========================================
   6. TARJETA DE PERFIL
========================================== */

.profile-card {
    width: 100%;
    padding: 45px 30px;

    text-align: center;

    background:
        linear-gradient(
            145deg,
            #192a43,
            #101a2b
        );

    border: 1px solid var(--border);
    border-radius: 24px;

    box-shadow: var(--shadow);

    transition:
        transform .3s ease,
        border-color .3s ease;
}

.profile-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.avatar {
    width: 140px;
    height: 140px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin: 0 auto 25px;

    border-radius: 50%;
    border: 3px solid var(--primary);

    background: #0b1727;
    color: var(--primary);

    font-size: 45px;
    font-weight: 800;

    box-shadow: 0 0 35px rgba(56, 189, 248, .12);
}

.profile-card h2 {
    font-size: 27px;
    font-weight: 800;
}

.profile-card p {
    margin: 12px auto 25px;
    color: var(--muted);
}

.status {
    display: inline-block;

    padding: 7px 16px;

    border-radius: 30px;

    background: #12344a;
    color: var(--primary);

    font-size: 12px;
    font-weight: 600;
}

/* ==========================================
   7. SECCIONES GENERALES
========================================== */

.section {
    padding: 90px 0;
    scroll-margin-top: 90px;
}

.section-dark {
    background: var(--bg-secondary);
}

.section h2 {
    margin-bottom: 20px;

    font-size: clamp(28px, 4vw, 36px);
    font-weight: 800;
    line-height: 1.3;
}

.section-description {
    max-width: 680px;
    margin-bottom: 35px;
    color: var(--muted);
}

/* ==========================================
   8. TARJETAS DE SERVICIOS
========================================== */

.cards {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 25px;
    margin-top: 40px;
}

.service-card,
.project-card {
    background: var(--card);
    padding: 30px;

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: 0 8px 25px rgba(0, 0, 0, .12);

    transition:
        transform .3s ease,
        border-color .3s ease,
        background .3s ease;
}

.service-card:hover,
.project-card:hover {
    transform: translateY(-5px);
    background: var(--card-hover);
    border-color: var(--primary);
}

.service-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 60px;
    height: 60px;

    margin-bottom: 24px;

    border-radius: 16px;

    background: rgba(56, 189, 248, .10);
    color: var(--primary);

    font-size: 25px;
    font-weight: 800;
}

.service-card h3,
.project-card h3 {
    margin-bottom: 12px;

    font-size: 21px;
    font-weight: 700;
}

.service-card p,
.project-card p {
    color: var(--muted);
    font-size: 14px;
}

/* ==========================================
   9. PROYECTOS
========================================== */

.project-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 25px;
}

.project-card {
    min-height: 200px;
}

.project-card span {
    display: inline-block;
    margin-bottom: 12px;

    color: var(--primary);

    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
}

/* ==========================================
   10. CONTACTO Y FOOTER
========================================== */

.contact {
    text-align: center;
}

.contact p {
    max-width: 650px;
    margin: 0 auto;
    color: var(--muted);
}

.contact-note {
    margin-top: 20px !important;
    font-size: 14px;
}

.footer {
    padding: 30px 0;

    text-align: center;

    border-top: 1px solid var(--border);

    background: var(--bg);
    color: var(--muted);

    font-size: 13px;
}

/* ==========================================
   11. PANTALLAS MEDIANAS
   EVITAR DESBORDAMIENTO DEL MENU
========================================== */

@media (min-width: 851px) and (max-width: 1180px) {

    .navbar {
        gap: 12px;
    }

    .logo {
        font-size: 21px;
    }

    .nav-links {
        gap: 12px;
    }

    .nav-links a {
        font-size: 12px;
    }

    .nav-links a.admin-access {
        font-size: 12px;
        padding: 8px 10px;
    }
}

/* ==========================================
   12. TABLETAS Y CELULARES
========================================== */

@media (max-width: 850px) {

    :root {
        --header-height: 72px;
    }

    html {
        scroll-padding-top: 85px;
    }

    .container {
        width: calc(100% - 32px);
    }

    /* HEADER */

    .navbar {
        min-height: var(--header-height);

        flex-direction: row;
        align-items: center;
        justify-content: space-between;

        gap: 12px;
        padding: 0;
    }

    .logo {
        font-size: 22px;
    }

    .nav-links {
        display: none;
    }

    /* BOTON HAMBURGUESA */

    .menu-toggle {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;

        flex-shrink: 0;

        width: 44px;
        height: 44px;
        gap: 5px;

        border: 1px solid var(--border);
        border-radius: 13px;

        background: var(--card);
    }

    .menu-toggle span {
        display: block;

        width: 21px;
        height: 2px;

        background: var(--primary);
        border-radius: 3px;

        transition: transform .25s ease;
    }

    .menu-toggle:hover {
        background: var(--card-hover);
    }

    /* FONDO OSCURO DEL MENU */

    .menu-backdrop {
        position: fixed;
        inset: 0;
        z-index: 140;

        background: rgba(0, 0, 0, .65);

        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
    }

    .menu-backdrop[hidden] {
        display: none !important;
    }

    .menu-backdrop.is-open {
        display: block;
    }

    /* PANEL LATERAL TIPO APP */

    .mobile-panel {
        display: flex;
        flex-direction: column;

        position: fixed;
        top: 0;
        right: 0;
        z-index: 150;

        width: min(340px, 86vw);

        height: 100vh;
        height: 100dvh;

        padding:
            calc(28px + env(safe-area-inset-top))
            22px
            calc(28px + env(safe-area-inset-bottom));

        background: #101b2e;

        border-left: 1px solid #2b405c;

        box-shadow:
            -15px 0 60px rgba(0, 0, 0, .5);

        transform: translateX(105%);
        visibility: hidden;

        transition:
            transform .3s ease,
            visibility .3s ease;

        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .mobile-panel.is-open {
        transform: translateX(0);
        visibility: visible;
    }

    /* ENCABEZADO DEL MENU */

    .mobile-panel-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;

        gap: 15px;
        padding-bottom: 25px;

        border-bottom: 1px solid var(--border);
    }

    .mobile-brand {
        display: block;

        color: var(--primary);

        font-size: 22px;
        font-weight: 800;
    }

    .mobile-panel-header p {
        color: var(--muted);
        font-size: 12px;
    }

    /* BOTON CERRAR */

    .menu-close {
        display: flex;
        align-items: center;
        justify-content: center;

        flex-shrink: 0;

        width: 40px;
        height: 40px;

        border: 1px solid var(--border);
        border-radius: 12px;

        background: var(--card);
        color: var(--text);

        font-size: 30px;
        line-height: 1;
    }

    .menu-close:hover {
        background: #263a55;
    }

    /* ENLACES DEL MENU LATERAL */

    .mobile-links {
        display: flex;
        flex-direction: column;

        gap: 9px;
        padding-top: 25px;
    }

    .mobile-links a {
        display: flex;
        align-items: center;

        min-height: 50px;
        padding: 12px 18px;

        border: 1px solid transparent;
        border-radius: 13px;

        color: #cbd5e1;

        font-size: 15px;
        font-weight: 600;

        transition:
            color .2s ease,
            background .2s ease;
    }

    .mobile-links a:hover,
    .mobile-links a:focus-visible {
        background: #1b3652;
        border-color: #294b6d;
        color: var(--primary);
    }

    /* =====================================
       LOGIN / PANEL ADMINISTRATIVO MOVIL
    ===================================== */

    .mobile-links a.admin-access {
        display: flex;
        align-items: center;
        justify-content: center;

        min-height: 50px;
        margin-top: 12px;
        padding: 12px 18px;

        border: 1px solid var(--primary);
        border-radius: 13px;

        background: #19324c;
        color: var(--primary);

        font-size: 15px;
        font-weight: 800;
    }

    .mobile-links a.admin-access:hover,
    .mobile-links a.admin-access:focus-visible {
        background: var(--primary);
        color: #07111f;
    }

    /* PIE DEL MENU LATERAL */

    .mobile-panel-footer {
        margin-top: auto;
        padding-top: 30px;

        color: var(--primary);
        font-weight: 800;
    }

    .mobile-panel-footer small {
        display: block;
        color: var(--muted);

        font-size: 12px;
        font-weight: 400;
    }

    /* BLOQUEAR SCROLL CON MENU ABIERTO */

    body.menu-open {
        overflow: hidden;
        overscroll-behavior: none;
    }

    /* SECCION PRINCIPAL */

    .hero {
        padding: 70px 0 55px;
    }

    .hero-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 35px;
    }

    .hero h1 {
        font-size: clamp(31px, 7vw, 46px);
        line-height: 1.2;
    }

    .hero p {
        font-size: 15px;
    }

    /* TARJETA DE PERFIL */

    .profile-card {
        max-width: 520px;
        margin: 0 auto;
        padding: 35px 25px;
    }

    .avatar {
        width: 120px;
        height: 120px;
        font-size: 38px;
    }

    /* SECCIONES */

    .section {
        padding: 65px 0;
        scroll-margin-top: 85px;
    }

    .section h2 {
        font-size: 28px;
    }

    /* SERVICIOS Y PROYECTOS */

    .cards {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    .project-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    .service-card,
    .project-card {
        padding: 25px;
    }

    /* =====================================
       BARRA INFERIOR FLOTANTE TIPO APP
    ===================================== */

    .app-tabbar {
        display: grid;

        grid-template-columns:
            repeat(4, minmax(0, 1fr));

        align-items: center;

        position: fixed;

        left: 50%;

        bottom: calc(
            10px + env(safe-area-inset-bottom)
        );

        transform: translateX(-50%);

        z-index: 120;

        width: min(
            470px,
            calc(100% - 24px)
        );

        min-height: 72px;
        padding: 8px;

        background: rgba(15, 25, 43, .96);

        border: 1px solid #30435e;
        border-radius: 22px;

        box-shadow:
            0 10px 40px rgba(0, 0, 0, .55);

        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }

    /* OPCIONES DE NAVEGACION INFERIOR */

    .app-tabbar a {
        display: flex;
        flex-direction: column;

        align-items: center;
        justify-content: center;

        gap: 3px;

        min-width: 0;
        min-height: 54px;

        border-radius: 15px;

        color: var(--muted);

        font-size: 10px;
        font-weight: 700;

        transition:
            color .2s ease,
            background .2s ease;
    }

    .app-tabbar svg {
        width: 23px;
        height: 23px;
        flex-shrink: 0;
    }

    .app-tabbar a.active,
    .app-tabbar a:hover,
    .app-tabbar a:focus-visible {
        background: #19324c;
        color: var(--primary);
    }

    /* ESPACIO PARA LA BARRA INFERIOR */

    .footer {
        padding: 30px 12px 120px;
    }
}

/* ==========================================
   13. CELULARES PEQUEÑOS
========================================== */

@media (max-width: 400px) {

    .container {
        width: calc(100% - 28px);
    }

    .logo {
        font-size: 20px;
    }

    .hero {
        padding-top: 55px;
    }

    .hero h1 {
        font-size: 31px;
    }

    .eyebrow {
        font-size: 10px;
        letter-spacing: 1.5px;
    }

    .actions {
        flex-direction: column;
    }

    .btn-primary,
    .btn-outline {
        width: 100%;
    }

    .profile-card {
        padding: 28px 20px;
    }

    .section {
        padding: 55px 0;
    }

    .service-card,
    .project-card {
        padding: 22px;
    }

    .app-tabbar {
        border-radius: 19px;
    }

    .app-tabbar a {
        font-size: 10px;
    }

    .app-tabbar svg {
        width: 21px;
        height: 21px;
    }
}

/* ==========================================
   14. ACCESIBILIDAD
========================================== */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}
