/* Portafolio Jesús Gutiérrez Villa - Estilos Principales */

/* Fuentes locales */
@font-face {
  font-family: "Butler";
  font-style: normal;
  font-weight: 400;
  src: url("../fonts/ButlerRegular.otf") format("opentype");
  font-display: swap;
}

@font-face {
  font-family: "Butler";
  font-style: normal;
  font-weight: 700;
  src: url("../fonts/ButlerBold.otf") format("opentype");
  font-display: swap;
}

@font-face {
  font-family: "Butler";
  font-style: normal;
  font-weight: 800;
  src: url("../fonts/ButlerExtraBold.otf") format("opentype");
  font-display: swap;
}

/* Variables de diseño */
:root {
  /* Paleta de colores */
  /* 60% BASE DOMINANTE: MIDNIGHT CARBON & SLATE */
  --color-navy: #0b0f19; /* Fondo principal */
  --color-navy-deep: #060911; /* Fondo profundo y footer */
  --color-navy-surface: #111827; /* Superficie de tarjetas */
  --color-navy-hover: #1a2336; /* Hover en tarjetas */
  --color-navy-elevated: #1e293b; /* Elementos elevados / modales */
  --color-navy-glass: rgba(17, 24, 39, 0.78);

  /* 25% CONTENIDO & LECTURA: ALABASTER & SLATE LIGHT */
  --color-sand: #f8fafc; /* Texto principal y titulares */
  --color-sand-soft: #cbd5e1; /* Texto secundario y párrafos */
  --color-sand-muted: #94a3b8; /* Metadatos y etiquetas atenuadas */

  /* 10% ARQUITECTURA & DETALLES: SLATE BORDER & SKY AQUA */
  --color-teal: #334155; /* Bordes y divisores */
  --color-teal-light: #64748b;
  --color-teal-subtle: rgba(56, 189, 248, 0.1);
  --color-teal-border: rgba(148, 163, 184, 0.16);

  --color-aqua: #7dd3fc; /* Acentos luminosos, tags y micro-interacciones */
  --color-aqua-subtle: rgba(56, 189, 248, 0.12);
  --color-aqua-glow: 0 0 20px rgba(56, 189, 248, 0.2);

  /* 5% MÁXIMA JERARQUÍA / ACCIÓN / FOCAL: ELECTRIC SKY */
  --color-gold: #38bdf8; /* Botón principal, active dock y llamadas clave */
  --color-gold-hover: #7dd3fc;
  --color-gold-subtle: rgba(56, 189, 248, 0.14);
  --color-gold-glow: 0 6px 22px rgba(56, 189, 248, 0.3);

  /* Mapeo Semántico */
  --bg-canvas: var(--color-navy);
  --bg-surface: var(--color-navy-surface);
  --bg-surface-card: var(--color-navy-surface);
  --bg-surface-hover: var(--color-navy-hover);
  --bg-surface-elevated: var(--color-navy-elevated);

  --text-white: var(--color-sand);
  --text-main: var(--color-sand-soft);
  --text-muted: var(--color-sand-muted);

  --border-subtle: var(--color-teal-border);
  --border-medium: rgba(148, 163, 184, 0.28);
  --border-active: var(--color-gold);

  --shadow-card: 0 14px 35px -10px rgba(2, 6, 23, 0.75);

  /* Tipografías */
  --font-barcelona: "Butler", Georgia, "Times New Roman", serif;
  --font-rome: "Roboto Slab", -apple-system, BlinkMacSystemFont, serif;
  --font-sans: "Roboto Slab", serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;

  /* Transiciones */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --trans-fast: 0.15s ease;
  --trans-normal: 0.28s var(--ease-spring);
  --trans-slow: 0.45s var(--ease-spring);
}

/* Reset y estilos globales */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-rome);
  background-color: var(--bg-canvas);
  color: var(--text-main);
  scroll-behavior: smooth;
  scroll-padding-top: 85px;
  overflow-x: clip;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: clip;
  line-height: 1.65;
  background-color: var(--color-navy);
  background-image:
    radial-gradient(
      ellipse at 15% 10%,
      rgba(56, 189, 248, 0.08) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 85% 85%,
      rgba(99, 102, 241, 0.07) 0%,
      transparent 60%
    );
}

@media (min-width: 768px) {
  body {
    background-attachment: fixed;
  }
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-barcelona);
  color: var(--color-sand);
  letter-spacing: -0.01em;
}

/* Alineación natural para textos breves y claros */
.card-desc,
.evaluator-text,
.exp-bullet-text,
.edu-desc,
.philosophy-desc {
  text-align: left;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all var(--trans-fast);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  transition: all var(--trans-fast);
}

/* Scrollbar principal de la página */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--color-navy-deep);
}
::-webkit-scrollbar-thumb {
  background: var(--color-teal);
  border-radius: 9999px;
  border: 2px solid var(--color-navy-deep);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-gold);
}

/* Maquetación y contenedores */
.container {
  width: 100%;
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 480px) {
  .container {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

@media (min-width: 640px) {
  .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.section-wrapper {
  padding-top: 2.25rem;
  padding-bottom: 2.25rem;
  border-top: 1px solid var(--border-subtle);
  position: relative;
}

@media (min-width: 768px) {
  .section-wrapper {
    padding-top: 3.25rem;
    padding-bottom: 3.25rem;
  }
}

.section-header {
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .section-header {
    margin-bottom: 1.75rem;
  }
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-aqua);
  margin-bottom: 0.45rem;
}

.section-title {
  font-size: clamp(1.75rem, 6vw, 2.75rem);
  font-weight: 700;
  line-height: 1.18;
  color: var(--color-sand);
  margin-bottom: 0.65rem;
}

.section-desc {
  font-family: var(--font-rome);
  font-size: clamp(0.925rem, 2.4vw, 1rem);
  color: var(--color-sand-soft);
  line-height: 1.6;
  max-width: 44rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .grid-2 {
    gap: 1.5rem;
  }
}

@media (min-width: 860px) {
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.grid-3 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .grid-3 {
    gap: 1.5rem;
  }
}

@media (min-width: 700px) {
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 700px) and (max-width: 1023px) {
  .grid-3 > .tool-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1.1fr;
  }

  .grid-3 > .tool-card:last-child:nth-child(odd) .tool-media {
    height: 100%;
    min-height: 240px;
    border-bottom: none;
    border-right: 1px solid var(--border-subtle);
  }
}

@media (min-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.grid-4 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Previene desbordamiento horizontal en todos los hijos de Grid */
.grid-2 > *,
.grid-3 > *,
.grid-4 > *,
.hero-grid > *,
.featured-project-body > *,
.stack-bento-grid > *,
.stack-items-grid > *,
.experience-layout > * {
  min-width: 0;
}

/* Efectos ambientales */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.ambient-light-1 {
  position: absolute;
  top: -120px;
  left: 10%;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(56, 189, 248, 0.09) 0%,
    transparent 70%
  );
  filter: blur(90px);
}

.ambient-light-2 {
  position: absolute;
  top: 55%;
  right: -50px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(99, 102, 241, 0.08) 0%,
    transparent 70%
  );
  filter: blur(100px);
}

@media (min-width: 768px) {
  .ambient-light-1 {
    left: 20%;
    width: 550px;
    height: 550px;
    filter: blur(140px);
  }

  .ambient-light-2 {
    width: 500px;
    height: 500px;
    filter: blur(150px);
  }
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0.85rem 0;
  transition: all var(--trans-normal);
}

.nav-container-centered {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: transparent;
  border: none;
  box-shadow: none;
}

/* Menú Central Flotante tipo Cápsula Glass con Slider */
.nav-menu {
  display: none;
  position: relative;
  align-items: center;
  gap: 0.35rem;
  background: rgba(6, 9, 17, 0.82);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  padding: 0.35rem 0.45rem;
  border-radius: 9999px;
  border: none;
  box-shadow:
    0 8px 28px rgba(2, 6, 23, 0.45),
    inset 0 0 0 1px rgba(148, 163, 184, 0.16);
  transition:
    background var(--trans-normal),
    box-shadow var(--trans-normal);
}

.navbar.scrolled .nav-menu {
  background: rgba(6, 9, 17, 0.92);
  box-shadow:
    0 12px 34px rgba(2, 6, 23, 0.72),
    inset 0 0 0 1px rgba(56, 189, 248, 0.24);
}

@media (min-width: 768px) {
  .nav-menu {
    display: inline-flex;
  }
}

/* Pastilla Deslizante Fluida (Selected to New Selected) */
.nav-indicator-pill {
  position: absolute;
  top: 0;
  left: 0;
  background: var(--color-gold);
  border-radius: 9999px;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.35);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition:
    transform 0.32s cubic-bezier(0.25, 1, 0.5, 1),
    width 0.32s cubic-bezier(0.25, 1, 0.5, 1),
    height 0.32s cubic-bezier(0.25, 1, 0.5, 1),
    opacity 0.2s ease;
}

.nav-link {
  position: relative;
  z-index: 2;
  font-family: var(--font-rome);
  padding: 0.5rem 1.15rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-sand);
  transition:
    color 0.22s ease,
    font-weight 0.22s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: #ffffff;
}

.nav-link.active {
  color: var(--color-navy-deep);
  font-weight: 700;
}

/* Botón Mobile */
.mobile-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 9999px;
  background: rgba(6, 9, 17, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.55);
  color: var(--color-sand);
  margin-left: auto;
}

@media (min-width: 768px) {
  .mobile-toggle {
    display: none;
  }
}

.mobile-drawer {
  display: none;
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 1rem;
  right: 1rem;
  background: rgba(6, 9, 17, 0.96);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--border-medium);
  border-radius: 16px;
  padding: 0.65rem;
  box-shadow: 0 20px 45px rgba(2, 6, 23, 0.85);
  z-index: 55;
}

@media (min-width: 768px) {
  .mobile-drawer,
  .mobile-drawer.open {
    display: none;
  }
}

.mobile-drawer.open {
  display: block;
}

.mobile-drawer nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mobile-drawer .nav-link {
  display: block;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  border-radius: 10px;
}

.mobile-drawer .nav-link:hover {
  background: rgba(56, 189, 248, 0.1);
}

.mobile-drawer .nav-link.active {
  background: var(--color-gold);
  color: var(--color-navy-deep);
  font-weight: 700;
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: var(--font-rome);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.6rem 1.35rem;
  border-radius: 10px;
  min-height: 40px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--trans-normal);
}

/* Sky Blue: Botón primario de máxima jerarquía */
.btn-primary {
  background: var(--color-gold);
  color: var(--color-navy-deep);
  border: 1px solid var(--color-gold);
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.25);
}

.btn-primary:hover {
  background: var(--color-gold-hover);
  border-color: var(--color-gold-hover);
  color: var(--color-navy-deep);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
}

/* Slate: Botón secundario */
.btn-secondary {
  background: rgba(51, 65, 85, 0.35);
  color: var(--color-sand);
  border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
  background: rgba(56, 189, 248, 0.14);
  border-color: var(--color-aqua);
  color: #ffffff;
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--color-sand);
  border: 1px solid var(--border-medium);
}

.btn-outline:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: var(--color-aqua);
  color: #ffffff;
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.45rem 1rem;
  font-size: 0.825rem;
  min-height: 36px;
}

/* Hero */
.hero-section {
  padding-top: 0.75rem;
  padding-bottom: 2.25rem;
  position: relative;
}

@media (min-width: 768px) {
  .hero-section {
    padding-top: 2rem;
    padding-bottom: 3.25rem;
  }
}

/* Distribución equilibrada en 2 Columnas */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.75rem;
  align-items: center;
  margin-bottom: 1.75rem;
}

@media (min-width: 768px) {
  .hero-grid {
    gap: 2.5rem;
    margin-bottom: 2.5rem;
  }
}

@media (min-width: 960px) {
  .hero-grid {
    grid-template-columns: 1.25fr 0.75fr;
    gap: 3.5rem;
  }
}

@media (min-width: 1200px) {
  .hero-grid {
    grid-template-columns: 1.3fr 0.7fr;
    gap: 4.5rem;
  }
}

.hero-content {
  display: flex;
  flex-direction: column;
}

.hero-title {
  font-family: var(--font-barcelona);
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--color-sand);
  margin-bottom: 0.9rem;
}

@media (min-width: 768px) {
  .hero-title {
    margin-bottom: 1.15rem;
  }
}

.hero-highlight {
  color: var(--color-gold);
}

.hero-subtitle {
  font-family: var(--font-rome);
  font-size: clamp(0.95rem, 2.5vw, 1.05rem);
  line-height: 1.65;
  color: var(--color-sand-soft);
  margin-bottom: 0;
}

@media (min-width: 768px) {
  .hero-subtitle {
    line-height: 1.7;
  }
}

.hero-subtitle strong {
  color: var(--color-sand);
  font-weight: 700;
}

/* Acciones principales del Hero (CV, GitHub, LinkedIn) */
.hero-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.hero-actions .btn {
  width: 100%;
  min-height: 44px;
}

.hero-actions .btn-primary {
  grid-column: 1 / -1;
}

@media (min-width: 520px) {
  .hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.75rem;
  }

  .hero-actions .btn {
    width: auto;
    padding: 0.62rem 1.3rem;
  }
}

/* Retrato YoFondo en el espacio libre */
.hero-media {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.hero-portrait-card {
  position: relative;
  width: 100%;
  max-width: min(290px, 84vw);
  padding: 5px;
  border-radius: 22px;
  background: linear-gradient(
    145deg,
    rgba(56, 189, 248, 0.4) 0%,
    rgba(99, 102, 241, 0.25) 50%,
    rgba(17, 24, 39, 0.9) 100%
  );
  box-shadow:
    0 25px 60px -15px rgba(2, 6, 23, 0.85),
    0 0 35px rgba(56, 189, 248, 0.12);
  transition:
    transform var(--trans-normal),
    box-shadow var(--trans-normal);
}

@media (min-width: 640px) {
  .hero-portrait-card {
    max-width: 310px;
  }
}

@media (min-width: 960px) {
  .hero-portrait-card {
    max-width: 350px;
  }
}

@media (min-width: 1200px) {
  .hero-portrait-card {
    max-width: 380px;
  }
}

.hero-portrait-card:hover {
  transform: translateY(-5px);
  box-shadow:
    0 30px 75px -15px rgba(2, 6, 23, 0.9),
    0 0 45px rgba(56, 189, 248, 0.24);
}

.hero-portrait-glow {
  position: absolute;
  inset: -12px;
  border-radius: 30px;
  background: radial-gradient(
    circle,
    rgba(56, 189, 248, 0.2) 0%,
    rgba(99, 102, 241, 0.14) 50%,
    transparent 75%
  );
  filter: blur(20px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.75;
  transition: opacity var(--trans-normal);
}

.hero-portrait-card:hover .hero-portrait-glow {
  opacity: 1;
}

.hero-portrait-frame {
  position: relative;
  border-radius: 17px;
  overflow: hidden;
  background: var(--color-navy-deep);
  aspect-ratio: 3 / 4;
  box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.4);
}

.hero-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform var(--trans-slow);
}

.hero-portrait-card:hover .hero-portrait-img {
  transform: scale(1.03);
}

/* Badge flotante inferior con indicador activo */
.hero-portrait-badge {
  position: absolute;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 1rem);
  background: rgba(6, 9, 17, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-medium);
  padding: 0.34rem 0.68rem;
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--color-sand);
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  transition: border-color var(--trans-fast);
}

@media (max-width: 359px) {
  .hero-portrait-badge {
    white-space: normal;
    text-align: center;
    line-height: 1.25;
    border-radius: 12px;
  }
}

@media (min-width: 640px) {
  .hero-portrait-badge {
    bottom: 0.9rem;
    padding: 0.34rem 0.74rem;
    font-size: 0.64rem;
    gap: 0.42rem;
  }
}

@media (min-width: 1200px) {
  .hero-portrait-badge {
    bottom: 1rem;
    padding: 0.38rem 0.88rem;
    font-size: 0.71rem;
    gap: 0.48rem;
  }
}

.hero-portrait-card:hover .hero-portrait-badge {
  border-color: var(--color-gold);
}

.hero-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  flex-shrink: 0;
}

/* Tecnologías principales */
.hero-core-strip {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 1rem;
  background: rgba(17, 24, 39, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--color-teal-border);
  border-radius: 16px;
}

@media (min-width: 640px) {
  .hero-core-strip {
    gap: 0.9rem;
    padding: 1.15rem 1.35rem;
  }
}

@media (min-width: 1080px) {
  .hero-core-strip {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.hero-core-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-sand-muted);
  white-space: nowrap;
}

.hero-core-pills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

@media (min-width: 600px) {
  .hero-core-pills {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
  }
}

@media (min-width: 1080px) {
  .hero-core-pills {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.65rem;
  }
}

.core-stack-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 38px;
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  background: rgba(6, 9, 17, 0.55);
  border: 1px solid var(--color-teal-border);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--color-sand);
  min-width: 0;
  transition:
    transform var(--trans-fast),
    border-color var(--trans-fast),
    background var(--trans-fast);
}

@media (min-width: 540px) {
  .core-stack-pill {
    gap: 0.5rem;
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
  }
}

@media (min-width: 1080px) {
  .core-stack-pill {
    justify-content: flex-start;
  }
}

.core-stack-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.core-stack-pill:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(30, 41, 59, 0.7);
}

.core-stack-pill img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.core-stack-pill i {
  font-size: 0.95rem;
  color: var(--color-aqua);
  flex-shrink: 0;
}

/* Proyectos */
.featured-project-card {
  background: var(--color-navy-surface);
  border: 1px solid var(--color-teal-border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  margin-bottom: 2rem;
  transition: all var(--trans-normal);
}

.featured-project-card:hover {
  border-color: var(--color-gold);
}

/* Imagen Arriba a sangre completa */
.featured-project-media {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  background: var(--color-navy-deep);
}

@media (min-width: 768px) {
  .featured-project-media {
    aspect-ratio: auto;
    height: 360px;
  }
}

.featured-project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform var(--trans-slow);
}

.featured-project-card:hover .featured-project-media img {
  transform: scale(1.02);
}

/* Contenido Abajo dividido en 2 columnas horizontales */
.featured-project-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1.25rem;
}

@media (min-width: 640px) {
  .featured-project-body {
    gap: 1.75rem;
    padding: 1.75rem;
  }
}

@media (min-width: 900px) {
  .featured-project-body {
    grid-template-columns: 1.15fr 0.85fr;
    padding: 2.25rem;
    gap: 2.25rem;
  }
}

/* Lado Izquierdo: Etiqueta, Título y Descripción */
.featured-col-info {
  display: flex;
  flex-direction: column;
}

/* Lado Derecho: Impacto, Tags y Botones */
.featured-col-meta {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Badges de Categoría */
.badge-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  max-width: 100%;
  width: fit-content;
  line-height: 1.35;
}

@media (min-width: 640px) {
  .badge-label {
    font-size: 0.725rem;
  }
}

.badge-label.production {
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-label.data {
  background: var(--color-aqua-subtle);
  color: var(--color-aqua);
  border: 1px solid rgba(56, 189, 248, 0.32);
}

.badge-label.ai {
  background: rgba(129, 140, 248, 0.15);
  color: #c7d2fe;
  border: 1px solid rgba(129, 140, 248, 0.35);
}

.badge-label.tool {
  background: rgba(148, 163, 184, 0.14);
  color: var(--color-sand-soft);
  border: 1px solid var(--border-medium);
}

.card-title {
  font-family: var(--font-barcelona);
  font-size: clamp(1.4rem, 4.5vw, 1.85rem);
  font-weight: 700;
  color: var(--color-sand);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.card-title-md {
  font-size: clamp(1.3rem, 3.8vw, 1.45rem);
}

.card-title-sm {
  font-size: clamp(1.22rem, 3.5vw, 1.32rem);
}

.card-desc {
  font-family: var(--font-rome);
  font-size: 0.95rem;
  color: var(--color-sand-soft);
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.card-desc-sm {
  font-size: 0.875rem;
}

/* Bloque resumen / Impacto */
.evaluator-box {
  background: rgba(6, 9, 17, 0.55);
  border-left: 3px solid var(--color-gold);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
}

.evaluator-label {
  font-family: var(--font-mono);
  font-size: 0.725rem;
  font-weight: 700;
  color: var(--color-gold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.evaluator-text {
  font-family: var(--font-rome);
  font-size: 0.825rem;
  color: var(--color-sand-soft);
  line-height: 1.5;
}

/* Tags de Stack */
.tech-tag-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.tech-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 27px;
  font-family: var(--font-mono);
  font-size: 0.69rem;
  line-height: 1;
  white-space: nowrap;
  color: var(--color-aqua);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.22);
  padding: 0 0.56rem;
  border-radius: 7px;
}

.card-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
}

.card-actions .btn {
  width: 100%;
  min-height: 38px;
}

@media (min-width: 480px) {
  .card-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
  }

  .card-actions .btn {
    width: auto;
  }
}

/* Distribución simétrica 50/50 para tarjetas compactas con 2 acciones */
@media (min-width: 380px) {
  .tool-card .card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
  }

  .tool-card .card-actions .btn {
    width: 100%;
    padding: 0.48rem 0.65rem;
    font-size: 0.8rem;
  }
}

/* Tarjetas Secundarias */
.project-card,
.tool-card {
  background: var(--color-navy-surface);
  border: 1px solid var(--color-teal-border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: all var(--trans-normal);
}

.project-card:hover,
.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-aqua);
  box-shadow: var(--shadow-card);
}

.project-card-media,
.tool-media {
  background: var(--color-navy-deep);
  padding: 0;
  margin: 0;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  position: relative;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .project-card-media,
  .tool-media {
    aspect-ratio: auto;
    height: 220px;
  }
}

.project-image-box,
.tool-image-box {
  width: 100%;
  height: 100%;
  border-radius: 0;
  border: none;
}

.project-image-box img,
.tool-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform var(--trans-slow);
}

.project-card:hover .project-image-box img,
.tool-card:hover .tool-image-box img {
  transform: scale(1.04);
}

.project-card-body,
.tool-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

@media (min-width: 640px) {
  .project-card-body,
  .tool-body {
    padding: 1.5rem;
  }
}

/* El bloque de contenido superior toma todo el espacio disponible */
.project-card-body > div:first-child,
.tool-body > div:first-child {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

/* Botones fijados estrictamente al fondo de la tarjeta de forma simétrica */
.project-card-body .card-actions,
.tool-body .card-actions,
.featured-col-meta .card-actions {
  margin-top: auto;
  padding-top: 1.25rem;
}

/* Tecnologías */
.stack-bento-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .stack-bento-grid {
    gap: 1.5rem;
  }
}

.stack-group-card {
  background: var(--color-navy-surface);
  border: 1px solid var(--color-teal-border);
  border-radius: 18px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition:
    border-color var(--trans-normal),
    box-shadow var(--trans-normal);
}

@media (min-width: 640px) {
  .stack-group-card {
    padding: 1.65rem;
  }
}

.stack-group-card:hover {
  border-color: rgba(56, 189, 248, 0.38);
  box-shadow: var(--shadow-card);
}

.stack-group-primary {
  border-color: rgba(56, 189, 248, 0.32);
  background: linear-gradient(
    145deg,
    rgba(17, 24, 39, 0.96) 0%,
    rgba(11, 20, 38, 0.9) 100%
  );
}

.stack-group-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 0.8rem;
  margin-bottom: 1.1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border-subtle);
}

.stack-group-heading {
  flex: 1 1 200px;
  min-width: 0;
}

.stack-tier-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-gold);
  background: var(--color-gold-subtle);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 0.24rem 0.65rem;
  border-radius: 9999px;
  white-space: nowrap;
}

@media (min-width: 640px) {
  .stack-group-header {
    gap: 0.85rem;
    margin-bottom: 1.35rem;
    padding-bottom: 0.9rem;
  }
}

.stack-group-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--color-gold-subtle);
  color: var(--color-gold);
  border: 1px solid rgba(56, 189, 248, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.stack-group-title {
  font-family: var(--font-barcelona);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-sand);
  line-height: 1.2;
}

.stack-group-subtitle {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--color-sand-muted);
  margin-top: 0.15rem;
}

.stack-items-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.65rem;
}

@media (min-width: 560px) {
  .stack-items-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }
}

@media (min-width: 820px) {
  .stack-items-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1080px) {
  .stack-group-card:not(.stack-group-primary) .stack-items-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.stack-pill-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.72rem 0.85rem;
  min-width: 0;
  min-height: 68px;
  height: 100%;
  background: rgba(6, 9, 17, 0.52);
  border: 1px solid var(--color-teal-border);
  border-radius: 12px;
  transition:
    transform var(--trans-normal),
    border-color var(--trans-normal),
    background var(--trans-normal),
    box-shadow var(--trans-normal);
}

@media (min-width: 640px) {
  .stack-pill-card {
    gap: 0.85rem;
    padding: 0.75rem 0.9rem;
  }
}

.stack-pill-card:hover {
  transform: translateY(-2px);
  background: rgba(30, 41, 59, 0.65);
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 8px 20px rgba(2, 6, 23, 0.45);
}

.stack-pill-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(17, 24, 39, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stack-pill-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.stack-pill-icon i {
  font-size: 1.25rem;
}

.stack-pill-icon i:not(.colored) {
  color: var(--color-aqua);
}

.stack-pill-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.stack-pill-name {
  font-family: var(--font-rome);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-sand);
  line-height: 1.25;
}

.stack-pill-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-sand-muted);
  margin-top: 0.15rem;
  line-height: 1.35;
}

/* Experiencia */
.experience-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .experience-layout {
    gap: 1.75rem;
  }
}

@media (min-width: 960px) {
  .experience-layout {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

.exp-main-card {
  background: var(--color-navy-surface);
  border: 1px solid var(--color-teal-border);
  border-radius: 18px;
  padding: 1.25rem;
  min-width: 0;
}

@media (min-width: 640px) {
  .exp-main-card {
    padding: 2rem;
  }
}

.exp-top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.65rem;
}

.exp-header {
  margin-bottom: 1.15rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.exp-role {
  font-family: var(--font-barcelona);
  font-size: clamp(1.3rem, 4.5vw, 1.6rem);
  font-weight: 700;
  color: var(--color-sand);
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.exp-company {
  font-family: var(--font-rome);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-aqua);
  margin-bottom: 0.35rem;
}

.exp-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-sand-muted);
}

.exp-bullets {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.exp-bullet {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.exp-check-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-gold-subtle);
  color: var(--color-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.2rem;
  font-size: 0.75rem;
}

.exp-bullet-text {
  font-family: var(--font-rome);
  font-size: 0.875rem;
  color: var(--color-sand-soft);
  line-height: 1.55;
}

.exp-bullet-text strong {
  color: var(--color-sand);
}

.philosophy-card {
  background: var(--color-navy-surface);
  border: 1px solid var(--color-teal-border);
  border-radius: 18px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

@media (min-width: 640px) {
  .philosophy-card {
    padding: 1.75rem;
  }
}

.philosophy-title {
  font-family: var(--font-barcelona);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-sand);
  margin-bottom: 1rem;
}

.philosophy-item {
  background: rgba(6, 9, 17, 0.52);
  border: 1px solid var(--color-teal-border);
  border-radius: 10px;
  padding: 0.9rem;
  margin-bottom: 0.75rem;
}

.philosophy-heading {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-gold);
  margin-bottom: 0.35rem;
}

.philosophy-desc {
  font-family: var(--font-rome);
  font-size: 0.825rem;
  color: var(--color-sand-soft);
  line-height: 1.5;
}

/* Formación y certificaciones */
.education-card {
  background: var(--color-navy-surface);
  border: 1px solid var(--color-teal-border);
  border-radius: 14px;
  padding: 1.2rem;
  margin-bottom: 1rem;
  position: relative;
}

.edu-status {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
}

@media (min-width: 540px) {
  .education-card {
    padding: 1.5rem;
  }

  .edu-status {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    margin-bottom: 0;
  }

  .edu-degree {
    padding-right: 5.5rem;
  }
}

.edu-status.active {
  background: var(--color-gold-subtle);
  color: var(--color-gold);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.edu-status.complete {
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.edu-degree {
  font-family: var(--font-barcelona);
  font-size: clamp(1.12rem, 3.8vw, 1.25rem);
  font-weight: 700;
  color: var(--color-sand);
  margin-bottom: 0.25rem;
}

.edu-institution {
  font-family: var(--font-rome);
  font-size: 0.9rem;
  color: var(--color-sand-muted);
  font-weight: 500;
  margin-bottom: 0.45rem;
}

.edu-residencia {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.38rem 0.72rem;
  margin: 0.15rem 0 0.7rem;
  border-radius: 8px;
  background: var(--color-gold-subtle);
  border: 1px solid rgba(56, 189, 248, 0.32);
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--color-aqua);
  line-height: 1.4;
  max-width: 100%;
}

.edu-residencia i {
  color: var(--color-gold);
  flex-shrink: 0;
}

.edu-desc {
  font-family: var(--font-rome);
  font-size: 0.85rem;
  color: var(--color-sand-soft);
  line-height: 1.5;
}

.languages-card {
  margin-bottom: 0;
}

.languages-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-right: 0;
  margin-bottom: 0.75rem;
}

.languages-heading i {
  color: var(--color-gold);
  font-size: 1rem;
}

.languages-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.6rem;
}

@media (min-width: 420px) {
  .languages-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.language-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 40px;
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  background: rgba(6, 9, 17, 0.52);
  border: 1px solid var(--color-teal-border);
}

.language-name {
  font-family: var(--font-rome);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-sand);
}

.language-level {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-aqua);
  white-space: nowrap;
}

.cert-item {
  background: var(--color-navy-surface);
  border: 1px solid var(--color-teal-border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
  position: relative;
  transition: all var(--trans-fast);
}

.cert-item > div:first-child {
  min-width: 0;
  width: 100%;
}

@media (min-width: 560px) and (max-width: 859px), (min-width: 1120px) {
  .cert-item {
    padding: 1.15rem 1.35rem;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }

  .cert-item > div:first-child {
    width: auto;
    flex: 1 1 auto;
  }
}

.cert-item:hover {
  transform: translateX(4px);
  border-color: var(--color-aqua);
}

.cert-item-interactive {
  cursor: pointer;
  user-select: none;
}

.cert-item-interactive:hover {
  border-color: var(--color-gold);
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.45);
}

.cert-title {
  font-family: var(--font-rome);
  font-size: 0.93rem;
  font-weight: 700;
  color: var(--color-sand);
  margin-bottom: 0.2rem;
  line-height: 1.35;
}

.cert-issuer {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--color-sand-muted);
  line-height: 1.4;
}

.cert-badge-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.cert-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  background: var(--color-aqua-subtle);
  color: var(--color-aqua);
  border: 1px solid rgba(56, 189, 248, 0.28);
  white-space: nowrap;
}

.cert-view-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-sand-soft);
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-subtle);
  padding: 0.18rem 0.5rem;
  border-radius: 9999px;
  transition: all var(--trans-fast);
}

.cert-item-interactive:hover .cert-view-hint {
  background: var(--color-gold);
  color: var(--color-navy-deep);
  border-color: var(--color-gold);
  transform: scale(1.05);
}

/* Popover Flotante en Hover */
.cert-preview-popover {
  position: absolute;
  bottom: calc(100% + 12px);
  right: 0;
  width: min(340px, 92vw);
  background: rgba(11, 15, 25, 0.96);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid rgba(56, 189, 248, 0.38);
  border-radius: 14px;
  padding: 8px;
  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.82),
    0 0 25px rgba(56, 189, 248, 0.15);
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  pointer-events: none;
  transition:
    opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 65;
}

.cert-preview-popover::after {
  content: "";
  position: absolute;
  bottom: -6px;
  right: 32px;
  width: 12px;
  height: 12px;
  background: rgba(11, 15, 25, 0.96);
  border-right: 1px solid rgba(56, 189, 248, 0.38);
  border-bottom: 1px solid rgba(56, 189, 248, 0.38);
  transform: rotate(45deg);
}

.cert-item-interactive:hover .cert-preview-popover,
.cert-item-interactive:focus-visible .cert-preview-popover {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (max-width: 767px), (hover: none) {
  .cert-preview-popover {
    display: none;
  }

  .cert-item:hover {
    transform: none;
  }
}

.cert-preview-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 10px;
  background: #060911;
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.cert-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cert-preview-caption {
  padding: 6px 4px 2px 4px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--color-aqua);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

/* Contacto */
.contact-card {
  background: linear-gradient(145deg, #111827 0%, #060911 100%);
  border: 1px solid var(--color-teal-border);
  border-radius: 18px;
  padding: 1.75rem 1.15rem;
  text-align: center;
  box-shadow: var(--shadow-card);
}

@media (min-width: 640px) {
  .contact-card {
    border-radius: 20px;
    padding: 3.25rem 2.5rem;
  }
}

.contact-title {
  font-family: var(--font-barcelona);
  font-size: clamp(1.55rem, 5.5vw, 2.2rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-sand);
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}

.contact-subtitle {
  font-family: var(--font-rome);
  font-size: clamp(0.92rem, 2.4vw, 1rem);
  color: var(--color-sand-soft);
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

@media (min-width: 640px) {
  .contact-subtitle {
    margin-bottom: 2rem;
  }
}

.contact-interactive-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 0.75rem;
}

@media (min-width: 560px) {
  .contact-interactive-bar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
  }
}

.email-interactive-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 46px;
  padding: 0.65rem 1rem;
  border-radius: 12px;
  background: rgba(6, 9, 17, 0.65);
  border: 1px solid var(--border-medium);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--color-sand);
  cursor: pointer;
  user-select: none;
  max-width: 100%;
  transition: all var(--trans-normal);
}

@media (min-width: 560px) {
  .email-interactive-chip {
    gap: 0.75rem;
    padding: 0.75rem 1.35rem;
    font-size: 0.925rem;
  }
}

.email-interactive-chip:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: var(--color-gold);
  transform: translateY(-2px);
  box-shadow: var(--color-gold-glow);
}

.chip-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gold);
  flex-shrink: 0;
}

.chip-email {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.chip-copy-hint {
  display: flex;
  align-items: center;
  color: var(--color-aqua);
}

.chip-tooltip {
  position: absolute;
  top: -36px;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: var(--color-navy-deep);
  color: var(--color-sand);
  border: 1px solid var(--color-gold);
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: all var(--trans-fast);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 10;
}

.chip-tooltip::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px 5px 0 5px;
  border-style: solid;
  border-color: var(--color-navy-deep) transparent transparent transparent;
}

.email-interactive-chip:hover .chip-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.email-interactive-chip.copied {
  border-color: var(--color-gold);
  background: var(--color-gold-subtle);
  color: var(--color-gold);
}

.email-interactive-chip.copied .chip-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  background: var(--color-navy-deep);
  border-color: var(--color-gold);
  color: var(--color-gold);
}

@media (hover: none) {
  .email-interactive-chip:hover .chip-tooltip {
    opacity: 0;
  }

  .email-interactive-chip.copied .chip-tooltip {
    opacity: 1;
  }
}

.direct-email-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 46px;
  padding: 0.65rem 1.25rem;
  border-radius: 12px;
  background: rgba(51, 65, 85, 0.35);
  border: 1px solid var(--border-medium);
  font-family: var(--font-rome);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-sand);
  transition: all var(--trans-normal);
}

.direct-email-link:hover {
  background: rgba(56, 189, 248, 0.14);
  border-color: var(--color-aqua);
  color: #ffffff;
  transform: translateY(-2px);
}

.contact-profile-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 1rem;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

.contact-profile-links .btn {
  width: 100%;
  min-height: 40px;
}

.contact-profile-links .btn-primary {
  grid-column: 1 / -1;
}

@media (min-width: 560px) {
  .contact-profile-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    max-width: none;
  }

  .contact-profile-links .btn {
    width: auto;
  }
}

/* Footer */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 2.5rem 0;
  background: var(--color-navy-deep);
  font-family: var(--font-rome);
  text-align: center;
}

.footer-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
}

.footer-social-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.15rem;
}

.social-icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.85);
  border: 1px solid var(--color-teal-border);
  color: var(--color-sand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all var(--trans-normal);
}

.social-icon-btn:hover {
  background: var(--color-gold);
  border-color: var(--color-gold);
  color: var(--color-navy-deep);
  transform: translateY(-3px) scale(1.08);
  box-shadow: var(--color-gold-glow);
}

.footer-name {
  font-family: var(--font-barcelona);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-sand);
}

.footer-meta {
  font-family: var(--font-mono);
  font-size: 0.775rem;
  color: var(--color-sand-muted);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(6, 9, 17, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--trans-normal);
}

@media (min-width: 640px) {
  .modal-overlay {
    padding: 1.25rem;
  }
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--color-navy-surface);
  border: 1px solid var(--color-teal-border);
  border-radius: 16px;
  width: 100%;
  max-width: 780px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden; /* Recorta perfectamente las esquinas redondeadas sin fugas */
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.85);
  transform: scale(0.96) translateY(12px);
  transition: transform var(--trans-normal);
}

@media (min-width: 640px) {
  .modal-dialog {
    border-radius: 20px;
    max-height: 88vh;
  }
}

.modal-overlay.active .modal-dialog {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(6, 9, 17, 0.82);
  color: var(--color-sand);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  border: 1px solid var(--color-teal-border);
  font-size: 1rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all var(--trans-fast);
}

@media (min-width: 640px) {
  .modal-close {
    top: 1.15rem;
    right: 1.15rem;
  }
}

.modal-close:hover {
  color: var(--color-navy-deep);
  background: var(--color-gold);
  border-color: var(--color-gold);
  transform: rotate(90deg);
}

.modal-body {
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(92vh - 2px);
  padding: 1.25rem;

  /* Scrollbar refinada Firefox */
  scrollbar-width: thin;
  scrollbar-color: var(--color-teal) transparent;
}

@media (min-width: 640px) {
  .modal-body {
    max-height: calc(88vh - 2px);
    padding: 2.25rem 2.5rem;
  }
}

.modal-highlights-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.85rem;
  margin: 1.25rem 0;
}

@media (min-width: 520px) {
  .modal-highlights-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.modal-highlight-card {
  background: rgba(6, 9, 17, 0.52);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1rem;
  height: 100%;
}

.modal-footer-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
}

.modal-footer-actions .btn {
  width: 100%;
}

@media (min-width: 560px) {
  .modal-footer-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }

  .modal-footer-actions .btn {
    width: auto;
  }
}

/* Scrollbar refinada Webkit sin flechas ni esquinas cuadradas */
.modal-body::-webkit-scrollbar {
  width: 7px;
}

.modal-body::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent !important;
  margin: 18px 0;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--color-teal);
  border-radius: 9999px;
  transition: background var(--trans-fast);
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--color-gold);
}

/* Lightbox de Certificados */
.cert-lightbox-dialog {
  position: relative;
  max-width: 900px;
  width: 100%;
  margin: auto;
  background: rgba(11, 15, 25, 0.96);
  border: 1px solid var(--border-medium);
  border-radius: 16px;
  padding: 0.9rem;
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.85);
  transform: translateY(20px) scale(0.96);
  transition: transform var(--trans-normal);
}

@media (min-width: 640px) {
  .cert-lightbox-dialog {
    width: 94%;
    border-radius: 18px;
    padding: 1.25rem;
  }
}

.modal-overlay.active .cert-lightbox-dialog {
  transform: translateY(0) scale(1);
}

.cert-lightbox-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  padding-top: 2.35rem;
}

@media (min-width: 640px) {
  .cert-lightbox-body {
    padding-top: 1rem;
  }
}

.cert-lightbox-body img {
  width: 100%;
  max-height: 76vh;
  object-fit: contain;
  border-radius: 10px;
  background: #020617;
  border: 1px solid rgba(148, 163, 184, 0.15);
  display: block;
}

.cert-lightbox-caption {
  font-family: var(--font-rome);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-sand);
  text-align: center;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  z-index: 70;
  background: var(--color-navy-deep);
  border: 1px solid var(--color-gold);
  color: var(--color-sand);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all var(--trans-normal);
}

@media (min-width: 640px) {
  .toast {
    left: auto;
    bottom: 1.75rem;
    right: 1.75rem;
    padding: 0.85rem 1.25rem;
    font-size: 0.825rem;
    justify-content: flex-start;
  }
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Animaciones */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.55s var(--ease-spring),
    transform 0.55s var(--ease-spring);
  will-change: opacity, transform;
}

.reveal-on-scroll.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

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