/* =========================================
   1. RESET & VARIABLES GLOBALES
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Paleta Base */
    --black: #000000;
    --black-soft: #111111;
    --black-mid: #4e4e4e;
    --gray-dark: #222222;
    --gray: #333333;
    --gray-light: #888888;
    --white: #ffffff;
    --white-soft: #fafafa;
    --fluo: #ccff00;
    --fluo-dark: #b3e600;

    /* Alias Semánticos */
    --bg-dark: var(--black-soft);
    --text-main: var(--white-soft);
    --text-muted: var(--gray-light);
    --accent: var(--fluo);
    --border-color: var(--gray-dark);
    
    /* Tipografía y Tiempos */
    --font-mono: 'Chelsea Market', monospace;
    --font-sans: 'Courier New', Courier, monospace;
    --transition-speed: 0.2s;
}

/* =========================================
   2. BASE & UTILIDADES
   ========================================= */
body {
    background-color: var(--black);
    color: var(--text-main);
    font-family: var(--font-sans);
    overflow-x: hidden;
    line-height: 1.5;
}

a {
    color: var(--fluo);
    transition: color var(--transition-speed) ease;
}

a:hover, 
a:focus-visible {
    color: var(--white);
    outline: none;
}

::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--black);
}
::-webkit-scrollbar-thumb {
    background: var(--fluo);
    border: 2px solid var(--black);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--white);
}

::selection {
    background: var(--fluo);
    color: var(--black);
}

/* =========================================
   3. ANIMACIONES GLOBALES
   ========================================= */
@keyframes falsoContacto {
    0%, 90%, 94%, 98% {
        color: rgba(240, 250, 255, 0.096);
        text-shadow: none;
    }
    92%, 96%, 100% {
        color: var(--fluo);
        text-shadow: 5px 5px 0px var(--black-soft);
    }
}

@keyframes glitch {
    0%, 100% { transform: skew(0deg, 0deg); opacity: 1; }
    95% { transform: skew(2deg, 1deg); opacity: 0.9; }
    96% { transform: skew(-1deg, -2deg); opacity: 0.95; }
    97% { transform: skew(0deg, 0deg); opacity: 1; }
}

/* =========================================
   4. COMPONENTES REUTILIZABLES (UI)
   ========================================= */
.tag {
    display: inline-block;
    color: var(--fluo);
    font-size: 0.75rem;
    letter-spacing: 2px;
    background: var(--black-soft);
    padding: 0.5rem 1rem;
    border-left: 3px solid var(--fluo);
    margin-bottom: 2rem;
}

.btn {
    display: inline-block;
    background-color: var(--white);
    color: var(--fluo);
    font-size: 1.2rem;
    font-weight: 100;
    padding: 1rem 2.5rem;
    text-decoration: none;
    border: 2px solid var(--white);
    transition: all 0.1s linear;
    letter-spacing: 2px;
}

.btn:hover,
.btn:focus-visible {
    transform: translate(6px, 6px);
    box-shadow: -6px -6px 0px var(--fluo);
    background-color: var(--fluo);
    color: var(--black);
    border-color: var(--black);
    outline: none;
}

/* =========================================
   5. NAVEGACIÓN
   ========================================= */
.main-nav {
    background-color: rgba(0, 0, 0, 0.95);
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(4px);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    max-width: 56rem;
    margin: 0 auto;
}

.nav-brand {
    color: var(--fluo);
    font-size: 1.25rem;
    font-weight: bold;
    text-decoration: none;
    letter-spacing: -0.05em;
    font-family: var(--font-mono);
    transition: opacity var(--transition-speed) ease;
}

.nav-brand:hover,
.nav-brand:focus-visible {
    opacity: 0.8;
}

.nav-links, 
.nav-links-mobile {
    list-style: none;
}

.nav-links a, 
.nav-links-mobile a {
    color: var(--fluo);
    text-decoration: none;
    font-size: 0.875rem;
    text-transform: uppercase;
    font-weight: bold;
}

.nav-cta {
    border: 2px solid var(--accent);
    padding: 0.35rem 0.75rem;
    color: var(--accent) !important;
}

.nav-cta:hover,
.nav-cta:focus-visible {
    background-color: var(--accent);
    color: var(--black) !important;
}

.mobile-toggle {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
}

.nav-links-mobile {
    background-color: var(--black-soft);
    border-bottom: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.5rem;
}

.desktop-only { 
    display: none; 
}

/* =========================================
   6. HERO SECTION (mejorado para móvil)
   ========================================= */
.hero {
    background-color: var(--black);
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    font-weight: 900;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='1' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.08'/%3E%3C/svg%3E");
    pointer-events: none;
    opacity: 0.3;
}

.hero-title {
    font-size: clamp(2.5rem, 12vw, 12rem);
    text-align: left;
    font-family: var(--font-mono);
    font-weight: 100;
    line-height: 1;
    margin-bottom: 2rem;
    animation: falsoContacto 4s infinite;
    color: rgba(240, 250, 255, 0.096);
    position: relative;
    z-index: 2;
    margin-top: 10vh;
}

.hero-title span {
    color: var(--fluo);
    animation: glitch 3s infinite;
    display: inline-block;
}

.hero-description {
    color: var(--gray-light);
    font-size: clamp(0.875rem, 1vw, 1rem);
    text-align: center;
    max-width: 600px;
    margin: 1rem auto;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 2;
}

/* =========================================
   7. TECH ARSENAL (borde y sombra responsiva)
   ========================================= */
.tech-arsenal {
    min-height: 100vh; 
    width: 100%;
    background-color: var(--fluo-dark);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    border-top: 22px solid white;    
    position: relative; 
    overflow: hidden;   
}

.bg-brutalist {
    position: absolute;
    top: -10%; 
    left: -5%;
    width: 120%; 
    height: 120%;    
    font-family: var(--font-mono);
    font-size: clamp(1rem, 1.5vw, 1.5rem);
    line-height: 1;
    color: var(--black-mid);
    opacity: 0.4;    
    z-index: 0;
    pointer-events: none;          
    text-align: center;
    word-wrap: break-word;
    letter-spacing: 10px;
}

.tech-arsenal ul {
    position: relative;
    z-index: 1;        
    list-style: none;
    font-size: clamp(2rem, 8vw, 8rem);
    color: var(--white);
    /* Mejorado: stroke y sombra adaptados */
    -webkit-text-stroke: 3px #000000;
    text-shadow: 6px 6px 0px #000000;
    font-family: var(--font-mono);
    font-weight: 100;
    line-height: 1.5;    
    display: flex;
    flex-direction: column;
    text-align: right;
    gap: 4rem; 
    width: 100%;
    max-width: 1200px; 
}

.tech-arsenal li {
    transition: transform var(--transition-speed) ease, color var(--transition-speed) ease;
}

.tech-arsenal li:hover {
    color: var(--white);
    transform: scale(0.95); 
}

/* =========================================
   8. PROYECTOS & TARJETAS (títulos mejorados)
   ========================================= */
.projects {
    background-color: var(--white);
    padding: 4rem 2rem;
    width: 100%;
    border-top: 4px solid var(--black);
    text-align: center;
}

.projects h2 {
    font-size: clamp(1.5rem, 5vw, 3.5rem);
    font-weight: 100;    
    color: var(--fluo);
    -webkit-text-stroke: 2px #000000;
    text-shadow: 6px 6px 0px #000000;
    display: inline-block;
    padding: 0.75rem 1.5rem;
    margin-bottom: 3rem;
    letter-spacing: 4px; 
    font-family: "Chelsea Market", system-ui;
    text-transform: uppercase;
    text-align: center;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.project-card {
    background-color: var(--white);
    border: 2px solid var(--black);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform var(--transition-speed) linear, box-shadow var(--transition-speed) linear;
    position: relative;
}

.project-card:hover,
.project-card:focus-within {
    transform: translate(-6px, -6px);
    box-shadow: 10px 10px 0px var(--gray-light);
}

.project-image {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: var(--gray-dark);
    border-bottom: 2px solid var(--black);
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .project-image img,
.project-card:focus-within .project-image img {
    transform: scale(1.01);
}

.card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-content h3 {
    font-size: 1.35rem;
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1.2;
    margin-bottom: 0.75rem;
    color: var(--black);
    letter-spacing: -0.5px;
    font-family: "Chelsea Market", system-ui;
}

.card-content h3::before {
    content: '■ ';
    color: var(--fluo);
}

.card-content p {
    font-size: 0.875rem;
    color: var(--gray);
    font-weight: bold;
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

.card-link {
    display: block;
    padding: 1rem 1.5rem;
    background: var(--black);
    color: var(--fluo);
    text-decoration: none;
    font-weight: 900;
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-align: center;
    border-top: 2px solid var(--black);
    text-transform: uppercase;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

.card-link:hover,
.card-link:focus-visible {
    background: var(--fluo);
    color: var(--black);
    outline: none;
}

/* =========================================
   9. CASOS DE ESTUDIO (Vistas de Detalle)
   ========================================= */
.case-study {
    background-color: var(--bg-dark);
    color: var(--text-main);
    padding: 2rem 1.5rem;
}

.case-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.case-header .back-link {
    display: inline-block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    font-weight: bold;
    text-transform: uppercase;
}

.case-header .back-link:hover,
.case-header .back-link:focus-visible {
    color: var(--fluo);
}

.case-header .tag {
    background-color: rgba(204, 255, 0, 0.1);
    border: 1px solid var(--fluo);
    margin-bottom: 1rem;
}

.case-header h1 {
    font-size: 2rem;
    font-weight: 900;
    color: var(--white);
    text-transform: uppercase;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.025em;
    line-height: 1.1;
    font-family: var(--font-mono);
}

.case-header .tech-stack {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0;
    font-family: var(--font-mono);
}

.case-body {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.case-body h2 {
    font-size: 1.25rem;
    color: var(--white);
    border-left: 4px solid var(--fluo);
    padding-left: 1rem;
    margin: 0 0 1rem 0;
    text-transform: uppercase;
    font-family: var(--font-mono);
}

.case-body ul {
    list-style-type: none;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.case-body li {
    position: relative;
    padding-left: 1.5rem;
}

.case-body li::before {
    content: ">";
    position: absolute;
    left: 0;
    color: var(--fluo);
    font-weight: bold;
}

.case-body code {
    background-color: var(--black-mid);
    color: var(--fluo);
    padding: 0.125rem 0.375rem;
    border: 1px solid var(--gray-dark);
    font-size: 0.875em;
}

/* =========================================
   10. FOOTER
   ========================================= */
footer {
    background: var(--black);
    border-top: 4px solid var(--fluo);
    padding: 4rem 2rem 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-brand {
    margin-bottom: 3rem;
    text-align: center;
}

.footer-logo {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--fluo);
    letter-spacing: 3px;
    background: var(--black-soft);
    display: inline-block;
    padding: 0.5rem 1rem;
    border-left: 4px solid var(--fluo);
}

.footer-tagline {
    color: var(--gray-light);
    font-size: 0.75rem;
    margin-top: 1rem;
    text-transform: uppercase;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
    padding: 2rem 0;
    border-top: 1px solid rgba(204, 255, 0, 0.2);
    border-bottom: 1px solid rgba(204, 255, 0, 0.2);
}

.footer-section h4 {
    color: var(--fluo);
    font-size: 0.85rem;
    letter-spacing: 3px;
    margin-bottom: 1rem;
    font-weight: 900;
    text-transform: uppercase;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
    color: var(--gray-light);
    font-size: 0.75rem;
}

.footer-section a {
    color: var(--gray-light);
    text-decoration: none;
}

.footer-section a:hover,
.footer-section a:focus-visible {
    color: var(--fluo);
}

.footer-bottom {
    text-align: center;
    font-size: 0.7rem;
    color: var(--gray);
    text-transform: uppercase;
}

/* =========================================
   11. MEDIA QUERIES (MEJORADAS PARA MÓVIL)
   ========================================= */
@media (min-width: 768px) {
    .case-study {
        padding: 4rem 2rem;
        max-width: 56rem;
        margin: 0 auto;
    }
    .case-header h1 {
        font-size: 3rem;
    }
    .case-body {
        gap: 3.5rem;
    }
    .nav-container {
        padding: 1.5rem 2rem;
    }
    .desktop-only {
        display: flex;
        gap: 2.5rem;
        align-items: center;
    }
    .mobile-toggle {
        display: none;
    }
    .nav-links-mobile {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .hero {
        height: auto;
        min-height: 100vh;
        padding: 4rem 1rem;
    }
    .hero-title {
        /* Reducimos sombra y stroke para móvil */
        text-shadow: 2px 2px 0px var(--black-soft);
        letter-spacing: -0.02em;
        margin-top: 5vh;
    }
    .hero-title span {
        text-shadow: inherit;
    }
    .tech-arsenal ul {
        /* Ajuste fino para móvil: stroke más delgado y sombra reducida */
        -webkit-text-stroke: 1.5px #000000;
        text-shadow: 3px 3px 0px #000000;
        gap: 2rem;
        text-align: center;
    }
    .tech-arsenal li {
        font-size: clamp(1.8rem, 10vw, 4rem);
    }
    .projects h2 {
        -webkit-text-stroke: 1px #000000;
        text-shadow: 3px 3px 0px #000000;
        padding: 0.5rem 1rem;
        margin-bottom: 2rem;
    }
    .projects {
        padding: 3rem 1.5rem;
    }
    .project-grid {
        gap: 1.5rem;
        grid-template-columns: 1fr;
    }
    .project-card:hover,
    .project-card:focus-within {
        transform: translate(-4px, -4px);
        box-shadow: 6px 6px 0px var(--gray-light);
    }
    .btn {
        padding: 0.75rem 2rem;
        font-size: 1rem;
    }
    .card-content h3 {
        font-size: 1.125rem;
    }
    footer {
        padding: 3rem 1.5rem 1.5rem;
    }
    .footer-links {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }
    .footer-section h4 {
        margin-bottom: 0.5rem;
    }
}

/* Móviles muy pequeños (<=480px): ajustes extra */
@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(2rem, 10vw, 3rem);
        text-shadow: 1px 1px 0px var(--black-soft);
    }
    .tech-arsenal ul {
        -webkit-text-stroke: 1px #000000;
        text-shadow: 2px 2px 0px #000000;
        gap: 1.5rem;
    }
    .projects h2 {
        -webkit-text-stroke: 0.5px #000000;
        text-shadow: 2px 2px 0px #000000;
        font-size: 1.6rem;
        letter-spacing: 2px;
    }
    .card-content h3 {
        font-size: 1rem;
    }
    .card-content p {
        font-size: 0.75rem;
    }
}
