/* ============================================
   INDEX.CSS — Landing Page Sections
   Scene-based Projects, Parallax Titles, About, Services
   ============================================ */

/* ============ LANDING HERO — INITIAL SCROLL TITLE ============ */
/*
  Este bloque controla solamente el hero inicial.
  Usa clases landing-hero-* para no interferir con los títulos internos
  que ya utilizan .section-hero y .hero-word.
*/
.landing-hero {
  min-height: 100svh;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  padding: 120px 24px 40px;
}

.landing-hero-background {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 50% 48%, rgba(245, 245, 245, 0.075), transparent 19%),
    radial-gradient(circle at 50% 52%, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.9) 78%),
    linear-gradient(180deg, #181818 0%, #0f0f0f 52%, #0b0b0b 100%);
}

.landing-hero-background::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.62;
  background:
    repeating-linear-gradient(90deg,
      rgba(245, 245, 245, 0.025) 0,
      rgba(245, 245, 245, 0.025) 1px,
      transparent 1px,
      transparent 110px),
    repeating-linear-gradient(0deg,
      transparent 0,
      transparent 110px,
      rgba(245, 245, 245, 0.018) 111px,
      rgba(245, 245, 245, 0.018) 112px);
}

.landing-hero-background::after {
  content: "";
  position: absolute;
  width: min(55vw, 820px);
  height: 72vh;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(ellipse at center,
      rgba(0, 0, 0, 0.96) 0%,
      rgba(0, 0, 0, 0.7) 45%,
      rgba(0, 0, 0, 0.12) 76%,
      transparent 100%);
  filter: blur(5px);
}

.landing-hero-inner {
  width: 100%;
  text-align: center;
}

.landing-hero-kicker {
  margin-bottom: 18px;
  color: var(--color-text-secondary);
  font-size: clamp(0.62rem, 1vw, 0.74rem);
  font-weight: 700;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

.landing-hero-title {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.45rem, 1.2vw, 1.1rem);
  color: var(--color-text);
  font-family: var(--ff-heading);
  font-size: clamp(2.7rem, 8.7vw, 9rem);
  font-weight: 900;
  letter-spacing: -0.09em;
  line-height: 0.86;
  text-transform: uppercase;
  white-space: nowrap;
}

.landing-hero-word {
  display: inline-block;
  will-change: transform, opacity, filter;
}

.landing-hero-copy {
  max-width: 620px;
  margin: 24px auto 0;
  color: var(--color-text-secondary);
  font-size: clamp(0.9rem, 1.35vw, 1.08rem);
  line-height: 1.7;
  opacity: 0;
  transform: translateY(18px);
  will-change: transform, opacity;
}

.landing-hero-scroll {
  position: absolute;
  right: clamp(24px, 4vw, 64px);
  bottom: 30px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-text-muted);
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  will-change: transform, opacity;
}

.landing-hero-scroll::before {
  content: "";
  width: 54px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-text-secondary));
}

@media (max-width: 768px) {
  .landing-hero {
    padding-inline: 14px;
  }

  .landing-hero-title {
    flex-wrap: wrap;
    gap: 0.1rem 0.7rem;
    white-space: normal;
  }

  .landing-hero-scroll {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
  }

  .landing-hero-scroll::before {
    width: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {

  .landing-hero-word,
  .landing-hero-copy,
  .landing-hero-scroll {
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
  }
}


/* ============ SECTION HERO TITLES (Red Barrels-style) ============ */
.section-hero {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.section-hero-title {
  font-size: clamp(3rem, 10vw, 8rem);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1;
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 100%;
  letter-spacing: 0;
  will-change: transform;
}

.hero-word {
  display: inline-block;
  will-change: transform, opacity;
  padding: 0 0.15em;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .section-hero {
    min-height: 40vh;
  }

  .section-hero-title {
    font-size: clamp(2.2rem, 9vw, 3rem);
  }
}


/* ============ WORKS / PROJECTS — First section ============ */
.works-section {
  display: flex;
  flex-direction: column;
  padding-top: 120px;
  scroll-margin-top: 100px;
}


/* ============ PROJECT SCENES (Sticky + Scroll Reveal) ============ */
.projects-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
  gap: 60px;
  position: relative;
}

/* — Lado Izquierdo (Sticky Gallery) — */
.projects-gallery {
  position: relative;
}

.projects-gallery-inner {
  position: sticky;
  top: 15vh;
  height: 70vh;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  border: 2px solid var(--color-border);
  transition: border-color 0.6s ease, box-shadow 0.6s ease, opacity 0.5s ease;
}

.projects-gallery-inner.no-frame {
  border-color: transparent;
  box-shadow: none;
  background-color: transparent;
  overflow: visible !important;
}

.project-preview-trigger {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-preview-trigger.active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

.project-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.project-preview-trigger.active:hover .project-cover {
  transform: scale(1.04);
}

/* — Visor 3D del modelo GLB (n8n) — */
.n8n-3d-viewer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.n8n-3d-viewer canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* — Lado Derecho (Scrolling List) — */
.projects-list {
  display: flex;
  flex-direction: column;
  padding-bottom: 20vh;
  position: relative;
  z-index: 2;
}

.project-item {
  min-height: 150vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  opacity: 0.4;
  filter: blur(2px);
  transform: translateY(20px);
  transition: opacity 0.6s ease, filter 0.6s ease, transform 0.6s ease;
}

.project-item.active {
  opacity: 1;
  filter: blur(0px);
  transform: translateY(0);
}

.scene-tag {
  font-family: var(--ff-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-text-muted);
  padding: 4px 14px;
  background: var(--color-foreground);
  border-radius: var(--radius-full);
  align-self: flex-start;
  border: 1px solid var(--color-border);
}

.scene-title {
  font-family: var(--ff-heading);
  font-size: clamp(2rem, 4vw, 4rem);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.scene-description {
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  color: var(--color-text-secondary);
  line-height: 1.6;
  max-width: 520px;
}

.scene-tech {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.scene-tech span {
  font-size: var(--fs-xs);
  font-weight: 500;
  padding: 3px 12px;
  background: var(--color-text);
  color: var(--color-background);
  border-radius: var(--radius-full);
}

/* — Responsive — */
@media (max-width: 1024px) {
  .projects-container {
    display: flex;
    flex-direction: column;
    padding: 0 30px;
    gap: 40px;
  }

  .projects-gallery-inner {
    position: sticky;
    top: 80px;
    height: 45vh;
    z-index: 10;
  }

  .project-item {
    min-height: 70vh;
  }
}

@media (max-width: 768px) {
  .works-section {
    padding-top: 80px;
  }

  .scene-title {
    font-size: clamp(1.8rem, 8vw, 3rem);
  }

  .projects-container {
    padding: 0 20px;
  }
}

@media (max-width: 480px) {
  .works-section {
    padding-top: 64px;
  }

  .project-item {
    min-height: 55vh;
    gap: 12px;
  }

  .scene-description {
    font-size: 0.9rem;
  }

  .projects-gallery-inner {
    height: 38vh;
  }
}


/* ============ PROJECT CAROUSEL ============ */
.project-carousel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* — Slides — */
.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  /* Estado inactivo: fuera de pantalla por la izquierda */
  transform: translateX(-100%);
  transition:
    opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.carousel-slide.active {
  opacity: 1;
  visibility: visible;
  /* Estado activo: deslizado a su posición */
  transform: translateX(0);
  z-index: 2;
}

.carousel-slide .project-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.carousel-slide.active:hover .project-cover {
  transform: scale(1.04);
}

/* — Slide Label Overlay — */
.carousel-slide-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 20px 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, transparent 100%);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease 0.2s, transform 0.4s ease 0.2s;
}

.carousel-slide.active .carousel-slide-label {
  opacity: 1;
  transform: translateY(0);
}

/* — Navigation Arrows — */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.project-carousel:hover .carousel-arrow {
  opacity: 1;
}

.carousel-arrow:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: translateY(-50%) scale(1.1);
}

.carousel-arrow:active {
  transform: translateY(-50%) scale(0.95);
}

.carousel-prev {
  left: 14px;
}

.carousel-next {
  right: 14px;
}

/* — Dot Indicators — */
.carousel-dots {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 10px;
  align-items: center;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.carousel-dot.active {
  width: 28px;
  border-radius: 999px;
  background: #fff;
  border-color: #fff;
}

.carousel-dot:hover:not(.active) {
  border-color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.2);
}

/* — Counter Badge — */
.carousel-counter {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

/* — Carousel Info Transition — */
#projectCarouselInfo .scene-title,
#projectCarouselInfo .scene-description,
#projectCarouselInfo .scene-tag,
#projectCarouselInfo .scene-tech {
  transition: opacity 0.35s ease, filter 0.35s ease;
}

#projectCarouselInfo.info-transitioning .scene-title,
#projectCarouselInfo.info-transitioning .scene-description,
#projectCarouselInfo.info-transitioning .scene-tag,
#projectCarouselInfo.info-transitioning .scene-tech {
  opacity: 0;
  filter: blur(8px);
}

/* — Carousel Responsive — */
@media (max-width: 1024px) {
  .carousel-arrow {
    width: 36px;
    height: 36px;
    opacity: 1;
  }

  .carousel-prev {
    left: 10px;
  }

  .carousel-next {
    right: 10px;
  }
}

@media (max-width: 768px) {
  .carousel-arrow {
    width: 32px;
    height: 32px;
  }

  /* En móvil el slide entra con menos recorrido (deslizamiento sutil) */
  .carousel-slide {
    transform: translateX(-40%);
  }

  .carousel-slide.active {
    transform: translateX(0);
  }

  .carousel-arrow svg {
    width: 16px;
    height: 16px;
  }

  .carousel-dots {
    bottom: 12px;
    gap: 8px;
  }

  .carousel-dot {
    width: 8px;
    height: 8px;
  }

  .carousel-dot.active {
    width: 22px;
  }

  .carousel-counter {
    top: 10px;
    right: 10px;
    font-size: 0.65rem;
    padding: 4px 10px;
  }
}


/* ============ TECH STACK 3D CAROUSEL ============ */
.banner {
  width: 100%;
  height: 100vh;
  text-align: center;
  overflow: hidden;
  position: relative;
}

.banner .slider {
  position: absolute;
  width: 200px;
  height: 250px;
  /* Subir el carrusel a la zona superior para que no se solape con el texto */
  top: 10%;
  left: calc(50% - 100px);
  transform-style: preserve-3d;
  transform: perspective(1000px);
  animation: autoRun 20s linear infinite;
}

@keyframes autoRun {
  from {
    transform: perspective(1000px) rotateX(-16deg) rotateY(0deg);
  }

  to {
    transform: perspective(1000px) rotateX(-16deg) rotateY(360deg);
  }
}

.banner .slider .item {
  position: absolute;
  inset: 0 0 0 0;
  transform:
    rotateY(calc((var(--position) - 1) * (360deg / var(--quantity)))) translateZ(var(--slider-z, 500px));
}

.banner .slider .item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner .content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: max-content;
  padding: 0 60px 80px;
  display: flex;
  justify-content: center;
  z-index: 2;
  background: linear-gradient(to top, var(--color-background) 55%, transparent);
}

.banner .content-text {
  width: 100%;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 32px;
}

.tech-section-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.26em;
}

.banner .content h1 {
  font-family: var(--ff-heading);
  font-weight: 800;
  font-size: clamp(48px, 12vw, 150px);
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 0;
  color: #fafafa;
}

.banner .content p {
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  line-height: 1.65;
  color: var(--color-text-secondary);
  font-weight: 400;
}

.content-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.content-tags {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  line-height: 2;
  text-align: right;
}

@media (max-width: 1024px) {
  .banner .slider {
    width: 160px;
    height: 200px;
    top: 8%;
    --slider-z: 370px;
    left: calc(50% - 80px);
  }
}

@media (max-width: 768px) {
  .banner {
    height: 78vh;
  }

  .banner .slider {
    width: 120px;
    height: 150px;
    top: 7%;
    --slider-z: 260px;
    left: calc(50% - 60px);
  }

  .banner .content {
    padding: 0 24px 56px;
  }

  .content-bottom {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .content-tags {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .banner {
    height: 72svh;
  }

  .banner .slider {
    width: 90px;
    height: 115px;
    top: 5%;
    --slider-z: 180px;
    left: calc(50% - 45px);
  }

  .banner .content {
    padding: 0 16px 40px;
  }
}

/* ============ ABOUT SECTION ============ */
.about-section {
  position: relative;
  display: flex;
  align-items: center;
  flex-direction: column;
  scroll-margin-top: 100px;
}

.about-content {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 30px 60px;
}

.about-inner {
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  gap: 56px;
}

.about-block {
  text-align: left;
}

.about-block-title {
  font-size: clamp(3rem, 6vw, 5.5rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: var(--sp-12);
}

.about-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
}

.about-col {
  display: flex;
  flex-direction: column;
  gap: 32px;
  border-top: 1px solid var(--color-border);
  padding-top: 28px;
}

.about-block p {
  font-size: clamp(1rem, 1.7vw, 1.2rem);
  font-weight: 400;
  line-height: 1.85;
  color: var(--color-text-secondary);
}

@media (max-width: 1024px) {
  .about-columns {
    gap: 48px;
  }
}

@media (max-width: 768px) {
  .about-columns {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* — Expertise Tags — */
.expertise-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.expertise-title {
  font-size: clamp(1.125rem, 2vw, 1.875rem);
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
}

.expertise-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 700px;
}

/* — Tech Icons — */
.tech-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.tech-title {
  font-size: clamp(1.125rem, 2vw, 1.875rem);
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
}

.tech-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.tech-icon {
  width: 36px;
  height: 36px;
  color: var(--color-text);
  opacity: 0.7;
  transition: all var(--duration-normal) ease;
}

.tech-icon:hover {
  opacity: 1;
  transform: scale(1.2);
}

@media (max-width: 512px) {
  .about-content {
    padding: 0 20px 40px;
  }

  .about-block-title {
    font-size: clamp(2rem, 9vw, 3rem);
    margin-bottom: var(--sp-6);
  }

  .expertise-tags {
    gap: 5px;
  }

  .tech-icon {
    width: 28px;
    height: 28px;
  }
}


/* ============ SERVICES — LISTA EDITORIAL ============ */
.services-section {
  display: flex;
  align-items: center;
  flex-direction: column;
  scroll-margin-top: 100px;
}

.services-list {
  max-width: 1100px;
  width: 100%;
  padding: 0 30px 80px;
}

.service-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 40px;
  align-items: start;
  padding: 36px 0;
  border-top: 1px solid var(--color-border);
  transition: border-color var(--duration-normal) ease;
}

.service-row:last-child {
  border-bottom: 1px solid var(--color-border);
}

.service-row:hover {
  border-top-color: var(--color-borderhover);
}

.service-row-number {
  font-family: var(--ff-heading);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--color-text-muted);
  letter-spacing: 0.14em;
  padding-top: 10px;
}

.service-row-body h3 {
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  font-weight: 800;
  line-height: 1;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

.service-row-title-line {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.service-row-title-line h3 {
  margin-bottom: 0;
}

.service-badge {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--color-text);
  color: var(--color-background);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.service-row-body p {
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
  line-height: 1.65;
  max-width: 500px;
}

.service-row-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  padding-top: 8px;
  min-width: 120px;
}

.service-type {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  text-align: right;
}

.service-quote {
  font-family: var(--ff-heading);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--color-text);
  padding: 7px 18px;
  border: 1px solid var(--color-borderhover);
  border-radius: var(--radius-full);
  white-space: nowrap;
  letter-spacing: 0.04em;
  transition: background var(--duration-normal) ease, color var(--duration-normal) ease;
}

.service-row:hover .service-quote {
  background: var(--color-text);
  color: var(--color-background);
}

@media (max-width: 768px) {
  .service-row {
    grid-template-columns: 36px 1fr;
    gap: 18px;
  }

  .service-row-aside {
    grid-column: 2;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    padding-top: 0;
  }

  .service-row-body h3 {
    font-size: clamp(1.5rem, 7vw, 2rem);
  }
}

@media (max-width: 480px) {
  .services-list {
    padding: 0 20px 60px;
  }

  .service-row {
    gap: 14px;
    padding: 28px 0;
  }
}


/* ============ CTA / CONTACT BOX ============ */
.cta-section {
  padding: 30px;
  margin-block: 25px;
}

.cta-box {
  background: var(--color-middleground);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: var(--sp-16) var(--sp-8);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-6);
  max-width: 800px;
  margin-inline: auto;
  transition: border-color var(--duration-normal) ease;
}

.cta-box:hover {
  border-color: var(--color-borderhover);
}

.cta-box h2 {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
}

.cta-box p {
  font-size: var(--fs-md);
  max-width: 500px;
}

@media (max-width: 768px) {
  .cta-box {
    padding: var(--sp-10) var(--sp-6);
  }
}

/* ============ PROJECT MODAL ============ */
.project-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.project-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.project-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
}

.project-modal-content {
  position: relative;
  width: min(1200px, 94vw);
  height: min(780px, 88vh);
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  background: #111;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.project-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.project-modal-header h3 {
  margin: 0;
  color: #fff;
}

.project-live-link {
  padding: 11px 16px;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.project-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: #111;
  font-size: 25px;
  cursor: pointer;
  z-index: 10;
}

.project-modal-browser {
  height: calc(100% - 62px);
  overflow: hidden;
  border-radius: 14px;
  background: #181818;
}

.browser-bar {
  display: flex;
  gap: 7px;
  padding: 12px;
  background: #222;
}

.browser-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.32);
}

.project-modal iframe {
  width: 100%;
  height: calc(100% - 34px);
  border: none;
  background: #fff;
}

.modal-open {
  overflow: hidden;
}

.modal-close-bar {
  display: none;
}

@media (max-width: 768px) {
  .project-modal {
    padding: 0;
    display: block;
  }

  .project-modal-content {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
    border: none;
    padding: 0;
    display: flex;
    flex-direction: column;
  }

  .project-modal-close {
    display: none;
  }

  .project-modal-header {
    padding: 14px 16px;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
  }

  .project-modal-header h3 {
    font-size: 1rem;
  }

  .project-live-link {
    font-size: 12px;
    padding: 8px 14px;
    white-space: nowrap;
  }

  .project-modal-browser {
    flex: 1;
    min-height: 0;
    height: auto;
    border-radius: 0;
  }

  .modal-close-bar {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding: 10px 16px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    background: #1a1a1a;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .modal-close-bar button {
    width: 100%;
    height: 52px;
    background: #ffffff;
    border: none;
    border-radius: 12px;
    color: #111;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    font-family: var(--ff-body);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }

  .modal-close-bar button:active {
    background: #e0e0e0;
  }
}

/* ============================================
   VISOR 3D DEL MODELO N8N — desktop full-screen
   ============================================ */

@media (min-width: 1025px) {
  .n8n-3d-viewer {
    position: fixed;
    width: 100vw;
    height: 100vh;
  }
}