/* =========================================================
   Mi Proyecto — Luminous Refraction (HTML + CSS + JS puro)
   ========================================================= */

   :root {
    --bg: hsl(225, 30%, 96%);
    --fg: hsl(230, 25%, 14%);
    --card: #ffffff;
    --muted: hsl(230, 15%, 40%);
    --border: hsl(225, 20%, 88%);
  
    --primary: hsl(252, 84%, 60%);
    --primary-glow: hsl(258, 90%, 72%);
    --accent: hsl(100, 65%, 55%);
  
    --gradient-hero: linear-gradient(135deg, hsl(252, 84%, 60%) 0%, hsl(258, 90%, 72%) 50%, hsl(100, 65%, 55%) 100%);
    --gradient-text: linear-gradient(120deg, hsl(252, 84%, 60%) 0%, hsl(100, 65%, 55%) 100%);
  
    --shadow-soft: 0 4px 20px -8px hsl(252 84% 60% / 0.15);
    --shadow-elegant: 0 20px 50px -20px hsl(252 84% 60% / 0.35);
    --shadow-glow: 0 0 60px -10px hsl(258 90% 72% / 0.5);
  
    --radius: 0.85rem;
  }
  
  * { box-sizing: border-box; margin: 0; padding: 0; }
  
  html { scroll-behavior: smooth; }
  
  body {
    font-family: 'Outfit', system-ui, sans-serif;
    background: var(--bg);
    color: var(--fg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
  }
  
  h1, h2, h3, h4 {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    letter-spacing: -0.02em;
    line-height: 1.15;
  }
  
  a { color: inherit; text-decoration: none; }
  img { display: block; max-width: 100%; }
  
  .container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
  
  .text-gradient {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
  
  .muted { color: var(--muted); font-size: 0.85rem; }
  .strong { font-weight: 600; font-size: 0.9rem; }
  
  /* ===== Buttons ===== */
  .btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.85rem 1.5rem; border-radius: var(--radius);
    font-weight: 600; font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer; border: none;
  }
  .btn-primary {
    background: var(--gradient-hero); color: white;
    box-shadow: var(--shadow-soft);
  }
  .btn-primary:hover { transform: scale(1.05); box-shadow: var(--shadow-glow); }
  .btn-outline {
    background: var(--card); color: var(--fg);
    border: 1px solid var(--border);
  }
  .btn-outline:hover { border-color: var(--primary); color: var(--primary); }
  
  /* ===== Chip ===== */
  .chip {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 1rem; border-radius: 999px;
    background: var(--card); border: 1px solid var(--border);
    font-size: 0.75rem; font-weight: 500; color: var(--muted);
    box-shadow: var(--shadow-soft);
  }
  
  /* ===== Navbar ===== */
  #navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 50;
    transition: all 0.3s ease;
  }
  #navbar.scrolled {
    background: rgba(245, 245, 250, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
  }
  .nav { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.5rem; }
  .brand { display: flex; align-items: center; gap: 0.5rem; }
  .brand-logo {
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--gradient-hero); color: white;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Space Grotesk', sans-serif; font-weight: 700;
    box-shadow: var(--shadow-glow);
  }
  .brand-name { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.1rem; }
  .nav-links { display: flex; gap: 2rem; list-style: none; }
  
  /* ✨ TRANSICIÓN DE LÍNEA EN HOVER ✨ */
  .nav-links a {
    position: relative;
    font-size: 0.9rem; font-weight: 500; color: var(--muted);
    transition: color 0.3s;
  }
  .nav-links a::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-text); /* Hereda el gradiente de tu diseño */
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .nav-links a:hover { color: var(--primary); }
  .nav-links a:hover::after { transform: scaleX(1); }
  /* ==================================== */
  
  .nav-cta { padding: 0.6rem 1.25rem; font-size: 0.85rem; }
  .menu-btn {
    display: none; background: none; border: none;
    font-size: 1.5rem; cursor: pointer; color: var(--fg);
  }
  
  /* ===== Hero ===== */
  .hero {
    position: relative; min-height: 100vh;
    display: flex; align-items: center;
    padding: 7rem 0 4rem; overflow: hidden;
  }
  .glow {
    position: absolute; border-radius: 50%;
    filter: blur(80px); opacity: 0.5; pointer-events: none;
  }
  .glow-1 { width: 400px; height: 400px; background: var(--primary); top: -80px; left: -80px; }
  .glow-2 { width: 400px; height: 400px; background: var(--accent); bottom: 0; right: 0; opacity: 0.35; }
  
  .hero-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 3rem;
    align-items: center; position: relative;
  }
  .hero-text { animation: fadeUp 0.7s ease-out both; }
  .hero-text h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem); font-weight: 700; margin: 1.5rem 0;
  }
  .lead { font-size: 1.1rem; color: var(--muted); max-width: 500px; }
  .lead.center { margin: 0 auto; text-align: center; }
  .hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin: 2rem 0; }
  
  .stats { display: flex; align-items: center; gap: 2rem; margin-top: 2rem; }
  .stats > div:not(.divider) { display: flex; flex-direction: column; }
  .stats strong {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.875rem; font-weight: 700;
  }
  .stats span { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin-top: 0.25rem; }
  .divider { width: 1px; height: 40px; background: var(--border); }
  
  .hero-image { position: relative; animation: fadeUp 0.7s ease-out 0.2s both; }
  .image-glow {
    position: absolute; inset: 0; background: var(--gradient-hero);
    border-radius: 2rem; filter: blur(40px); opacity: 0.4;
    animation: pulseGlow 3s ease-in-out infinite;
  }
  .hero-image img {
    position: relative; width: 100%; aspect-ratio: 1;
    object-fit: cover; border-radius: 2rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-elegant);
    animation: float 6s ease-in-out infinite;
  }
  .floating-badge {
    position: absolute; bottom: -1rem; left: -1rem;
    background: var(--card); border: 1px solid var(--border);
    border-radius: 1rem; padding: 1rem;
    display: flex; align-items: center; gap: 0.75rem;
    box-shadow: var(--shadow-elegant);
    animation: float 6s ease-in-out 1s infinite;
  }
  .badge-icon {
    width: 40px; height: 40px; border-radius: 10px;
    background: hsl(100 65% 55% / 0.2);
    display: flex; align-items: center; justify-content: center; font-size: 1.25rem;
  }
  
  /* ===== Sections ===== */
  .section { padding: 6rem 0; }
  .section-alt { background: hsl(225, 25%, 92%); }
  .section-head { text-align: center; max-width: 700px; margin: 0 auto 4rem; }
  .section-head h2 {
    font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; margin: 1rem 0;
  }
  
  /* ===== About ===== */
  .about-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem;
  }
  .card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 2rem;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
  }
  .card:hover { transform: translateY(-5px); box-shadow: var(--shadow-elegant); }
  .card h3 { font-size: 1.25rem; margin-bottom: 1rem; }
  .card p { color: var(--muted); }
  
  .check-list { list-style: none; }
  .check-list li {
    padding: 0.4rem 0; color: var(--muted);
    display: flex; align-items: center; gap: 0.5rem;
  }
  .check-list li::before { content: "✓"; color: var(--accent); font-weight: 700; }
  
  .tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
  .tags span {
    padding: 0.35rem 0.85rem; border-radius: 999px;
    background: hsl(252 84% 60% / 0.1); color: var(--primary);
    font-size: 0.8rem; font-weight: 500;
  }
  
  /* ===== Projects ===== */
  .projects-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem;
  }
  .project-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow-soft); transition: all 0.4s ease;
  }
  .project-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-elegant); }
  .project-img { aspect-ratio: 16/10; overflow: hidden; }
  .project-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
  .project-card:hover .project-img img { transform: scale(1.08); }
  .project-body { padding: 1.5rem; }
  .project-body h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
  .project-body p { color: var(--muted); margin-bottom: 1rem; font-size: 0.95rem; }
  .project-actions { display: flex; gap: 1rem; margin-top: 1rem; }
  .link { color: var(--primary); font-weight: 500; font-size: 0.9rem; transition: opacity 0.2s; }
  .link:hover { opacity: 0.7; }
  
  /* ===== Contact ===== */
  .contact-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
  }
  .contact-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 2.5rem 2rem;
    text-align: center; box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 320px;
  }
  .contact-card:hover {
    transform: translateY(-5px); border-color: var(--primary);
    box-shadow: var(--shadow-elegant);
  }
  .contact-icon {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
  }
  .contact-icon svg,
  .contact-icon img {
    width: 80px;
    height: 80px;
    object-fit: contain;
  }
  .contact-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
  .contact-card p { color: var(--muted); font-size: 0.9rem; word-break: break-word; }
  
  /* ===== Footer ===== */
  .footer { padding: 2.5rem 0; border-top: 1px solid var(--border); }
  .footer-grid {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 1.5rem;
  }
  .footer .brand { margin-bottom: 0.5rem; }
  
  /* ===== Animations ===== */
  @keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
  }
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
  }
  @keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 20px hsl(252 84% 60% / 0.3); }
    50% { box-shadow: 0 0 40px hsl(252 84% 60% / 0.6); }
  }
  
  /* ===== Responsive ===== */
  @media (max-width: 900px) {
    .hero-grid, .about-grid, .projects-grid, .contact-grid {
      grid-template-columns: 1fr;
    }
    .nav-links, .nav-cta { display: none; }
    .menu-btn { display: block; }
    .nav-links.open {
      display: flex; flex-direction: column;
      position: absolute; top: 100%; left: 0; right: 0;
      background: var(--card); padding: 1.5rem; gap: 1rem;
      border-bottom: 1px solid var(--border);
    }
    .stats { flex-wrap: wrap; gap: 1rem; }
    .floating-badge { left: 0; }
    
    .contact-icon {
      width: 100px;
      height: 100px;
    }
    .contact-icon svg,
    .contact-icon img {
      width: 70px;
      height: 70px;
    }
  }