/* --- FLUID DESIGN SYSTEM --- */
:root {
    /* Paleta Notion x Brutalism */
    --bg-paper: #F6F5F4;
    --bg-white: #FFFFFF;
    --ink: #191919;
    --accent-yellow: #FFF176; /* Notion Yellow */
    --accent-red: #FF8A80;    /* Notion Red */
    --accent-blue: #82B1FF;   /* Notion Blue */
    --accent-gray: #E0E0E0;
    
    /* Bordes y Sombras */
    --border-thick: clamp(2px, 0.4vw, 4px) solid var(--ink);
    --shadow-hard: clamp(4px, 0.8vw, 8px) clamp(4px, 0.8vw, 8px) 0px var(--ink);
    --shadow-hover: clamp(2px, 0.4vw, 4px) clamp(2px, 0.4vw, 4px) 0px var(--ink);
    
    /* Tipografía Fluida - La magia del Fluid Design */
    /* clamp(minimo, ideal, maximo) */
    --font-mono: 'JetBrains Mono', monospace;
    --font-sans: 'Inter', sans-serif;
    
    --text-display: clamp(2.5rem, 9vw, 6rem); /* Título gigante */
    --text-h2: clamp(1.5rem, 4vw, 3rem);
    --text-h3: clamp(1.1rem, 2.5vw, 1.8rem);
    --text-body: clamp(0.9rem, 1.5vw, 1.15rem);
    
    --space-container: clamp(1rem, 5vw, 5rem);
    --space-block: clamp(1rem, 3vw, 2rem);
}

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

body {
    background-color: var(--bg-paper);
    color: var(--ink);
    font-family: var(--font-sans);
    line-height: 1.5;
    overflow-x: hidden; /* Evitar scroll horizontal */
}

/* Layout Grid Fluido */
.canvas {
    width: 100%;
    min-height: 100vh;
    padding: var(--space-container);
    display: grid;
    /* Grid de 12 columnas que colapsa automáticamente */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-block);
    align-items: start;
}

/* --- COMPONENTES BRUTALISTAS --- */

/* Bloque Base */
.block {
    background: var(--bg-white);
    border: var(--border-thick);
    padding: var(--space-block);
    box-shadow: var(--shadow-hard);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.block:hover {
    transform: translate(2px, 2px);
    box-shadow: var(--shadow-hover);
}

/* Header ocupa todo el ancho si hay espacio */
.header-block {
    grid-column: 1 / -1;
    background-color: var(--ink);
    color: var(--bg-white);
    position: relative;
    overflow: hidden;
}

.title-name {
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: var(--text-display);
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: -0.05em;
    margin-bottom: var(--space-block);
    z-index: 2;
    position: relative;
}

/* Cursor parpadeante - Velocidad ajustada */
.blinking-cursor {
    opacity: 1;
    animation: blink 1.2s infinite; /* Más lento: 1.2s */
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}

.subtitle-role {
    font-family: var(--font-mono);
    font-size: var(--text-h3);
    color: var(--accent-yellow);
    border-top: 1px solid var(--bg-paper);
    padding-top: 1rem;
    display: inline-block;
}

/* Secciones específicas */
.about-section {
    grid-row: span 2; /* Ocupa más altura verticalmente */
}

.stack-section {
    background-color: #fff;
}

.education-section {
    background-color: var(--bg-white);
}

.contact-section {
    grid-column: 1 / -1; /* Ocupa todo el ancho abajo */
    background-color: var(--accent-yellow);
    text-align: center;
    align-items: center;
    justify-content: center;
}

/* Estilos de Texto */
h2 {
    font-family: var(--font-mono);
    font-size: var(--text-h2);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

p {
    font-size: var(--text-body);
    margin-bottom: 1rem;
}

/* Tags Estilo Código */
.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.tag {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: bold;
    padding: 0.4rem 0.8rem;
    border: 2px solid var(--ink);
    background: var(--bg-paper);
    box-shadow: 2px 2px 0px var(--ink);
    transition: 0.2s;
}

.tag:hover {
    background: var(--ink);
    color: var(--bg-white);
    transform: translateY(-2px);
    box-shadow: 4px 4px 0px var(--accent-red);
}

.tag.strong {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
    box-shadow: 2px 2px 0px var(--ink);
}

/* Timeline minimalista */
.timeline-item {
    border-left: 4px solid var(--ink);
    padding-left: 1rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 0;
    width: 16px;
    height: 16px;
    background: var(--ink);
    border-radius: 0; /* Cuadrado brutalista */
}

.date {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    background: var(--ink);
    color: white;
    padding: 2px 6px;
    display: inline-block;
    margin-bottom: 0.5rem;
}

/* Links Sociales */
.social-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 2rem;
}

.btn-brutalist {
    text-decoration: none;
    color: var(--ink);
    font-family: var(--font-mono);
    font-weight: bold;
    font-size: var(--text-body);
    padding: 1rem 2rem;
    background: var(--bg-white);
    border: var(--border-thick);
    box-shadow: var(--shadow-hard);
    display: inline-block;
    transition: 0.1s;
}

.btn-brutalist:hover {
    transform: translate(4px, 4px);
    box-shadow: 0px 0px 0px var(--ink);
    background: var(--bg-white);
}

.btn-primary {
    background: var(--ink);
    color: var(--bg-white);
    border-color: var(--bg-white);
    box-shadow: clamp(4px, 0.8vw, 8px) clamp(4px, 0.8vw, 8px) 0px var(--bg-white);
}
.btn-primary:hover {
     background: var(--accent-red);
     color: var(--ink);
     box-shadow: 0px 0px 0px transparent;
}

/* Marquee Efecto (Animación mejorada) */
.marquee-container {
    position: absolute;
    bottom: 1rem;
    right: 0;
    width: 100%;
    opacity: 0.15; /* Aumentado para que se vea mejor a la derecha */
    font-family: var(--font-mono);
    font-size: 4rem;
    white-space: nowrap;
    overflow: hidden;
    pointer-events: none;
    font-weight: 900;
    display: flex;
    
    /* MÁSCARA: Visible a la derecha, transparente a la izquierda */
    -webkit-mask-image: linear-gradient(to left, black 40%, transparent 100%);
    mask-image: linear-gradient(to left, black 40%, transparent 100%);
}

.marquee-content {
    display: flex;
    animation: scroll 240s linear infinite; /* Velocidad ultra lenta (4 min) */
}

.marquee-item {
    padding-right: 2rem; /* Espacio entre repeticiones */
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* --- LAYOUT PARA PANTALLAS GRANDES (16:9) --- */
@media (min-width: 1024px) {
    .canvas {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "header header"
            "about experience"
            "about stack"
            "education education"
            "contact contact";
    }

    .header-block { grid-area: header; }
    .experience-section { grid-area: experience; }
    .about-section { grid-area: about; grid-row: auto; } /* Reset grid-row */
    .stack-section { grid-area: stack; }
    .education-section { grid-area: education; }
    .contact-section { grid-area: contact; }
}

/* --- BOTÓN VOLVER ARRIBA --- */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
    text-decoration: none;
    color: var(--ink);
    font-family: var(--font-mono);
    font-weight: bold;
    font-size: 1.5rem; /* Más grande para que sea un ícono */
    padding: 0.8rem 1.2rem;
    background: var(--bg-white);
    border: var(--border-thick);
    box-shadow: var(--shadow-hard);
    transition: 0.1s;
    opacity: 0; /* Oculto por defecto */
    visibility: hidden;
    transform: translateY(100px);
    transition: all 0.3s ease;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translate(4px, 4px);
    box-shadow: 0px 0px 0px var(--ink);
}
