/* ==========================================================================
   Portafolio Marcelo Bonilla — estilos del sitio público
   Bootstrap 5.3 + tokens propios (claro / oscuro)
   ========================================================================== */

:root,
[data-bs-theme="light"] {
    --mb-primary: #1e4065;
    --mb-primary-2: #2b5b8f;
    --mb-accent: #0ea5e9;
    --mb-accent-2: #22d3ee;
    --mb-bg: #f6f8fb;
    --mb-surface: #ffffff;
    --mb-surface-2: #eef3f9;
    --mb-text: #0f1b2d;
    --mb-muted: #536378;
    --mb-border: rgba(15, 27, 45, .09);
    --mb-heading: #0b1a2e;
    --mb-link: #1e4065;
    --mb-shadow: 0 1px 2px rgba(15, 27, 45, .04), 0 8px 24px -6px rgba(15, 27, 45, .10);
    --mb-shadow-lg: 0 24px 48px -12px rgba(15, 27, 45, .22);
    --mb-nav-bg: rgba(255, 255, 255, .78);
    --mb-grad: linear-gradient(135deg, #1e4065 0%, #2b5b8f 45%, #0ea5e9 100%);
    --mb-text-grad: linear-gradient(120deg, #1e4065 10%, #0ea5e9 90%);
    --mb-radius: 18px;
    --mb-radius-sm: 12px;

    --bs-body-bg: var(--mb-bg);
    --bs-body-color: var(--mb-text);
    --bs-secondary-color: var(--mb-muted);
    --bs-border-color: var(--mb-border);
    --bs-link-color-rgb: 30, 64, 101;
    --bs-link-hover-color-rgb: 14, 165, 233;
    --bs-primary: #1e4065;
    --bs-primary-rgb: 30, 64, 101;
    --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

[data-bs-theme="dark"] {
    --mb-primary: #7fb2ec;
    --mb-primary-2: #5b95d6;
    --mb-accent: #38bdf8;
    --mb-accent-2: #67e8f9;
    --mb-bg: #070d1a;
    --mb-surface: #0e1729;
    --mb-surface-2: #111d33;
    --mb-text: #dbe4f0;
    --mb-muted: #93a3b8;
    --mb-border: rgba(255, 255, 255, .08);
    --mb-heading: #f1f5fb;
    --mb-link: #8cc4ff;
    --mb-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -6px rgba(0, 0, 0, .45);
    --mb-shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, .6);
    --mb-nav-bg: rgba(7, 13, 26, .78);
    --mb-grad: linear-gradient(135deg, #1e4065 0%, #25649f 50%, #0ea5e9 100%);
    --mb-text-grad: linear-gradient(120deg, #8cc4ff 10%, #67e8f9 90%);

    --bs-body-bg: var(--mb-bg);
    --bs-body-color: var(--mb-text);
    --bs-secondary-color: var(--mb-muted);
    --bs-border-color: var(--mb-border);
    --bs-link-color-rgb: 140, 196, 255;
    --bs-link-hover-color-rgb: 103, 232, 249;
    --bs-tertiary-bg: var(--mb-surface-2);
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { background: var(--mb-bg); color: var(--mb-text); overflow-x: hidden; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, .section-title, .hero-title { font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; color: var(--mb-heading); letter-spacing: -.02em; }
a { color: var(--mb-link); text-underline-offset: 3px; }
::selection { background: rgba(14, 165, 233, .25); }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--mb-accent); outline-offset: 3px; border-radius: 6px; }

.skip-link { position: fixed; top: -60px; left: 16px; z-index: 2000; background: var(--mb-primary); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; transition: top .2s; }
.skip-link:focus { top: 12px; color: #fff; }

.scroll-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 1100; pointer-events: none; }
.scroll-progress span { display: block; height: 100%; width: 100%; transform-origin: left; transform: scaleX(0); background: var(--mb-grad); }

.hero-name { color: var(--mb-primary); }
.text-gradient { background: var(--mb-text-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Botones ---------- */
.btn { font-weight: 600; border-radius: 12px; padding: .7rem 1.35rem; transition: transform .2s ease, box-shadow .2s ease, background-color .2s, color .2s, border-color .2s; }
.btn-lg { padding: .9rem 1.6rem; font-size: 1rem; }
.btn-sm { padding: .45rem .9rem; border-radius: 10px; }
.btn-brand { background: var(--mb-grad); background-size: 150% 150%; border: 0; color: #fff; box-shadow: 0 10px 24px -10px rgba(30, 64, 101, .7); }
.btn-brand:hover, .btn-brand:focus-visible { color: #fff; transform: translateY(-2px); background-position: 100% 0; box-shadow: 0 14px 28px -10px rgba(14, 165, 233, .6); }
.btn-brand:active { transform: translateY(0); }
.btn-ghost { background: transparent; border: 1.5px solid var(--mb-border); color: var(--mb-heading); }
.btn-ghost:hover { border-color: var(--mb-accent); color: var(--mb-accent); background: rgba(14, 165, 233, .06); transform: translateY(-2px); }
.btn-icon { width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 12px; border: 1px solid var(--mb-border); background: var(--mb-surface); color: var(--mb-heading); padding: 0; }
.btn-icon:hover { color: var(--mb-accent); border-color: var(--mb-accent); }

.theme-toggle .theme-icon-light { display: none; }
[data-bs-theme="dark"] .theme-toggle .theme-icon-light { display: inline; }
[data-bs-theme="dark"] .theme-toggle .theme-icon-dark { display: none; }

/* ---------- Navbar ---------- */
.site-nav { padding: .9rem 0; transition: padding .25s, background-color .25s, box-shadow .25s, border-color .25s; border-bottom: 1px solid transparent; }
.site-nav.is-scrolled { padding: .55rem 0; background: var(--mb-nav-bg); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); border-bottom-color: var(--mb-border); box-shadow: 0 6px 20px -12px rgba(15, 27, 45, .25); }
.brand-logo { height: 46px; width: auto; transition: height .25s; }
.is-scrolled .brand-logo { height: 40px; }
[data-bs-theme="dark"] .brand-logo, [data-bs-theme="dark"] .footer-logo { filter: brightness(0) invert(1); }
.site-nav .nav-link { font-weight: 600; font-size: .95rem; color: var(--mb-muted); padding: .5rem .85rem !important; border-radius: 10px; position: relative; }
.site-nav .nav-link:hover, .site-nav .nav-link.active { color: var(--mb-heading); }
.site-nav .nav-link.active::after { content: ''; position: absolute; left: .85rem; right: .85rem; bottom: .2rem; height: 2px; border-radius: 2px; background: var(--mb-grad); }
.toggler-bars { display: inline-flex; flex-direction: column; gap: 5px; width: 24px; }
.toggler-bars span { height: 2px; border-radius: 2px; background: var(--mb-heading); transition: transform .25s, opacity .25s; }
.navbar-toggler[aria-expanded="true"] .toggler-bars span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar-toggler[aria-expanded="true"] .toggler-bars span:nth-child(2) { opacity: 0; }
.navbar-toggler[aria-expanded="true"] .toggler-bars span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 991.98px) {
    .site-nav .navbar-collapse { background: var(--mb-surface); border: 1px solid var(--mb-border); border-radius: var(--mb-radius); margin-top: .75rem; padding: .5rem; box-shadow: var(--mb-shadow-lg); }
    .site-nav .nav-link { padding: .75rem 1rem !important; }
    .site-nav .nav-link.active::after { display: none; }
    .site-nav .nav-link.active { background: var(--mb-surface-2); }
    .site-nav:not(.is-scrolled):has(.show) { background: var(--mb-nav-bg); backdrop-filter: blur(14px); }
}

/* ---------- Secciones ---------- */
.section { padding: 110px 0; position: relative; }
.section-alt { background: var(--mb-surface-2); }
[data-bs-theme="dark"] .section-alt { background: #0a1224; }
.section-head { margin-bottom: 3.25rem; }
.section-title { font-size: clamp(1.9rem, 1.2rem + 2.2vw, 2.8rem); font-weight: 800; margin-bottom: 1rem; line-height: 1.15; }
.section-sub { color: var(--mb-muted); max-width: 640px; margin: 0 auto; font-size: 1.075rem; }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--mb-accent); margin-bottom: .85rem; }
.eyebrow::before { content: ''; width: 22px; height: 2px; border-radius: 2px; background: currentColor; }
.eyebrow-light { color: var(--mb-accent-2); }
.lead-text { font-size: 1.125rem; line-height: 1.75; color: var(--mb-text); }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100vh; padding: 140px 0 70px; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; }
.blob-1 { width: 520px; height: 520px; background: radial-gradient(circle, rgba(14, 165, 233, .45), transparent 70%); top: -120px; right: -80px; animation: float 16s ease-in-out infinite; }
.blob-2 { width: 460px; height: 460px; background: radial-gradient(circle, rgba(30, 64, 101, .4), transparent 70%); bottom: -160px; left: -120px; animation: float 20s ease-in-out infinite reverse; }
[data-bs-theme="dark"] .blob { opacity: .4; }
.grid-pattern { position: absolute; inset: 0; background-image: linear-gradient(var(--mb-border) 1px, transparent 1px), linear-gradient(90deg, var(--mb-border) 1px, transparent 1px); background-size: 48px 48px; mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%); opacity: .7; }
@keyframes float { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-30px, 40px); } }

.availability { display: inline-flex; align-items: center; gap: .6rem; padding: .45rem 1rem .45rem .8rem; border-radius: 999px; background: var(--mb-surface); border: 1px solid var(--mb-border); box-shadow: var(--mb-shadow); font-size: .875rem; font-weight: 600; color: var(--mb-heading); margin-bottom: 1.5rem; }
.pulse-dot { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); } 70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }

.hero-title { font-size: clamp(2.4rem, 1.4rem + 4vw, 4.4rem); font-weight: 800; line-height: 1.05; margin-bottom: 1rem; }
.hero-role { font-size: clamp(1.15rem, 1rem + .6vw, 1.5rem); font-weight: 600; color: var(--mb-muted); margin-bottom: 1.25rem; min-height: 2.2em; }
.rotator { color: var(--mb-heading); position: relative; white-space: nowrap; }
.rotator::after { content: ''; display: inline-block; width: 2px; height: 1.1em; margin-left: 3px; vertical-align: -.15em; background: var(--mb-accent); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.hero-lead { font-size: 1.15rem; line-height: 1.7; color: var(--mb-muted); max-width: 560px; margin-bottom: 2rem; }

.hero-visual { position: relative; max-width: 560px; margin: 0 auto; aspect-ratio: 1 / .92; display: flex; align-items: flex-end; justify-content: center; }
.hero-ring { position: absolute; inset: 6% 8% 0; border-radius: 42% 58% 55% 45% / 50% 45% 55% 50%; background: var(--mb-grad); box-shadow: var(--mb-shadow-lg); animation: morph 14s ease-in-out infinite; }
.hero-ring::after { content: ''; position: absolute; inset: -14px; border-radius: inherit; border: 2px dashed rgba(14, 165, 233, .35); }
@keyframes morph { 0%, 100% { border-radius: 42% 58% 55% 45% / 50% 45% 55% 50%; } 50% { border-radius: 55% 45% 40% 60% / 45% 58% 42% 55%; } }
.hero-photo { position: relative; width: 118%; max-width: none; height: auto; object-fit: contain; margin-bottom: -2px; filter: drop-shadow(0 20px 30px rgba(15, 27, 45, .25)); -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent 100%); mask-image: linear-gradient(to bottom, #000 82%, transparent 100%); }
.float-card { position: absolute; display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; border-radius: 16px; background: color-mix(in srgb, var(--mb-surface) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--mb-border); box-shadow: var(--mb-shadow-lg); max-width: 250px; animation: bob 6s ease-in-out infinite; z-index: 2; }
.float-card strong { display: block; font-size: .85rem; color: var(--mb-heading); line-height: 1.3; }
.float-card small { display: block; font-size: .75rem; color: var(--mb-muted); }
.float-icon { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.05rem; }
.icon-accent { background: rgba(14, 165, 233, .12); color: var(--mb-accent); }
.float-card-1 { top: 16%; left: -4%; }
.float-card-2 { bottom: 12%; right: -4%; animation-delay: -3s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.stats-band { margin-top: 4rem; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--mb-surface); border: 1px solid var(--mb-border); border-radius: var(--mb-radius); box-shadow: var(--mb-shadow); overflow: hidden; }
.stat { padding: 1.6rem 1.25rem; text-align: center; position: relative; }
.stat + .stat::before { content: ''; position: absolute; left: 0; top: 25%; bottom: 25%; width: 1px; background: var(--mb-border); }
.stat-value { display: block; font-family: 'Plus Jakarta Sans', sans-serif; font-size: clamp(1.8rem, 1.3rem + 1.4vw, 2.5rem); font-weight: 800; line-height: 1; background: var(--mb-text-grad); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: .45rem; }
.stat-label { font-size: .875rem; color: var(--mb-muted); font-weight: 500; }

.scroll-cue { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); width: 26px; height: 42px; border: 2px solid var(--mb-border); border-radius: 14px; display: none; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--mb-accent); animation: scrollcue 1.8s infinite; }
@keyframes scrollcue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 80% { opacity: 0; transform: translateY(12px); } 100% { opacity: 0; } }
@media (min-width: 992px) and (min-height: 820px) { .scroll-cue { display: block; } }

/* ---------- Redes ---------- */
.social-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.social-btn { width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 12px; background: var(--mb-surface); border: 1px solid var(--mb-border); color: var(--mb-heading); text-decoration: none; transition: transform .2s, background-color .2s, color .2s, border-color .2s; }
.social-btn:hover { transform: translateY(-3px); background: var(--mb-primary); border-color: var(--mb-primary); color: #fff; }
[data-bs-theme="dark"] .social-btn:hover { background: var(--mb-accent); border-color: var(--mb-accent); color: #04121f; }
.social-btn-sm { width: 36px; height: 36px; border-radius: 10px; font-size: .9rem; }
.social-row-light .social-btn { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .14); color: #fff; }
.social-row-light .social-btn:hover { background: #fff; color: #1e4065; }

/* ---------- Sobre mí ---------- */
.about-media { position: relative; border-radius: 28px; overflow: visible; }
.about-media img { width: 100%; aspect-ratio: 4 / 4.4; object-fit: cover; object-position: 58% 30%; border-radius: 28px; box-shadow: var(--mb-shadow-lg); }
.about-media::before { content: ''; position: absolute; inset: 18px -18px -18px 18px; border-radius: 28px; border: 2px solid var(--mb-accent); opacity: .35; z-index: -1; }
.about-badge { position: absolute; left: -16px; bottom: 28px; background: var(--mb-surface); border: 1px solid var(--mb-border); border-radius: 16px; padding: 1rem 1.2rem; box-shadow: var(--mb-shadow-lg); max-width: 270px; }
.about-badge small { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--mb-accent); margin-bottom: .2rem; }
.about-badge strong { display: block; color: var(--mb-heading); font-size: .95rem; line-height: 1.3; }
.about-badge span { font-size: .85rem; color: var(--mb-muted); }
@media (max-width: 575.98px) { .about-badge { left: 12px; right: 12px; bottom: 12px; max-width: none; } .about-media::before { display: none; } }

.info-list { list-style: none; padding: 0; margin: 1.75rem 0 2rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.info-list li { display: flex; gap: .85rem; align-items: flex-start; }
.info-list i { flex: 0 0 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--mb-surface-2); color: var(--mb-primary); }
.info-list span { font-weight: 600; color: var(--mb-heading); font-size: .95rem; word-break: break-word; }
.info-list small { display: block; font-weight: 500; font-size: .78rem; color: var(--mb-muted); }
.info-list a { color: inherit; text-decoration: none; }
.info-list a:hover { color: var(--mb-accent); }

.skills-grid { margin-top: 5rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; }
.skill-card { background: var(--mb-surface); border: 1px solid var(--mb-border); border-radius: var(--mb-radius); padding: 1.6rem; box-shadow: var(--mb-shadow); transition: transform .25s, box-shadow .25s, border-color .25s; }
.skill-card:hover { transform: translateY(-6px); box-shadow: var(--mb-shadow-lg); border-color: rgba(14, 165, 233, .35); }
.skill-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 14px; background: var(--mb-grad); color: #fff; font-size: 1.25rem; margin-bottom: 1.1rem; box-shadow: 0 10px 20px -8px rgba(14, 165, 233, .6); }
.skill-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: .9rem; }

.chip-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { display: inline-flex; align-items: center; padding: .3rem .7rem; font-size: .8rem; font-weight: 600; border-radius: 999px; background: var(--mb-surface-2); color: var(--mb-primary); border: 1px solid var(--mb-border); line-height: 1.3; }
.chip-sm { font-size: .72rem; padding: .22rem .6rem; }

/* ---------- Trayectoria ---------- */
.resume-tabs { gap: .5rem; margin-bottom: 3rem; background: var(--mb-surface); border: 1px solid var(--mb-border); border-radius: 16px; padding: .4rem; width: fit-content; margin-inline: auto; box-shadow: var(--mb-shadow); flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.resume-tabs .nav-link { border-radius: 12px; font-weight: 600; color: var(--mb-muted); padding: .65rem 1.2rem; white-space: nowrap; border: 0; background: transparent; }
.resume-tabs .nav-link:hover { color: var(--mb-heading); }
.resume-tabs .nav-link.active { background: var(--mb-grad); color: #fff; box-shadow: 0 8px 18px -8px rgba(14, 165, 233, .7); }

.timeline { list-style: none; padding: 0; margin: 0 auto; max-width: 900px; position: relative; }
.timeline::before { content: ''; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(to bottom, var(--mb-accent), var(--mb-border) 60%); }
.timeline-item { position: relative; padding-left: 46px; margin-bottom: 1.25rem; }
.timeline-dot { position: absolute; left: 3px; top: 26px; width: 18px; height: 18px; border-radius: 50%; background: var(--mb-surface); border: 3px solid var(--mb-primary-2); }
.is-current .timeline-dot { border-color: var(--mb-accent); box-shadow: 0 0 0 6px rgba(14, 165, 233, .18); }
.timeline-card { background: var(--mb-surface); border: 1px solid var(--mb-border); border-radius: var(--mb-radius); padding: 1.4rem 1.6rem; box-shadow: var(--mb-shadow); transition: border-color .25s, transform .25s; }
.timeline-card:hover { border-color: rgba(14, 165, 233, .4); transform: translateX(4px); }
.timeline-title { font-size: 1.12rem; font-weight: 700; margin: 0 0 .25rem; }
.timeline-org { margin: 0; font-weight: 600; color: var(--mb-accent); font-size: .92rem; }
.timeline-desc { margin: .5rem 0 0; color: var(--mb-muted); line-height: 1.7; font-size: .96rem; }
.timeline-continued::before { top: -1.25rem; background: var(--mb-border); }
.timeline-more.collapsing { transition: height .5s cubic-bezier(.2, .7, .2, 1); }
.timeline-toggle .when-expanded, .timeline-toggle[aria-expanded="true"] .when-collapsed { display: none; }
.timeline-toggle[aria-expanded="true"] .when-expanded { display: inline; }
.timeline-toggle i { transition: transform .3s ease; }
.timeline-toggle[aria-expanded="true"] i { transform: rotate(180deg); }
.period-badge { display: inline-block; font-size: .78rem; font-weight: 700; padding: .35rem .75rem; border-radius: 999px; background: var(--mb-surface-2); color: var(--mb-primary); border: 1px solid var(--mb-border); white-space: nowrap; }

.edu-card, .cert-card { background: var(--mb-surface); border: 1px solid var(--mb-border); border-radius: var(--mb-radius); padding: 1.5rem; box-shadow: var(--mb-shadow); transition: transform .25s, border-color .25s; }
.edu-card:hover, .cert-card:hover { transform: translateY(-4px); border-color: rgba(14, 165, 233, .4); }
.edu-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: .6rem; }
.cert-card { display: flex; gap: .9rem; align-items: flex-start; padding: 1.2rem; }
.cert-card > i { color: var(--mb-accent); font-size: 1.35rem; margin-top: .1rem; }
.cert-card h3 { font-size: .95rem; font-weight: 700; margin: 0 0 .2rem; font-family: 'Inter', sans-serif; letter-spacing: 0; }
.cert-card small { color: var(--mb-muted); font-size: .8rem; }

.achievements { margin-top: 5rem; }
.achievements-title { font-size: 1.35rem; font-weight: 800; text-align: center; margin-bottom: 2rem; }
.achievements-title { display: flex; align-items: center; justify-content: center; gap: .6rem; }
.achievements-icon { color: var(--mb-accent); flex: 0 0 auto; }
.achievement-card { position: relative; overflow: hidden; border-radius: var(--mb-radius); padding: 1.75rem; background: var(--mb-grad); color: rgba(255, 255, 255, .88); box-shadow: var(--mb-shadow-lg); }
.achievement-card::after { content: '\f091'; font-family: 'Font Awesome 6 Free'; font-weight: 900; position: absolute; right: -10px; bottom: -24px; font-size: 7rem; opacity: .1; color: #fff; }
.achievement-card h4 { color: #fff; font-size: 1.15rem; font-weight: 800; margin-bottom: .5rem; }
.achievement-year { display: inline-block; font-size: .75rem; font-weight: 700; padding: .3rem .7rem; border-radius: 999px; background: rgba(255, 255, 255, .16); color: #fff; margin-bottom: 1rem; }

/* ---------- Proyectos / Blog ---------- */
.project-card, .post-card { position: relative; display: flex; flex-direction: column; background: var(--mb-surface); border: 1px solid var(--mb-border); border-radius: var(--mb-radius); overflow: hidden; box-shadow: var(--mb-shadow); transition: transform .3s, box-shadow .3s, border-color .3s; }
.project-card:hover, .post-card:hover { transform: translateY(-8px); box-shadow: var(--mb-shadow-lg); border-color: rgba(14, 165, 233, .35); }
.project-media, .post-media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--mb-surface-2); }
.project-media img, .post-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.project-card:hover .project-media img, .post-card:hover .post-media img { transform: scale(1.06); }
.project-stage { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .75rem; font-size: .74rem; font-weight: 700; letter-spacing: .02em; border-radius: 999px; background: rgba(11, 26, 46, .82); color: #fff; backdrop-filter: blur(6px); line-height: 1.3; }
.project-stage::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .25); }
.project-card .project-stage { position: absolute; top: .85rem; left: .85rem; z-index: 2; pointer-events: none; }
.detail-hero .project-stage { margin-bottom: 1rem; }
/* Proyecto destacado: tarjeta ancha horizontal (en móvil se apila como las demás) */
.project-flag { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .75rem; font-size: .74rem; font-weight: 700; letter-spacing: .02em; border-radius: 999px; background: rgba(251, 191, 36, .14); color: #b45309; border: 1px solid rgba(251, 191, 36, .45); line-height: 1.3; }
[data-bs-theme="dark"] .project-flag { color: #fbbf24; }
.project-featured .project-stage { position: static; }
.project-featured .card-heading { font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2rem); }
.project-featured .card-text { font-size: 1.05rem; }
@media (min-width: 992px) {
    .project-featured { flex-direction: row; }
    .project-featured .project-media { flex: 0 0 58%; aspect-ratio: auto; min-height: 360px; }
    .project-featured .project-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 2.5rem; }
}
.post-media-fallback { display: grid; place-items: center; height: 100%; background: var(--mb-grad); color: rgba(255, 255, 255, .5); font-size: 3rem; }
.project-body, .post-body { padding: 1.5rem; display: flex; flex-direction: column; flex: 1; }
.card-heading { font-size: 1.15rem; font-weight: 700; line-height: 1.35; margin-bottom: .6rem; }
.card-heading a { color: var(--mb-heading); text-decoration: none; }
.card-heading a:hover { color: var(--mb-accent); }
.card-text { color: var(--mb-muted); font-size: .94rem; line-height: 1.65; flex: 1; }
.card-more { font-weight: 700; font-size: .9rem; color: var(--mb-primary); margin-top: .5rem; }
.card-more i { transition: transform .2s; margin-left: .35rem; }
.project-card:hover .card-more i, .post-card:hover .card-more i { transform: translateX(4px); }
.post-meta { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .82rem; color: var(--mb-muted); font-weight: 500; margin-bottom: .75rem; }

.empty-state { text-align: center; padding: 3.5rem 1rem; border: 2px dashed var(--mb-border); border-radius: var(--mb-radius); color: var(--mb-muted); }
.empty-state i { font-size: 2.5rem; margin-bottom: 1rem; opacity: .6; }

/* ---------- Contacto ---------- */
.contact-section { padding-top: 40px; }
.contact-panel { position: relative; overflow: hidden; border-radius: 32px; padding: clamp(1.75rem, 1rem + 4vw, 4rem); background: radial-gradient(circle at 0% 0%, rgba(14, 165, 233, .35), transparent 45%), radial-gradient(circle at 100% 100%, rgba(34, 211, 238, .18), transparent 40%), linear-gradient(135deg, #0b1a2e, #13325a); color: rgba(255, 255, 255, .8); box-shadow: var(--mb-shadow-lg); }
.contact-lead { font-size: 1.05rem; line-height: 1.7; color: rgba(255, 255, 255, .72); margin-bottom: 2rem; }
.contact-list { list-style: none; padding: 0; margin: 0 0 2rem; display: grid; gap: .75rem; }
.contact-list a, .contact-link-static { display: flex; align-items: center; gap: 1rem; color: #fff; text-decoration: none; padding: .6rem; margin: -.6rem; border-radius: 14px; transition: background-color .2s; }
.contact-list a:hover { background: rgba(255, 255, 255, .06); }
.contact-list small { display: block; font-size: .75rem; color: rgba(255, 255, 255, .6); }
.contact-list span { font-weight: 600; word-break: break-word; }
.contact-icon { flex: 0 0 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: rgba(255, 255, 255, .1); color: var(--mb-accent-2); font-size: 1.1rem; }
.contact-form { background: var(--mb-surface); border-radius: 22px; padding: clamp(1.25rem, .8rem + 2vw, 2.25rem); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5); color: var(--mb-text); }
.contact-form .form-control { background: var(--mb-surface-2); border: 1.5px solid transparent; border-radius: 14px; color: var(--mb-heading); }
.contact-form .form-control:focus { border-color: var(--mb-accent); box-shadow: 0 0 0 4px rgba(14, 165, 233, .15); background: var(--mb-surface); }
.contact-form .form-floating > label { color: var(--mb-muted); }
.contact-form .form-floating > .form-control:focus ~ label::after, .contact-form .form-floating > .form-control:not(:placeholder-shown) ~ label::after { background: transparent; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: .8rem; color: var(--mb-muted); text-align: center; margin: .9rem 0 0; }
.btn-loading { display: none; }
.is-loading .btn-label { display: none; }
.is-loading .btn-loading { display: inline-flex; align-items: center; }
.form-result:empty { display: none; }
.form-result { margin-bottom: 1rem; }

/* ---------- Detalle (proyectos / posts) ---------- */
.detail-hero { padding: 140px 0 48px; position: relative; }
.detail-breadcrumb { font-size: .875rem; margin-bottom: 1.5rem; }
.detail-breadcrumb a { text-decoration: none; color: var(--mb-muted); }
.detail-breadcrumb a:hover { color: var(--mb-accent); }
.detail-title { font-size: clamp(2rem, 1.3rem + 2.8vw, 3.4rem); font-weight: 800; line-height: 1.12; margin-bottom: 1rem; }
.detail-lead { font-size: 1.2rem; color: var(--mb-muted); line-height: 1.65; max-width: 760px; margin-bottom: 1.5rem; }
.detail-cover { margin: 0 0 3.5rem; border-radius: 24px; overflow: hidden; box-shadow: var(--mb-shadow-lg); }
.detail-cover img { width: 100%; max-height: 560px; object-fit: cover; }
.detail-cover-narrow { max-width: 1040px; margin-inline: auto; }
.author-chip { display: inline-flex; align-items: center; gap: .75rem; text-align: left; padding: .4rem 1rem .4rem .4rem; border-radius: 999px; background: var(--mb-surface); border: 1px solid var(--mb-border); }
.author-chip img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; object-position: 58% 25%; }
.author-chip strong { display: block; font-size: .9rem; color: var(--mb-heading); }
.author-chip small { display: block; font-size: .75rem; color: var(--mb-muted); }
.reading-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 1101; background: var(--mb-grad); }

.prose { font-size: 1.125rem; line-height: 1.85; color: var(--mb-text); margin-bottom: 3rem; overflow-wrap: break-word; }
.prose > *:first-child { margin-top: 0; }
.prose h2, .prose h3, .prose h4 { font-weight: 800; margin: 2.5rem 0 1rem; line-height: 1.3; }
.prose h2 { font-size: 1.75rem; }
.prose h3 { font-size: 1.4rem; }
.prose p { margin-bottom: 1.4rem; }
.prose a { color: var(--mb-link); font-weight: 600; text-decoration-color: rgba(14, 165, 233, .4); }
.prose a:hover { text-decoration-color: currentColor; }
.prose img { height: auto; border-radius: 14px; margin: 1.5rem 0; box-shadow: var(--mb-shadow); }
.prose ul, .prose ol { padding-left: 1.5rem; margin-bottom: 1.5rem; }
.prose li { margin-bottom: .5rem; }
.prose li::marker { color: var(--mb-accent); }
.prose blockquote { margin: 2rem 0; padding: 1.25rem 1.5rem; border-left: 4px solid var(--mb-accent); background: var(--mb-surface-2); border-radius: 0 14px 14px 0; font-size: 1.15rem; font-style: italic; color: var(--mb-heading); }
.prose blockquote p:last-child { margin: 0; }
.prose pre { background: #0b1220; color: #e2e8f0; padding: 1.25rem; border-radius: 14px; font-size: .9rem; overflow-x: auto; }
.prose code { background: var(--mb-surface-2); padding: .15rem .4rem; border-radius: 6px; font-size: .9em; color: var(--mb-primary); }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose table { width: 100%; margin-bottom: 1.5rem; border-collapse: collapse; font-size: 1rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--mb-border); padding: .6rem .8rem; }
.prose th { background: var(--mb-surface-2); }
.prose iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 14px; margin: 1.5rem 0; }
.prose hr { margin: 2.5rem 0; opacity: .15; }
.prose figure { margin: 1.5rem 0; }
.prose figcaption { font-size: .875rem; color: var(--mb-muted); text-align: center; }

/* Imágenes alineadas estilo WordPress (clases que pone TinyMCE; mismo CSS en admin.js → content_style) */
.prose { display: flow-root; }
.prose figure { max-width: 100%; }
.prose figure.image { width: fit-content; }
.prose figure.image img { display: block; margin: 0 0 .5rem; }
.prose .align-left, .prose .align-right { max-width: 50%; margin-top: .35rem; margin-bottom: 1rem; }
.prose .align-left { float: left; margin-right: 1.75rem; margin-left: 0; }
.prose .align-right { float: right; margin-left: 1.75rem; margin-right: 0; }
.prose figure.align-left img, .prose figure.align-right img { margin: 0 0 .5rem; }
.prose img.align-center { display: block; margin-left: auto; margin-right: auto; }
.prose figure.align-center { margin-left: auto; margin-right: auto; }
.prose h2, .prose h3, .prose h4, .prose hr, .prose pre, .prose table { clear: both; }
@media (max-width: 575.98px) {
    .prose .align-left, .prose .align-right { float: none; max-width: 100%; margin: 1.5rem auto; }
    .prose img.align-left, .prose img.align-right { display: block; }
}

/* ---------- Galería del artículo (carrusel) ---------- */
.post-gallery { margin: 0 0 3rem; }
.post-gallery-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.post-gallery-counter { font-size: .875rem; font-weight: 600; color: var(--mb-muted); font-variant-numeric: tabular-nums; }
.post-gallery-carousel { border-radius: 20px; overflow: hidden; background: #0b1220; box-shadow: var(--mb-shadow-lg); }
.post-gallery-carousel .carousel-item { margin: 0 -100% 0 0; aspect-ratio: 16 / 10; position: relative; }
.post-gallery-carousel .carousel-item { overflow: hidden; }
.post-gallery-carousel .carousel-item img { width: 100%; height: 100%; object-fit: contain; display: block; transition: transform .3s ease; }
.post-gallery-carousel .carousel-item.is-zoomed { cursor: zoom-in; }
.post-gallery-carousel .carousel-item.is-zoomed img { transform: scale(2); }
.post-gallery-carousel .carousel-item.is-zoomed figcaption { opacity: 0; }
.post-gallery-carousel figcaption { pointer-events: none; transition: opacity .2s; }
.post-gallery-carousel figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 2.5rem 1.25rem 1rem; color: #fff; font-size: .95rem; text-align: center; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); }
.post-gallery-carousel .carousel-control-prev, .post-gallery-carousel .carousel-control-next { width: 4.5rem; opacity: 1; }
.post-gallery-arrow { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .9); color: #0b1a2e; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); transition: transform .2s, background-color .2s; }
.post-gallery-carousel button:hover .post-gallery-arrow, .post-gallery-carousel button:focus-visible .post-gallery-arrow { transform: scale(1.08); background: #fff; }
.post-gallery-thumbs { position: relative; display: flex; gap: .6rem; margin-top: .85rem; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; scroll-snap-type: x proximity; }
.post-gallery-thumbs button { flex: 0 0 88px; height: 62px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: var(--mb-surface-2); opacity: .55; cursor: pointer; scroll-snap-align: start; transition: opacity .2s, border-color .2s; }
.post-gallery-thumbs button:hover { opacity: .85; }
.post-gallery-thumbs button.active { opacity: 1; border-color: var(--mb-accent); }
.post-gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 575.98px) {
    .post-gallery-carousel { border-radius: 14px; }
    .post-gallery-carousel .carousel-item { aspect-ratio: 4 / 3; }
    .post-gallery-carousel .carousel-control-prev, .post-gallery-carousel .carousel-control-next { width: 3.25rem; }
    .post-gallery-arrow { width: 36px; height: 36px; font-size: .85rem; }
    .post-gallery-thumbs button { flex-basis: 68px; height: 50px; }
}

.share-bar { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; padding-top: 1.75rem; border-top: 1px solid var(--mb-border); }

.blog-search { display: flex; align-items: center; gap: .75rem; max-width: 520px; background: var(--mb-surface); border: 1px solid var(--mb-border); border-radius: 16px; padding: .4rem 1rem; box-shadow: var(--mb-shadow); }
.blog-search:focus-within { border-color: var(--mb-accent); }
.blog-search i { color: var(--mb-muted); }
.blog-search input { flex: 1; border: 0; background: transparent; padding: .6rem 0; outline: none; color: var(--mb-heading); }
.pagination .page-link { border-radius: 10px !important; margin: 0 .2rem; border-color: var(--mb-border); color: var(--mb-heading); background: var(--mb-surface); }
.pagination .active .page-link { background: var(--mb-primary); border-color: var(--mb-primary); color: #fff; }

/* ---------- 404 ---------- */
.notfound { min-height: 80vh; display: flex; align-items: center; padding: 140px 0 80px; }
.notfound-code { font-family: 'Plus Jakarta Sans', sans-serif; font-size: clamp(6rem, 4rem + 8vw, 10rem); font-weight: 800; line-height: 1; display: flex; justify-content: center; align-items: flex-end; gap: .5rem; color: var(--mb-heading); margin-bottom: 1.5rem; }
.notfound-zero { display: inline-block; width: .62em; height: .62em; margin-bottom: .12em; border-radius: 50%; background: var(--mb-grad); animation: bounce404 1.2s infinite cubic-bezier(.28, .84, .42, 1); }
@keyframes bounce404 { 0%, 100% { transform: translateY(0) scale(1.08, .92); } 50% { transform: translateY(-40px) scale(.95, 1.05); } }

/* ---------- Footer ---------- */
.site-footer { background: #060c18; color: rgba(255, 255, 255, .65); padding: 80px 0 28px; margin-top: 110px; }
.footer-logo { height: 58px; width: auto; filter: brightness(0) invert(1); }
.footer-text { max-width: 380px; line-height: 1.7; }
.footer-title { font-family: 'Inter', sans-serif; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #fff; margin-bottom: 1.1rem; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.footer-links a { color: rgba(255, 255, 255, .65); text-decoration: none; }
.footer-links a:hover { color: #fff; }
.site-footer .social-btn { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .1); color: #fff; }
.site-footer .social-btn:hover { background: #fff; color: #0b1a2e; }
.footer-bottom { margin-top: 3.5rem; padding-top: 1.75rem; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; font-size: .875rem; }
.footer-bottom a { color: #fff; font-weight: 600; text-decoration: none; }

/* ---------- Flotantes ---------- */
.to-top { position: fixed; right: 22px; bottom: 22px; z-index: 1029; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--mb-border); background: var(--mb-surface); color: var(--mb-heading); box-shadow: var(--mb-shadow); opacity: 0; visibility: hidden; transform: translateY(10px); transition: all .25s; }
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { color: var(--mb-accent); border-color: var(--mb-accent); }
@media (max-width: 575.98px) {
    .to-top { right: 16px; bottom: 16px; }
}

.toast { border-radius: 14px; box-shadow: var(--mb-shadow-lg); }

/* ---------- Animaciones de entrada ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--d, 0ms); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
    .js [data-reveal] { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .section { padding: 80px 0; }
    .hero { min-height: auto; padding-top: 110px; }
    .hero-visual { max-width: 440px; }
    .float-card-1 { left: 0; top: 8%; }
    .float-card-2 { right: 0; bottom: 6%; }
    .stats-band { grid-template-columns: repeat(2, 1fr); margin-top: 3rem; }
    .stat:nth-child(3)::before { display: none; }
    .stat:nth-child(n+3) { border-top: 1px solid var(--mb-border); }
    .skills-grid { margin-top: 3.5rem; }
    .detail-hero { padding-top: 120px; }
    .site-footer { margin-top: 80px; }
}
@media (max-width: 575.98px) {
    .hero-visual { max-width: 340px; }
    .float-card { padding: .55rem .75rem; max-width: 175px; }
    .float-card-1 { top: -2%; left: -2%; }
    .float-card-2 { bottom: 0; right: -2%; }
    .float-card strong { font-size: .75rem; }
    .float-card small { font-size: .68rem; }
    .float-icon { flex-basis: 32px; width: 32px; height: 32px; font-size: .9rem; }
    .stat { padding: 1.2rem .75rem; }
    .timeline-item { padding-left: 34px; }
    .timeline::before { left: 7px; }
    .timeline-dot { left: 0; width: 16px; height: 16px; }
    .timeline-card { padding: 1.15rem; }
    .resume-tabs { justify-content: flex-start !important; }
    .resume-tabs .nav-link { padding: .55rem .9rem; font-size: .9rem; }
    .btn-lg { padding: .8rem 1.25rem; font-size: .95rem; }
}
