:root {
    --bg-a: #1a1a2e;
    --bg-b: #0d0d14;
    --bg-c: #110c0a;
    --superficie: #14141f;
    --superficie-alta: #191927;
    --borde: rgba(255, 255, 255, 0.08);
    --text-primary: #f2f1f6;
    --text-secondary: #8d8ba0;
    --accent: #6fe3c9;
    --accent-soft: rgba(111, 227, 201, 0.14);
    --ember: #e8a355;
    --ember-soft: rgba(232, 163, 85, 0.16);
    --font-display: "Space Grotesk", -apple-system, sans-serif;
    --font-body: "Inter", -apple-system, sans-serif;
    --font-mono: "IBM Plex Mono", monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background: var(--bg-b);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.5;
    position: relative;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;

}

/* Textura de grano muy sutil sobre todo el sitio: rompe la planitud típica de un fondo degradado liso */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 999;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.contenedor {
    width: min(92vw, 1080px);
    margin-inline: auto;
}

.seccion {
    padding: clamp(3.5rem, 9vw, 6.5rem) 0;
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.titulo-seccion {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.6rem, 3.4vw, 2.4rem);
    line-height: 1.2;
    max-width: 22ch;
    margin-bottom: 1rem;
}

.texto-seccion {
    color: var(--text-secondary);
    max-width: 54ch;
}

.acento {
    color: var(--accent);
}

.stack-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    margin-top: 1.25rem;
}

.stack-tags li {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    border: 1px solid var(--borde);
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
}

/* ===== Botones ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.92rem;
    border-radius: 999px;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-primario {
    background: var(--accent);
    color: var(--bg-b);
}

.btn-primario:hover {
    transform: translateY(-2px);
}

.btn-secundario {
    border-color: var(--borde);
    color: var(--text-primary);
}

.btn-secundario:hover {
    border-color: var(--accent);
    color: var(--accent);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* ===== Reveal on scroll ===== */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ===== NAVBAR ===== */
.navbar {
    position: fixed;
    top: 0;
    inset-inline: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem clamp(1.2rem, 4vw, 3rem);
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
}

.navbar.scrolled {
    background: rgba(13, 13, 20, 0.75);
    backdrop-filter: blur(10px);
    border-color: var(--borde);
}

.navbar-logo {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
    text-decoration: none;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 2.5vw, 2rem);
    list-style: none;
}

.navbar-links a {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding-bottom: 3px;
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.navbar-links a:hover {
    color: var(--text-primary);
}

.navbar-links a[aria-current="page"] {
    color: var(--accent);
    border-color: var(--accent);
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
}

@media (max-width: 720px) {
    .navbar-toggle {
        display: block;
    }

    .navbar-links {
        position: fixed;
        inset: 0 0 auto 0;
        top: 64px;
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
        background: var(--bg-b);
        border-bottom: 1px solid var(--borde);
        padding: 1.5rem clamp(1.2rem, 4vw, 3rem) 2rem;
        transform: translateY(-130%);
        transition: transform 0.3s ease;
    }

    .navbar-links.abierto {
        transform: translateY(0);
    }
}

/* ===== HERO (home) ===== */
.hero {
    position: relative;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, var(--bg-a) 0%, var(--bg-b) 50%, var(--bg-c) 100%);
    display: flex;
    align-items: center;
}

canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
}

.hero .contenido {
    position: relative;
    z-index: 2;
    width: min(92vw, 760px);
    margin-inline: auto;
    text-align: center;
    pointer-events: none;
    animation: aparecer 1s ease-out 0.3s both;
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 6.5vw, 4.2rem);
    font-weight: 600;
    letter-spacing: -1.5px;
    line-height: 1.08;
    margin-bottom: 1.1rem;
}

.hero .firma {
    font-size: clamp(0.85rem, 2vw, 1rem);
    font-family: var(--font-mono);
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    margin-bottom: 2rem;
}

.hero-cta {
    display: flex;
    justify-content: center;
    gap: 0.9rem;
    margin-bottom: 2.25rem;
    pointer-events: auto;
}

.redes {
    display: flex;
    justify-content: center;
    gap: 0.9rem;
    pointer-events: auto;
}

.redes a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--borde);
    border-radius: 50%;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.redes a svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.redes a:hover,
.redes a:focus-visible {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

@keyframes aparecer {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== HERO de subpáginas (sin partículas, más ligero) ===== */
.pagina-hero {
    position: relative;
    padding: clamp(7rem, 16vw, 10rem) 0 clamp(2.5rem, 6vw, 4rem);
    background: radial-gradient(circle at 15% 0%, var(--bg-a) 0%, var(--bg-b) 55%, var(--bg-c) 100%);
    border-bottom: 1px solid var(--borde);
}

/* ===== SOBRE MÍ ===== */
.sobre-mi-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
}

.avatar-marco {
    aspect-ratio: 1;
    border-radius: 24px;
    border: 1px solid var(--borde);
    background: linear-gradient(160deg, var(--bg-a), var(--bg-c));
    overflow: hidden;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (max-width: 780px) {
    .sobre-mi-grid {
        grid-template-columns: 1fr;
    }

    .avatar-wrap {
        order: -1;
        max-width: 260px;
        margin-inline: auto;
    }
}

/* ===== SERVICIOS ===== */
.grid-servicios {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-top: 2.5rem;
}

.tarjeta-servicio {
    background: var(--superficie);
    border: 1px solid var(--borde);
    border-radius: 16px;
    padding: 1.75rem;
    transition: border-color 0.25s ease, transform 0.25s ease;
}

.tarjeta-servicio:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.icono-servicio {
    width: 28px;
    height: 28px;
    color: var(--accent);
    margin-bottom: 1rem;
}

.tarjeta-servicio h4 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.tarjeta-servicio p {
    color: var(--text-secondary);
    font-size: 0.92rem;
}

@media (max-width: 780px) {
    .grid-servicios {
        grid-template-columns: 1fr;
    }
}

/* ===== PROYECTOS ===== */
.grid-proyectos {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.tarjeta-proyecto {
    border: 1px solid var(--borde);
    border-radius: 16px;
    overflow: hidden;
    background: var(--superficie);
    text-decoration: none;
    color: inherit;
    display: block;
    transition: border-color 0.25s ease, transform 0.25s ease;
}

.tarjeta-proyecto:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

@media (max-width: 780px) {
    .grid-proyectos {
        grid-template-columns: 1fr;
    }
}

/* ===== Comparador antes / después (accesible: input range real) ===== */
.comparador {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: inherit;
    background: var(--superficie-alta);
}

.comparador-img {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-color: #1c1c28;
}

.comparador-antes-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.comparador-antes-wrap .comparador-img {
    width: var(--ancho-comparador, 400px);
}

.comparador-etiqueta {
    position: absolute;
    bottom: 0.75rem;
    left: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.55);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    z-index: 2;
}

.comparador-antes .comparador-etiqueta {
    color: var(--ember);
}

.comparador-despues .comparador-etiqueta {
    color: var(--accent);
    right: 0.75rem;
    left: auto;
}

.comparador-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--ember);
    transform: translateX(-1px);
    pointer-events: none;
    z-index: 3;
}

.comparador-handle-circulo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--ember);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 4px var(--ember-soft);
}

.comparador-handle-circulo svg {
    width: 16px;
    height: 16px;
    stroke: var(--bg-b);
}

.comparador-range {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: ew-resize;
    z-index: 4;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}

.comparador-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 100%;
    height: 100%;
    background: transparent;
}

.comparador-range::-moz-range-thumb {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
}

.comparador-range:focus-visible~.comparador-handle .comparador-handle-circulo {
    box-shadow: 0 0 0 4px var(--ember-soft), 0 0 0 6px var(--accent);
}

.tarjeta-proyecto-info {
    padding: 1.25rem 1.5rem 1.5rem;
}

.tarjeta-proyecto-info h4 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.tarjeta-proyecto-info p {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.proyecto-detalle-comparador {
    margin-top: 2.5rem;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--borde);
}

.proyecto-detalle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2.5rem;
}

.proyecto-detalle-grid h5 {
    font-family: var(--font-display);
    font-size: 1rem;
    margin-bottom: 0.6rem;
}

.proyecto-detalle-grid p {
    color: var(--text-secondary);
    font-size: 0.92rem;
}

@media (max-width: 780px) {
    .proyecto-detalle-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== CONTACTO ===== */
.contacto-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
}

.formulario-contacto {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.campo {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.campo input,
.campo textarea {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--superficie);
    border: 1px solid var(--borde);
    border-radius: 10px;
    padding: 0.7rem 0.9rem;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.campo input:focus,
.campo textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    outline: none;
}

.formulario-contacto button {
    align-self: flex-start;
}

.formulario-estado {
    font-size: 0.85rem;
    color: var(--accent);
    min-height: 1.2em;
}

@media (max-width: 780px) {
    .contacto-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== FOOTER ===== */
.footer {
    border-top: 1px solid var(--borde);
    padding: 2.5rem 0;
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-copy {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* ===== ESTILOS DEL PRELOADER ===== */
body.no-scroll {
    overflow: hidden;
}

.preloader {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background-color: #0a0a0a;
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.typing-container {
    font-family: var(--font-mono);
    font-size: clamp(2.5rem, 5vw, 5rem);
    font-weight: 700;
}

.cursor {
    animation: blink 0.8s infinite;
    color: #00ffcc;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* ===== ESTILOS DEL NUEVO HERO INFORMAL / MASIVO ===== */
.hero-title-massive {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 7vw, 5.5rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0;
}

.btn-primario:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(111, 227, 201, 0.2);
}

@media (max-width: 480px) {
    .hero-ctas {
        flex-direction: column;
    }
}

/* ===== HERO ULTRA MINIMALISTA (ESTILO PATRICK SCOTT) ===== */
.hero-minimal {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    /* svh = altura visible real, evita el salto por la barra del navegador en móvil */
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: linear-gradient(200deg, var(--bg-c) 0%, var(--bg-b) 45%, var(--bg-a) 100%);
}

/* El canvas se queda por detrás de forma absoluta */
#lienzo {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: auto;
    /* Permite que las partículas reaccionen al ratón */
}

/* Contenedor del texto por encima de las partículas */
.contenido-centrado {
    position: relative;
    z-index: 2;
    text-align: center;
    pointer-events: none;
    /* Hace que el ratón "atraviese" el texto y mueva las partículas de fondo */
}

.contenido-centrado::before {
    content: "";
    position: absolute;
    inset: -20% -30%;
    background: radial-gradient(ellipse at center, rgba(13, 13, 20, 0.6) 0%, transparent 70%);
    z-index: -1;
}

.marca-nombre {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    text-transform: lowercase;
    /* Estilo estético totalmente plano en minúsculas */
}

.marca-subtitulo {
    font-family: var(--font-body);
    font-size: clamp(0.8rem, 1.5vw, 0.95rem);
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    margin-bottom: 2.5rem;
}

/* Botones circulares integrados con la estética Tech */
.redes-circulares {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    /* Esto permite que pasen a la línea de abajo en móviles */
    gap: 1.2rem;
    margin-bottom: 0;
    pointer-events: auto;
}

.redes-circulares a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 46px;
    height: 46px;
    background: rgba(255, 255, 255, 0.03);
    /* Fondo casi invisible */
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Borde sutil */
    border-radius: 50%;
    color: var(--text-secondary);
    /* Color grisáceo por defecto */
    text-decoration: none;
    transition: all 0.3s ease;
}

.redes-circulares a svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

/* Efecto Neón al pasar el ratón */
.redes-circulares a:hover,
.redes-circulares a:focus-visible {
    background: rgba(111, 227, 201, 0.1);
    /* Fondo sutil con tu acento */
    border-color: var(--accent);
    /* El cyan que ya usas */
    color: var(--accent);
    /* Icono cyan */
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(111, 227, 201, 0.25);
    /* Resplandor */
}

.redes-circulares a:hover svg {
    transform: scale(1.1);
}

/* Enlace inferior 'about me' */
.navegacion-inferior {
    pointer-events: auto;
}

.enlace-sutil {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.25s ease;
}

.enlace-sutil:hover {
    color: var(--text-primary);
}

/* =========================================
   HERO TIPO EDITOR/TERMINAL
   ========================================= */

.hero-minimal {
    /* Ajustamos el layout para centrar la nueva ventana */
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 4rem;
}

.hero-editor-wrap {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.25rem;
    width: min(92vw, 640px);
}

/* Resplandor ambiental detrás del editor */
.hero-editor-wrap::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140%;
    height: 140%;
    /* Una luz cyan muy suave y difuminada */
    background: radial-gradient(circle, rgba(111, 227, 201, 0.06) 0%, transparent 65%);
    z-index: -1;
    pointer-events: none;
}

/* La ventana del editor */
.editor-ventana {
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(20, 20, 31, 0.75);
    /* Fondo oscuro semitransparente */
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    animation: aparecer 0.8s ease-out both;
}

/* Barra superior estilo macOS */
.editor-barra {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.editor-punto {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: inline-block;
}

.punto-rojo {
    background: #ff5f57;
}

.punto-amarillo {
    background: #febc2e;
}

.punto-verde {
    background: #28c840;
}

.editor-archivo {
    margin-left: 0.6rem;
    /* Usamos tu fuente monoespaciada */
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    color: #a0a0b0;
}

/* Cuerpo donde va el código */
.editor-cuerpo {
    padding: 1.5rem 1.6rem;
    text-align: left;
}

.editor-codigo {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.85rem, 1.8vw, 1rem);
    line-height: 1.7;
    color: #e2e2e8;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 9.5em;
    /* Mantiene la altura fija mientras se escribe el texto */
    margin: 0;
}

/* Cursor parpadeante */
.editor-codigo::after {
    content: "";
    display: inline-block;
    width: 8px;
    height: 1.1em;
    background: #00f0ff;
    /* Color cyan para el cursor (cámbialo si prefieres otro) */
    margin-left: 4px;
    vertical-align: text-bottom;
    animation: blink 0.9s step-end infinite;
}

/* Colores simulando syntax highlighting */
.tok-clave {
    color: #ff7b72;
}

/* Rojo/Naranja para const, let... */
.tok-string {
    color: #a5d6ff;
}

/* Azul claro para textos */
.tok-prop {
    color: #d2a8ff;
}

/* Morado para propiedades */
.tok-bool {
    color: #79c0ff;
}

/* Azul para true/false */

/* Animaciones */
@keyframes aparecer {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* --- Fondo limpio para sustituir al canvas --- */
.hero-minimal {
    /* Un gradiente oscuro y elegante que no consume recursos */
    background: linear-gradient(135deg, #0d0d14 0%, #171721 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 4rem;
}

@media (max-width: 480px) {
    .hero-minimal {
        padding-top: 2.5rem;
        padding-bottom: 2rem;
    }

    .hero-editor-wrap {
        gap: 1.6rem;
    }
}

/* --- Mejoras en la ventana del editor --- */
.editor-ventana {
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(15, 15, 24, 0.85);
    /* Más opaco para mejor contraste */
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

/* Brillo superior tipo reflejo de pantalla */
.editor-ventana::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
}

/* Efecto hover 3D */
.editor-ventana:hover {
    transform: translateY(-4px) rotateX(2deg);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6);
}

/* --- Números de línea y Cursor --- */
.linea {
    display: block;
    padding-left: 2.8em;  /* Empuja todo el texto hacia la derecha */
    text-indent: -2.8em;  /* Tira de
    /* Para que la animación de GSAP funcione bien línea por línea */
}

.linea-num {
    display: inline-block;
    width: 1.6em;
    color: #626270;
    opacity: 0.6;
    user-select: none;
    margin-right: 1.2em;
    text-align: right;
}

.cursor-editor {
    display: inline-block;
    width: 8px;
    height: 1.1em;
    background: #00f0ff;
    margin-left: 4px;
    vertical-align: text-bottom;
    animation: blink 0.9s step-end infinite;
}

/* Quita el after antiguo si aún lo tienes en tu CSS */
.editor-codigo::after {
    display: none;
}

/* --- Botón CTA --- */
.acciones-hero {
    margin-top: 1rem;
}

/* --- Botón CTA estilo Developer --- */
.btn-primario {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    text-decoration: none;
    font-weight: 500;
    border-radius: 6px;
    font-family: var(--font-mono);
    /* Usamos tu fuente de código para que encaje mejor */
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(111, 227, 201, 0.1);
}

.btn-primario:hover {
    background: var(--accent);
    color: var(--bg-b);
    /* Texto oscuro al hacer hover */
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(111, 227, 201, 0.3);
}


/* ===== Botones hero (pill glass) ===== */
.hero-cta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.9rem;
    margin-top: 0.5rem;
    margin-bottom: 2rem;
    pointer-events: auto;
    flex-wrap: wrap;
}

.btn-primario {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.9rem;
    border-radius: 999px;
    background: var(--accent-soft);
    border: 1px solid rgba(111, 227, 201, 0.5);
    color: var(--accent);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.92rem;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 0 18px rgba(111, 227, 201, 0.18);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.btn-primario:hover,
.btn-primario:focus-visible {
    transform: translateY(-3px);
    background: rgba(111, 227, 201, 0.22);
    box-shadow: 0 8px 26px rgba(111, 227, 201, 0.32);
}

.btn-secundario {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.8rem 1.7rem;
    border-radius: 999px;
    background: transparent;
    border: 1px solid var(--borde);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.btn-secundario:hover,
.btn-secundario:focus-visible {
    transform: translateY(-3px);
    border-color: var(--text-primary);
    color: var(--text-primary);
}

/* ===== Tooltips en iconos de redes ===== */
.redes-circulares a {
    position: relative;
}

.redes-circulares a::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translate(-50%, 4px);
    background: var(--superficie-alta);
    border: 1px solid var(--borde);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 5;
}

.redes-circulares a::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--superficie-alta);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 5;
}

@media (max-width: 420px) {
    .redes-circulares {
        gap: 0.8rem;
    }

    .redes-circulares a {
        width: 42px;
        height: 42px;
    }

    /* En pantallas táctiles el tooltip por hover no aplica: lo ocultamos para que no estorbe al dedo */
    .redes-circulares a::after,
    .redes-circulares a::before {
        display: none;
    }
}

.redes-circulares a:hover::after,
.redes-circulares a:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

.redes-circulares a:hover::before,
.redes-circulares a:focus-visible::before {
    opacity: 1;
}

/* ===== Enlace "sobre mí" fusionado ===== */
.enlace-sutil {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.25s ease, gap 0.25s ease;
}

.enlace-sutil svg {
    width: 14px;
    height: 14px;
    transition: transform 0.25s ease;
}

.enlace-sutil:hover,
.enlace-sutil:focus-visible {
    color: var(--accent);
    gap: 0.55rem;
}

.enlace-sutil:hover svg {
    transform: translateY(2px);
}

/* ===== Texto central de hover para iconos ===== */
.tooltip-central {
    height: 1.2em;
    margin: 0.9rem 0 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    color: var(--accent);
    text-align: center;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.tooltip-central.visible {
    opacity: 1;
    transform: translateY(0);
}


/* ===== Página de contacto ===== */
.pantalla-completa {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.contacto-halo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 900px;
    height: 900px;
    background: radial-gradient(circle, rgba(111, 227, 201, 0.07) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}

.btn-volver {
    position: absolute;
    top: 2rem;
    left: clamp(1.2rem, 4vw, 3rem);
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.25s ease, transform 0.25s ease;
}

.btn-volver:hover,
.btn-volver:focus-visible {
    color: var(--accent);
    transform: translateX(-3px);
}

.tarjeta-contacto {
    position: relative;
    z-index: 1;
    background: rgba(20, 20, 31, 0.6);
    border: 1px solid var(--borde);
    border-radius: 20px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: clamp(1.75rem, 4vw, 3rem);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.via-rapida {
    border-top: 1px solid var(--borde);
    padding-top: 1.5rem;
    margin-top: 0.5rem;
}

.via-rapida-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.9rem;
}

.via-rapida-nota {
    margin-top: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.75;
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.6rem;
    border-radius: 999px;
    background: var(--ember-soft);
    border: 1px solid rgba(232, 163, 85, 0.5);
    color: var(--ember);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.btn-whatsapp:hover,
.btn-whatsapp:focus-visible {
    transform: translateY(-3px);
    background: rgba(232, 163, 85, 0.22);
    box-shadow: 0 8px 22px rgba(232, 163, 85, 0.28);
}

.formulario-contacto button[type="submit"] {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.formulario-contacto button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.formulario-estado {
    font-size: 0.85rem;
    min-height: 1.2em;
    margin-top: 0.5rem;
}

.formulario-estado.exito {
    color: var(--accent);
}

.formulario-estado.error {
    color: var(--ember);
}

@media (max-width: 780px) {
    .pantalla-completa {
        padding: 6rem 0 3rem;
    }
}

@media (max-width: 768px) {
    .typing-container {
        /* Reducimos el tamaño de la fuente solo en móviles para que quepa mejor */
        font-size: clamp(1.4rem, 6vw, 2.2rem);

        /* Centramos el texto por si se divide en dos líneas */
        text-align: center;

        /* Aseguramos que ocupe todo el ancho disponible pero con márgenes seguros */
        width: 100%;
        padding: 0 1.5rem;

        /* Ajustamos el interlineado para que quede estético si salta de línea */
        line-height: 1.3;

        /* Previene cualquier desbordamiento (scroll) inesperado en esta caja */
        box-sizing: border-box;
    }
}