/* css styles */

:root {
  --brand-dark: #193B59;
  --brand-light: #2c5f8a;
  --hero-bg: #0a1f3d;
  --accent: #7fe3d9;       /* aquamarine nodes */
  --line: #7fb2f5;         /* network links */
  --cream: #efe9c6;        /* a few warm nodes */
  --header-height: 100px;
}

/* ---------- Navbar logo ---------- */

/* the PNG has wide transparent margins: enlarge it and use negative
   margins so the navbar keeps its original height */
.navbar-brand .navbar-logo {
  max-height: 90px;
  margin: -25px 0;
}

/* ---------- Translucent header (home only) ---------- */

/* Pages with a hero: the fixed header floats over the hero image.
   Quarto sets body padding-top inline to clear the fixed header,
   so !important is needed to let the hero slide underneath it. */
body:has(.hero) {
  padding-top: 0 !important;
}

body:has(.hero) #quarto-header .navbar {
  background-color: rgba(8, 24, 48, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: background-color 0.3s ease;
}

/* once scrolled past the top, more opacity keeps white text readable over light content */
body:has(.hero) #quarto-header.headroom--not-top .navbar {
  background-color: rgba(8, 24, 48, 0.85);
}

/* ---------- Hero ---------- */

.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  /* extra height/padding equal to the header (--header-height) that now overlaps the hero */
  min-height: calc(55vh + var(--header-height));
  margin-top: -2.9rem;
  margin-bottom: 3rem;
  padding: calc(var(--header-height) + 2rem) 1.5rem 3rem;
  color: #fff;
  text-align: center;
  /* base for the particle network (js/hero-particles.js); also the no-JS fallback */
  background: linear-gradient(135deg, var(--hero-bg), var(--brand-dark));
  position: relative;
  overflow: hidden;
}

#hero-particles {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.hero .hero-title {
  display: block;
  margin: 0 0 1rem;
  color: #fff;
  font-family: var(--bs-headings-font-family, inherit);
  font-size: clamp(1.8rem, 4.5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-usp {
  display: block;
  margin-bottom: 0.75rem;
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 700;
}

.hero-subtitle {
  display: block;
  max-width: 700px;
  margin: 0 auto;
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  font-style: italic;
  font-weight: 300;
  opacity: 0.85;
}

/* ---------- Shared section styles ---------- */

.presentacion,
.tools-section,
.projects-section {
  margin-bottom: 4rem;
}

.presentacion h2,
.tools-section h2,
.projects-section h2 {
  margin-top: 0;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--brand-dark);
  color: var(--brand-dark);
}

/* ---------- Presentación ---------- */

.presentacion {
  align-items: center;
}

.presentacion-photo {
  margin-bottom: 2rem;
  text-align: center;
}

.profile-img {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: 51% 75%;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(25, 59, 89, 0.25);
}

.contact-links {
  margin-top: 1rem;
}

.contact-links p {
  margin-bottom: 0.5rem;
}

.contact-links a {
  color: var(--brand-dark);
  text-decoration: none;
}

.contact-links a:hover {
  color: var(--brand-light);
}

/* icons are drawn with CSS (Bootstrap Icons font) because RStudio's visual
   editor strips empty icon spans from the markdown */
.contact-email::before,
.social-icon::before {
  font-family: "bootstrap-icons";
  font-weight: normal;
  line-height: 1;
  vertical-align: -0.125em;
}

.contact-email::before {
  content: "\f32f";
  margin-right: 0.35rem;
}

/* link text stays in the HTML for screen readers; only the icon is visible */
.social-icon {
  margin: 0 0.4rem;
  font-size: 0;
}

.social-icon::before {
  font-size: 1.6rem;
}

.social-linkedin::before {
  content: "\f472";
}

.social-github::before {
  content: "\f3ed";
}

.presentacion-text ul {
  padding-left: 1.2rem;
}

.presentacion-text li {
  margin-bottom: 0.5rem;
}

/* ---------- Tools carousel ---------- */

.tools-carousel {
  overflow: hidden;
  padding: 1rem 0;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
}

.tools-track {
  display: flex;
  width: max-content;
  animation: tools-scroll 30s linear infinite;
}

.tools-carousel:hover .tools-track {
  animation-play-state: paused;
}

.tools-group {
  display: flex;
  align-items: center;
  gap: 3rem;
  margin: 0;
  padding: 0 1.5rem;
  list-style: none;
}

.tools-group li {
  flex: 0 0 auto;
}

/* horizontal card: logo on the left, tool name on the right */
.tool-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  height: 60px;
  min-width: 110px;
  padding: 0 1rem;
  border: 2px solid var(--brand-dark);
  border-radius: 8px;
  transition: border-color 0.3s ease, background-color 0.3s ease,
    box-shadow 0.3s ease, transform 0.3s ease;
}

/* logos slightly muted at rest so the hover can intensify them */
.tool-card img {
  height: 36px;
  width: auto;
  filter: grayscale(50%) opacity(0.8);
  transition: filter 0.3s ease;
}

.tool-name {
  color: var(--brand-dark);
  font-weight: 600;
  white-space: nowrap;
}

.tool-card:hover {
  background-color: rgba(25, 59, 89, 0.08);
  box-shadow: 0 8px 18px rgba(25, 59, 89, 0.25), 0 0 0 3px rgba(127, 227, 217, 0.45);
  transform: translateY(-4px) scale(1.05);
}

.tool-card:hover img {
  filter: none;
}

@keyframes tools-scroll {
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tools-carousel {
    -webkit-mask-image: none;
    mask-image: none;
  }

  .tools-track {
    width: auto;
    justify-content: center;
    animation: none;
  }

  .tools-group {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
  }

  .tools-group[aria-hidden="true"] {
    display: none;
  }

  .tool-card:hover {
    transform: none;
  }
}

/* ---------- Projects ---------- */

.projects-more {
  margin-top: 2rem;
  text-align: center;
}

.projects-btn.btn-primary {
  padding: 0.75rem 2rem;
  border-color: var(--brand-dark);
  background-color: var(--brand-dark);
  color: #fff;
}

.projects-btn.btn-primary:hover,
.projects-btn.btn-primary:focus {
  border-color: var(--brand-light);
  background-color: var(--brand-light);
}

/* ---------- Responsive ---------- */

@media (max-width: 767.98px) {
  .hero {
    min-height: calc(45vh + var(--header-height));
    padding: calc(var(--header-height) + 1.5rem) 1rem 2.5rem;
  }

  .hero .hero-title {
    letter-spacing: 0.04em;
  }

  .profile-img {
    max-width: 240px;
  }

  .tools-group {
    gap: 2rem;
  }
}

/* ---------- Blog ---------- */

.blog-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.blog-chips p {
  display: contents;
}

.blog-chip {
  padding: 0.35rem 1rem;
  border: 1px solid var(--brand-dark);
  border-radius: 999px;
  color: var(--brand-dark);
  font-size: 0.9rem;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.blog-chip:hover,
.blog-chip.active {
  background-color: var(--brand-dark);
  color: #fff;
}

.ficha-libro,
.ficha-evento,
.ficha-foto {
  margin-bottom: 2rem;
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--brand-dark);
  border-radius: 8px;
  background-color: rgba(25, 59, 89, 0.06);
}

.ficha-libro {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}

.ficha-libro p {
  margin-bottom: 0;
}

.ficha-libro-portada {
  width: 140px;
  max-width: 35%;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(25, 59, 89, 0.25);
}

.ficha-libro-datos {
  flex: 1;
}

@media (max-width: 575.98px) {
  .ficha-libro {
    flex-direction: column;
  }
}
