/* NAVBAR */
#navbar .container {
  display: flex;
  flex-direction: row;
  max-width: 98vw;
}
#navbar .container .navbar-brand {
  padding-left: 0.5rem;
}

.navbar-nav {
  align-items: center;
}

.navbar-nav li:first-child a {
  padding-right: 10rem !important;
  opacity: 0.2;
  color: var(--color-light);
  pointer-events: none;
}

/* Skip link (visually hidden until focused) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  z-index: 9999;
  border-radius: 4px;
}

/* BURGER MENU A CRUZ */
.custom-toggler {
  width: 54px;
  /* height: 24px; */
  scale: 1.2;
  position: relative;
  border: none;
  background: none;
  cursor: pointer;
  z-index: 9999;
}

.custom-toggler:focus {
  outline: 3px solid rgba(13, 110, 253, 0.18);
  outline-offset: 4px;
}

.fs-2 {
  font-size: calc(1.55rem + 0.9vw) !important;
}

/* --------------------------------------------------------------------------
HERO SECTION
-------------------------------------------------------------------------- */
/* Hero full viewport */
.hero {
  position: relative;
  width: 100%;
  /* use dynamic viewport height first, keep vh as fallback */
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: var(--color-dark);
}

/* Capas de fondo: imagen y video */
.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  z-index: -3;
}

/* Texto principal */
.container-info-home {
  position: absolute;
  z-index: 1;
  text-align: center;
  color: var(--color-light);
  display: flex;
  flex-direction: row;
  text-align: center;
  align-items: center;
  font-family: var(--font-body);
  bottom: 0;
  right: 24px;

  padding-bottom: env(safe-area-inset-bottom);
  padding-top: env(safe-area-inset-top);
}

.container-info-home p:last-child {
  margin-left: 0.5rem;
  font-size: 80px;
  font-weight: 400;
}

.scroll-indicator {
  position: absolute;
  bottom: max(1.5rem, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
}

/* 
--------------------------------------------------------------------------
WORKS SECTION
-------------------------------------------------------------------------- */

#works {
  padding-top: 6rem;
  background-color: var(--color-dark);
}

.projects {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 16px;
  row-gap: 40px;
  padding-inline: 2rem;
}

.container-projects {
  padding-inline: 2rem;
  /* max-width: 80vw; */
}

.row {
  margin-top: 2rem;
}

.project {
  grid-column: span 6;
}

.reveal {
  opacity: 0;
  transform: translateY(40px);
  will-change: transform, opacity;
}

.project-card {
  background: var(--color-bg-alt);
  border-radius: 1rem;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
  height: 60vh;
  min-height: 30vh;
  min-height: 40vh;
  aspect-ratio: 3 / 2;
  width: 100%;
  overflow: hidden;
}

.project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-info {
  padding-top: 1rem;
  gap: var(--space-xs);
}

.container-cta {
  display: flex;
  justify-content: center;
  padding-top: 2rem;
}

.cta-AllWorks {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  color: white;
  width: fit-content;
  text-align: center;
  /* padding: 60px; */
  scale: 0.75;
  position: relative;
  transition: transform 0.5s ease, font-variation-settings 0.25s ease;
}

.cta-AllWorks:hover {
  cursor: pointer;
  color: #0d6efd;
  transform: scale(1.01);
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}

.cta-AllWorks:after {
  content: "";
  position: absolute;
  background-color: #0d6efd;
  height: 3px;
  width: 0%;
  left: 0;
  bottom: -3px;
  transition: 0.5s;
}

.cta-AllWorks:hover:after {
  /* width: 100%; */
  width: calc(100% + 24px);
}

.cta-AllWorks p {
  font-size: var(--font-section);
}

.cta-AllWorks p:hover {
  font-weight: 700;
}

.cta-AllWorks .arrow-container {
  overflow: visible;
  margin: auto 0;
  scale: 2;
  transform: rotate(45deg);
}

/* 
--------------------------------------------------------------------------
ABOUT ME SECTION
-------------------------------------------------------------------------- */

#AboutMe {
  padding-top: 6rem;
  background-color: var(--color-dark);
}

.description-about-me {
  margin-inline: auto;
  padding-bottom: var(--space-md);
  padding-left: 2rem;
}

.description-about-me .word {
  color: #555555;
  white-space: pre;
  will-change: color;
  opacity: 1;
}

.description-about-me p {
  font-size: var(--font-small);
  line-height: 1.5;
  width: 85vw;
  color: #ffffff;
  font-weight: var(--font-regular);
}

/* SKILLS  */
.skills {
  padding: 2rem var(--space-sm);
  display: flex;
  flex-direction: column;
  max-width: 90vw;
}

.mt-4 {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.fw-semibold {
  opacity: 1;
  font-size: clamp(1.25rem, 3vw, 1.5rem);
}

.text-muted {
  opacity: 0.6;
  color: var(--color-light) !important;
}

.skill-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.skill-bar {
  height: 100%;
  width: 0;
  transition: width 1.5s ease-out;
}

/* ABOUT ME FOCUS */
.about-me-focus {
  margin-inline: auto;
  padding: var(--space-md) var(--space-sm);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 16px;
}

.about-me-sub {
  grid-column: span 6;
  height: fit-content;
  display: flex;
  flex-direction: row;
  gap: 1rem;
  align-items: center !important;
}

.about-me-sub p {
  font-size: clamp(1.75rem, 4vw, 2.5rem);

  color: var(--color-light);
}

.about-me-focus div:last-child {
  grid-column: span 6;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.about-me-focus div:last-child p {
  font-size: clamp(1.75rem, 4vw, 4rem);

  color: var(--color-light);
  font-weight: var(--font-bold);

  opacity: 1;
  transform: translateY(20px);
  will-change: transform, opacity;
}

.about-me-sub .arrow-container {
  overflow: visible;
  margin: auto 0;
  display: inline-block;
  transition: transform 0.5s ease;
  /* margin-bottom: 22px; */
  transform: rotate(90deg);
}

.arrow-container svg {
  color: var(--color-light);
  scale: 1.5;
}

/* 
--------------------------------------------------------------------------
CONTACT ME SECTION
-------------------------------------------------------------------------- */

#ContactMe {
  padding-top: 6rem;
  background-color: var(--color-dark);
}

.contact-me-info {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  margin-inline: auto;
  padding: 0 2rem var(--space-sm) 2rem;
}

.contact-me-info div:first-child {
  display: flex;
  flex-direction: column;
  grid-column: span 6;
  column-gap: 16px;
}

.contact-me-info div:first-child p {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

.contact-me-info div:first-child p:first-child {
  font-weight: 700;
}

.contact-me-info div:first-child p:nth-child(2),
.contact-me-info div:first-child p:last-child {
  font-weight: 400;
  opacity: 0.6;
}

.social-links {
  display: flex;
  flex-direction: column;
  grid-column: span 6;
  list-style: none;
}

.social-links li a {
  text-decoration: none;
  color: white !important;
  position: relative;
  width: fit-content;
  line-height: 1.6;

  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: var(--font-bold);
  color: var(--color-light) !important;
  text-decoration: none;

  position: relative;
}

.social-links li a:hover {
  color: white !important;
}

.social-links li a:after {
  content: "";
  position: absolute;
  background-color: #0d6efd;
  height: 3px;
  width: 0%;
  left: 0;
  bottom: -3px;
  transition: 0.5s;
}

.social-links li a:hover:after {
  width: 100%;
}

.email {
  margin-top: 2rem;
  font-size: var(--font-section);
  color: var(--color-light);
  font-weight: var(--font-regular);
  opacity: 0.6;
}

/* 
--------------------------------------------------------------------------
FOOTER SECTION
-------------------------------------------------------------------------- */

.footer-marquee {
  width: 100vw;
  overflow: hidden;
  background: var(--color-dark);
  padding-block: clamp(1rem, 3vw, 3rem);
}

.footer-text {
  display: block;
  font-size: clamp(6rem, 17vw, 18rem);
  font-weight: 600;
  line-height: 0.9;
  margin: 0;
  color: var(--color-light) !important;
  text-decoration: none;

  white-space: nowrap;
  text-align: justify;
}

.last-text {
  padding-left: 2rem;
  margin: 0;
}

/* 
--------------------------------------------------------------------------
NOT FOUND PAGE
-------------------------------------------------------------------------- */

.page-404 {
  position: relative;
  width: min(1200px, 90vw);
  min-height: 100svh;
  /* max-height: 80vh; */
  margin: auto;

  display: grid;
  place-items: center;

  overflow: hidden;
  box-sizing: border-box;
  /* ajuste visual */
  transform: translateY(-8%);
}

/* 404 gigante */
.bg-404 {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;

  font-size: clamp(10rem, 30vw, 28rem);
  font-weight: 700;
  line-height: 0.85;

  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.25),
    rgba(255, 255, 255, 0.05)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;

  pointer-events: none;
  user-select: none;
}

/* Contenido central */
.content-404 {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  align-items: center;
  text-align: center;

  transform: translateY(82%);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.3));
}

.content-404 p:first-child {
  font-size: clamp(3rem, 4vw, 5rem);
}

.content-404 a:first-child {
  font-size: clamp(1rem, 4vw, 3rem);
  color: #ffffff !important;
  text-decoration: none;
}
.content-404 a:first-child:hover {
  font-weight: 700;
}

.content-404 p:nth-child(2) {
  margin-top: 3rem;
  margin-bottom: 1rem;
  font-size: clamp(1rem, 4vw, 1.5rem);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
}

@media screen and (max-width: 768px) {
  /* SECTION HERO */
  .container-info-home p:last-child {
    font-size: 3.5rem;
  }

  .mouse {
    display: none;
  }
  h1 {
    padding-left: 2rem;
    font-size: 48px;
  }

  h2 {
    font-size: clamp(1.25rem, 3vw, 1.125rem);
  }

  .navbar-nav li:first-child {
    display: none !important;
  }

  #works {
    padding-top: 4rem;
  }
  .projects {
    grid-template-columns: 1fr;
    padding-inline: 16px;
    aspect-ratio: 4 / 5;
  }

  .project-card {
    height: 45vh;
  }

  .row {
    margin-top: 0;
  }
  .col-md-8 {
    flex: 0 0 auto;
    width: 100%;
    margin-bottom: 2rem;
  }

  .col-6 {
    flex: 0 0 auto;
    width: 50%;
    flex-grow: 1;
    margin-bottom: 2rem;
  }

  .cta-AllWorks {
    gap: 2rem;
  }
  .cta-AllWorks .arrow-container {
    scale: 1.5;
  }

  /* --------------
  ABOUT ME SECTION 
  --------------- */

  .description-about-me {
    padding: 0 2rem;
  }

  .description-about-me p {
    width: 100%;
  }

  /* SKILLS  */
  .skills {
    padding: 2rem 1rem;
    max-width: 100%;
  }

  .footer-text {
    font-size: 16vw;
  }

  /* 404 PAGE NOT FOUND  */
  .page-404 {
    height: 100vh !important;
    max-height: 100vh;
    overflow-y: hidden;
    box-sizing: border-box;
    /* ajuste visual */
    transform: translateY(-8%);
    margin: auto;
    padding-top: 8vh;
  }

  .content-404 {
    transform: translateY(56%);
  }
  .content-404 a:first-child {
    font-size: clamp(2rem, 4vw, 3rem);
  }

  .content-404 p:nth-child(2) {
    margin-top: 0;
  }
}

@media screen and (max-width: 430px) {
  /* BURGER MENU A CRUZ */
  .custom-toggler {
    width: 38px;
    scale: 1.2;
    position: relative;
    border: none;
    background: none;
    cursor: pointer;
    z-index: 9999;
  }

  .fs-2 {
    font-size: calc(1.5rem + 0.9vw) !important;
  }

  .hero {
    height: calc(var(--vh, 1vh) * 100);
  }
  .container-info-home p:last-child {
    margin-left: 0.5rem;
    font-size: 3rem;
    font-weight: 400;
  }

  .mouse {
    display: none;
  }

  h1 {
    padding-left: 1rem;
    font-size: 2rem;
    margin-bottom: 1rem;
  }
  .container-projects {
    padding-inline: 1rem;
  }

  .projects {
    grid-template-columns: 1fr;
    padding-inline: 16px;
    aspect-ratio: 3 / 2;
    gap: 1rem;
  }

  .project-card {
    height: 40vh;
  }

  .col-md-8 {
    flex: 0 0 auto;
    width: 100%;
    margin-bottom: 1rem;
  }

  .col-6 {
    flex: 0 0 auto;
    width: 100%;
    flex-grow: 1;
    margin-bottom: 1rem;
  }

  .container-cta {
    padding-top: 1rem;
  }

  /* --------------
  ABOUT ME SECTION 
  --------------- */

  #AboutMe {
    padding-top: 4rem;
  }

  .skills {
    padding: 1rem;
  }

  .mt-4 {
    gap: 0.5rem;
    margin-top: 1rem !important;
  }

  .description-about-me {
    padding-left: 1rem;
    padding-bottom: var(--space-sm);
  }

  .about-me-focus {
    padding: 1rem;
    display: flex;
    flex-direction: column;
  }

  #ContactMe {
    padding-top: 5rem;
  }

  .contact-me-info {
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .last-text {
    padding-left: 1rem;
  }

  .contact-me-info div:first-child p {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
  }

  .social-links {
    padding-bottom: 2rem;
  }
  .social-links li a {
    font-size: clamp(2.5rem, 4vw, 3rem);
    line-height: 1.2;
  }

  .footer-text {
    font-size: 16vw;
  }

  /* 404 PAGE NOT FOUND  */
  .page-404 {
    margin: auto;
    height: 100vh !important;
    /* max-height: 100vh; */
    max-height: 100svh;
    overflow-y: hidden;
    box-sizing: border-box;
    /* ajuste visual */
    transform: translateY(-14%);
  }

  .bg-404 {
    /* height: 100vh !important; */
    margin-top: -6vh;
  }

  .content-404 {
    transform: translateY(36%);
  }

  .content-404 p:first-child {
    line-height: 1.2;
  }

  .content-404 p:nth-child(2) {
    margin-top: 1rem;
  }

  .content-404 a:first-child {
    font-size: clamp(1.5rem, 4vw, 3rem);
  }
}
