/* Tinajero Tech · Estilos del sitio (sobre Bootstrap 5.3) */

:root {
  --brand: #7a1fc2;
  --brand-rgb: 122, 31, 194;
  --brand-2: #2f6bf0;
  --brand-grad: linear-gradient(135deg, var(--brand), var(--brand-2));
  --surface: #ffffff;
  --surface-alt: #f6f3fb;
  --card-border: rgba(30, 20, 60, 0.1);
  --card-shadow: 0 10px 30px rgba(40, 20, 80, 0.08);
  --logo-bg: #ffffff;

  --bs-primary: var(--brand);
  --bs-primary-rgb: var(--brand-rgb);
  --bs-link-color: var(--brand);
  --bs-link-color-rgb: var(--brand-rgb);
  --bs-link-hover-color: #5c1596;
  --bs-link-hover-color-rgb: 92, 21, 150;
  --bs-body-font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

[data-bs-theme="dark"] {
  --brand: #b671ff;
  --brand-rgb: 182, 113, 255;
  --brand-2: #6e9bff;
  --surface: #14111c;
  --surface-alt: #1a1625;
  --card-border: rgba(255, 255, 255, 0.1);
  --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --bs-body-bg: #0f0c16;
  --bs-body-bg-rgb: 15, 12, 22;
  --bs-link-hover-color: #cfa3ff;
  --bs-link-hover-color-rgb: 207, 163, 255;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--bs-body-font-family);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Utilidades de marca ---------- */
.text-gradient {
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.btn-brand {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: transparent;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--brand);
  --bs-btn-hover-border-color: transparent;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--brand);
  --bs-btn-focus-shadow-rgb: var(--brand-rgb);
  background-image: var(--brand-grad);
  border: 0;
  font-weight: 700;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn-brand:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(var(--brand-rgb), 0.35);
}
[data-bs-theme="dark"] .btn-brand { --bs-btn-color: #12091f; --bs-btn-hover-color: #12091f; --bs-btn-active-color: #12091f; color: #12091f; }

.btn-outline-brand {
  --bs-btn-color: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--brand);
  --bs-btn-hover-border-color: var(--brand);
  --bs-btn-active-bg: var(--brand);
  --bs-btn-active-border-color: var(--brand);
  --bs-btn-focus-shadow-rgb: var(--brand-rgb);
  font-weight: 700;
}
[data-bs-theme="dark"] .btn-outline-brand { --bs-btn-hover-color: #12091f; --bs-btn-active-color: #12091f; }

.kicker {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 0.5rem;
}

.section { padding: 5rem 0; }
.section-alt { background: var(--surface-alt); }
.section-title { font-weight: 800; letter-spacing: -0.02em; }

.card-soft {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 1.1rem;
  box-shadow: var(--card-shadow);
}

/* ---------- Navegación ---------- */
.site-nav {
  background: rgba(var(--bs-body-bg-rgb), 0.82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.site-nav.is-scrolled {
  border-bottom-color: var(--card-border);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}
.site-nav .navbar-brand { font-weight: 800; letter-spacing: -0.02em; }
.brand-logo {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.7rem;
  background: var(--logo-bg);
  padding: 0.15rem;
  border: 1px solid var(--card-border);
  object-fit: contain;
}
.site-nav .nav-link { font-weight: 600; font-size: 0.92rem; }
.site-nav .nav-link.active { color: var(--brand); }

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--card-border);
  background: var(--surface);
  color: var(--bs-body-color);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.4;
}
.toolbar-btn:hover,
.toolbar-btn:focus-visible { border-color: var(--brand); color: var(--brand); }
.dropdown-menu .dropdown-item { display: flex; align-items: center; gap: 0.6rem; font-weight: 600; }
.dropdown-menu .dropdown-item.active,
.dropdown-menu .dropdown-item:active { background: rgba(var(--brand-rgb), 0.14); color: var(--brand); }
.dropdown-item .bi-check2 { margin-left: auto; visibility: hidden; }
.dropdown-item.active .bi-check2 { visibility: visible; }

/* ---------- Héroe ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 7rem 0 4rem;
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  pointer-events: none;
}
.hero::before { width: 28rem; height: 28rem; background: var(--brand); top: -10rem; right: -8rem; }
.hero::after { width: 22rem; height: 22rem; background: var(--brand-2); bottom: -8rem; left: -8rem; opacity: 0.22; }
.hero > .container { position: relative; z-index: 1; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(var(--brand-rgb), 0.12);
  color: var(--brand);
  border: 1px solid rgba(var(--brand-rgb), 0.25);
}
.hero-badge .dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 0.5rem rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }

.hero h1 { font-size: clamp(2.3rem, 5.5vw, 4rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.08; }
.hero .lead { max-width: 38rem; }

.hero-avatar {
  position: relative;
  width: min(100%, 22rem);
  aspect-ratio: 1;
  margin-inline: auto;
}
.hero-avatar .ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--brand-grad);
  padding: 0.4rem;
  box-shadow: 0 25px 60px rgba(var(--brand-rgb), 0.35);
}
.hero-avatar .ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--logo-bg);
  object-fit: contain;
  padding: 0.5rem;
}
.float-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  border-radius: 0.8rem;
  background: var(--surface);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  font-size: 0.8rem;
  font-weight: 700;
  animation: float 6s ease-in-out infinite;
}
.float-chip .bi { color: var(--brand); }
.float-chip.c1 { top: 6%; left: -6%; }
.float-chip.c2 { top: 42%; right: -10%; animation-delay: -2s; }
.float-chip.c3 { bottom: 6%; left: 2%; animation-delay: -4s; }
@keyframes float { 50% { transform: translateY(-10px); } }
@media (max-width: 575.98px) {
  .hero { padding-top: 6rem; }
  .hero-avatar { width: min(70%, 15rem); }
  .float-chip.c1 { left: -8%; }
  .float-chip.c2 { right: -8%; }
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--surface);
  color: var(--bs-body-color);
  font-size: 1.15rem;
  transition: all 0.15s ease;
}
.social-link:hover { background: var(--brand); border-color: var(--brand); color: #fff; transform: translateY(-2px); }
[data-bs-theme="dark"] .social-link:hover { color: #12091f; }

/* ---------- Estadísticas ---------- */
.stat { text-align: center; padding: 1.4rem 1rem; }
.stat .num { font-size: 2.2rem; font-weight: 800; line-height: 1; }
.stat .lbl { font-size: 0.85rem; color: var(--bs-secondary-color); margin-top: 0.4rem; }

/* ---------- Tarjetas de servicios ---------- */
.service { padding: 1.6rem; height: 100%; transition: transform 0.2s ease, border-color 0.2s ease; }
.service:hover { transform: translateY(-4px); border-color: rgba(var(--brand-rgb), 0.5); }
.icon-tile {
  width: 3rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.9rem;
  font-size: 1.4rem;
  color: var(--brand);
  background: rgba(var(--brand-rgb), 0.12);
  margin-bottom: 1rem;
}

/* ---------- Línea de tiempo ---------- */
.timeline { position: relative; padding-left: 1.75rem; }
.timeline::before {
  content: "";
  position: absolute;
  left: 0.4rem;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 2px;
  background: linear-gradient(var(--brand), rgba(var(--brand-rgb), 0.1));
}
.timeline-item { position: relative; padding: 1.5rem; margin-bottom: 1.5rem; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.75rem;
  top: 1.9rem;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--brand);
}
.timeline-item ul { padding-left: 1.1rem; margin-bottom: 0; }
.timeline-item li { margin-bottom: 0.4rem; color: var(--bs-secondary-color); }
.period {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: rgba(var(--brand-rgb), 0.12);
  color: var(--brand);
  white-space: nowrap;
}

/* ---------- Proyectos ---------- */
.filter-chip {
  border: 1px solid var(--card-border);
  background: var(--surface);
  color: var(--bs-body-color);
  border-radius: 999px;
  padding: 0.4rem 1.1rem;
  font-weight: 700;
  font-size: 0.88rem;
}
.filter-chip:hover { border-color: var(--brand); color: var(--brand); }
.filter-chip.active { background: var(--brand-grad); border-color: transparent; color: #fff; }
[data-bs-theme="dark"] .filter-chip.active { color: #12091f; }

.project { display: flex; flex-direction: column; height: 100%; overflow: hidden; transition: transform 0.2s ease, border-color 0.2s ease; }
.project:hover { transform: translateY(-4px); border-color: rgba(var(--brand-rgb), 0.5); }
.project-media {
  aspect-ratio: 16 / 9;
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.project-media img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.project-media.is-app img { object-fit: contain; padding: 0.5rem; }
.project-media.is-icon { background: var(--brand-grad); color: #fff; font-size: 3.2rem; }
[data-bs-theme="dark"] .project-media.is-icon { color: #12091f; }
.project-body { padding: 1.25rem; display: flex; flex-direction: column; flex: 1; }
.project-body p { color: var(--bs-secondary-color); font-size: 0.93rem; }
.project-body .btn { margin-top: auto; align-self: flex-start; }
.tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  color: var(--bs-secondary-color);
}

/* ---------- Habilidades ---------- */
.skill-group { padding: 1.5rem; height: 100%; }
.skill-group h3 { font-size: 1rem; font-weight: 800; display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1rem; }
.skill-group h3 .bi { color: var(--brand); }
.pill {
  display: inline-block;
  margin: 0 0.35rem 0.5rem 0;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(var(--brand-rgb), 0.1);
  border: 1px solid rgba(var(--brand-rgb), 0.2);
}
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { display: flex; gap: 0.6rem; margin-bottom: 0.5rem; color: var(--bs-secondary-color); }
.check-list .bi { color: var(--brand); flex: none; margin-top: 0.15rem; }

/* ---------- Educación ---------- */
.edu-card { padding: 1.5rem; height: 100%; }
.edu-card .bi-mortarboard-fill,
.edu-card .bi-patch-check-fill { color: var(--brand); font-size: 1.6rem; }

/* ---------- Contacto ---------- */
.contact-panel {
  position: relative;
  overflow: hidden;
  padding: 3rem 1.5rem;
  border-radius: 1.5rem;
  background: var(--brand-grad);
  color: #fff;
  text-align: center;
}
[data-bs-theme="dark"] .contact-panel { color: #12091f; }
.contact-panel .lead { max-width: 36rem; margin-inline: auto; opacity: 0.92; }
.contact-panel .btn-light { font-weight: 700; }
.contact-panel .social-link { background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 255, 255, 0.35); color: inherit; }
.contact-panel .social-link:hover { background: #fff; color: var(--brand); border-color: #fff; }
.contact-card { padding: 1.4rem; text-align: center; height: 100%; }
.contact-card a { font-weight: 700; word-break: break-word; }

/* ---------- Pie ---------- */
.site-footer { border-top: 1px solid var(--card-border); padding: 2rem 0; font-size: 0.9rem; color: var(--bs-secondary-color); }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--brand); }

/* ---------- Páginas legales / 404 ---------- */
.legal { max-width: 46rem; padding-top: 7rem; padding-bottom: 4rem; }
.legal h2 { font-size: 1.25rem; font-weight: 800; margin-top: 2rem; }
.legal p, .legal li { color: var(--bs-secondary-color); }
html[lang="es"] .l-en,
html[lang="en"] .l-es { display: none !important; }
.not-found { min-height: 80vh; display: flex; align-items: center; text-align: center; padding-top: 6rem; }
.not-found .code { font-size: clamp(5rem, 18vw, 9rem); font-weight: 800; line-height: 1; }

/* ---------- Accesibilidad ---------- */
.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -4rem;
  z-index: 2000;
  background: var(--brand);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 0.5rem; color: #fff; }
:focus-visible { outline: 3px solid rgba(var(--brand-rgb), 0.6); outline-offset: 2px; }

/* ---------- Animación de aparición ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .float-chip, .hero-badge .dot { animation: none; }
}
@media print {
  .site-nav, .skip-link, .float-chip { display: none !important; }
}

/* ---------- Galería de certificados ---------- */
.cert-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  text-align: left;
  color: inherit;
  cursor: zoom-in;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.cert-card:hover { transform: translateY(-3px); border-color: rgba(var(--brand-rgb), 0.5); }
.cert-thumb { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface-alt); }
.cert-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.cert-meta { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.8rem 0.9rem 1rem; }
.cert-title { font-size: 0.88rem; font-weight: 700; line-height: 1.3; }
.cert-sub { font-size: 0.75rem; color: var(--bs-secondary-color); }

/* ---------- Logo de Google Play en tarjetas sin captura ---------- */
.project-media.is-logo { background: var(--surface-alt); }
.project-media.is-logo img { width: auto; height: 46%; object-fit: contain; padding: 0; }

/* ---------- Código abierto ---------- */
.pkg { padding: 1.4rem; height: 100%; display: flex; flex-direction: column; transition: transform 0.2s ease, border-color 0.2s ease; }
.pkg:hover { transform: translateY(-4px); border-color: rgba(var(--brand-rgb), 0.5); }
.pkg p { color: var(--bs-secondary-color); font-size: 0.92rem; }
.pkg .btn { margin-top: auto; align-self: flex-start; }
.pkg h3 { word-break: break-word; }
.org-card { padding: 1.5rem; }
.flex-none { flex: none; }
.pkg h3.h6 { font-size: 0.85rem; }
.lead-narrow { max-width: 40rem; }
.lead-wide { max-width: 44rem; }
.page-top { padding-top: 8rem; }
