:root {
  --bg-color-home: linear-gradient(to right, #0b486b, #f56217);
  --bg-color-estudios: linear-gradient(to right, #360033, #0b8793);
  --bg-color-laboral: linear-gradient(to right, #16bffd, #cb3066);
  --bg-color-conocimientos: linear-gradient(to right, #4da0b0, #d39d38);

  --fnt-color-green: #2ab415;
  --fnt-color-blue: #1335b0;
  --fnt-color-black: #000000;
}

.fnt-blue { color: var(--fnt-color-blue); }
.fnt-green { color: var(--fnt-color-green); }
.fnt-black { color: var(--fnt-color-black); }

h1 { font-size: 1.8rem; }
h2 { font-size: 1.5rem; }
p { font-size: 1.1rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    height: 100dvh;
    overflow: hidden;
    font-family: Arial, sans-serif;
}
body {
  cursor: default;
}
/* Contenedor con scroll snap */
.container {
    height: 100dvh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}
/* Cada sección ocupa toda la pantalla */
section {
    height: 100dvh;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
/* Navbar fija */
nav {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.8);
    border-radius: 0.5rem;
    display: flex;

    padding: 0.5rem 1rem;
    max-width: calc(100% - 1rem);
    transition: background 0.3s;
    z-index: 10;
}
nav.sticky {
    position: fixed;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
nav a {
    text-decoration: none;
    text-align: center;
    color: #333;
    font-weight: bold;
    padding: 0.2rem 0.5rem;
    border-radius: 0.3rem;
    transition: background 0.2s;
}
nav a.active,
nav a:hover {
    background: #eee;
}

/* Clase genérica para cajas semi-transparentes */
.transparent-box {
  background: rgba(255, 255, 255, 0.3);   /* blanco al 50% de opacidad */
  backdrop-filter: blur(8px);             /* desenfoque del fondo */
  -webkit-backdrop-filter: blur(8px);     /* para Safari */
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 1rem;
  padding: 1rem;
  max-width: 600px;
  margin: 1rem auto;
  color: #333;                            /* texto oscuro para contraste */
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Estilos ejemplo para sección de presentación */
#home {
    background: var(--bg-color-home);
    flex-direction: column;
    text-align: center;

}

.avatar-flip {
  width: 200px;
  height: 200px;
  perspective: 1000px;
  margin-bottom: 1rem;
  border-radius: 50%;

  transform: translateY(40px);
  opacity: 0;
  transition: opacity 1s ease, transform 1s ease;
}

.avatar-flip.visible {
  opacity: 1;
  transform: translateY(0);
}

.avatar-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s;
}

.avatar-flip:hover .avatar-inner,
.avatar-flip:active .avatar-inner {
  transform: rotateY(180deg);
}

.avatar-front,
.avatar-back {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  backface-visibility: hidden;
}

.avatar-front img,
.avatar-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-back img { 
  object-fit: contain;
  transform: scale(1.2);
  padding-top: 15px;
}

.avatar-back {
  transform: rotateY(180deg);
}

.bio {
  padding-top: 0.5rem;
  line-height: 1.5rem;
  opacity: 0;
  transition: opacity 4s ease, transform 4s ease;
}

.bio.visible {
  opacity: 1;
}

#estudios {
  background: var(--bg-color-estudios);
  flex-direction: column;
  align-items: center;
  padding-top: 3rem;
}

#laboral {
  background: var(--bg-color-laboral);
  flex-direction: column;
  text-align: center;
}

#conocimientos {
  background: var(--bg-color-conocimientos);
  flex-direction: column;
  text-align: center;
  align-items: center;
  padding: 2rem;
}

/* RADAR CHART */

#radar-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  justify-content: center;
  width: 100%;
}

.radar-chart {
  width: 100%;
  height: auto;
  max-width: 300px;
  margin: 0 auto;
}

.level {
  fill: none;
  stroke: #ffffff;
  stroke-width: 1;
}

.axis {
  stroke: #ffffff;
  stroke-width: 1;
}

.data {
  stroke-width: 2;
}
.data.frontend {
  fill: rgba(243, 114, 44, 0.5);
  stroke: #F9844A;

}
.data.backend {
  fill: rgba(193, 18, 31, 0.5);
  stroke: #C1121F;

}
.data.databases {
  fill: rgba(255, 183, 3, 0.5);
  stroke: #FFB703;
}
.data.infra {
  fill: rgba(33, 150, 243, 0.5);
  stroke: #2196f3;
}
.data.arch {
  fill: rgba(0, 128, 0, 0.5);
  stroke: #008000;
}

.radar-chart text{
  font-size: 12px;
  fill: #333;
  paint-order: stroke;
  font-weight: bold;
}

/* TIMELINE */
.timeline-vertical {
  position: relative;
  width: 100%;
  max-width: 600px;
  /* height: 50%; */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-left: 100px;
}

/* Línea central animada */
.progress-line {
  position: absolute;
  left: 90px;
  top: 0;
  bottom: 0;
  width: 30px;
  background: linear-gradient(to top, #43a047 0%, #c8e6c9 100%);
  border-radius: 0 0 15px 15px;
  /* animation: fillLine 2.5s ease-in-out forwards; */
  transform-origin: bottom;
  transform: scaleY(0);
}

/* SOLO si tiene clase .animate, se anima */
.progress-line.animate {
  animation: fillLine 1.5s ease-in-out forwards;
}
 
@keyframes fillLine {
  to {
    transform: scaleY(1);
  }
}

/* Hitos posicionados a la derecha */
.timeline-hito {
  position: relative;
  margin-bottom: 3rem;
  margin-left: 50px;

  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1.5s ease, transform 1s ease;
}

.timeline-hito.visible {
  opacity: 1;
  transform: translateY(0);
}

.hito-box {
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(6px);
  border-radius: 1rem;
  padding: 1rem;
  width: 430px;
  text-align: left;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin-left: 2rem;
}

.hito-fecha {
  font-weight: bold;
  font-size: 0.9rem;
}

/* Conector círculo */
.timeline-hito::before {
  content: '✔️';
  font-size: 35px;
  position: absolute;
  left: -75px;
  top: 2rem;
  width: 50px;
  height: 50px;
  background: white;
  border: 4px solid #43a047;
  border-radius: 50%;
  z-index: 2;
}

@media (max-width: 726px) {
    #radar-container {
    gap: 0.5rem;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }
}

@media (max-width: 660px) {

  .timeline-vertical {
    padding-left: 40px;
  }

  .progress-line {
    left: 20px;
  }

  .timeline-hito {
    margin-left: 0;
  }

  .hito-box {
    width: 90%;
    margin-left: 1.5rem;
  }

  .timeline-hito::before {
    left: -5px;
    transform: translateX(-50%);
  }

  #radar-container {
    gap: 0.5rem;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  #conocimientos {
    padding: 3rem 10px 10px 10px
  }
}


@media (max-width: 375px) {
  .avatar-flip { display: none; }
  #navbar a { font-size: 0.9rem; }
  .bio { margin-top: 4rem;}
  .timeline-hito { margin-bottom: 2rem; }
  .radar-container { gap: 0.3rem; }
  .radar-card h3 { font-size: 0.8rem; }
  .section-title { display: none;}
  #laboral { padding-top: 5rem; }
}