/* Pre-scrolly showcase — tipografía alineada con main.css (--font-primary / --font-secondary) */
#mws-preshow {
  /* Acento = verde corporativo (--mws-green en main.css) */
  --mwsps-yellow: var(--mws-green);
  --mwsps-bg: #161616;
  /* Alto según contenido: evita 100vh fijo + min-height que añadían scroll de más */
  height: auto;
  min-height: 0;
  max-height: none;
  padding: clamp(20px, 3.5vh, 44px) clamp(16px, 3vw, 40px) clamp(20px, 3.5vh, 44px) clamp(16px, 3vw, 30px);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  z-index: 1;
  user-select: none;
  overflow: hidden;
  background-color: var(--mwsps-bg);
  background-image: url("https://www.yudiz.com/codepen/photography-banner/frame.png");
  background-size: cover;
  background-position: center;
}

#mws-preshow *::selection {
  background-color: rgba(201, 255, 0, 0.2);
  color: #ffffff;
}

#mws-preshow::before {
  content: "";
  border-radius: 197.5px 0;
  opacity: 0.35;
  background: var(--mwsps-yellow);
  filter: blur(162px);
  height: 35%;
  width: 55%;
  position: absolute;
  top: -40%;
  left: -66%;
  transform: translate(50%, 50%);
  z-index: 0;
  pointer-events: none;
}

#mws-preshow .left-part {
  padding: 20px 0 0;
  overflow-x: visible;
  overflow-y: hidden;
  position: relative;
  z-index: 2;
  flex: 1 1 42%;
  min-width: 0;
}

#mws-preshow .left-part h1 {
  margin: 0;
  color: #fff;
  font-family: var(--font-primary);
  /* Más pequeño para que la frase larga en una línea no se corte */
  font-size: clamp(18px, 4.6vw, 72px);
  line-height: 0.85;
  font-weight: 800;
  font-style: normal;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

#mws-preshow .left-part h1 .d-flex {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.15em;
}

/* Solo la frase rotativa: una línea, sin recorte (tamaño ligeramente menor + tracking) */
#mws-preshow .left-part h1 .text {
  color: var(--mwsps-yellow);
  display: inline-block;
  min-height: 0.85em;
  min-width: 0.25ch;
  white-space: nowrap;
  overflow: visible;
  vertical-align: bottom;
  font-size: 0.88em;
  letter-spacing: -0.045em;
}

#mws-preshow .left-part h1 .char {
  display: inline-block;
}

#mws-preshow .left-part h1 .typed-line-char {
  display: inline-block;
  will-change: transform, opacity;
}

#mws-preshow .typed-cursor {
  display: none !important;
}

#mws-preshow .left-part p {
  width: min(100%, 420px);
  margin: 20px 0 0;
  color: #fff;
  font-size: clamp(10px, 1.15vw, 12px);
  font-style: normal;
  font-weight: 400;
  line-height: 1.85;
  font-family: var(--font-secondary);
  opacity: 0.85;
}

#mws-preshow .book-link {
  margin: clamp(24px, 4vw, 40px) 0 0;
  padding: 0;
  border: 0;
  font-size: clamp(11px, 1.9vw, 22px);
  line-height: 1.15;
  color: #f1f1f1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--font-primary);
  font-weight: 700;
  font-style: normal;
  display: inline-flex;
  align-items: center;
  gap: clamp(16px, 3vw, 28px);
  position: relative;
  text-decoration: none;
}

#mws-preshow .book-link .linktext {
  position: relative;
  overflow: hidden;
  display: inline-block;
}

#mws-preshow .book-link .linktext::before {
  position: absolute;
  content: "";
  left: 0;
  bottom: 6px;
  width: 100%;
  height: 3px;
  background-color: #ffffff;
  transform: scaleX(1);
  transition: transform 250ms ease-in-out;
  transform-origin: 0 0;
}

#mws-preshow .book-link:hover .linktext::before,
#mws-preshow .book-link:focus-visible .linktext::before {
  transform: scaleX(0);
  transform-origin: 100% 100%;
}

#mws-preshow .book-link .arrow {
  height: 36px;
  width: 36px;
  top: -5px;
  display: inline-block;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

#mws-preshow .book-link .arrow::before,
#mws-preshow .book-link .arrow::after {
  position: absolute;
  content: "";
  background-color: var(--mwsps-yellow);
  transition: all ease-in-out 0.35s;
  transform-origin: 0 0;
  border-radius: 30px;
}

#mws-preshow .book-link .arrow::before {
  height: 2px;
  width: 100%;
  top: 0;
  right: 0;
}

#mws-preshow .book-link .arrow::after {
  width: 2px;
  height: 100%;
  top: 0;
  right: 0;
}

#mws-preshow .book-link:hover .arrow::before,
#mws-preshow .book-link:focus-visible .arrow::before {
  width: 65%;
}

#mws-preshow .book-link:hover .arrow::after,
#mws-preshow .book-link:focus-visible .arrow::after {
  height: 65%;
}

#mws-preshow .book-link .arrow span {
  background-color: var(--mwsps-yellow);
  height: 2px;
  width: 100%;
  display: inline-block;
  transform: rotate(-45deg) translate(-3px, -1px);
  transform-origin: right top;
  border-radius: 30px;
  position: absolute;
  top: 0;
  left: 0;
  transition: all ease-in-out 0.35s;
}

#mws-preshow .book-link .arrow span::before {
  background-color: var(--mwsps-yellow);
  content: "";
  height: 100%;
  width: 15px;
  left: -15px;
  top: 0;
  position: absolute;
}

#mws-preshow .right-part {
  background-color: transparent;
  height: min(52vw, 480px);
  width: min(52vw, 480px);
  max-width: min(52vw, 480px);
  max-height: min(52vw, 480px);
  aspect-ratio: 1;
  margin: 0 0 0 auto;
  margin-right: -14px;
  display: block;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

#mws-preshow .right-part::before {
  content: "";
  border-radius: 197.5px 0;
  opacity: 0.35;
  background: var(--mwsps-yellow);
  filter: blur(112px);
  height: 35%;
  width: 55%;
  position: absolute;
  top: 50%;
  right: 33%;
  transform: translate(50%, -50%);
  z-index: -1;
  pointer-events: none;
}

#mws-preshow .right-part .d-flex {
  height: 100%;
  gap: 24px;
  display: flex;
  flex-wrap: wrap;
  align-content: space-between;
  position: relative;
}

#mws-preshow .main-grid {
  position: relative;
  width: 100%;
  height: 100%;
}

#mws-preshow .box {
  width: calc((100% / 3) - 16px);
  height: calc((100% / 3) - 16px);
  background-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #555555;
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
  line-height: 1.25;
  color: #ffffff;
  font-family: var(--font-primary);
  border-radius: 120px;
  position: absolute;
  box-sizing: border-box;
}

#mws-preshow .box:nth-child(1) {
  left: 0;
  top: 0;
  animation: mwsps-box-1 30s infinite;
}
#mws-preshow .box:nth-child(2) {
  left: calc(100% / 3);
  top: 0;
  animation: mwsps-box-2 30s infinite;
}
#mws-preshow .box:nth-child(3) {
  left: calc((100% / 3) * 2);
  top: 0;
  animation: mwsps-box-3 30s infinite;
}
#mws-preshow .box:nth-child(4) {
  left: 0;
  top: calc(100% / 3);
  animation: mwsps-box-4 30s infinite;
}
#mws-preshow .box:nth-child(5) {
  left: calc((100% / 3) * 2);
  top: calc(100% / 3);
  animation: mwsps-box-5 30s infinite;
}
#mws-preshow .box:nth-child(6) {
  left: 0;
  top: calc((100% / 3) * 2);
  animation: mwsps-box-6 30s infinite;
}
#mws-preshow .box:nth-child(7) {
  left: calc(100% / 3);
  top: calc((100% / 3) * 2);
  animation: mwsps-box-7 30s infinite;
}
#mws-preshow .box:nth-child(8) {
  left: calc((100% / 3) * 2);
  top: calc((100% / 3) * 2);
  animation: mwsps-box-8 30s infinite;
}

#mws-preshow .box span {
  position: absolute;
  display: block;
  opacity: 0.8;
  z-index: 5;
}

#mws-preshow .box:nth-child(1) span {
  top: 43%;
  left: -27px;
  transform: translateY(-50%);
}

#mws-preshow .box:nth-child(3) span {
  left: -10px;
  bottom: 2px;
}

#mws-preshow .box:nth-child(4) span {
  top: 50%;
  left: 55%;
  transform: translate(-50%, -50%);
}

#mws-preshow .box:nth-child(8) span {
  top: 50%;
  transform: translate(-50%, -50%);
  left: 15%;
}

#mws-preshow .box .bg-img {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 120px;
  overflow: hidden;
}

#mws-preshow .box .bg-img,
#mws-preshow .box .bg-img img {
  height: 100%;
  width: 100%;
}

#mws-preshow .box .bg-img img {
  max-width: 100%;
  object-fit: cover;
  object-position: center center;
}

#mws-preshow .bg-line {
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 85px;
  z-index: 0;
  overflow: hidden;
  display: flex;
  white-space: nowrap;
}

#mws-preshow .bg-line img {
  position: relative;
  flex-shrink: 0;
  animation: 26s linear infinite;
}

#mws-preshow .bg-line img:nth-child(1) {
  animation-name: mwsps-first-wave;
}

#mws-preshow .bg-line img:nth-child(2) {
  animation-name: mwsps-second-wave;
}

@keyframes mwsps-first-wave {
  50% {
    transform: translateX(-100%);
    opacity: 1;
  }
  50.05% {
    opacity: 0;
  }
  50.1% {
    transform: translateX(100%);
    opacity: 1;
  }
  100% {
    transform: translateX(0%);
  }
}

@keyframes mwsps-second-wave {
  0% {
    transform: translateX(0%);
  }
  50% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(-200%);
  }
}

#mws-preshow .bg-dash-circle {
  position: absolute;
  bottom: -35px;
  right: -13px;
  z-index: 0;
  width: 180px;
  aspect-ratio: 1/1;
}

#mws-preshow .bg-dash-circle img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  object-position: center center;
  animation: mwsps-dash-rotate 18s linear infinite;
}

@keyframes mwsps-dash-rotate {
  0% {
    transform: rotate(0);
  }
  100% {
    transform: rotate(360deg);
  }
}

#mws-preshow .bg-circle-h-line {
  bottom: 42px;
  left: -68px;
  z-index: 2;
  width: 181px;
  height: 111px;
  position: absolute;
}

#mws-preshow .bg-circle-h-line img {
  width: 100%;
  max-width: 100%;
  height: auto;
  position: absolute;
  left: 0;
}

#mws-preshow .bg-circle-h-line img:nth-child(1) {
  top: 0;
  animation: mwsps-top-ring 2.5s linear infinite;
}

#mws-preshow .bg-circle-h-line img:nth-child(2) {
  top: 50%;
  transform: translateY(-50%);
}

#mws-preshow .bg-circle-h-line img:nth-child(3) {
  bottom: 0;
  animation: mwsps-bottom-ring 2.5s linear infinite;
}

@keyframes mwsps-top-ring {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(5px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes mwsps-bottom-ring {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
  100% {
    transform: translateY(0);
  }
}

@media screen and (min-width: 1500px) {
  #mws-preshow {
    padding-left: 120px;
  }
}

@media screen and (min-width: 1400px) {
  #mws-preshow {
    padding-left: 100px;
  }
}

@media screen and (max-width: 1199px) {
  #mws-preshow .bg-line {
    height: 68px;
  }

  #mws-preshow .right-part {
    height: min(58vw, 360px);
    width: min(58vw, 360px);
    max-width: min(58vw, 360px);
    max-height: min(58vw, 360px);
  }

  #mws-preshow .right-part .d-flex {
    gap: 20px;
  }

  #mws-preshow .box {
    font-size: 9px;
  }

  #mws-preshow .left-part h1 {
    font-size: clamp(16px, 4vw, 58px);
  }

  #mws-preshow .left-part p {
    font-size: 11px;
    line-height: 1.8;
    width: 85%;
  }

  #mws-preshow .bg-dash-circle {
    width: 130px;
  }

  #mws-preshow .bg-circle-h-line {
    width: 156px;
    height: 92px;
  }

  #mws-preshow .book-link {
    font-size: clamp(13px, 2.5vw, 26px);
    gap: 24px;
  }

  #mws-preshow .book-link .arrow {
    height: 28px;
    width: 28px;
  }
}

@media screen and (max-width: 767px) {
  #mws-preshow {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
    min-height: auto;
    max-height: none;
    height: auto;
    gap: 0;
  }

  #mws-preshow .bg-line {
    height: 52px;
  }

  #mws-preshow .left-part {
    padding: 24px 16px 16px;
    flex: none;
  }

  #mws-preshow .left-part h1 {
    font-size: clamp(26px, 6.6vw, 68px);
  }

  #mws-preshow .right-part {
    height: min(90vw, 300px);
    width: min(90vw, 300px);
    max-width: min(90vw, 300px);
    max-height: min(90vw, 300px);
    margin: 0 auto;
  }

  #mws-preshow .left-part p {
    font-size: clamp(15px, 4.4vw, 18px);
    width: 96%;
  }

  #mws-preshow .box {
    font-size: 13px;
  }

  #mws-preshow .book-link .arrow {
    height: 24px;
    width: 24px;
  }

  #mws-preshow .book-link {
    font-size: clamp(19px, 6.9vw, 36px);
    gap: 20px;
    margin-top: 16px;
  }

  #mws-preshow .bg-dash-circle {
    width: 80px;
  }

  #mws-preshow .bg-circle-h-line {
    width: 126px;
    height: 65px;
  }
}

/* XL: menos hueco entre copy y grid — la izquierda deja de estirarse y la derecha crece */
@media screen and (min-width: 1536px) {
  #mws-preshow {
    gap: clamp(12px, 2.5vw, 40px);
    padding-left: clamp(80px, 5vw, 120px);
    padding-right: clamp(40px, 5vw, 100px);
    padding-top: clamp(24px, 3vh, 48px);
    padding-bottom: clamp(24px, 3vh, 48px);
  }

  #mws-preshow .left-part {
    flex: 0 1 auto;
    max-width: min(920px, 52vw);
    min-width: 0;
  }

  /* Tope por altura de viewport: evita grid más alto que la pantalla y scroll extra */
  #mws-preshow .right-part {
    height: min(48vw, 70vh, 640px);
    width: min(48vw, 70vh, 640px);
    max-width: min(48vw, 70vh, 640px);
    max-height: min(48vw, 70vh, 640px);
    margin-right: 0;
  }

  #mws-preshow .box {
    font-size: clamp(12px, 0.85vw, 16px);
  }

  #mws-preshow .bg-dash-circle {
    width: clamp(200px, 13vw, 260px);
  }

  #mws-preshow .bg-circle-h-line {
    width: clamp(200px, 13vw, 250px);
    height: clamp(120px, 8vw, 150px);
    left: clamp(-72px, -4.5vw, -52px);
  }

  #mws-preshow .bg-line {
    height: clamp(90px, 6vw, 118px);
  }
}

@media (prefers-reduced-motion: reduce) {
  #mws-preshow .bg-line img,
  #mws-preshow .bg-dash-circle img,
  #mws-preshow .bg-circle-h-line img:nth-child(1),
  #mws-preshow .bg-circle-h-line img:nth-child(3) {
    animation: none !important;
  }

  #mws-preshow .box {
    animation: none !important;
  }
}
