
:root {
  --bg-color: #f0f0e6;
  --text-color: #111111;
  --accent-color: #ff2a5f;
  --font-display: 'Anton', sans-serif;
  --font-body: 'Inter', sans-serif;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html, body {
  overflow-x: hidden;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-body);
  cursor: none;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background-image: url('assets/fondo.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.3;
  filter: blur(7px);
  pointer-events: none;
}
a, button {
  cursor: none;
  color: inherit;
  text-decoration: none;
}
.cursor-dot,
.cursor-outline {
  position: fixed;
  top: 0; left: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 9999;
  pointer-events: none;
}
.cursor-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-color);
}
.cursor-outline {
  width: 40px;
  height: 40px;
  border: 2px solid var(--text-color);
  transition: width 0.2s, height 0.2s, background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.cursor-outline::after {
  content: "VER";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--bg-color);
  letter-spacing: 1px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.cursor-hover .cursor-outline {
  width: 60px;
  height: 60px;
  background-color: rgba(255, 42, 95, 0.1);
  border-color: var(--accent-color);
}
.cursor-hover .cursor-dot {
  background-color: var(--text-color);
}
.cursor-project .cursor-outline {
  width: 80px;
  height: 80px;
  background-color: #ffffff !important;
  border: 2px solid #ffffff !important;
  mix-blend-mode: difference;
  box-shadow: none;
}
.cursor-project .cursor-outline::after {
  color: #000000;
  opacity: 1;
}
.cursor-project .cursor-dot {
  opacity: 0 !important;
  transition: opacity 0.2s;
}
h1, h2, h3, .display-text {
  font-family: var(--font-display);
  text-transform: uppercase;
  line-height: 0.9;
}
.huge-text {
  font-size: clamp(4rem, 15vw, 15rem);
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.section-padding {
  padding: 8rem 2rem;
}
.container {
  max-width: 1400px;
  margin: 0 auto;
}
nav {
  position: fixed;
  top: 0; left: 0; width: 100%;
  padding: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  mix-blend-mode: difference;
  color: #fff;
}
.logo {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 1px;
}
.nav-links {
  display: flex;
  gap: 3rem;
  font-weight: 700;
  font-size: 1.1rem;
}
.nav-links a {
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0%; height: 2px;
  background: #fff;
  transition: width 0.3s ease;
}
.nav-links a:hover::after {
  width: 100%;
}
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}
.hero-content {
  padding: 0 2rem;
  z-index: 10;
  pointer-events: none;
}
.hero-subtitle {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 2rem;
  max-width: 500px;
  line-height: 1.4;
}
.hero-image-wrapper {
  position: absolute;
  right: 10%;
  top: 20%;
  width: 300px;
  height: 400px;
  overflow: hidden;
  z-index: 5;
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  transform: scale(0.85);
  transition: border-radius 2s ease-in-out, transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}
.hero-image-wrapper:hover {
  border-radius: 20px !important;
  transition: border-radius 0.6s cubic-bezier(0.25, 1, 0.5, 1), transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  transform: scale(1);
}
.hero-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.2);
  transition: filter 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}
.hero-image-wrapper:hover img {
  filter: grayscale(0%) contrast(1.1); /* Recupera el color original */
}
.parallax-hero-img {
  width: 120% !important;
  height: 120% !important;
  object-fit: cover;
  position: absolute;
  top: -10%;
  left: -10%;
  transition: transform 0.1s ease-out, filter 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}
.marquee-container {
  overflow: hidden;
  background: var(--text-color);
  color: var(--bg-color);
  padding: 2rem 0;
  display: flex;
  white-space: nowrap;
  transform: rotate(-5deg) scale(1.1);
  margin: 4rem 0;
}
.marquee-content {
  display: flex;
  animation: scroll-left 20s linear infinite;
  font-family: var(--font-display);
  font-size: 4rem;
  text-transform: uppercase;
}
.marquee-item {
  padding: 0 2rem;
}
.marquee-item span {
  color: var(--accent-color);
}
@keyframes scroll-left {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.projects-grid {
  display: flex;
  flex-direction: column;
  gap: 8rem;
  margin-top: 4rem;
}
.project-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
}
.project-row:nth-child(even) .project-image-col {
  order: -1;
}
.project-row:nth-child(even) .project-info-col {
  text-align: right;
}
.project-figure {
  width: 100%;
  height: 70vh;
  overflow: hidden;
  position: relative;
  margin: 0;
  background-color: transparent;
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  transform: scale(0.85);
  transition: border-radius 2s ease-in-out, transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}
.project-figure:hover {
  border-radius: 12px !important;
  transition: border-radius 0.6s cubic-bezier(0.25, 1, 0.5, 1), transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  transform: scale(1);
}
.project-img {
  width: 120%;
  height: 120%;
  object-fit: cover;
  display: block;
  position: absolute;
  top: -10%;
  left: -10%;
  transition: transform 0.1s ease-out;
}
.project-number {
  font-family: var(--font-display);
  font-size: 6rem;
  color: transparent;
  -webkit-text-stroke: 2px var(--text-color);
  opacity: 0.3;
  margin-bottom: -2rem;
  display: block;
}
.project-title {
  font-size: 5rem;
  margin-bottom: 1rem;
  transition: color 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}
.project-row:hover .project-title {
  color: var(--accent-color);
}
.project-desc {
  font-size: 1.25rem;
  max-width: 400px;
  line-height: 1.5;
  margin-bottom: 2rem;
}
.project-row:nth-child(even) .project-desc {
  margin-left: auto;
}
.tags {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.project-row:nth-child(even) .tags {
  justify-content: flex-end;
}
.tag {
  border: 1px solid var(--text-color);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
}
.border-top {
  border-top: 4px solid var(--text-color);
  padding-top: 6rem;
}
.services-list {
  display: flex;
  flex-direction: column;
}
.service-item {
  border-bottom: 2px solid var(--text-color);
  padding: 3rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  position: relative;
  overflow: hidden;
  z-index: 1;
}
.service-item::before {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-color: var(--text-color);
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: -1;
}
.service-item:first-child {
  border-top: 2px solid var(--text-color);
}
.service-item:hover {
  color: var(--bg-color);
  padding-left: 2rem;
  padding-right: 2rem;
}
.service-item:hover::before {
  transform: translateY(0);
}
.service-title {
  font-family: var(--font-display);
  font-size: 3rem;
  width: 40%;
}
.service-desc {
  font-size: 1.25rem;
  width: 50%;
  line-height: 1.5;
}
footer {
  background: var(--text-color);
  color: var(--bg-color);
  padding: 8rem 2rem 4rem;
  text-align: center;
}
.footer-huge {
  font-size: clamp(3rem, 10vw, 10rem);
  line-height: 1;
  margin-bottom: 4rem;
}
.footer-huge span { color: var(--accent-color); }
.contact-link {
  display: inline-block;
  font-size: 2rem;
  font-weight: 700;
  border-bottom: 3px solid var(--accent-color);
  padding-bottom: 0.5rem;
  transition: color 0.3s;
}
.contact-link:hover {
  color: var(--accent-color);
}
.chat-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent-color);
  border: 2px solid var(--text-color);
  cursor: none;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-color);
  box-shadow: 6px 6px 0 rgba(0,0,0,1);
  transition: transform 0.3s;
}
.chat-toggle:hover {
  transform: translateY(-5px);
}
.chat-toggle.active {
  background: var(--text-color);
  color: var(--bg-color);
  border: 2px solid var(--accent-color);
  box-shadow: 6px 6px 0 var(--accent-color);
}
.chat-panel {
  position: fixed;
  bottom: 6.5rem;
  right: 2rem;
  width: 380px;
  max-height: 520px;
  border: 4px solid var(--text-color);
  z-index: 999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: bottom right;
  background: var(--bg-color);
  box-shadow: 10px 10px 0 var(--text-color);
}
.chat-panel.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}
.chat-header {
  padding: 14px 18px;
  background: var(--accent-color);
  color: #fff;
  border-bottom: 4px solid var(--text-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 330px;
  scroll-behavior: smooth;
  font-family: var(--font-body);
}
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--text-color); }
.msg-bot {
  align-self: flex-start;
  max-width: 85%;
  background: #fff;
  border: 2px solid var(--text-color);
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-color);
  animation: msgIn 0.3s ease-out;
}
.msg-user {
  align-self: flex-end;
  max-width: 85%;
  background: var(--accent-color);
  border: 2px solid var(--text-color);
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.5;
  color: #fff;
  animation: msgIn 0.3s ease-out;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-options {
  padding: 4px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.opt-btn {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: #fff;
  border: 2px solid var(--text-color);
  color: var(--text-color);
  font-size: 0.9rem;
  font-family: var(--font-body);
  font-weight: 700;
  cursor: none;
  transition: all 0.2s;
  text-align: left;
  box-shadow: 3px 3px 0 var(--text-color);
}
.opt-btn::before {
  content: '\f105';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  color: var(--accent-color);
  margin-right: 10px;
  font-size: 0.9rem;
}
.opt-btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--text-color);
  background: var(--accent-color);
  color: #fff;
}
.opt-btn:hover::before {
  color: #fff;
}
.chat-input-area {
  padding: 10px 14px;
  border-top: 4px solid var(--text-color);
  display: none;
  align-items: center;
  gap: 8px;
  background: #fff;
}
.chat-input-area.show {
  display: flex;
}
.chat-input-area input {
  flex: 1;
  padding: 10px 12px;
  background: var(--bg-color);
  border: 2px solid var(--text-color);
  color: var(--text-color);
  font-size: 0.95rem;
  font-family: var(--font-body);
  font-weight: 500;
  outline: none;
  border-radius: 0;
}
.chat-input-area input:focus {
  border-color: var(--accent-color);
}
.chat-input-area button {
  width: 42px;
  height: 42px;
  background: var(--text-color);
  border: 2px solid var(--text-color);
  color: var(--bg-color);
  cursor: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s;
  flex-shrink: 0;
}
.chat-input-area button:hover {
  background: var(--accent-color);
  color: #fff;
}
.typing {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  align-self: flex-start;
}
.typing span {
  width: 8px;
  height: 8px;
  background: var(--text-color);
  animation: typingBounce 0.6s ease-in-out infinite;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  padding: 14px 20px;
  background: var(--text-color);
  border: 2px solid var(--text-color);
  color: var(--bg-color);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 6px 6px 0 var(--accent-color);
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  align-items: center;
  gap: 12px;
}
.toast.show {
  transform: translateX(0);
}
.toast i {
  color: var(--accent-color);
  font-size: 1.2rem;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(255,255,255,0); }
}
.fade-in-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}
/* Project Floating Badges */
.project-image-col {
  position: relative;
}

.project-badge {
  position: absolute;
  width: 210px;
  pointer-events: none;
  z-index: 10;
  opacity: 0.9;
}

.project-badge img {
  width: 100%;
  height: auto;
  filter: drop-shadow(4px 4px 0px rgba(0, 0, 0, 0.15));
}

@keyframes float-badge-left {
  0% { transform: translateY(20px) rotate(-10deg); }
  100% { transform: translateY(-5px) rotate(-15deg); }
}

@keyframes float-badge-right {
  0% { transform: translateY(20px) rotate(10deg); }
  100% { transform: translateY(-5px) rotate(15deg); }
}

/* Odd rows (1, 3): image right, badge bottom-left */
.project-row:nth-child(odd) .project-badge {
  left: 0;
  bottom: -40px;
  animation: float-badge-left 4s ease-in-out infinite alternate;
}

/* Even rows (2, 4): image left, badge bottom-right */
.project-row:nth-child(even) .project-badge {
  right: 0;
  bottom: -40px;
  animation: float-badge-right 4.5s ease-in-out infinite alternate;
}

@media (max-width: 900px) {
  .section-padding {
    padding: 5rem 1.5rem;
  }
  
  .huge-text {
    font-size: clamp(2.2rem, 10vw, 4.5rem);
    white-space: normal; /* Permite que el texto se ajuste en pantallas muy pequeñas */
  }
  
  .hero {
    padding-top: 9rem; /* Más espacio arriba para evitar colisión con el menú fijo */
    min-height: auto;
  }
  
  .hero-content {
    padding: 0;
  }
  
  /* Elimina el margen negativo del segundo h1 ("DEVELOPER") en móviles */
  .hero-content h1:nth-child(2) {
    margin-top: 0.5rem !important; 
  }
  
  .hero-subtitle {
    margin-top: 2rem !important; /* Separación clara después del título */
    font-size: 1.1rem;
    max-width: 100%;
    line-height: 1.5;
  }

  .project-row {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .project-row:nth-child(even) .project-image-col {
    order: 1;
  }
  .project-row:nth-child(even) .project-info-col {
    order: 2;
    text-align: left;
  }
  .project-row:nth-child(even) .project-desc {
    margin-left: 0;
  }
  .project-row:nth-child(even) .tags {
    justify-content: flex-start;
  }
  
  .project-title {
    font-size: 2.8rem;
  }
  
  .project-number {
    font-size: 4rem;
    margin-bottom: -1rem;
  }
  
  .project-desc {
    font-size: 1.1rem;
    max-width: 100%;
  }
  
  .project-figure {
    height: 40vh;
  }
  
  nav {
    padding: 1.2rem 1.5rem;
    flex-direction: row; /* Mantener en fila en lugar de apilar verticalmente */
    justify-content: space-between;
    align-items: center;
  }
  
  .logo {
    font-size: 1.3rem;
  }
  
  .nav-links {
    gap: 1.5rem;
    font-size: 0.9rem;
  }
  
  .cursor-dot, .cursor-outline {
    display: none; /* Desactivar cursor personalizado en móviles */
  }
  body {
    cursor: auto;
  }
  a, button {
    cursor: pointer;
  }
  
  .hero-image-wrapper {
    position: relative;
    right: auto;
    top: auto;
    margin: 3rem auto 0;
    width: 250px;
    height: 300px;
    /* Eliminamos border-radius: 0 para que conserve el efecto blob animado por JS */
  }
  
  .service-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 2rem 0;
  }
  .service-item:hover {
    padding-left: 0;
    padding-right: 0;
    color: var(--bg-color);
  }
  .service-title {
    font-size: 2rem;
    width: 100%;
  }
  .service-desc {
    font-size: 1.1rem;
    width: 100%;
  }
  
  .chat-toggle {
    bottom: 1rem;
    right: 1rem;
    width: 50px;
    height: 50px;
  }
  
  .chat-panel {
    width: calc(100% - 2rem);
    right: 1rem;
    bottom: 4.8rem;
    max-height: 60vh; /* Evita que se salga en pantallas de baja altura */
  }

  .footer-huge {
    font-size: clamp(2.5rem, 8vw, 5.5rem);
  }
  
  .contact-link {
    font-size: 1.4rem;
  }
  
  /* Responsive badges */
  .project-badge {
    width: 140px;
  }
  .project-row:nth-child(odd) .project-badge {
    left: 10px;
    bottom: -20px;
    animation: float-badge-left 4s ease-in-out infinite alternate;
  }
  .project-row:nth-child(even) .project-badge {
    right: 10px;
    bottom: -20px;
    animation: float-badge-right 4.5s ease-in-out infinite alternate;
  }
}
