/*
Theme Name: k2ingenieria Theme
Author: Ramón & Gemini Consultancy
Description: Tema a medida para k2ingeniería basado en noctura theme
Version: 1.2
*/

body {
    background-color: #0a0a0a; 
    color: #ffffff;
    font-family: 'Geist', sans-serif;
    overflow-x: hidden;
    cursor: none; 
    margin: 0;
    padding: 0;
    user-select: none;
}

/* CURSOR PERSONALIZADO */
#custom-cursor {
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    mix-blend-mode: difference;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0; 
    color: black;
    font-weight: 700;
    will-change: left, top, transform; 
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), width 0.3s, height 0.3s, font-size 0.2s;
}

#custom-cursor.project-hover { width: 110px; height: 110px; mix-blend-mode: normal; font-size: 0.65rem; letter-spacing: 0.15em; }
#custom-cursor.article-hover { width: 80px; height: 80px; background: transparent; border: 1px solid white; mix-blend-mode: normal; }
#custom-cursor.footer-dark { background: black; border: 1px solid black; mix-blend-mode: normal; color: white; }

/* ANIMACIÓN REBOTE "SCROLL DOWN" */
@keyframes subtle-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}
.animate-subtle-bounce { animation: subtle-bounce 2s ease-in-out infinite; }

/* HEADER STICKY */
nav {
    position: fixed;
    top: 0; left: 0; width: 100%; z-index: 1000;
    display: flex; justify-content: space-between; align-items: center;
    padding: 2.5rem 3.5rem; pointer-events: none; 
}
nav div { pointer-events: auto; }

/* MARQUEE HERO */
.marquee-content {
    display: flex; flex-shrink: 0; gap: 4rem; align-items: center;
    animation: scroll 30s linear infinite; padding-top: 2rem; padding-bottom: 2rem;
}
@keyframes scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* HERO BACKGROUND (HOME) */
.hero-background {
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: linear-gradient(rgba(10, 10, 10, 0.7), rgba(10, 10, 10, 0.7)), url('https://images.unsplash.com/photo-1698164443690-5d282206ede2?q=80&w=2070&auto=format&fit=crop'); 
    background-size: cover; 
    background-position: center; 
    z-index: -1; 
    filter: grayscale(100%) contrast(120%);
    transition: filter 0.4s ease;
}

.noise-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: url('https://grainy-gradients.vercel.app/noise.svg');
    opacity: 0.04; pointer-events: none; z-index: 5;
}

.nav-link { font-size: 0.8rem; letter-spacing: 0.1em; transition: all 0.3s ease; }

/* MENÚ OVERLAY */
#menu-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    z-index: 9000; display: flex; flex-direction: column; justify-content: center; align-items: center;
    visibility: hidden; opacity: 0; transition: opacity 0.5s ease, visibility 0.5s;
}
#menu-overlay.active { visibility: visible; opacity: 1; }
.menu-list { width: 80%; max-width: 1200px; }
.menu-item {
    position: relative; padding: 1.5rem 0; border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex; align-items: baseline; gap: 1.5rem; transition: filter 0.4s ease, opacity 0.4s ease; cursor: pointer;
}
.menu-item::after {
    content: ""; position: absolute; bottom: -1px; left: 0; width: 100%; height: 1px;
    background-color: white; transform: scaleX(0); transform-origin: right; transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}
.menu-item:hover::after { transform: scaleX(1); transform-origin: left; }
.menu-list:has(.menu-item:hover) .menu-item:not(:hover) { filter: blur(5px); opacity: 0.3; }

/* SISTEMA DE VISTAS (SPA) */
.view-section {
    width: 100%;
    transition: opacity 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* SECCIÓN CLAIM */
#section-claim { background-color: #0a0a0a; padding: 0 10%; display: flex; align-items: center; justify-content: center; height: 100vh; }
.claim-word { display: inline-block; font-size: 5vw; font-weight: 300; line-height: 1.2; margin-right: 1.2vw; opacity: 0.1; transition: opacity 0.4s cubic-bezier(0.25, 0.1, 0.25, 1); }

/* SECCIÓN PROYECTOS (HOME) - Altura dinámica corregida */
#section-projects { position: relative; background-color: #0a0a0a; width: 100%; height: auto; min-height: 100vh; padding-top: 30vh; padding-bottom: 15vh; }
.projects-bg-text {
    /* Usamos clamp() para un tamaño de fuente responsive pero controlado */
    font-size: clamp(4rem, 11vw, 10rem); font-weight: 300; letter-spacing: 0.02em; opacity: 0.8; line-height: 1; filter: blur(0px); will-change: filter, opacity;
    text-align: center; color: #ffffff; transition: filter 0.4s ease-out, opacity 0.6s ease-out;
}
.project-card {
    position: relative; display: flex; flex-direction: column; will-change: transform; width: 100%;
    pointer-events: auto; margin-bottom: 25vh; cursor: pointer;
}
.project-card.narrow { max-width: 60%; } .project-card.medium { max-width: 80%; } 

.hero-marquee-separator {
    transition: fill 0.4s ease;
    fill: white; /* Default fill */
}

/* Ajuste para la página de "WORK" (Grid regular) */
.project-card-regular { margin-bottom: 4rem !important; max-width: 100% !important; }

.project-img-wrap { position: relative; width: 100%; overflow: hidden; background: #111; }
.project-img-wrap img { width: 100%; height: auto; aspect-ratio: 4/5; object-fit: cover; filter: grayscale(100%); transition: transform 1.2s cubic-bezier(0.19, 1, 0.22, 1); }
.project-card:hover img { transform: scale(1.1); filter: grayscale(0%); }

/* SECCIÓN ARTÍCULOS */
#section-articles { background-color: #0a0a0a; padding-top: 2vh; padding-bottom: 15vh; overflow: hidden; }
.articles-track { display: flex; gap: 4rem; padding: 0 2rem; will-change: transform; }
.article-card { flex-shrink: 0; width: 500px; background-color: #ffffff; color: #000000; padding: 1.5rem; padding-bottom: 3.5rem; display: flex; flex-direction: column; gap: 1.8rem; transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); cursor: pointer; }
.article-card img { pointer-events: none; user-drag: none; -webkit-user-drag: none; transition: transform 1.2s cubic-bezier(0.19, 1, 0.22, 1); }
.article-card:hover img { transform: scale(1.1); }
.article-img-wrap { width: 100%; aspect-ratio: 16/9; overflow: hidden; background-color: #f5f5f5; }

/* Ajuste para página de Artículos (Grid regular) */
.article-card-regular { width: 100% !important; flex-shrink: 1; }

/* CONTACT CARDS */
.contact-card {
    background-color: #ffffff;
    color: #000000;
    padding: 4rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    aspect-ratio: 4/3;
    will-change: transform;
}

/* CSS - FOOTER */
#main-footer { background-color: #ffffff; color: #000000; padding: 4rem 1.5rem 2rem 1.5rem; position: relative; z-index: 50; overflow: hidden; }
@media (min-width: 768px) { #main-footer { padding: 6rem 3.5rem 2rem 3.5rem; } }

.footer-grid { display: grid; grid-template-columns: 1fr; gap: 3rem; margin-bottom: 5rem; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 4rem; } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1.5fr; margin-bottom: 8rem; } }

.footer-col-header { font-size: 0.7rem; letter-spacing: 0.15em; opacity: 0.4; margin-bottom: 2.5rem; display: block; font-weight: 700; }
.footer-logo { font-size: 1rem; font-weight: 500; margin-bottom: 2.5rem; display: block; }
.footer-desc { font-size: 1.1rem; font-weight: 300; line-height: 1.3; margin-bottom: 3rem; max-width: 280px; }
.footer-link { display: block; font-size: 1rem; font-weight: 300; margin-bottom: 0.8rem; transition: opacity 0.3s; text-decoration: none; color: inherit; word-break: break-word; }
.footer-link:hover { opacity: 0.5; }
.footer-contact-small { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; margin-top: 1rem; display: block; }

.footer-branding-giant { font-size: 13vw; font-weight: 300; letter-spacing: -0.04em; line-height: 0.95; display: flex; align-items: center; white-space: nowrap; overflow: hidden; border-top: 1px solid rgba(0,0,0,0.05); padding-top: 2rem; padding-bottom: 2rem; }
.footer-marquee-content { display: flex; flex-shrink: 0; align-items: center; gap: 2.5vw; padding-right: 2.5vw; animation: scroll 30s linear infinite; }
.footer-tri-separator { width: 8vw; height: 8vw; background-color: #000; clip-path: polygon(0 0, 0 100%, 100% 100%); flex-shrink: 0; }

/* ESTILOS PARA LOS FILTROS DESPLEGABLES */
.filter-select {
    background-color: transparent;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.3);
    color: white;
    font-family: 'Geist', sans-serif;
    font-weight: 300;
    font-size: 1.1rem;
    padding: 0.5rem 2rem 0.5rem 0;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 0.2rem top 50%;
    background-size: 0.65rem auto;
    transition: border-color 0.3s;
}
.filter-select:hover { border-bottom-color: rgba(255,255,255,1); }
.filter-select option { background-color: #0a0a0a; color: white; padding: 10px; }

/* Animación suave al filtrar */
@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.project-card-regular { animation: fadeInScale 0.4s ease-out forwards; }

/* TRANSICIONES DE PÁGINA (SWUP) */
.transition-fade {
  transition: opacity 0.4s ease-in-out;
  opacity: 1;
  transform: none;
}

html.is-animating .transition-fade {
  opacity: 0;
  transform: translateY(20px);
}

.theme-switcher {
    position: relative;
    display: inline-block;
}

.theme-toggle-checkbox {
    display: none;
}

.theme-toggle-label {
    display: block;
    width: 50px;
    height: 26px;
    background-color: rgba(255,255,255,0.15);
    border-radius: 13px;
    cursor: pointer;
    position: relative;
    transition: background-color 0.3s ease;
}

.theme-toggle-slider {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1), background-color 0.3s ease;
}

.theme-toggle-checkbox:checked + .theme-toggle-label {
    background-color: rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.1);
}

.theme-toggle-checkbox:checked + .theme-toggle-label .theme-toggle-slider {
    transform: translateX(24px);
    background-color: #0a0a0a;
}

.theme-toggle-slider svg {
    position: absolute;
    transition: opacity 0.2s ease;
}

.theme-toggle-slider .moon-icon {
    opacity: 1;
    fill: #0a0a0a; /* Moon icon is black */
}

.theme-toggle-slider .sun-icon {
    opacity: 0;
    fill: white; /* Sun icon is white */
}

.theme-toggle-checkbox:checked + .theme-toggle-label .moon-icon {
    opacity: 0;
}

.theme-toggle-checkbox:checked + .theme-toggle-label .sun-icon {
    opacity: 1;
}

/* --- LIGHT THEME OVERRIDES --- */
body.light-theme {
    background-color: #f0f0f0;
    color: #0a0a0a;
}

/* Cursor */
body.light-theme #custom-cursor { background: #0a0a0a; }
body.light-theme #custom-cursor.project-hover { background: #f0f0f0; color: #0a0a0a; border: 1px solid #0a0a0a; }
body.light-theme #custom-cursor.article-hover { border: 1px solid #0a0a0a; }
body.light-theme #custom-cursor.footer-dark { background: #f0f0f0; color: #0a0a0a; border: 1px solid #0a0a0a; }

/* General Elements */
body.light-theme .nav-link, body.light-theme .nav-link a { color: #0a0a0a; }
body.light-theme #menu-overlay { background-color: rgba(240, 240, 240, 0.85); }
body.light-theme .menu-item { border-bottom-color: rgba(10, 10, 10, 0.1); }
body.light-theme .menu-item a, body.light-theme .menu-item span { color: #0a0a0a; }
body.light-theme .menu-item::after { background-color: #0a0a0a; }
body.light-theme #section-claim, body.light-theme #section-projects, body.light-theme #section-articles { background-color: #f0f0f0; }
body.light-theme .claim-word, body.light-theme .projects-bg-text, body.light-theme .project-card { color: #0a0a0a; }
body.light-theme .hero-background { 
    background: linear-gradient(rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.3)), url('https://images.unsplash.com/photo-1759683935137-f02072e6ac54?q=80&w=1170');
    background-size: cover;
    background-position: center;
    filter: grayscale(10%) contrast(60%) brightness(2.0);
}
body.light-theme .hero-marquee-separator { fill: #0a0a0a; }

/* Single pages text color */
body.light-theme .page-content-area {
    color: #0a0a0a;
}

/* Inverted Cards */
body.light-theme .article-card, body.light-theme .contact-card { background-color: #0a0a0a; color: #f0f0f0; }
body.light-theme .article-card h3, body.light-theme .article-card p, body.light-theme .contact-card * { color: #f0f0f0; }
body.light-theme .contact-card .border-black\/10 { border-color: rgba(255, 255, 255, 0.1); }

/* Filters */
body.light-theme .filter-select {
    color: #0a0a0a;
    border-bottom-color: rgba(10, 10, 10, 0.3);
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%230A0A0A%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
}
body.light-theme .filter-select:hover { border-bottom-color: #0a0a0a; }
body.light-theme .filter-select option { background-color: #f0f0f0; color: #0a0a0a; }

/* Footer */
body.light-theme #main-footer { background-color: #0a0a0a; color: #f0f0f0; }
body.light-theme #main-footer * { color: #f0f0f0; }
body.light-theme .footer-branding-giant { border-top-color: rgba(255, 255, 255, 0.1); }
body.light-theme .footer-tri-separator { background-color: #f0f0f0; }

/* EXCEPCIONES: No invertir color del texto sobre imágenes */
body.light-theme .text-on-image,
body.light-theme .text-on-image * {
    color: white;
}
body.light-theme .hero-subtitle {
    color: #0a0a0a;
}