/* ===================================================== */
/* CAPSULE MENU — Templates / Palettes                    */
/* Switch by changing class on wrapper:                  */
/*  - capsule-theme-glass (default)                      */
/*  - capsule-theme-solid                                */
/* ===================================================== */

/* ---------- GLASS (Liquid-ish) ---------- */
.capsule-theme-glass {
  --cap-bg: rgba(255, 255, 255, 0.58);
  --cap-border: rgba(255, 255, 255, 0.55);
  --cap-shadow: 0 14px 38px rgba(0,0,0,0.12);
  --cap-shadow-hover: 0 18px 46px rgba(0,0,0,0.16);

  --cap-link: rgba(15, 15, 15, 0.88);
  --cap-link-hover: rgba(15, 15, 15, 0.60);

  --cap-blur: 18px;
  --cap-sat: 160%;

  /* highlight interno tipo vidrio */
  --cap-highlight: linear-gradient(
    to bottom,
    rgba(255,255,255,0.85),
    rgba(255,255,255,0.25)
  );
}

/* ---------- SOLID (fallback / alternativa) ---------- */
.capsule-theme-solid {
  --cap-bg: #ffffff;
  --cap-border: rgba(0,0,0,0.06);
  --cap-shadow: 0 10px 30px rgba(0,0,0,0.08);
  --cap-shadow-hover: 0 14px 38px rgba(0,0,0,0.10);

  --cap-link: #111;
  --cap-link-hover: rgba(0,0,0,0.60);

  --cap-blur: 0px;
  --cap-sat: 100%;
  --cap-highlight: none;
}

/* ----------------------------------------------------- */
/* CAPSULE MENU — Floating Navigation Capsule            */
/* ----------------------------------------------------- */

.nav-capsule-wrapper {
  width: 100%;
  text-align: center;
  margin-top: 2.5rem;
}

/* Capsule core */
.nav-capsule {
  position: relative;
  display: inline-flex;
  gap: 2rem;
  align-items: center;
  justify-content: center;

  padding: 1rem 2.5rem;
  border-radius: 999px;

  /* Glass base */
  background: var(--cap-bg);
  border: 1px solid var(--cap-border);
  box-shadow: var(--cap-shadow);

  /* iOS-ish glass */
  -webkit-backdrop-filter: blur(var(--cap-blur)) saturate(var(--cap-sat));
  backdrop-filter: blur(var(--cap-blur)) saturate(var(--cap-sat));

  transition: transform 0.25s ease, box-shadow 0.25s ease, padding 0.25s ease, background 0.25s ease;
}

/* highlight interno */
.nav-capsule::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 999px;
  background: var(--cap-highlight);
  pointer-events: none;
  opacity: 0.9;
}

/* Hover */
.nav-capsule:hover {
  transform: translateY(-2px);
  box-shadow: var(--cap-shadow-hover);
}

/* Links */
.nav-capsule a {
  position: relative; /* para quedar por encima del highlight */
  z-index: 1;

  color: var(--cap-link);
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-capsule a:hover {
  opacity: 1;
  color: var(--cap-link-hover);
  transform: translateY(-1px);
}

/* ----------------------------------------------------- */
/* STICKY MODE                                           */
/* ----------------------------------------------------- */

.capsule-sticky {
  position: sticky;
  top: 1.2rem;
  z-index: 50;
}

/* Optional shrink when sticky (si luego lo activas con JS) */
.capsule-sticky.is-stuck .nav-capsule {
  padding: 0.7rem 2rem;
  box-shadow: 0 10px 26px rgba(0,0,0,0.10);
}

/* ----------------------------------------------------- */
/* ANCHOR OFFSET — Prevent capsule covering titles       */
/* ----------------------------------------------------- */
:where(#hero, #about, #skills, #projects, #contact) {
  scroll-margin-top: 120px;
}

/* ----------------------------------------------------- */
/* SMOOTH SCROLL                                         */
/* ----------------------------------------------------- */
html {
  scroll-behavior: smooth;
}

/* ----------------------------------------------------- */
/* Reduce motion                                         */
/* ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .nav-capsule,
  .nav-capsule a {
    transition: none;
  }
}
