/*
=================================================================
  1. Global Styles & Variables
-----------------------------------------------------------------
  * Base styles, variables, and global container.
=================================================================
*/
:root {
  --bg: #111111;
  --text: #FAFAFA;
  --hover: #FFEE00;
}

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

html {
  overflow-y: scroll; /* Prevents layout shift when scrollbar appears */
}

body {
  font-family: 'Poppins', sans-serif;
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.4;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

main {
  flex-grow: 1;
  display: flex;
  width: 100%;
  align-items: flex-start; /* Default alignment for content */
}

/* Specific alignment for homepage hero */
.home-page main {
  align-items: center;
}

/*
=================================================================
  2. Header & Navigation
-----------------------------------------------------------------
  * Logo, desktop navigation, and mobile menu styles.
=================================================================
*/
header {
  padding: 1.5rem 0;
  position: relative;
 /* z-index: 100;*/
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
}

/* --- Desktop Navigation --- */
.desktop-nav {
  display: none; /* Hidden on mobile */
}

.desktop-nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.desktop-nav a {
  text-decoration: none;
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  text-transform: lowercase;
  transition: color 0.3s;
}

.desktop-nav a:hover {
  color: var(--hover);
}

/* --- Mobile Menu --- */
.menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  z-index: 150; /* Above the overlay */
}

.icon {
  width: 28px;
  height: 28px;
  color: var(--text);
}

.hidden-icon {
  display: none;
}

.nav-menu {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 100vw;
  background-color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateX(100%);
  transition: transform 0.4s ease-in-out;
  z-index: 50;
}

.nav-menu.open {
  transform: translateX(0);
}

.nav-menu ul {
  list-style: none;
  text-align: center;
}

.nav-menu li {
  margin: 1.5rem 0;
}

.nav-menu a {
  text-decoration: none;
  color: var(--text);
  font-size: clamp(1rem, 8vw, 2rem);
  font-weight: 500;
  text-transform: lowercase;
  transition: color 0.3s;
}

.nav-menu a:hover {
  color: var(--hover);
}


/*
=================================================================
  3. Footer
-----------------------------------------------------------------
*/
footer {
  padding: 1.5rem 0;
}

.footer-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
}

.footer-container a {
  text-decoration: none;
  color: var(--text);
  transition: color 0.3s;
}

.footer-container a:hover {
  color: var(--hover);
}

.footer-container div a:first-child {
  margin-right: 1.5rem;
}
.cv-links a {
  text-decoration: none;
  color: var(--text);
  transition: color 0.3s;
}

.cv-links a:hover {
  color: var(--hover);
}

.cv-links span {
  margin: 2rem; /* Espacio alrededor de la barra separadora */
  color: #a0a0a0;
}
.cv-links a:first-child {
  margin-right: 0 !important;
}
/*
=================================================================
  4. Page Styles
-----------------------------------------------------------------
  * Specific styles for Homepage, About, Portfolio, etc.
=================================================================
*/

/* --- 4.1 Homepage --- */
.hero {
  width: 100%;
  padding: 2rem 1.5rem 4rem 1.5rem;
}

.hero-intro {
  text-align: left;
  margin-bottom: 2rem;
}


.hero-intro {
  text-align: left;
  margin-bottom: 1rem;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}

.hero-tagline {
  font-size: 2rem;
  font-weight: 400;
  color: var(--hover);
}
.hero-title {
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: bold;
  line-height: 1.1;
  max-width: 1280px;
  margin: 0 auto;
}

.line-wrapper {
  font-size: clamp(2.8rem, 9vw, 5.5rem);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.static-text {
  display: block;
  white-space: nowrap;
}

.carousel {
  display: block;
  position: relative;
  height: 3.4rem;
  color: var(--hover);
  font-weight: bold;
  min-width: 220px;
  cursor: pointer;
}

.carousel ul {
  list-style: none;
}

.carousel li {
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  white-space: normal;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: none; /* Solid effect */
}

.carousel li.is-visible {
  opacity: 1;
}

/* --- 4.2 About Page --- */
.hero-about {
  color: var(--hover);
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: bold;
}
.about-header-container {
  display: flex;
  flex-direction: column; 
  gap: 2rem;
  margin-bottom: 2rem;
}

.about-image-container img {
  width: 100%;
  max-width: 180px; 
  height: 180px;
  display: block;
  margin: 0 auto;
  border-radius: 50%;
  object-fit: cover;
}
/* For bigger screens */
@media (min-width: 768px) {
  .about-header-container {
    display: flex; 
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 2rem; 
    margin-bottom: 3rem;
  }

  .about-header-container .hero-about {
    text-align: left;
    white-space: nowrap; /* avoids the text to divide */
    flex-shrink: 0;      /* avoid the container if titlee gets smaller */
  }

  .about-image-container img {
    margin: 0;
    flex-shrink: 1; /* makes îctures smaller if need it */
  }
}

.about-content {
  margin-top: 1rem;
}

.intro-text {
  font-size: 1.5rem;
  margin-bottom: 2rem;
}
/* icons list */
.fun-facts-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

.fun-facts-list li {
  display: grid;
  grid-template-columns: 40px 1fr; /* column for icon and anothe for text */
  grid-template-rows: auto auto;
  gap: 0 1rem; /* 0 vertical space, 1rem dhorizontal space */
  align-items: center;
}

.fact-icon {
  grid-row: 1 / 2;
  grid-column: 1 / 2;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fact-icon img {
  width: 32px; 
  height: 32px;
}

.fun-facts-list h3 {
  grid-row: 1 / 2;
  grid-column: 2 / 3;
  font-size: 1.25rem;
  margin-bottom: 0; 
  color: var(--hover);
}

.fun-facts-list p {
  grid-row: 2 / 3;
  grid-column: 2 / 3;
}

/* Two columns in desktop */
@media (min-width: 768px) {
  .fun-facts-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
  }
}
/* --- 4.3 Contact Page --- */
.hero-form {
  margin-top: 0;
}

.contact-form {
  max-width: 600px;
  padding: 2rem 0;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--text);
  background-color: var(--bg);
  color: var(--text);
}

.form-group textarea {
  min-height: 150px;
}

.submit-btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  border: 1px solid var(--hover);
  background-color: transparent;
  color: var(--hover);
  text-decoration: none;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
}

.submit-btn:hover {
  background-color: var(--hover);
  color: var(--bg);
}
.form-row {
  display: flex;
  gap: 1.5rem; /* Controls the space between the name fields */
}

.form-row .form-group {
  width: 100%; /* Each field will take up half the available space */
}
@media (max-width: 768px) {
  .form-row {
    flex-direction: column;
    gap: 0; /* No gap needed when they are stacked */
  }
}

/* --- 4.4 Portfolio Page --- */
.hero-portfolio {
  color: var(--hover);
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: bold;
}

.filter-container {
  margin: 2rem 0;
}

.filter-btn {
  background: none;
  border: 1px solid var(--text);
  color: var(--text);
  padding: 0.5rem 1rem;
  margin: 0.5rem 0.5rem 0.5rem 0;
  cursor: pointer;
  transition: all 0.3s;
  font-family: 'Poppins', sans-serif;
  text-transform: lowercase;
  font-weight: 500;
}

.filter-btn:hover,
.filter-btn.active {
  background-color: var(--hover);
  color: var(--bg);
  border-color: var(--hover);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.portfolio-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.portfolio-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.portfolio-item .overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.4s;
}

.portfolio-item:hover .overlay {
  opacity: 1;
}

.portfolio-item:hover img {
  transform: scale(1.1);
}

.portfolio-item h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--hover);
  margin: 0;
}

.portfolio-item p {
  font-size: 0.9rem;
  font-weight: 300;
  margin: 0;
  padding: 0 1rem;
}


/* --- 4.5 Case Study Page --- */
.case-study-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
}

.breadcrumbs {
  font-size: 0.9rem;
  margin-bottom: 2rem;
  color: #a0a0a0;
}
.breadcrumbs a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.3s;
}
.breadcrumbs a:hover {
  color: var(--hover);
}
.breadcrumbs span {
  font-weight: 500;
  color: var(--hover);
}

.project-header {
  text-align: left;
  margin-bottom: 3rem;
}

.project-title {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: bold;
    color: var(--hover);
    margin-bottom: 0.5rem;
}

.project-subtitle {
  font-size: 1.25rem;
  margin: 0 0 1.5rem 0;
  line-height: 1.6;
}
.case-study-content ul {
  list-style-position: inside;
  padding-left: 1rem;
  margin: 1rem 0;
}

.case-study-content ul li {
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 0.5rem;
}

.project-details {
  display: flex;
  flex-wrap: wrap; /* Allow wrapping on small screens */
  justify-content: flex-start;
  gap: 2rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  color: #c0c0c0;
}
.project-details strong {
  color: var(--text);
}

.project-hero-image {
  width: 100%;
  height: auto;
  margin-bottom: 4rem;
}

.case-study-content section {
  margin-bottom: 4rem;
}

.case-study-content h2 {
  font-size: 2rem;
  font-weight: bold;
  color: var(--hover);
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--hover);
  display: inline-block;
  padding-bottom: 0.5rem;
}

.case-study-content h3 {
  font-size: 1.5rem;
  font-weight: 500;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.case-study-content p {
  line-height: 1.8;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

/* --- Style for vertical hero poster --- */
.project-hero-poster {
  display: block; 
  margin: 0 auto; 
  max-width: 500px; 
  width: 100%;    
  height: auto;
  margin-bottom: 4rem; 
}

/*
=================================================================
  5. Components
-----------------------------------------------------------------
  * Reusable components like galleries and modals.
=================================================================
*/

/* --- 5.1 Before & After Gallery --- */
.before-after-gallery {
  display: grid;
  grid-template-columns: 1fr; /* Single column on mobile */
  gap: 1.5rem;
  margin-top: 2rem;
}

.before-after-gallery figure {
  margin: 0;
}

.before-after-gallery img {
  width: 100%;
  display: block;
}

.before-after-gallery figcaption {
  font-size: 0.9rem;
  padding: 0.75rem;
  background-color: var(--bg);
  text-align: center;
}

/* --- 5.2 Document Carousel --- */
.document-carousel-container {
    position: relative;
    max-width: 800px;
    margin: 2rem auto;
    border: 1px solid #333;
}

.document-carousel {
    display: flex;
    overflow: hidden;
}

.carousel-slide {
    width: 100%;
    flex-shrink: 0;
    display: none; /* Hide slides by default */
}

.carousel-slide.active-slide {
    display: block; /* Show active slide */
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--bg);
    color: var(--text);
    border: 1px solid var(--text);
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 10;
}

.carousel-btn:hover {
    background-color: var(--hover);
    color: var(--bg);
    border-color: var(--hover);
}

.carousel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.prev-btn { left: 1rem; }
.next-btn { right: 1rem; }

.carousel-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* --- 5.3 Bento Gallery --- */
.bento-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

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

/* --- 5.4 Lightbox (Image Viewer) --- */
.bento-gallery a {
  display: block;
  cursor: pointer;
  height: 100%;
}

.lightbox {
  display: none; /* Hidden by default */
  position: fixed;
  z-index: 1000;
  padding-top: 60px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: var(--bg);
  backdrop-filter: blur(5px);
}

.lightbox-content {
  margin: auto;
  display: block;
  max-width: 85%;
  max-height: 75vh;
  animation: zoom 0.6s;
}

.lightbox-caption {
  margin: 1rem auto;
  display: block;
  width: 80%;
  max-width: 700px;
  text-align: center;
  color: var(--text);
  padding: 10px 0;
  animation: zoom 0.6s;
}

@keyframes zoom {
  from {transform: scale(0.9)}
  to {transform: scale(1)}
}

.lightbox-close {
  position: absolute;
  top: 15px;
  right: 35px;
  color: var(--text);
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
}

.lightbox-close:hover,
.lightbox-close:focus {
  color: var(--hover);
  text-decoration: none;
}

.lightbox-prev, .lightbox-next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  padding: 16px;
  margin-top: -50px;
  color: var(--text);
  font-weight: bold;
  font-size: 20px;
  transition: 0.6s ease;
  user-select: none;
}

.lightbox-next {
  right: 0;
  border-radius: 3px 0 0 3px;
}
.lightbox-prev {
  left: 0;
  border-radius: 0 3px 3px 0;
}

.lightbox-prev:hover, .lightbox-next:hover {
  background-color: var(--hover);
  color: var(--bg);
}
.video-hero-container {
  position: relative; 
  width: 100%;
  height: 70vh; 
  overflow: hidden; 
  background-color: var(--bg); 
}

.fullscreen-video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  object-fit: cover; 
  transform: translate(-50%, -50%);
  z-index: 1; 
}

/*
=================================================================
  6. Desktop & Tablet Styles (Media Queries)
-----------------------------------------------------------------
*/
@media (min-width: 768px) {

  /* --- Header & Nav --- */
  .menu-btn {
    display: none;
  }
  .desktop-nav {
    display: block;
  }
  .nav-menu {
    transform: translateX(100%) !important;
    pointer-events: none;
  }

  /* --- Footer --- */
  .footer-container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .footer-container div a:first-child {
      margin-right: 2rem;
  }

  /* --- Homepage --- */
  .hero-title {
    font-size: clamp(6rem, 12vw, 10rem);
  }
  .line-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: clamp(4rem, 7vw, 5.5rem);
    margin-bottom: 0;
  }
  .static-text {
    display: inline;
  }
  .carousel {
    min-width: 300px;
    height: 6rem;
  }
  .carousel li {
    white-space: nowrap;
  }

  /* --- About Page --- */
  .fun-facts-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* --- Components --- */
  .before-after-gallery {
    grid-template-columns: 1fr 1fr;
  }
  .bento-gallery {
    grid-template-columns: repeat(4, 1fr);
  }
  .bento-item[style*="grid-column"] {
    grid-column: span 2 !important;
  }
  .bento-item[style*="grid-row"] {
    grid-row: span 2 !important;
  }
}

/*
=================================================================
  7. Custom Cursor
-----------------------------------------------------------------
*/

/* 1. Hides default cursor*/

html,
a,
button,
.portfolio-item,
.filter-btn,
.carousel,
.submit-btn,
.menu-btn,
.bento-gallery a,     
.carousel-btn,        
.lightbox-prev,       
.lightbox-next,       
.lightbox-close   {
  cursor: none !important; 
}


/* 2. Personalized style */
.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 15px;   /* Default Size */
  height: 15px;
  border-radius: 50%;
  
  /* Cursor color) */
  background-color: var(--text); 
  
  /* Color difference */
  mix-blend-mode: difference;
  
  /* animation */
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease-out, width 0.2s ease, height 0.2s ease;
  
  /* Asegúrate de que no interfiera con los clics */
  pointer-events: none;
  z-index: 9999;
}

/* 3. Hover style */
.custom-cursor.hover {
  width: 50px;  /* turns bigger */
  height: 50px;
  /* Opcional: podrías cambiarle el fondo si no te gusta el efecto de inversión aquí */
   /*background-color: var(--hover); */
}

/*
=================================================================
  9. Mobile adjustments for Custom Cursor
-----------------------------------------------------------------
*/

/* Rule for touch screens.
*/
@media (pointer: coarse) {
  
  /* 1. Hides custom cursor */
  .custom-cursor {
    display: none !important;
  }

  /* 2. Restore default cursor for mobile */
  html,
  a,
  button,
  .portfolio-item,
  .filter-btn,
  .carousel,
  .submit-btn,
  .menu-btn,
  .bento-gallery a,
  .carousel-btn,
  .lightbox-prev,
  .lightbox-next,
  .lightbox-close {
    cursor: auto !important; 
  }
}
/*
=================================================================
  10. Back to Top Button
-----------------------------------------------------------------
*/
.back-to-top-btn {
  position: fixed;   /* fixed on the screen */
  bottom: 20px;      /* 20px from down */
  right: 20px;        /* 20px desde la izquierda */
  display: none;     /* Oculto por defecto, JS lo mostrará */
  
  width: 50px;
  height: 50px;
  background-color: var(--hover);
  color: var(--bg);
  
  text-decoration: none;
  border-radius: 50%; /* Lo hace circular */
  text-align: center;
  
  font-size: 32px;
  line-height: 48px; /* Centra el ">" verticalmente */
  font-weight: 900;
  
  transform: rotate(-90deg); /* Apunta el ">" hacia arriba */
  transition: opacity 0.3s, transform 0.3s;
  z-index: 500;
}

.back-to-top-btn:hover {
  transform: rotate(-90deg) scale(1.1); /* Efecto de zoom al pasar el ratón */
}

/*
=================================================================
  9. WorkPics Color Palette Styles
-----------------------------------------------------------------
*/
.color-palette-container {
  margin: 2rem 0;
  padding: 1.5rem;

  border-radius: 8px;
}

.color-palette-title {
  text-align: center;
  color: var(--text); /* Use existing text color variable */
  margin-bottom: 1.5rem;
}

.color-palette-grid {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
  gap: 1.5rem;
  text-align: center;
}

.color-item {
  flex-basis: 100px; /* Base width for each item */
}

.color-block {
  width: 100px;
  height: 100px;
  margin: 0 auto 0.5rem auto; /* Center block, add bottom margin */
  border-radius: 4px;
}

/* Specific background colors */
.color-block-white {
  background-color: #F5F5F5;
  border: 1px solid #555; /* Add border for visibility against light backgrounds */
}

.color-block-blue {
  background-color: #4300FF;
}

.color-block-green {
  background-color: #08CB00;
}

.color-block-orange {
  background-color: #FF6600;
}

.color-hex {
  font-size: 0.9rem;
  color: #ccc; /* Lighter text color for hex codes */
  margin: 0;
}

.color-desc {
  font-size: 0.8rem;
  color: #aaa; /* Even lighter text color for descriptions */
  margin: 0;
}

/*=================================================================
  10. Bedizen Comparison version development
-----------------------------------------------------------------
*/
/* --- Estilos para la comparación de versiones (Bedizen) --- */

.version-comparison {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 2rem;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .version-comparison {
    grid-template-columns: 1fr 1fr;
  }
}

.version-card {
  background: #1d1d1d; 
  border: 1px solid #222222;
  padding: 1.5rem;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}

.version-desc {
  flex-grow: 1; 
  display: flex;
  flex-direction: column;
}

.version-desc .submit-btn {
  margin-top: auto; 
  align-self: flex-start;
  display: inline-block;

}

.version-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.badge {
  background-color: #eee;
  color: var(--bg);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: bold;
}

.badge.new {
  background-color: #ff4d4d; 
  color: white;
}

.project-img-shadow {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  margin-bottom: 1.5rem;
}
/* Responsive for mobile */
@media (max-width: 768px) {
  .version-comparison {
    grid-template-columns: 1fr; /* it wrap vertically */
  }
}
