/* =========================================================
   Portfolio Roman Ruiz — Bulma Overrides Minimalista
   Sin gradientes / Sin emojis / Estilo plano y limpio
   ========================================================= */

:root {
    /* Paleta inspirada en colores de la foto de perfil
       Fondo cálido beige, camisa azul, piedra oscura, madera marrón */
    --brand-primary: #1c1a17;       /* piedra oscura cálida (pared + reloj) */
    --brand-primary-dark: #0f0e0c;  /* oscuro más profundo */
    --brand-accent: #4a7aad;        /* azul camisa de cuadros */
    --brand-accent-warm: #a0764e;   /* marrón cálido madera (acento 2) */

    /* Fondo único cálido sin separaciones (beige de mármol + blanco camisa) */
    --color-bg: #f6f2ec;
    --color-bg-alt: #f6f2ec;
    --color-bg-elevated: #f6f2ec;
    --color-bg-dark-solid: #f6f2ec;

    --color-text: #1c1a17;
    --color-text-muted: #5e574f;
    --color-text-subtle: #9a9186;
    --color-border: #e5ddd0;

    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    --shadow-soft: 0 1px 3px rgba(17, 24, 39, 0.04),
                   0 1px 2px rgba(17, 24, 39, 0.03);
    --shadow-md: 0 4px 12px rgba(17, 24, 39, 0.06),
                 0 2px 4px rgba(17, 24, 39, 0.04);
    --shadow-lg: 0 10px 25px -5px rgba(17, 24, 39, 0.08),
                 0 4px 10px -6px rgba(17, 24, 39, 0.05);

    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: rgba(37, 99, 235, 0.15);
    color: var(--color-text);
}

img, svg {
    max-width: 100%;
    height: auto;
}

/* ======== ACCESIBILIDAD ======== */
.skip-link {
    position: fixed;
    top: -100%;
    left: 1rem;
    z-index: 9999;
    padding: 0.6rem 1rem;
    background: var(--brand-primary);
    color: #fff !important;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: top 200ms ease;
}
.skip-link:focus {
    top: 1rem;
    outline: none;
}
:focus-visible {
    outline: 2px solid var(--brand-accent);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* ======== HERO ======== */
.hero--portfolio {
    position: relative;
    background: var(--color-bg);
    border-bottom: none;
}

.profile-wrapper {
    gap: 3rem !important;
    position: relative;
    z-index: 1;
}

/* Avatar */
.profile-avatar {
    position: relative;
    width: clamp(9rem, 20vw, 14rem);
    height: clamp(9rem, 20vw, 14rem);
    border-radius: 50%;
    background: var(--color-bg-elevated);
    padding: 0.4rem;
    border: 2px solid var(--color-border);
    box-shadow: var(--shadow-md);
}
.profile-avatar-svg,
.profile-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    color: var(--color-text-subtle);
}

/* Perfil texto */
.profile-info { max-width: 32rem; }

.profile-greeting {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--brand-accent);
    margin-bottom: 0.4rem !important;
}

.profile-subtitle {
    font-size: 0.75rem;
    color: var(--color-text-subtle);
    letter-spacing: 0.15em;
    margin-bottom: 0.4rem !important;
}

.profile-name {
    font-size: clamp(2.25rem, 6vw, 3.75rem) !important;
    font-weight: 800 !important;
    line-height: 1.1 !important;
    color: var(--color-text) !important;
    margin-bottom: 1.5rem !important;
    position: relative;
    display: inline-block;
}

.cursor-blink {
    display: inline-block;
    width: 4px;
    height: 0.85em;
    background: var(--brand-accent);
    margin-left: 0.2rem;
    border-radius: 2px;
    animation: cursorBlink 1s steps(1) infinite;
    vertical-align: -0.1em;
}
@keyframes cursorBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Social buttons */
.social-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}
.social-btn {
    width: 2.6rem;
    height: 2.6rem;
    border: 1.5px solid var(--color-border) !important;
    background: #fff !important;
    color: var(--color-text-muted) !important;
    border-radius: 50% !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all var(--transition-fast) !important;
    box-shadow: var(--shadow-soft);
}
.social-btn .icon {
    width: 0.95rem;
    height: 0.95rem;
    font-size: 0.95rem;
    margin: 0 !important;
}
.social-btn:hover {
    transform: translateY(-2px);
    background: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    color: #fff !important;
    box-shadow: var(--shadow-md);
}

/* ======== SECCIONES ======== */
.section {
    position: relative;
    padding: 3rem 1.5rem !important;
    background: var(--color-bg);
}
.section--welcome { padding-top: 2.25rem !important; }
.section--contact { padding-bottom: 3.75rem !important; }

.tech-block-spacer { margin-top: 2rem !important; margin-bottom: 1.25rem !important; }

.section-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.75rem;
}
.section-title {
    font-weight: 800 !important;
    line-height: 1.2 !important;
    margin-bottom: 0.5rem !important;
    position: relative;
}
.section-title::after {
    content: '';
    display: block;
    width: 3.5rem;
    height: 3px;
    margin: 0.85rem auto 0;
    background: var(--brand-accent);
    border-radius: 3px;
}
.section-subtitle {
    color: var(--color-text-muted) !important;
    font-weight: 400 !important;
    max-width: 40rem;
    margin: 0 auto 0.75rem !important;
}
.section-sub-heading {
    font-size: 1.05rem !important;
    font-weight: 600 !important;
    color: var(--color-text) !important;
    margin-bottom: 0 !important;
}

/* ======== TECH GRID (Lenguajes + Herramientas + Librerías) ======== */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
    max-width: 62rem;
    margin: 0 auto;
}
.tech-grid--5 { grid-template-columns: repeat(2, 1fr); }
.tech-card { display: block; }

.tech-card-inner {
    background: var(--color-bg-elevated);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1rem 0.6rem 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    height: 100%;
    box-shadow: var(--shadow-soft);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    text-align: center;
}
.tech-card-inner .icon.is-large {
    font-size: 1.1rem;
    margin-bottom: 0.1rem;
}
.tech-card-inner .icon.is-large i.fa-3x {
    font-size: 2.4rem;
}
.tech-card-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--brand-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-base);
}
.tech-card:hover .tech-card-inner {
    transform: translateY(-3px);
    border-color: var(--brand-accent);
    box-shadow: var(--shadow-md);
}
.tech-card:hover .tech-card-inner::before {
    transform: scaleX(1);
}

.tech-icon--python { color: #3776ab; }
.tech-icon--html   { color: #e34f26; }
.tech-icon--react  { color: #0ea5e9; }
.tech-icon--git    { color: #f05032; }
.tech-icon--vscode { color: #007acc; }
.tech-icon--node   { color: #10b981; }
.tech-icon--sql    { color: #336791; }
.tech-icon--shell  { color: #5e574f; }
.tech-icon--express{ color: #1c1a17; }
.tech-icon--cf     { color: #f38020; }
.tech-icon--pyhttp { color: #6b7280; }
.tech-icon--bulma  { color: #00d1b2; }
.tech-icon--leaflet{ color: #199900; }
.tech-icon--pvlib  { color: #eab308; }
.tech-icon--pandas { color: #7a378b; }
.tech-icon--ai     { color: #8b5cf6; }
.tech-icon--ocr    { color: #0d9488; }
.tech-icon--pdf    { color: #dc2626; }
.tech-icon--img    { color: #ca8a04; }
.tech-icon--ffox   { color: #ff7139; }
.tech-icon--docker { color: #2496ed; }
.tech-icon--pg     { color: #336791; }
.tech-icon--nginx  { color: #009639; }
.tech-icon--waf    { color: #f59e0b; }
.tech-icon--dns    { color: #6366f1; }
.tech-icon--nasa   { color: #1d4ed8; }
.tech-icon--osm    { color: #7eae4a; }
.tech-icon--cdn    { color: #0ea5e9; }

.tech-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 !important;
    letter-spacing: -0.01em;
}
.tech-detail {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--color-text-subtle);
    margin: 0 !important;
    line-height: 1.3;
}
.tech-card:hover .tech-name { color: var(--brand-accent); }

@media (min-width: 40rem) {
    .tech-grid        { grid-template-columns: repeat(3, 1fr); }
    .tech-grid--5     { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 64rem) {
    .tech-grid        { grid-template-columns: repeat(4, 1fr); }
    .tech-grid--5     { grid-template-columns: repeat(5, 1fr); }
}

/* ======== PROJECT CARDS ======== */
.project-card {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg) !important;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: all var(--transition-base);
    height: 100%;
    display: flex;
    flex-direction: column;
}
.project-card:hover {
    transform: translateY(-6px);
    border-color: var(--brand-accent);
    box-shadow: var(--shadow-lg);
}

.project-card-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: var(--color-bg-alt);
}
.project-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    color: var(--color-text-subtle);
    transition: transform var(--transition-base);
}
.project-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-base);
}
.project-card:hover .project-placeholder,
.project-card:hover .project-card-image img {
    transform: scale(1.05);
}

/* Overlay de proyecto — BOTÓN CENTRADO */
.project-overlay {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.72);
    display: flex;
    align-items: center;          /* CENTRADO vertical */
    justify-content: center;    /* CENTRADO horizontal */
    padding: 1rem;
    opacity: 0;
    transition: opacity var(--transition-base);
}
.project-card:hover .project-overlay { opacity: 1; }

.project-overlay .button.is-primary.is-outlined {
    border-color: #fff !important;
    color: #fff !important;
    border-width: 2px;
    font-weight: 600;
    border-radius: var(--radius-full) !important;
}
.project-overlay .button.is-primary.is-outlined:hover {
    background: #fff !important;
    color: var(--brand-primary) !important;
    transform: scale(1.04);
}

.project-card-content {
    padding: 1.25rem !important;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.15rem;
}
.project-tags .tag {
    background: var(--color-bg-alt) !important;
    color: var(--brand-accent) !important;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    padding: 0.2rem 0.6rem !important;
    border: 1px solid var(--color-border);
}

.project-title {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
    color: var(--color-text);
    transition: color var(--transition-fast);
}
.project-card:hover .project-title { color: var(--brand-accent); }

.project-desc {
    font-size: 0.88rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin: 0;
}

/* ======== CTA CONTACTO — MISMO FONDO SIN SEPARACION ======== */
.cta-box {
    background: var(--color-bg);
    padding: 2.25rem 1.5rem;
    border-radius: var(--radius-xl);
    color: var(--color-text);
    position: relative;
    overflow: hidden;
    border: 1.5px solid var(--color-border);
    box-shadow: var(--shadow-md);
}

.cta-box > * { position: relative; z-index: 1; }

.cta-box .section-title {
    color: var(--color-text) !important;
    margin-bottom: 0.6rem !important;
}
.cta-box .section-title::after {
    background: var(--brand-accent);
}

.cta-subtitle {
    color: var(--color-text-muted) !important;
    font-weight: 400 !important;
    max-width: 36rem;
    margin: 0 auto 1.25rem !important;
}

.cta-box .buttons .button {
    min-width: 11rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    border-radius: var(--radius-full) !important;
    padding: 0.7rem 1.5rem !important;
}

.cta-box .button.is-primary {
    background: var(--brand-primary) !important;
    color: #fff !important;
    border: 1.5px solid var(--brand-primary) !important;
    box-shadow: var(--shadow-soft);
}
.cta-box .button.is-primary:hover {
    background: var(--brand-primary-dark) !important;
    border-color: var(--brand-primary-dark) !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.cta-box .button.is-light {
    background: #fff !important;
    color: var(--brand-primary) !important;
    border: 1.5px solid var(--color-border) !important;
}
.cta-box .button.is-light:hover {
    background: var(--color-bg-alt) !important;
    border-color: var(--brand-primary) !important;
    color: var(--brand-primary) !important;
    transform: translateY(-2px);
}

/* ======== FOOTER — INTEGRADO SIN CONTRASTE ======== */
.footer--portfolio {
    background: var(--color-bg);
    color: var(--color-text-muted);
    padding: 2.25rem 1.5rem 2rem !important;
    border-top: 1px solid var(--color-border);
}

.footer-copy {
    color: var(--color-text-muted) !important;
    font-size: 0.85rem;
    margin: 0 !important;
}

.footer-socials {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}
.footer-socials a {
    width: 2.1rem;
    height: 2.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--color-text-muted);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    transition: all var(--transition-fast);
    font-size: 0.85rem;
}
.footer-socials a:hover {
    color: #fff;
    background: var(--brand-accent);
    border-color: var(--brand-accent);
    transform: translateY(-2px);
}

/* ======== MODO OSCURO (prefers-color-scheme) ======== */
@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #12110f;
        --color-bg-alt: #12110f;
        --color-bg-elevated: #12110f;
        --color-bg-dark-solid: #12110f;

        --color-text: #efe9df;
        --color-text-muted: #b5ac9e;
        --color-text-subtle: #797063;
        --color-border: #282521;

        --brand-primary: #efe9df;
        --brand-primary-dark: #f8f4ec;
        --brand-accent: #6e9bcd;
    }

    .profile-avatar {
        background: var(--color-bg);
    }

    .social-btn {
        background: var(--color-bg) !important;
        border-color: var(--color-border) !important;
    }

    .cta-box {
        background: var(--color-bg);
        border: 1.5px solid var(--color-border);
    }

    .footer--portfolio {
        background: var(--color-bg);
    }
}

/* ======== REDUCED MOTION ======== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ======== RESPONSIVE FINO ======== */
@media (max-width: 48rem) {
    .section { padding: 2.25rem 1rem !important; }
    .cta-box { padding: 1.75rem 1.1rem; }
}

/* ======== OVERRIDES BULMA ======== */
.title:not(.is-spaced) + .subtitle { margin-top: 0 !important; }
.section > .columns,
.hero-body > .container > .columns { padding: 0; margin: 0; }
.columns:last-child { margin-bottom: 0 !important; }
.column {
    display: block;
    flex-basis: 0;
    flex-grow: 1;
    flex-shrink: 1;
    padding: 0.75rem;
}

@media (max-width: 1023px) {
    /* Mobile overrides */
}
