@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700;900&display=swap');

:root {
    --primary-color: #0f172a;
    --secondary-color: #38bdf8;
    --bg-gradient-start: #f8fafc;
    --bg-gradient-end: #e2e8f0;
    --card-bg: rgba(255, 255, 255, 0.7);
    --text-color: #1e293b;
    --font-main: 'Outfit', sans-serif;
    --bento-radius: 28px;
    --card-border: rgba(0, 0, 0, 0.05);
}

[data-bs-theme="dark"] {
    --primary-color: #f8fafc;
    --secondary-color: #38bdf8;
    --bg-gradient-start: #0f172a;
    --bg-gradient-end: #1e293b;
    --card-bg: rgba(30, 41, 59, 0.5);
    --text-color: #f8fafc;
    --card-border: rgba(255, 255, 255, 0.1);
}

body {
    font-family: var(--font-main);
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-color);
    transition: background 0.3s ease, color 0.3s ease;
}

/* Theme Toggle fixed */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

/* Bento Grid System */
.bento-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(180px, auto);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.bento-box {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--bento-radius);
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bento-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

/* Grid Spans */
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.row-span-2 { grid-row: span 2; }

/* Responsive Grid */
@media (max-width: 992px) {
    .bento-container {
        grid-template-columns: repeat(2, 1fr);
    }
    .span-2, .span-3, .span-4 { grid-column: span 2; }
    /* Para tablets, la caja de contacto ya no necesita abarcar dos filas porque no está al lado de una caja de texto delgada */
    .row-span-2 { grid-row: span 1; }
    .hero-title {
        font-size: 2.5rem !important;
    }
}

@media (max-width: 576px) {
    .bento-container {
        grid-template-columns: 1fr;
    }
    /* Todas las cajas ocupan 1 columna en móvil y las filas se vuelven automáticas */
    .span-1, .span-2, .span-3, .span-4 { grid-column: span 1; }
    .row-span-2 { grid-row: span 1; padding-top: 2rem; padding-bottom: 2rem;}
}

/* Avatar Styling */
.profile-avatar {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--secondary-color);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* Hero Typography */
.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -1px;
    color: var(--text-color);
}
.hero-title span {
    background: linear-gradient(135deg, var(--secondary-color), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.role-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--secondary-color);
    letter-spacing: 1px;
    text-transform: uppercase;
}
.bio-text {
    font-size: 1.15rem;
    line-height: 1.6;
    opacity: 0.9;
}

/* Social Buttons */
.social-btn {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background-color: var(--card-border);
    color: var(--text-color);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.social-btn:hover {
    background-color: var(--hover-color);
    color: #fff;
    transform: scale(1.1) rotate(5deg);
}

/* Iframe credentials */
.cred-iframe-container {
    width: 100%;
    aspect-ratio: 4 / 3;
    max-height: 500px;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    margin: 0 auto;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.cred-iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Kinetic typography style */
.kinetic-text {
    font-size: 8rem;
    font-weight: 900;
    line-height: 0.8;
    color: var(--text-color);
    opacity: 0.05;
    position: absolute;
    right: -20px;
    bottom: -10px;
    pointer-events: none;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Contact Button */
.contact-btn {
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: transform 0.2s;
}
.contact-btn:hover {
    transform: translateY(-2px);
}

/* Entrance Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}
.bento-box {
    opacity: 0;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.bento-box:nth-child(1) { animation-delay: 0.1s; }
.bento-box:nth-child(2) { animation-delay: 0.2s; }
.bento-box:nth-child(3) { animation-delay: 0.3s; }
.bento-box:nth-child(4) { animation-delay: 0.4s; }
.bento-box:nth-child(5) { animation-delay: 0.5s; }
.bento-box:nth-child(6) { animation-delay: 0.6s; }