/* ==========================================================
   Josu DevLab - hoja de estilos (v2, paso 1: estilo visual)
   Basado en las reglas de taste-skill (redesign) y emil-design-eng
   Orden: variables, base, botones, header, hero, secciones,
          habilidades, proyectos, servicios, contacto, footer,
          accesibilidad, responsive
   ========================================================== */
 
:root {
    /* Colores: una sola familia de grises (fríos) + UN acento */
    --bg: #0c0d10;
    --bg-alt: #121419;
    --surface: #171a20;
    --text: #ececef;
    --text-muted: #9b9ea8;
    --text-soft: #6c707b;
    --accent: #5ec79a;          /* verde menta, guiño a "servidor encendido" */
    --accent-strong: #7ad8ae;
    --accent-ink: #06140d;      /* texto encima del acento */
    --border: #22252d;
    --border-strong: #2f333d;
 
    /* Tipografía */
    --font-sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
 
    /* Forma: botones e inputs 8px, tarjetas 14px (regla fija en toda la página) */
    --radius-sm: 8px;
    --radius-lg: 14px;
 
    /* Movimiento: curvas con más "punch" que las de CSS por defecto */
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
 
    --max-width: 1120px;
    --header-h: 64px;
}
 
/* ---------- Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}
 
html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
}
 
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}
 
/* Grano sutil encima de todo para que el fondo no se vea "plano" */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
 
h1, h2, h3 {
    margin: 0 0 0.6em;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.15;
    text-wrap: balance;
}
 
p {
    margin: 0 0 1em;
    color: var(--text-muted);
    text-wrap: pretty;
}
 
a {
    color: var(--accent);
    text-decoration: none;
}
 
ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
 
img {
    max-width: 100%;
    display: block;
}
 
::selection {
    background: var(--accent);
    color: var(--accent-ink);
}
 
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}
 
/* ---------- Botones ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font: 500 0.95rem/1 var(--font-sans);
    cursor: pointer;
    white-space: nowrap;
    transition:
        background-color 200ms ease,
        border-color 200ms ease,
        color 200ms ease,
        transform 160ms var(--ease-out);
}
 
/* Al presionar, el botón se "hunde" un poquito: se siente físico */
.btn:active {
    transform: scale(0.97);
}
 
.btn-primary {
    background: var(--accent);
    color: var(--accent-ink);
}
 
.btn-primary:hover {
    background: var(--accent-strong);
}
 
/* El secundario ya no es otro botón con borde: es un link sobrio */
.btn-outline {
    background: transparent;
    color: var(--text);
    padding-left: 6px;
    padding-right: 6px;
}
 
.btn-outline:hover {
    color: var(--accent);
}
 
/* ---------- Header / navegación ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(12, 13, 16, 0.78);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    border-bottom: 1px solid var(--border);
}
 
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
}
 
.logo {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.98rem;
    color: var(--text);
    letter-spacing: -0.01em;
}
 
.logo span {
    color: var(--accent);
}
 
.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
}
 
.nav-link {
    color: var(--text-muted);
    font-size: 0.92rem;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: color 200ms ease, background-color 200ms ease;
}
 
.nav-link:hover {
    color: var(--text);
    background: var(--surface);
}
 
.nav-cta {
    color: var(--text);
    border: 1px solid var(--border-strong);
    margin-left: 8px;
}
 
.nav-cta:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: transparent;
}
 
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
}
 
.nav-toggle span {
    width: 100%;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 200ms var(--ease-out), opacity 200ms ease;
}
 
/* ---------- Hero (alineado a la izquierda, ya no centrado) ---------- */
.hero {
    position: relative;
    padding: 96px 0 104px;
    overflow: hidden;
}
 
/* Luz ambiental suave detrás del título (no es el típico degradado morado) */
.hero::before {
    content: "";
    position: absolute;
    top: -220px;
    left: -160px;
    width: 720px;
    height: 560px;
    background: radial-gradient(closest-side, rgba(94, 199, 154, 0.13), transparent 72%);
    pointer-events: none;
}
 
.hero-inner {
    position: relative;
    max-width: var(--max-width);
}
 
.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-soft);
    margin-bottom: 1.4em;
}
 
.hero h1 {
    font-size: clamp(2.2rem, 5.2vw, 3.9rem);
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1.05;
    max-width: 16ch;
    margin-bottom: 0.45em;
}
 
.hero-text {
    font-size: 1.1rem;
    max-width: 52ch;
    margin-bottom: 2em;
}
 
.hero-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
 
/* ---------- Secciones genéricas ---------- */
.section {
    padding: 88px 0 96px;
    border-top: 1px solid var(--border);
}
 
.section-alt {
    background: var(--bg-alt);
}
 
.section-title {
    font-size: clamp(1.6rem, 2.6vw, 2.1rem);
    margin-bottom: 0.5em;
}
 
.section-text {
    max-width: 62ch;
    font-size: 1.05rem;
}
 
/* ---------- Habilidades: chips en fuente mono, sin cajas grandes ---------- */
.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
    max-width: 780px;
}
 
.skill-card {
    font-family: var(--font-mono);
    font-size: 0.88rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    transition: border-color 200ms ease, color 200ms ease;
}
 
.skill-card:hover {
    border-color: var(--border-strong);
    color: var(--accent);
}
 
/* ---------- Proyectos: cada proyecto a lo ancho, imagen + texto lado a lado ---------- */
#proyectos .cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    margin-top: 36px;
}
 
#proyectos .card {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
}
 
/* El segundo proyecto invierte el orden (imagen a la derecha) para dar ritmo */
#proyectos .card:nth-child(even) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
}
 
#proyectos .card:nth-child(even) .card-image {
    order: 2;
    border-right: none;
    border-left: 1px solid var(--border);
}
 
#proyectos .card-image {
    aspect-ratio: 16 / 10;
    border-bottom: none;
    border-right: 1px solid var(--border);
}
 
#proyectos .card-body {
    justify-content: center;
    padding: 32px;
}
 
#proyectos .card h3 {
    font-size: 1.35rem;
}
 
#proyectos .card-link {
    margin-top: 8px;
}
 
.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color 250ms ease, transform 250ms var(--ease-out);
}
 
.card:hover {
    border-color: var(--border-strong);
    transform: translateY(-3px);
}
 
.card-image {
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(120% 90% at 0% 0%, rgba(94, 199, 154, 0.08), transparent 60%),
        var(--bg-alt);
    color: var(--text-soft);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}
 
.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 600ms var(--ease-out);
}
 
.card:hover .card-image img {
    transform: scale(1.03);
}
 
.card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 22px 24px 24px;
}
 
.card h3 {
    font-size: 1.15rem;
    margin-bottom: 0.4em;
}
 
.card p {
    font-size: 0.96rem;
    margin-bottom: 0.9em;
}
 
/* La línea de tecnologías (tercer <p> del card) en mono y más tenue */
.card-body p + p {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-soft);
}
 
.card-link {
    font-weight: 500;
    font-size: 0.92rem;
    margin-top: auto;
    margin-right: 18px;
    display: inline-block;
    transition: color 200ms ease;
}
 
.card-link:hover {
    color: var(--accent-strong);
}
 
/* ---------- Servicios: lista con divisiones, no 3 tarjetas iguales ---------- */
#servicios .cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    margin-top: 28px;
    max-width: 820px;
}
 
#servicios .card {
    display: grid;
    grid-template-columns: minmax(180px, 280px) 1fr;
    gap: 24px;
    align-items: baseline;
    background: transparent;
    border: none;
    border-top: 1px solid var(--border);
    border-radius: 0;
    padding: 22px 0;
}
 
#servicios .card:hover {
    transform: none;
}
 
#servicios .card h3 {
    font-size: 1.05rem;
    margin: 0;
}
 
#servicios .card p {
    margin: 0;
}
 
/* ---------- Contacto ---------- */
.contact-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 56px;
    margin-top: 32px;
    align-items: start;
}
 
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
 
.contact-form label {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
    margin-top: 10px;
}
 
.contact-form input,
.contact-form textarea {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: var(--text);
    font: inherit;
    font-size: 0.96rem;
    transition: border-color 200ms ease, box-shadow 200ms ease;
}
 
.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(94, 199, 154, 0.18);
}
 
.contact-form textarea {
    resize: vertical;
    min-height: 140px;
}
 
.contact-form button {
    margin-top: 14px;
    align-self: flex-start;
}
 
.form-note {
    font-size: 0.82rem;
    color: var(--text-soft);
    margin-top: 6px;
}
 
.contact-links {
    display: flex;
    flex-direction: column;
}
 
.contact-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-top: 1px solid var(--border);
    color: var(--text);
    font-size: 0.98rem;
    transition: color 200ms ease, padding-left 250ms var(--ease-out);
}
 
.contact-link:last-child {
    border-bottom: 1px solid var(--border);
}
 
.contact-link::after {
    content: "\2197"; /* flecha ↗ */
    color: var(--text-soft);
    transition: color 200ms ease, transform 250ms var(--ease-out);
}
 
.contact-link:hover {
    color: var(--accent);
}
 
.contact-link:hover::after {
    color: var(--accent);
    transform: translate(2px, -2px);
}
 
/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 28px 0 36px;
}
 
.site-footer p {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-soft);
    margin: 0;
}
 
/* ---------- Accesibilidad ---------- */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}
 
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
 
/* ==========================================================
   Responsive - celular y tablet
   ========================================================== */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }
 
    .nav-menu {
        position: absolute;
        top: var(--header-h);
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 24px 20px;
        transform: translateY(-8px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 200ms ease, transform 250ms var(--ease-out);
    }
 
    .nav-menu.is-open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }
 
    .nav-link {
        padding: 14px 0;
        border-radius: 0;
        border-bottom: 1px solid var(--border);
    }
 
    .nav-link:hover {
        background: transparent;
    }
 
    .nav-cta {
        border: none;
        border-bottom: 1px solid var(--border);
        margin-left: 0;
    }
 
    .hero {
        padding: 64px 0 72px;
    }
 
    .section {
        padding: 64px 0 72px;
    }
 
    .contact-grid {
        grid-template-columns: 1fr;
    }
 
    #proyectos .card,
    #proyectos .card:nth-child(even) {
        grid-template-columns: 1fr;
    }
 
    #proyectos .card:nth-child(even) .card-image {
        order: 0;
        border-left: none;
    }
 
    #proyectos .card-image,
    #proyectos .card:nth-child(even) .card-image {
        aspect-ratio: 16 / 9;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
 
    #proyectos .card-body {
        padding: 22px 24px 24px;
    }
 
    #servicios .card {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}
 