:root {
      --primary: #05668d;
      --secondary: #427aa1;
      --accent: #a5be00;
      --background: #f5f7fa;
      --card-bg: #ffffff;
      --text: #0b1f2a;
      --text-muted: #5b6b77;
      --glass-bg: rgba(255, 255, 255, 0.7);
      --glass-border: rgba(255, 255, 255, 0.3);
      --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
      --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
      --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.15);
      --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }
    html {
      scroll-behavior: smooth;
      font-size: 16px;
    }
    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
      background: var(--background);
      color: var(--text);
      line-height: 1.6;
      overflow-x: hidden;
      overscroll-behavior-y: contain; /* evita el espacio vacío al finalizar el scroll */
    }
    /* Skip to content link for accessibility */
    .skip {
      position: absolute;
      top: 0;
      left: 50%;
      transform: translate(-50%, -150%);
      background: var(--primary);
      color: white;
      padding: 0.5rem 1rem;
      text-decoration: none;
      z-index: 10000;
      border-radius: 0 0 4px 4px;
      box-shadow: var(--shadow-sm);
      transition: transform 0.2s ease;
    }
    .skip:focus {
      transform: translate(-50%, 0);
    }
    /* Particles background */
    #particles-canvas {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      z-index: -1;
      pointer-events: none;
      background: var(--background);
    }
    /* Header (Liquid Glass Navigation) */
    header {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 1000;
      background: transparent; /* transparent background, pill provides glass effect */
      border-bottom: none;
      transition: var(--transition);
    }
    header.scrolled {
      /* When header is scrolled, the inner nav has a more opaque background and shadow */
    }
    nav {
      max-width: 1200px;
      margin: 0 auto;
      padding: 1rem 2rem;
    }
    .nav-inner {
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: var(--glass-bg);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border: 1px solid var(--glass-border);
      padding: 0.5rem 1.5rem;
      border-radius: 50px;
      transition: var(--transition);
      gap: 1.5rem;
    }
    .nav-menu {
      flex: 1;
      display: flex;
      align-items: center;
      gap: 1.5rem;
    }
    header.scrolled .nav-inner {
      background: rgba(255, 255, 255, 0.85);
      box-shadow: var(--shadow-sm);
    }
    .logo {
      font-size: 1.5rem;
      font-weight: 700;
      background: linear-gradient(135deg, var(--primary), var(--secondary));
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
      text-decoration: none;
    }
    .nav-links {
      display: flex;
      gap: 2.5rem;
      list-style: none;
      align-items: center;
      padding: 0;
      margin: 0;
      justify-content: center;
      flex: 1;
    }
    .nav-link {
      color: var(--text);
      text-decoration: none;
      font-weight: 500;
      position: relative;
      transition: var(--transition);
      padding: 0.25rem 0;
    }
    .nav-link::after {
      content: '';
      position: absolute;
      bottom: -4px;
      left: 0;
      width: 0;
      height: 2px;
      background: var(--primary);
      transition: width 0.3s ease;
    }
    .nav-link:hover::after {
      width: 100%;
    }
    .nav-link.active {
      color: var(--primary);
      font-weight: 600;
    }
    .nav-link.active::after {
      width: 100%;
    }
    .say-hi {
      background: var(--accent);
      color: white;
      padding: 0.5rem 1.5rem;
      border-radius: 50px;
      font-weight: 600;
      transition: var(--transition);
      margin-left: auto;
    }
    .say-hi:hover {
      transform: translateY(-2px);
      box-shadow: var(--shadow-md);
    }
    .say-hi::after {
      display: none;
    }
    .hamburger {
      display: none;
      flex-direction: column;
      gap: 4px;
      cursor: pointer;
      padding: 0.5rem;
      border: none;
      background: transparent;
    }
    .hamburger span {
      width: 25px;
      height: 3px;
      background: var(--text);
      border-radius: 2px;
      transition: var(--transition);
    }
    /* Hero Section */
    .hero {
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 6rem 2rem 4rem;
      text-align: center;
      position: relative;
      overflow: hidden;
    }
    .hero-content {
      max-width: 800px;
      z-index: 1;
    }
    .hero h1 {
      font-size: clamp(3rem, 8vw, 5rem);
      font-weight: 800;
      margin-bottom: 1rem;
      background: linear-gradient(135deg, var(--primary), var(--secondary));
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }
    .hero h2 {
      font-size: clamp(1.2rem, 3vw, 1.5rem);
      color: var(--text-muted);
      font-weight: 400;
      margin-bottom: 1.5rem;
    }
    .hero p {
      font-size: 1.1rem;
      color: var(--text-muted);
      margin-bottom: 2.5rem;
      line-height: 1.8;
    }
    .cta-buttons {
      display: flex;
      gap: 1rem;
      justify-content: center;
      flex-wrap: wrap;
      margin-bottom: 2rem;
    }
    .btn {
      padding: 0.875rem 2rem;
      border-radius: 50px;
      font-weight: 600;
      text-decoration: none;
      transition: var(--transition);
      cursor: pointer;
      border: none;
      font-size: 1rem;
    }
    .btn-primary {
      background: var(--primary);
      color: white;
    }
    .btn-primary:hover {
      background: var(--secondary);
      transform: translateY(-2px);
      box-shadow: var(--shadow-md);
    }
    .btn-ghost {
      background: transparent;
      color: var(--primary);
      border: 2px solid var(--primary);
    }
    .btn-ghost:hover {
      background: var(--primary);
      color: white;
      transform: translateY(-2px);
    }
    .social-links {
      display: flex;
      gap: 1.5rem;
      justify-content: center;
    }
    .social-links a {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      background: var(--card-bg);
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--primary);
      text-decoration: none;
      transition: var(--transition);
      box-shadow: var(--shadow-sm);
    }
    .social-links a:hover {
      transform: translateY(-4px);
      box-shadow: var(--shadow-md);
      background: var(--primary);
      color: white;
    }
    /* Section Styles */
    main {
      /* padding-bottom: 6rem; */ /* Eliminado para evitar doble espaciado */
    }
    section {
      padding: 5rem 2rem;
      max-width: 1200px;
      margin: 0 auto;
      opacity: 0;
      transform: translateY(30px);
      transition: opacity 0.6s ease, transform 0.6s ease;
      scroll-margin-top: 120px;
    }
    section.visible {
      opacity: 1;
      transform: translateY(0);
    }
    .section-title {
      font-size: clamp(2rem, 5vw, 2.5rem);
      font-weight: 700;
      margin-bottom: 1rem;
      color: var(--text);
    }
    .section-description {
      font-size: 1.1rem;
      color: var(--text-muted);
      margin-bottom: 3rem;
      max-width: 700px;
    }
    /* About Section */
    .about-content {
      display: grid;
      gap: 2rem;
    }
    .about-text {
      font-size: 1.1rem;
      line-height: 1.8;
      color: var(--text);
      margin-bottom: 1.5rem;
    }
    .skill-tags {
      display: flex;
      flex-wrap: wrap;
      gap: 1rem;
      margin-top: 2rem;
    }
    .skill-tag {
      padding: 0.75rem 1.5rem;
      border-radius: 50px;
      background: linear-gradient(135deg, var(--primary), var(--secondary));
      color: white;
      font-weight: 600;
      transition: var(--transition);
      cursor: default;
    }
    .skill-tag:hover {
      transform: translateY(-4px);
      box-shadow: var(--shadow-lg);
    }
    /* Projects Section */
    .filter-buttons {
      display: flex;
      gap: 1rem;
      margin-bottom: 3rem;
      flex-wrap: wrap;
    }
    .filter-btn {
      padding: 0.75rem 1.5rem;
      border-radius: 50px;
      background: var(--card-bg);
      color: var(--text);
      border: 2px solid transparent;
      cursor: pointer;
      font-weight: 600;
      transition: var(--transition);
    }
    .filter-btn:hover {
      border-color: var(--primary);
    }
    .filter-btn.active {
      background: var(--primary);
      color: #ffffff;
      border-color: var(--primary);
    }
    .projects-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
      gap: 2rem;
      margin-bottom: 2rem;
    }
    .project-card {
      background: var(--card-bg);
      border-radius: 16px;
      padding: 2rem;
      box-shadow: var(--shadow-sm);
      border: 2px solid transparent;
      transition: var(--transition);
      display: none;
    }
    .project-card.visible {
      display: block;
      animation: fadeIn 0.5s ease forwards;
    }
    @keyframes fadeIn {
      from {
        opacity: 0;
        transform: translateY(20px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }
    .project-card:hover {
      transform: translateY(-8px);
      box-shadow: var(--shadow-lg);
      border-color: var(--primary);
    }
    .project-header {
      display: flex;
      justify-content: space-between;
      align-items: start;
      margin-bottom: 1rem;
    }
    .project-title {
      font-size: 1.3rem;
      font-weight: 700;
      color: var(--text);
      margin-bottom: 0.5rem;
    }
    .project-year {
      background: var(--accent);
      color: white;
      padding: 0.25rem 0.75rem;
      border-radius: 20px;
      font-size: 0.875rem;
      font-weight: 600;
    }
    .project-description {
      color: var(--text-muted);
      margin-bottom: 1.5rem;
      line-height: 1.6;
    }
    .project-tags {
      display: flex;
      flex-wrap: wrap;
      gap: 0.5rem;
      margin-bottom: 1.5rem;
    }
    .project-tag {
      padding: 0.25rem 0.75rem;
      background: rgba(5, 102, 141, 0.1);
      color: var(--primary);
      border-radius: 12px;
      font-size: 0.875rem;
      font-weight: 500;
    }
    .project-links {
      display: flex;
      gap: 1rem;
      flex-wrap: wrap;
    }
    .project-link {
      padding: 0.5rem 1rem;
      border-radius: 8px;
      text-decoration: none;
      font-weight: 600;
      font-size: 0.875rem;
      transition: var(--transition);
    }
    .project-link.code {
      background: var(--primary);
      color: white;
    }
    .project-link.code:hover {
      background: var(--secondary);
    }
    .project-link.demo,
    .project-link.notebook {
      background: rgba(5, 102, 141, 0.1);
      color: var(--primary);
      border: 1px solid var(--primary);
    }
    .project-link.demo:hover,
    .project-link.notebook:hover {
      background: var(--primary);
      color: white;
    }
    .show-more {
      display: flex;
      justify-content: center;
      margin-top: 2rem;
    }
    /* Experience Timeline */
    .timeline-container {
      position: relative;
      margin-top: 3rem;
    }
    .timeline-nav {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 1rem;
      margin-bottom: 2rem;
    }
    .timeline-nav-btn {
      width: 48px;
      height: 48px;
      border-radius: 50%;
      background: var(--card-bg);
      border: 2px solid var(--primary);
      color: var(--primary);
      font-size: 1.5rem;
      cursor: pointer;
      transition: var(--transition);
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .timeline-nav-btn:hover {
      background: var(--primary);
      color: white;
      transform: scale(1.08);
    }
    .timeline-nav-btn:disabled,
    .timeline-nav-btn:disabled:hover {
      opacity: 0.35;
      cursor: not-allowed;
      background: var(--card-bg);
      color: var(--primary);
      transform: none;
    }
    .fade-scroll-wrapper {
      position: relative;
    }
    .fade-scroll-wrapper::before,
    .fade-scroll-wrapper::after {
      content: '';
      position: absolute;
      top: 0;
      bottom: 16px;
      width: 4rem;
      pointer-events: none;
      z-index: 5;
    }
    .fade-scroll-wrapper::before {
      left: 0;
      background: linear-gradient(to right, var(--background) 35%, rgba(245, 247, 250, 0));
    }
    .fade-scroll-wrapper::after {
      right: 0;
      background: linear-gradient(to left, var(--background) 35%, rgba(245, 247, 250, 0));
    }
    .timeline-wrapper {
      overflow-x: auto;
      scroll-behavior: smooth;
      scrollbar-width: thin;
      scrollbar-color: var(--primary) var(--card-bg);
      padding-bottom: 1rem;
      scroll-snap-type: x proximity;
    }
    .timeline-wrapper::-webkit-scrollbar {
      height: 8px;
    }
    .timeline-wrapper::-webkit-scrollbar-track {
      background: var(--card-bg);
      border-radius: 10px;
    }
    .timeline-wrapper::-webkit-scrollbar-thumb {
      background: var(--primary);
      border-radius: 10px;
    }
    .timeline {
      display: flex;
      gap: 2rem;
      padding: 2rem 0;
      min-width: min-content;
      position: relative;
    }
    .timeline::before {
      content: '';
      position: absolute;
      top: 2.5rem;
      left: 0;
      right: 0;
      height: 2px;
      background: rgba(5, 102, 141, 0.15);
      z-index: 0;
    }
    .timeline-card-wrapper {
      position: relative;
      min-width: 320px;
      max-width: 400px;
      padding-top: 2.5rem;
      scroll-snap-align: start;
    }
    .timeline-card {
      background: var(--card-bg);
      border-radius: 16px;
      padding: 2rem;
      box-shadow: var(--shadow-sm);
      border: 2px solid transparent;
      transition: var(--transition);
      opacity: 0;
      transform: translateY(20px);
      height: 100%;
      position: relative;
    }
    .timeline-card::before {
      content: '';
      position: absolute;
      top: -1.75rem;
      left: 2rem;
      width: 1rem;
      height: 1rem;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--primary), var(--secondary));
      border: 3px solid var(--background);
      box-shadow: 0 0 0 6px rgba(5, 102, 141, 0.12);
      transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    .timeline-card.visible {
      opacity: 1;
      transform: translateY(0);
    }
    .timeline-card:hover {
      transform: translateY(-8px);
      box-shadow: var(--shadow-lg);
      border-color: var(--primary);
    }
    .timeline-card:hover::before {
      transform: scale(1.1);
      box-shadow: 0 0 0 8px rgba(5, 102, 141, 0.18);
    }
    .timeline-title {
      font-size: 1.3rem;
      font-weight: 700;
      color: var(--text);
      margin-bottom: 0.5rem;
    }
    .timeline-subtitle {
      font-size: 0.95rem;
      color: var(--text-muted);
      margin-bottom: 1rem;
      font-weight: 500;
    }
    .timeline-description {
      color: var(--text-muted);
      line-height: 1.6;
      margin-bottom: 1rem;
    }
    .timeline-tags {
      display: flex;
      flex-wrap: wrap;
      gap: 0.5rem;
    }
    .timeline-tag {
      padding: 0.25rem 0.75rem;
      background: rgba(165, 190, 0, 0.15);
      color: var(--accent);
      border-radius: 12px;
      font-size: 0.875rem;
      font-weight: 600;
    }
    /* Skills Section */
    .skills-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
      gap: 3rem;
      margin-bottom: 3rem;
    }
    .skills-column h3 {
      font-size: 1.5rem;
      margin-bottom: 2rem;
      color: var(--text);
    }
    .skill-item {
      margin-bottom: 2rem;
    }
    .skill-header {
      display: flex;
      justify-content: space-between;
      margin-bottom: 0.5rem;
    }
    .skill-name {
      font-weight: 600;
      color: var(--text);
    }
    .skill-percentage {
      font-weight: 700;
      color: var(--primary);
    }
    .skill-bar {
      height: 8px;
      background: rgba(5, 102, 141, 0.1);
      border-radius: 10px;
      overflow: hidden;
    }
    .skill-progress {
      height: 100%;
      background: linear-gradient(90deg, var(--primary), var(--secondary));
      border-radius: 10px;
      width: 0;
      transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .skill-item.animate .skill-progress {
      width: var(--skill-width);
    }
    /* Grouped Skills Container */
    .skills-container {
      background: var(--card-bg);
      border: 1px solid rgba(5, 102, 141, 0.1);
      border-radius: 16px;
      padding: 2rem;
      box-shadow: var(--shadow-sm);
    }
    .skills-container h3 {
      font-size: 1.5rem;
      margin-bottom: 2rem;
      color: var(--text);
    }
    .tech-skills {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
      gap: 1.5rem 2rem;
      margin-bottom: 2rem;
    }
    .soft-skills {
      list-style: none;
      padding: 0;
      margin: 0;
      display: grid;
      grid-template-columns: 1fr;
      gap: 0.5rem 1rem;
    }
    .soft-skills li {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      color: var(--text);
    }
    .soft-skills li::before {
      content: '✓';
      width: 24px;
      height: 24px;
      background: var(--accent);
      color: white;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      flex-shrink: 0;
    }
    .certifications {
      background: var(--card-bg);
      border-radius: 16px;
      padding: 2rem;
      box-shadow: var(--shadow-sm);
      margin-top: 3rem;
    }
    .certifications h3 {
      font-size: 1.5rem;
      margin-bottom: 1.5rem;
      color: var(--text);
    }
    .certifications ul {
      list-style: none;
      padding: 0;
    }
    .certifications li {
      padding: 0.75rem 0;
      border-bottom: 1px solid rgba(5, 102, 141, 0.1);
      color: var(--text-muted);
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }
    .certifications li:last-child {
      border-bottom: none;
    }
    .certifications li::before {
      content: '✓';
      width: 24px;
      height: 24px;
      background: var(--accent);
      color: white;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      flex-shrink: 0;
    }
    /* Contact Section */
    .contact-icons {
      display: flex;
      justify-content: center;
      gap: 1rem;
      flex-wrap: wrap;
      margin-top: 2.5rem;
    }
    .contact-icon-link {
      width: 56px;
      height: 56px;
      border-radius: 50%;
      border: 1.5px solid rgba(11, 31, 42, 0.4);
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text);
      background: rgba(255, 255, 255, 0.9);
      transition: var(--transition);
    }
    .contact-icon-link svg {
      width: 26px;
      height: 26px;
      stroke: currentColor;
      fill: none;
      stroke-width: 1.5;
      stroke-linecap: round;
      stroke-linejoin: round;
    }
    .contact-icon-link:hover {
      color: var(--primary);
      border-color: var(--primary);
      transform: translateY(-4px);
      box-shadow: var(--shadow-sm);
    }
    /* Footer */
    footer {
      text-align: center;
      padding: 2rem;
      background: var(--card-bg);
      color: var(--text-muted);
      border-top: 1px solid rgba(5, 102, 141, 0.1);
    }
    /* Responsive Design */
    @media (max-width: 768px) {
      .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--glass-bg);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 2rem;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: var(--shadow-lg);
        gap: 1.5rem;
      }
      .nav-menu.active {
        transform: translateX(0);
      }
      .nav-links {
        flex-direction: column;
        width: 100%;
        gap: 1rem;
        justify-content: flex-start;
        flex: initial;
      }
      .nav-link {
        width: 100%;
        text-align: center;
        padding: 0.75rem 0;
      }
      .say-hi {
        width: 100%;
        text-align: center;
        margin-left: 0;
      }
      .hamburger {
        display: flex;
      }
      .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
      }
      .hamburger.active span:nth-child(2) {
        opacity: 0;
      }
      .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
      }
      .hero {
        padding-top: 8rem;
      }
      section {
        padding: 3rem 1.5rem;
      }
      .projects-grid {
        grid-template-columns: 1fr;
      }
      .timeline-card {
        min-width: 280px;
      }
      .skills-grid {
        grid-template-columns: 1fr;
      }
    }
    @media (min-width: 768px) {
      .soft-skills {
        grid-template-columns: 1fr 1fr;
      }
    }
  
    #contacto {
      padding-bottom: 6rem; /* Aumentado para dar espacio antes del footer */
      margin-bottom: 0;
    }

#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}